CUBRID Engine  latest
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)
36 {
37  const char *name; /* column name of show statement */
38  const char *type; /* colume type */
39 };
40 
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 */
54 
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 
67 {
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);
85 #endif
86 
87 #endif /* _SHOW_META_H_ */
void showstmt_metadata_final(void)
Definition: show_meta.c:994
const char * type
Definition: show_meta.h:38
int showstmt_metadata_init(void)
Definition: show_meta.c:937
SHOWSTMT_TYPE show_type
Definition: show_meta.h:68
SHOWSTMT_TYPE
const SHOWSTMT_METADATA * showstmt_get_metadata(SHOWSTMT_TYPE show_type)
Definition: show_meta.c:734
DB_ATTRIBUTE * showstmt_attrs
Definition: show_meta.h:78
const SHOWSTMT_NAMED_ARG * args
Definition: show_meta.h:75
const SHOWSTMT_COLUMN_ORDERBY * orderby
Definition: show_meta.h:73
DB_ATTRIBUTE * showstmt_get_attributes(SHOWSTMT_TYPE show_type)
Definition: show_meta.c:753
SHOW_SEMANTIC_CHECK_FUNC semantic_check_func
Definition: show_meta.h:77
SP_PARSER_CTX * parser
const char * name
Definition: show_meta.h:37
const char * name
Definition: show_meta.h:58
const char * alias_print
Definition: show_meta.h:70
PT_NODE *(* SHOW_SEMANTIC_CHECK_FUNC)(PARSER_CONTEXT *parser, PT_NODE *node)
Definition: show_meta.h:63
ARG_VALUE_TYPE type
Definition: show_meta.h:59
ARG_VALUE_TYPE
Definition: show_meta.h:48
const SHOWSTMT_COLUMN * cols
Definition: show_meta.h:71