#include "univ.i"
#include "que0types.h"
#include "usr0types.h"
#include "dict0types.h"
#include "pars0types.h"
#include "row0types.h"
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 |
Enumerations | |
enum | sym_tab_entry { SYM_VAR = 91, SYM_IMPLICIT_VAR, SYM_LIT, SYM_TABLE, SYM_COLUMN, SYM_CURSOR, SYM_PROCEDURE_NAME, SYM_INDEX, SYM_FUNCTION } |
Functions | |
UNIV_INTERN sym_tab_t * | sym_tab_create (mem_heap_t *heap) |
UNIV_INTERN void | sym_tab_free_private (sym_tab_t *sym_tab) |
UNIV_INTERN sym_node_t * | sym_tab_add_int_lit (sym_tab_t *sym_tab, ulint val) |
UNIV_INTERN sym_node_t * | sym_tab_add_str_lit (sym_tab_t *sym_tab, byte *str, ulint len) |
UNIV_INTERN sym_node_t * | sym_tab_add_bound_lit (sym_tab_t *sym_tab, const char *name, ulint *lit_type) |
UNIV_INTERN sym_node_t * | sym_tab_add_null_lit (sym_tab_t *sym_tab) |
UNIV_INTERN sym_node_t * | sym_tab_add_id (sym_tab_t *sym_tab, byte *name, ulint len) |
UNIV_INTERN sym_node_t * | sym_tab_add_bound_id (sym_tab_t *sym_tab, const char *name) |
#define SYM_CLUST_FIELD_NO 0 |
Index of sym_node_struct::field_nos corresponding to the clustered index
Definition at line 132 of file pars0sym.h.
Referenced by opt_find_all_cols().
#define SYM_SEC_FIELD_NO 1 |
Index of sym_node_struct::field_nos corresponding to a secondary index
Definition at line 134 of file pars0sym.h.
Referenced by opt_find_all_cols().
enum sym_tab_entry |
Types of a symbol table node
Definition at line 137 of file pars0sym.h.
UNIV_INTERN sym_node_t* sym_tab_add_bound_id | ( | sym_tab_t * | sym_tab, |
const char * | name | ||
) |
Add a bound identifier to a symbol table.
Add a bound identifier to a symbol table.
sym_tab | in: symbol table |
name | in: name of bound id |
Definition at line 360 of file pars0sym.cc.
References sym_node_struct::common, sym_node_struct::cursor_def, dfield_set_null(), 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, pars_info_get_bound_id(), sym_node_struct::prefetch_buf, sym_node_struct::resolved, sym_tab_struct::sym_list, sym_tab_add_bound_id(), sym_node_struct::sym_table, que_common_struct::type, ut_a, UT_LIST_ADD_LAST, and que_common_struct::val.
Referenced by sym_tab_add_bound_id().
UNIV_INTERN sym_node_t* sym_tab_add_bound_lit | ( | sym_tab_t * | sym_tab, |
const char * | name, | ||
ulint * | lit_type | ||
) |
Add a bound literal to a symbol table.
Add a bound literal to a symbol table.
sym_tab | in: symbol table |
name | in: name of bound literal |
lit_type | out: type of literal (PARS_*_LIT) |
Definition at line 204 of file pars0sym.cc.
References pars_bound_lit_struct::address, sym_node_struct::common, sym_node_struct::cursor_def, 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(), pars_info_get_bound_lit(), sym_node_struct::prefetch_buf, pars_bound_lit_struct::prtype, sym_node_struct::resolved, sym_tab_struct::sym_list, SYM_LIT, sym_tab_add_bound_lit(), sym_node_struct::sym_table, sym_node_struct::token_type, que_common_struct::type, pars_bound_lit_struct::type, ut_a, ut_error, UT_LIST_ADD_LAST, and que_common_struct::val.
Referenced by sym_tab_add_bound_lit().
UNIV_INTERN sym_node_t* sym_tab_add_id | ( | sym_tab_t * | sym_tab, |
byte * | name, | ||
ulint | len | ||
) |
Adds an identifier to a symbol table.
Adds an identifier to a symbol table.
sym_tab | in: symbol table |
name | in: identifier name |
len | in: identifier length |
Definition at line 321 of file pars0sym.cc.
References sym_node_struct::common, sym_node_struct::cursor_def, dfield_set_null(), sym_tab_struct::heap, sym_node_struct::indirection, mem_heap_alloc(), mem_heap_strdupl(), sym_node_struct::name, sym_node_struct::name_len, sym_node_struct::prefetch_buf, sym_node_struct::resolved, sym_tab_struct::sym_list, sym_tab_add_id(), sym_node_struct::sym_table, que_common_struct::type, UT_LIST_ADD_LAST, and que_common_struct::val.
Referenced by sym_tab_add_id().
UNIV_INTERN sym_node_t* sym_tab_add_int_lit | ( | sym_tab_t * | sym_tab, |
ulint | val | ||
) |
Adds an integer literal to a symbol table.
Adds an integer literal to a symbol table.
sym_tab | in: symbol table |
val | in: integer value |
Definition at line 111 of file pars0sym.cc.
References sym_node_struct::common, sym_node_struct::cursor_def, dfield_set_data(), dtype_set(), sym_tab_struct::heap, sym_node_struct::indirection, mach_write_to_4(), mem_heap_alloc(), sym_node_struct::prefetch_buf, sym_node_struct::resolved, sym_tab_struct::sym_list, SYM_LIT, sym_tab_add_int_lit(), sym_node_struct::sym_table, sym_node_struct::token_type, que_common_struct::type, UT_LIST_ADD_LAST, and que_common_struct::val.
Referenced by sym_tab_add_int_lit().
UNIV_INTERN sym_node_t* sym_tab_add_null_lit | ( | sym_tab_t * | sym_tab | ) |
Adds an SQL null literal to a symbol table.
Adds an SQL null literal to a symbol table.
sym_tab | in: symbol table |
Definition at line 283 of file pars0sym.cc.
References sym_node_struct::common, sym_node_struct::cursor_def, dfield_set_null(), sym_tab_struct::heap, sym_node_struct::indirection, mem_heap_alloc(), sym_node_struct::prefetch_buf, sym_node_struct::resolved, sym_tab_struct::sym_list, SYM_LIT, sym_tab_add_null_lit(), sym_node_struct::sym_table, sym_node_struct::token_type, que_common_struct::type, UT_LIST_ADD_LAST, and que_common_struct::val.
Referenced by sym_tab_add_null_lit().
UNIV_INTERN sym_node_t* sym_tab_add_str_lit | ( | sym_tab_t * | sym_tab, |
byte * | str, | ||
ulint | len | ||
) |
Adds an string literal to a symbol table.
Adds a string literal to a symbol table.
sym_tab | in: symbol table |
str | in: string with no quotes around it |
len | in: string length |
Definition at line 154 of file pars0sym.cc.
References sym_node_struct::common, sym_node_struct::cursor_def, dfield_set_data(), dtype_set(), sym_tab_struct::heap, sym_node_struct::indirection, mem_heap_alloc(), sym_node_struct::prefetch_buf, sym_node_struct::resolved, sym_tab_struct::sym_list, SYM_LIT, sym_tab_add_str_lit(), sym_node_struct::sym_table, sym_node_struct::token_type, que_common_struct::type, UT_LIST_ADD_LAST, ut_memcpy(), and que_common_struct::val.
Referenced by sym_tab_add_str_lit().
UNIV_INTERN sym_tab_t* sym_tab_create | ( | mem_heap_t * | heap | ) |
Creates a symbol table for a single stored procedure or query.
Creates a symbol table for a single stored procedure or query.
heap | in: memory heap where to create |
Definition at line 49 of file pars0sym.cc.
References sym_tab_struct::func_node_list, sym_tab_struct::heap, mem_heap_alloc(), sym_tab_struct::sym_list, sym_tab_create(), and UT_LIST_INIT.
Referenced by pars_sql(), and sym_tab_create().
UNIV_INTERN void sym_tab_free_private | ( | sym_tab_t * | sym_tab | ) |
Frees the memory allocated dynamically AFTER parsing phase for variables etc. in the symbol table. Does not free the mem heap where the table was originally created. Frees also SQL explicit cursor definitions. in, own: symbol table
Frees the memory allocated dynamically AFTER parsing phase for variables etc. in the symbol table. Does not free the mem heap where the table was originally created. Frees also SQL explicit cursor definitions.
sym_tab | in, own: symbol table |
Definition at line 71 of file pars0sym.cc.
References sym_node_struct::cursor_def, sym_tab_struct::func_node_list, sym_node_struct::prefetch_buf, que_graph_free_recursive(), sel_col_prefetch_buf_free(), sym_tab_struct::sym_list, sym_tab_free_private(), UT_LIST_GET_FIRST, and UT_LIST_GET_NEXT.
Referenced by que_graph_free(), and sym_tab_free_private().