#include "univ.i"#include "que0types.h"#include "usr0types.h"#include "dict0types.h"#include "pars0types.h"#include "row0types.h"Include dependency graph for pars0sym.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Classes | |
| struct | sym_node_struct |
| struct | sym_tab_struct |
Defines | |
| #define | SYM_CLUST_FIELD_NO 0 |
| #define | SYM_SEC_FIELD_NO 1 |
| #define | SYM_VAR 91 |
| #define | SYM_IMPLICIT_VAR 92 |
| #define | SYM_LIT 93 |
| #define | SYM_TABLE 94 |
| #define | SYM_COLUMN 95 |
| #define | SYM_CURSOR 96 |
| #define | SYM_PROCEDURE_NAME 97 |
| #define | SYM_INDEX 98 |
| #define | SYM_FUNCTION 99 |
Functions | |
| sym_tab_t * | sym_tab_create (mem_heap_t *heap) |
| void | sym_tab_free_private (sym_tab_t *sym_tab) |
| sym_node_t * | sym_tab_add_int_lit (sym_tab_t *sym_tab, ulint val) |
| sym_node_t * | sym_tab_add_str_lit (sym_tab_t *sym_tab, byte *str, ulint len) |
| sym_node_t * | sym_tab_add_bound_lit (sym_tab_t *sym_tab, const char *name, ulint *lit_type) |
| sym_node_t * | sym_tab_add_null_lit (sym_tab_t *sym_tab) |
| sym_node_t * | sym_tab_add_id (sym_tab_t *sym_tab, byte *name, ulint len) |
| sym_node_t * | sym_tab_add_bound_id (sym_tab_t *sym_tab, const char *name) |
| #define SYM_CLUST_FIELD_NO 0 |
Definition at line 95 of file pars0sym.h.
Referenced by opt_find_all_cols(), row_sel_fetch_columns(), and row_upd_copy_columns().
| #define SYM_COLUMN 95 |
Definition at line 213 of file pars0sym.h.
Referenced by opt_check_exp_determined_before(), opt_find_all_cols(), opt_look_for_col_in_comparison_before(), opt_normalize_cmp_conds(), pars_create_index(), pars_create_table(), and pars_resolve_exp_columns().
| #define SYM_CURSOR 96 |
Definition at line 214 of file pars0sym.h.
Referenced by pars_cursor_declaration(), pars_fetch_statement(), pars_open_statement(), and pars_resolve_exp_variables_and_types().
| #define SYM_FUNCTION 99 |
Definition at line 217 of file pars0sym.h.
Referenced by pars_function_declaration(), and pars_resolve_exp_variables_and_types().
| #define SYM_IMPLICIT_VAR 92 |
| #define SYM_INDEX 98 |
Definition at line 216 of file pars0sym.h.
| #define SYM_LIT 93 |
Definition at line 211 of file pars0sym.h.
Referenced by eval_notfound(), sym_tab_add_bound_lit(), sym_tab_add_int_lit(), sym_tab_add_null_lit(), and sym_tab_add_str_lit().
| #define SYM_PROCEDURE_NAME 97 |
| #define SYM_SEC_FIELD_NO 1 |
Definition at line 96 of file pars0sym.h.
Referenced by opt_find_all_cols(), and row_sel_fetch_columns().
| #define SYM_TABLE 94 |
Definition at line 212 of file pars0sym.h.
Referenced by pars_create_index(), pars_create_table(), and pars_retrieve_table_def().
| #define SYM_VAR 91 |
Definition at line 207 of file pars0sym.h.
Referenced by pars_resolve_exp_variables_and_types(), and pars_variable_declaration().
| sym_node_t* sym_tab_add_bound_id | ( | sym_tab_t * | sym_tab, | |
| const char * | name | |||
| ) |
Definition at line 319 of file pars0sym.c.
References sym_node_struct::common, sym_node_struct::cursor_def, dfield_set_data(), FALSE, sym_tab_struct::heap, pars_bound_id_struct::id, sym_node_struct::indirection, sym_tab_struct::info, mem_heap_alloc(), mem_heap_strdup(), sym_node_struct::name, sym_node_struct::name_len, NULL, pars_info_get_bound_id(), sym_node_struct::prefetch_buf, QUE_NODE_SYMBOL, sym_node_struct::resolved, strlen(), sym_tab_struct::sym_list, sym_node_struct::sym_table, que_common_struct::type, ut_a, UT_LIST_ADD_LAST, que_common_struct::val, and que_common_struct::val_buf_size.
00321 : symbol table node */ 00322 sym_tab_t* sym_tab, /* in: symbol table */ 00323 const char* name) /* in: name of bound id */ 00324 { 00325 sym_node_t* node; 00326 pars_bound_id_t* bid; 00327 00328 bid = pars_info_get_bound_id(sym_tab->info, name); 00329 ut_a(bid); 00330 00331 node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); 00332 00333 node->common.type = QUE_NODE_SYMBOL; 00334 00335 node->resolved = FALSE; 00336 node->indirection = NULL; 00337 00338 node->name = mem_heap_strdup(sym_tab->heap, bid->id); 00339 node->name_len = strlen(node->name); 00340 00341 UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); 00342 00343 dfield_set_data(&(node->common.val), NULL, UNIV_SQL_NULL); 00344 00345 node->common.val_buf_size = 0; 00346 node->prefetch_buf = NULL; 00347 node->cursor_def = NULL; 00348 00349 node->sym_table = sym_tab; 00350 00351 return(node); 00352 }
Here is the call graph for this function:

