Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00026 #pragma once
00027 #ifndef pars0sym_h
00028 #define pars0sym_h
00029
00030 #include "univ.i"
00031 #include "que0types.h"
00032 #include "usr0types.h"
00033 #include "dict0types.h"
00034 #include "pars0types.h"
00035 #include "row0types.h"
00036
00037
00040 UNIV_INTERN
00041 sym_tab_t*
00042 sym_tab_create(
00043
00044 mem_heap_t* heap);
00045
00049 UNIV_INTERN
00050 void
00051 sym_tab_free_private(
00052
00053 sym_tab_t* sym_tab);
00054
00057 #ifdef __cplusplus
00058 extern "C"
00059 #endif
00060 UNIV_INTERN
00061 sym_node_t*
00062 sym_tab_add_int_lit(
00063
00064 sym_tab_t* sym_tab,
00065 ulint val);
00066
00069 #ifdef __cplusplus
00070 extern "C"
00071 #endif
00072 UNIV_INTERN
00073 sym_node_t*
00074 sym_tab_add_str_lit(
00075
00076 sym_tab_t* sym_tab,
00077 byte* str,
00079 ulint len);
00080
00083 #ifdef __cplusplus
00084 extern "C"
00085 #endif
00086 UNIV_INTERN
00087 sym_node_t*
00088 sym_tab_add_bound_lit(
00089
00090 sym_tab_t* sym_tab,
00091 const char* name,
00092 ulint* lit_type);
00093
00096 #ifdef __cplusplus
00097 extern "C"
00098 #endif
00099 UNIV_INTERN
00100 sym_node_t*
00101 sym_tab_add_null_lit(
00102
00103 sym_tab_t* sym_tab);
00104
00107 #ifdef __cplusplus
00108 extern "C"
00109 #endif
00110 UNIV_INTERN
00111 sym_node_t*
00112 sym_tab_add_id(
00113
00114 sym_tab_t* sym_tab,
00115 byte* name,
00116 ulint len);
00118
00121 #ifdef __cplusplus
00122 extern "C"
00123 #endif
00124 UNIV_INTERN
00125 sym_node_t*
00126 sym_tab_add_bound_id(
00127
00128 sym_tab_t* sym_tab,
00129 const char* name);
00132 #define SYM_CLUST_FIELD_NO 0
00133
00134 #define SYM_SEC_FIELD_NO 1
00135
00137 enum sym_tab_entry {
00138 SYM_VAR = 91,
00140 SYM_IMPLICIT_VAR,
00142 SYM_LIT,
00143 SYM_TABLE,
00144 SYM_COLUMN,
00145 SYM_CURSOR,
00146 SYM_PROCEDURE_NAME,
00147 SYM_INDEX,
00148 SYM_FUNCTION
00149 };
00150
00152 struct sym_node_struct{
00153 que_common_t common;
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173 sym_node_t* indirection;
00178 sym_node_t* alias;
00183 UT_LIST_NODE_T(sym_node_t) col_var_list;
00187 ibool copy_val;
00191 ulint field_nos[2];
00203 ibool resolved;
00208 enum sym_tab_entry token_type;
00210 const char* name;
00211 ulint name_len;
00212 dict_table_t* table;
00215 ulint col_no;
00217 sel_buf_t* prefetch_buf;
00221 sel_node_t* cursor_def;
00224 ulint param_type;
00228 sym_tab_t* sym_table;
00230 UT_LIST_NODE_T(sym_node_t) sym_list;
00232 };
00233
00235 struct sym_tab_struct{
00236 que_t* query_graph;
00239 const char* sql_string;
00241 size_t string_len;
00243 int next_char_pos;
00247 pars_info_t* info;
00248 sym_node_list_t sym_list;
00251 UT_LIST_BASE_NODE_T(func_node_t)
00252 func_node_list;
00255 mem_heap_t* heap;
00257 };
00258
00259 #ifndef UNIV_NONINL
00260 #include "pars0sym.ic"
00261 #endif
00262
00263 #endif