CUBRID Engine
latest
Main Page
Namespaces
Classes
Files
File List
File Members
show_meta.h
Go to the documentation of this file.
1
/*
2
* Copyright 2008 Search Solution Corporation
3
* Copyright 2016 CUBRID Corporation
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*/
18
19
20
/*
21
* show_meta.h - include basic enum and structure for show statements.
22
*/
23
24
#ifndef _SHOW_META_H_
25
#define _SHOW_META_H_
26
27
#ident "$Id$"
28
29
#include "config.h"
30
#include "
dbtype_def.h
"
31
#include "
parse_tree.h
"
32
33
#if !defined(SERVER_MODE)
34
typedef
struct
showstmt_column
SHOWSTMT_COLUMN
;
35
struct
showstmt_column
36
{
37
const
char
*
name
;
/* column name of show statement */
38
const
char
*
type
;
/* colume type */
39
};
40
41
typedef
struct
showstmt_column_orderby
SHOWSTMT_COLUMN_ORDERBY
;
42
struct
showstmt_column_orderby
43
{
44
int
pos
;
/* order by position, start from 1 */
45
bool
asc
;
/* true for PT_ASC */
46
};
47
48
typedef
enum
49
{
50
AVT_INTEGER
,
/* argument value type of integer */
51
AVT_STRING
,
/* argument value type of string */
52
AVT_IDENTIFIER
,
/* argument value type of identifier */
53
}
ARG_VALUE_TYPE
;
54
55
typedef
struct
showstmt_named_arg
SHOWSTMT_NAMED_ARG
;
56
struct
showstmt_named_arg
57
{
58
const
char
*
name
;
/* name of argument should be used in syntax */
59
ARG_VALUE_TYPE
type
;
/* expected type of argument value */
60
bool
optional
;
/* whether or not omit */
61
};
62
63
typedef
PT_NODE
*(*SHOW_SEMANTIC_CHECK_FUNC) (
PARSER_CONTEXT
*
parser
,
PT_NODE
* node);
64
65
typedef
struct
showstmt_metadata
SHOWSTMT_METADATA
;
66
struct
showstmt_metadata
67
{
68
SHOWSTMT_TYPE
show_type
;
69
bool
only_for_dba
;
/* dba is only allowed */
70
const
char
*
alias_print
;
/* for pt_print_select */
71
const
SHOWSTMT_COLUMN
*
cols
;
/* SHOWSTMT_COLUMN array */
72
int
num_cols
;
/* size of cols array */
73
const
SHOWSTMT_COLUMN_ORDERBY
*
orderby
;
/* SHOWSTMT_COLUMN array */
74
int
num_orderby
;
/* size of orderby array */
75
const
SHOWSTMT_NAMED_ARG
*
args
;
/* argument rule */
76
int
arg_size
;
/* size of args array */
77
SHOW_SEMANTIC_CHECK_FUNC
semantic_check_func
;
/* semantic check function pointer */
78
DB_ATTRIBUTE
*
showstmt_attrs
;
/* the attribute list */
79
};
80
81
extern
int
showstmt_metadata_init
(
void
);
82
extern
void
showstmt_metadata_final
(
void
);
83
extern
const
SHOWSTMT_METADATA
*
showstmt_get_metadata
(
SHOWSTMT_TYPE
show_type);
84
extern
DB_ATTRIBUTE
*
showstmt_get_attributes
(
SHOWSTMT_TYPE
show_type);
85
#endif
86
87
#endif
/* _SHOW_META_H_ */
showstmt_metadata_final
void showstmt_metadata_final(void)
Definition:
show_meta.c:994
showstmt_named_arg::optional
bool optional
Definition:
show_meta.h:60
showstmt_metadata::num_cols
int num_cols
Definition:
show_meta.h:72
showstmt_metadata::arg_size
int arg_size
Definition:
show_meta.h:76
AVT_IDENTIFIER
Definition:
show_meta.h:52
showstmt_column::type
const char * type
Definition:
show_meta.h:38
showstmt_metadata_init
int showstmt_metadata_init(void)
Definition:
show_meta.c:937
parse_tree.h
showstmt_metadata::show_type
SHOWSTMT_TYPE show_type
Definition:
show_meta.h:68
showstmt_metadata::num_orderby
int num_orderby
Definition:
show_meta.h:74
SHOWSTMT_TYPE
SHOWSTMT_TYPE
Definition:
storage_common.h:1032
AVT_INTEGER
Definition:
show_meta.h:50
showstmt_get_metadata
const SHOWSTMT_METADATA * showstmt_get_metadata(SHOWSTMT_TYPE show_type)
Definition:
show_meta.c:734
parser_node
Definition:
parse_tree.h:3437
showstmt_column
Definition:
show_meta.h:35
showstmt_metadata
Definition:
show_meta.h:66
showstmt_metadata::showstmt_attrs
DB_ATTRIBUTE * showstmt_attrs
Definition:
show_meta.h:78
showstmt_metadata::args
const SHOWSTMT_NAMED_ARG * args
Definition:
show_meta.h:75
showstmt_metadata::orderby
const SHOWSTMT_COLUMN_ORDERBY * orderby
Definition:
show_meta.h:73
showstmt_get_attributes
DB_ATTRIBUTE * showstmt_get_attributes(SHOWSTMT_TYPE show_type)
Definition:
show_meta.c:753
parser_context
Definition:
parse_tree.h:3530
showstmt_column_orderby::asc
bool asc
Definition:
show_meta.h:45
showstmt_metadata::semantic_check_func
SHOW_SEMANTIC_CHECK_FUNC semantic_check_func
Definition:
show_meta.h:77
parser
SP_PARSER_CTX * parser
Definition:
shard_proxy_handler.c:52
dbtype_def.h
showstmt_column::name
const char * name
Definition:
show_meta.h:37
showstmt_named_arg::name
const char * name
Definition:
show_meta.h:58
showstmt_named_arg
Definition:
show_meta.h:56
showstmt_metadata::alias_print
const char * alias_print
Definition:
show_meta.h:70
SHOW_SEMANTIC_CHECK_FUNC
PT_NODE *(* SHOW_SEMANTIC_CHECK_FUNC)(PARSER_CONTEXT *parser, PT_NODE *node)
Definition:
show_meta.h:63
AVT_STRING
Definition:
show_meta.h:51
showstmt_metadata::only_for_dba
bool only_for_dba
Definition:
show_meta.h:69
showstmt_named_arg::type
ARG_VALUE_TYPE type
Definition:
show_meta.h:59
sm_attribute
Definition:
class_object.h:439
showstmt_column_orderby::pos
int pos
Definition:
show_meta.h:44
ARG_VALUE_TYPE
ARG_VALUE_TYPE
Definition:
show_meta.h:48
showstmt_column_orderby
Definition:
show_meta.h:42
showstmt_metadata::cols
const SHOWSTMT_COLUMN * cols
Definition:
show_meta.h:71
src
parser
show_meta.h
Generated by
1.8.11