| sym_node_t* sym_tab_add_bound_lit | ( | sym_tab_t * | sym_tab, | |
| const char * | name, | |||
| ulint * | lit_type | |||
| ) |
Definition at line 173 of file pars0sym.c.
References pars_bound_lit_struct::address, sym_node_struct::common, sym_node_struct::cursor_def, DATA_BLOB, DATA_CHAR, DATA_FIXBINARY, DATA_INT, DATA_VARCHAR, dfield_set_data(), dtype_set(), sym_tab_struct::heap, sym_node_struct::indirection, sym_tab_struct::info, pars_bound_lit_struct::length, mem_heap_alloc(), NULL, PARS_BLOB_LIT, PARS_FIXBINARY_LIT, pars_info_get_bound_lit(), PARS_INT_LIT, PARS_STR_LIT, sym_node_struct::prefetch_buf, pars_bound_lit_struct::prtype, QUE_NODE_SYMBOL, sym_node_struct::resolved, sym_tab_struct::sym_list, SYM_LIT, sym_node_struct::sym_table, sym_node_struct::token_type, TRUE, que_common_struct::type, pars_bound_lit_struct::type, dfield_struct::type, ut_a, ut_error, UT_LIST_ADD_LAST, que_common_struct::val, and que_common_struct::val_buf_size.
00175 : symbol table node */ 00176 sym_tab_t* sym_tab, /* in: symbol table */ 00177 const char* name, /* in: name of bound literal */ 00178 ulint* lit_type) /* out: type of literal (PARS_*_LIT) */ 00179 { 00180 sym_node_t* node; 00181 pars_bound_lit_t* blit; 00182 ulint len = 0; 00183 00184 blit = pars_info_get_bound_lit(sym_tab->info, name); 00185 ut_a(blit); 00186 00187 node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); 00188 00189 node->common.type = QUE_NODE_SYMBOL; 00190 00191 node->resolved = TRUE; 00192 node->token_type = SYM_LIT; 00193 00194 node->indirection = NULL; 00195 00196 switch (blit->type) { 00197 case DATA_FIXBINARY: 00198 len = blit->length; 00199 *lit_type = PARS_FIXBINARY_LIT; 00200 break; 00201 00202 case DATA_BLOB: 00203 *lit_type = PARS_BLOB_LIT; 00204 break; 00205 00206 case DATA_VARCHAR: 00207 *lit_type = PARS_STR_LIT; 00208 break; 00209 00210 case DATA_CHAR: 00211 ut_a(blit->length > 0); 00212 00213 len = blit->length; 00214 *lit_type = PARS_STR_LIT; 00215 break; 00216 00217 case DATA_INT: 00218 ut_a(blit->length > 0); 00219 ut_a(blit->length <= 8); 00220 00221 len = blit->length; 00222 *lit_type = PARS_INT_LIT; 00223 break; 00224 00225 default: 00226 ut_error; 00227 } 00228 00229 dtype_set(&(node->common.val.type), blit->type, blit->prtype, len, 0); 00230 00231 dfield_set_data(&(node->common.val), blit->address, blit->length); 00232 00233 node->common.val_buf_size = 0; 00234 node->prefetch_buf = NULL; 00235 node->cursor_def = NULL; 00236 00237 UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); 00238 00239 node->sym_table = sym_tab; 00240 00241 return(node); 00242 }
Here is the call graph for this function:

