/******************************************************************//**
Creates a symbol table for a single stored procedure or query.
@return own: symbol table */
sym_tab_t*
sym_tab_create( /*===========*/
mem_heap_t* heap) /*!< in: memory heap where to create */
{
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. */ void
sym_tab_free_private( /*=================*/
sym_tab_t* sym_tab) /*!< in, own: symbol table */
{
sym_node_t* sym;
func_node_t* func;
/******************************************************************//**
Adds a string literal to a symbol table.
@return symbol table node */
sym_node_t*
sym_tab_add_str_lit( /*================*/
sym_tab_t* sym_tab, /*!< in: symbol table */ const byte* str, /*!< in: string with no quotes around
it */
ulint len) /*!< in: string length */
{
sym_node_t* node;
byte* data;
/******************************************************************//**
Add a bound literal to a symbol table.
@return symbol table node */
sym_node_t*
sym_tab_add_bound_lit( /*==================*/
sym_tab_t* sym_tab, /*!< in: symbol table */ constchar* name, /*!< in: name of bound literal */
ulint* lit_type) /*!< out: type of literal (PARS_*_LIT) */
{
sym_node_t* node;
pars_bound_lit_t* blit;
ulint len = 0;
switch (blit->type) { case DATA_FIXBINARY: case DATA_CHAR:
ut_ad(blit->length > 0);
len = blit->length; /* fall through */ case DATA_BLOB: case DATA_VARCHAR:
*lit_type = PARS_STR_LIT; break;
case DATA_INT:
ut_a(blit->length > 0);
ut_a(blit->length <= 8);
len = blit->length;
*lit_type = PARS_INT_LIT; break;
/**********************************************************************
Rebind literal to a node in the symbol table. */
sym_node_t*
sym_tab_rebind_lit( /*===============*/ /* out: symbol table node */
sym_node_t* node, /* in: node that is bound to literal*/ constvoid* address, /* in: pointer to data */
ulint length) /* in: length of data */
{
dfield_t* dfield = que_node_get_val(node);
dtype_t* dtype = dfield_get_type(dfield);
/* Don't force [FALSE] creation of sub-nodes (for LIKE) */
pars_like_rebind(
node,static_cast<const byte*>(address), length);
}
/* FIXME: What's this ? */
node->common.val_buf_size = 0;
if (node->prefetch_buf) {
sel_col_prefetch_buf_free(node->prefetch_buf);
node->prefetch_buf = NULL;
}
if (node->cursor_def) {
que_graph_free_recursive(node->cursor_def);
node->cursor_def = NULL;
}
return(node);
}
/******************************************************************//**
Adds an SQL null literal to a symbol table.
@return symbol table node */
sym_node_t*
sym_tab_add_null_lit( /*=================*/
sym_tab_t* sym_tab) /*!< in: symbol table */
{
sym_node_t* node;
/******************************************************************//**
Add a bound identifier to a symbol table.
@return symbol table node */
sym_node_t*
sym_tab_add_bound_id( /*=================*/
sym_tab_t* sym_tab, /*!< in: symbol table */ constchar* name) /*!< in: name of bound id */
{
sym_node_t* node;
pars_bound_id_t* bid;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.