| sym_node_t* sym_tab_add_id | ( | sym_tab_t * | sym_tab, | |
| byte * | name, | |||
| ulint | len | |||
| ) |
Definition at line 283 of file pars0sym.c.
References sym_node_struct::common, sym_node_struct::cursor_def, dfield_set_data(), FALSE, sym_tab_struct::heap, sym_node_struct::indirection, mem_heap_alloc(), mem_heap_strdupl(), sym_node_struct::name, sym_node_struct::name_len, NULL, sym_node_struct::prefetch_buf, QUE_NODE_SYMBOL, sym_node_struct::resolved, sym_tab_struct::sym_list, sym_node_struct::sym_table, que_common_struct::type, UT_LIST_ADD_LAST, que_common_struct::val, and que_common_struct::val_buf_size.
Referenced by pars_select_all_columns().
00285 : symbol table node */ 00286 sym_tab_t* sym_tab, /* in: symbol table */ 00287 byte* name, /* in: identifier name */ 00288 ulint len) /* in: identifier length */ 00289 { 00290 sym_node_t* node; 00291 00292 node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); 00293 00294 node->common.type = QUE_NODE_SYMBOL; 00295 00296 node->resolved = FALSE; 00297 node->indirection = NULL; 00298 00299 node->name = mem_heap_strdupl(sym_tab->heap, (char*) name, len); 00300 node->name_len = len; 00301 00302 UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); 00303 00304 dfield_set_data(&(node->common.val), NULL, UNIV_SQL_NULL); 00305 00306 node->common.val_buf_size = 0; 00307 node->prefetch_buf = NULL; 00308 node->cursor_def = NULL; 00309 00310 node->sym_table = sym_tab; 00311 00312 return(node); 00313 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sym_node_t* sym_tab_add_int_lit | ( | sym_tab_t * | sym_tab, | |
| ulint | val | |||
| ) |
Definition at line 87 of file pars0sym.c.
References sym_node_struct::common, sym_node_struct::cursor_def, data, DATA_INT, dfield_set_data(), dtype_set(), sym_tab_struct::heap, sym_node_struct::indirection, mach_write_to_4(), mem_heap_alloc(), NULL, sym_node_struct::prefetch_buf, QUE_NODE_SYMBOL, sym_node_struct::resolved, sym_tab_struct::sym_list, SYM_LIT, sym_node_struct::sym_table, sym_node_struct::token_type, TRUE, que_common_struct::type, dfield_struct::type, UT_LIST_ADD_LAST, que_common_struct::val, and que_common_struct::val_buf_size.
Referenced by yyparse().
00089 : symbol table node */ 00090 sym_tab_t* sym_tab, /* in: symbol table */ 00091 ulint val) /* in: integer value */ 00092 { 00093 sym_node_t* node; 00094 byte* data; 00095 00096 node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); 00097 00098 node->common.type = QUE_NODE_SYMBOL; 00099 00100 node->resolved = TRUE; 00101 node->token_type = SYM_LIT; 00102 00103 node->indirection = NULL; 00104 00105 dtype_set(&(node->common.val.type), DATA_INT, 0, 4, 0); 00106 00107 data = mem_heap_alloc(sym_tab->heap, 4); 00108 mach_write_to_4(data, val); 00109 00110 dfield_set_data(&(node->common.val), data, 4); 00111 00112 node->common.val_buf_size = 0; 00113 node->prefetch_buf = NULL; 00114 node->cursor_def = NULL; 00115 00116 UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); 00117 00118 node->sym_table = sym_tab; 00119 00120 return(node); 00121 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sym_node_t* sym_tab_add_null_lit | ( | sym_tab_t * | sym_tab | ) |
Definition at line 248 of file pars0sym.c.
References sym_node_struct::common, sym_node_struct::cursor_def, DATA_ERROR, dfield_set_data(), sym_tab_struct::heap, sym_node_struct::indirection, mem_heap_alloc(), dtype_struct::mtype, NULL, sym_node_struct::prefetch_buf, QUE_NODE_SYMBOL, sym_node_struct::resolved, sym_tab_struct::sym_list, SYM_LIT, sym_node_struct::sym_table, sym_node_struct::token_type, TRUE, que_common_struct::type, dfield_struct::type, UT_LIST_ADD_LAST, que_common_struct::val, and que_common_struct::val_buf_size.
00250 : symbol table node */ 00251 sym_tab_t* sym_tab) /* in: symbol table */ 00252 { 00253 sym_node_t* node; 00254 00255 node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); 00256 00257 node->common.type = QUE_NODE_SYMBOL; 00258 00259 node->resolved = TRUE; 00260 node->token_type = SYM_LIT; 00261 00262 node->indirection = NULL; 00263 00264 node->common.val.type.mtype = DATA_ERROR; 00265 00266 dfield_set_data(&(node->common.val), NULL, UNIV_SQL_NULL); 00267 00268 node->common.val_buf_size = 0; 00269 node->prefetch_buf = NULL; 00270 node->cursor_def = NULL; 00271 00272 UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); 00273 00274 node->sym_table = sym_tab; 00275 00276 return(node); 00277 }
Here is the call graph for this function:

| sym_node_t* sym_tab_add_str_lit | ( | sym_tab_t * | sym_tab, | |
| byte * | str, | |||
| ulint | len | |||
| ) |
Definition at line 127 of file pars0sym.c.
References sym_node_struct::common, sym_node_struct::cursor_def, data, DATA_ENGLISH, DATA_VARCHAR, dfield_set_data(), dtype_set(), sym_tab_struct::heap, sym_node_struct::indirection, mem_heap_alloc(), NULL, sym_node_struct::prefetch_buf, QUE_NODE_SYMBOL, sym_node_struct::resolved, sym_tab_struct::sym_list, SYM_LIT, sym_node_struct::sym_table, sym_node_struct::token_type, TRUE, que_common_struct::type, dfield_struct::type, UT_LIST_ADD_LAST, ut_memcpy(), que_common_struct::val, and que_common_struct::val_buf_size.
00129 : symbol table node */ 00130 sym_tab_t* sym_tab, /* in: symbol table */ 00131 byte* str, /* in: string with no quotes around 00132 it */ 00133 ulint len) /* in: string length */ 00134 { 00135 sym_node_t* node; 00136 byte* data; 00137 00138 node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); 00139 00140 node->common.type = QUE_NODE_SYMBOL; 00141 00142 node->resolved = TRUE; 00143 node->token_type = SYM_LIT; 00144 00145 node->indirection = NULL; 00146 00147 dtype_set(&(node->common.val.type), DATA_VARCHAR, DATA_ENGLISH, 0, 0); 00148 00149 if (len) { 00150 data = mem_heap_alloc(sym_tab->heap, len); 00151 ut_memcpy(data, str, len); 00152 } else { 00153 data = NULL; 00154 } 00155 00156 dfield_set_data(&(node->common.val), data, len); 00157 00158 node->common.val_buf_size = 0; 00159 node->prefetch_buf = NULL; 00160 node->cursor_def = NULL; 00161 00162 UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); 00163 00164 node->sym_table = sym_tab; 00165 00166 return(node); 00167 }
Here is the call graph for this function:

| sym_tab_t* sym_tab_create | ( | mem_heap_t * | heap | ) |
Definition at line 28 of file pars0sym.c.
References sym_tab_struct::func_node_list, sym_tab_struct::heap, mem_heap_alloc(), sym_tab_struct::sym_list, and UT_LIST_INIT.
Referenced by pars_sql().
00030 : symbol table */ 00031 mem_heap_t* heap) /* in: memory heap where to create */ 00032 { 00033 sym_tab_t* sym_tab; 00034 00035 sym_tab = mem_heap_alloc(heap, sizeof(sym_tab_t)); 00036 00037 UT_LIST_INIT(sym_tab->sym_list); 00038 UT_LIST_INIT(sym_tab->func_node_list); 00039 00040 sym_tab->heap = heap; 00041 00042 return(sym_tab); 00043 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void sym_tab_free_private | ( | sym_tab_t * | sym_tab | ) |
Definition at line 51 of file pars0sym.c.
References eval_node_free_val_buf(), func, sym_tab_struct::func_node_list, que_graph_free_recursive(), sel_col_prefetch_buf_free(), sym_tab_struct::sym_list, UT_LIST_GET_FIRST, and UT_LIST_GET_NEXT.
Referenced by que_graph_free().
00053 : symbol table */ 00054 { 00055 sym_node_t* sym; 00056 func_node_t* func; 00057 00058 sym = UT_LIST_GET_FIRST(sym_tab->sym_list); 00059 00060 while (sym) { 00061 eval_node_free_val_buf(sym); 00062 00063 if (sym->prefetch_buf) { 00064 sel_col_prefetch_buf_free(sym->prefetch_buf); 00065 } 00066 00067 if (sym->cursor_def) { 00068 que_graph_free_recursive(sym->cursor_def); 00069 } 00070 00071 sym = UT_LIST_GET_NEXT(sym_list, sym); 00072 } 00073 00074 func = UT_LIST_GET_FIRST(sym_tab->func_node_list); 00075 00076 while (func) { 00077 eval_node_free_val_buf(func); 00078 00079 func = UT_LIST_GET_NEXT(func_node_list, func); 00080 } 00081 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.4.7

