MySQL 9.1.0
Source Code Documentation
pars0sym.cc File Reference

SQL parser symbol table. More...

#include "current_thd.h"
#include "pars0sym.h"
#include "data0data.h"
#include "data0type.h"
#include "dict0dd.h"
#include "eval0eval.h"
#include "mem0mem.h"
#include "pars0grm.h"
#include "pars0pars.h"
#include "que0que.h"
#include "row0sel.h"

Functions

sym_tab_tsym_tab_create (mem_heap_t *heap)
 Creates a symbol table for a single stored procedure or query. More...
 
void sym_tab_free_private (sym_tab_t *sym_tab)
 Frees the memory allocated dynamically AFTER parsing phase for variables etc. More...
 
sym_node_tsym_tab_add_int_lit (sym_tab_t *sym_tab, ulint val)
 Adds an integer literal to a symbol table. More...
 
sym_node_tsym_tab_add_str_lit (sym_tab_t *sym_tab, const byte *str, ulint len)
 Adds a string literal to a symbol table. More...
 
sym_node_tsym_tab_add_bound_lit (sym_tab_t *sym_tab, const char *name, ulint *lit_type)
 Add a bound literal to a symbol table. More...
 
sym_node_tsym_tab_rebind_lit (sym_node_t *node, const void *address, ulint length)
 
sym_node_tsym_tab_add_null_lit (sym_tab_t *sym_tab)
 Adds an SQL null literal to a symbol table. More...
 
sym_node_tsym_tab_add_id (sym_tab_t *sym_tab, byte *name, ulint len)
 Adds an identifier to a symbol table. More...
 
sym_node_tsym_tab_add_bound_id (sym_tab_t *sym_tab, const char *name)
 Add a bound identifier to a symbol table. More...
 

Detailed Description

SQL parser symbol table.

Created 12/15/1997 Heikki Tuuri

Function Documentation

◆ sym_tab_add_bound_id()

sym_node_t * sym_tab_add_bound_id ( sym_tab_t sym_tab,
const char *  name 
)

Add a bound identifier to a symbol table.

Returns
symbol table node
Parameters
sym_tabin: symbol table
namein: name of bound id

◆ sym_tab_add_bound_lit()

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.

Returns
symbol table node
Parameters
sym_tabin: symbol table
namein: name of bound literal
lit_typeout: type of literal (PARS_*_LIT)

◆ sym_tab_add_id()

sym_node_t * sym_tab_add_id ( sym_tab_t sym_tab,
byte name,
ulint  len 
)

Adds an identifier to a symbol table.

Returns
symbol table node
Parameters
sym_tabin: symbol table
namein: identifier name
lenin: identifier length

◆ sym_tab_add_int_lit()

sym_node_t * sym_tab_add_int_lit ( sym_tab_t sym_tab,
ulint  val 
)

Adds an integer literal to a symbol table.

Returns
symbol table node
Parameters
sym_tabin: symbol table
valin: integer value

◆ sym_tab_add_null_lit()

sym_node_t * sym_tab_add_null_lit ( sym_tab_t sym_tab)

Adds an SQL null literal to a symbol table.

Returns
symbol table node
Parameters
sym_tabin: symbol table

◆ sym_tab_add_str_lit()

sym_node_t * sym_tab_add_str_lit ( sym_tab_t sym_tab,
const byte str,
ulint  len 
)

Adds a string literal to a symbol table.

Adds an string literal to a symbol table.

Returns
symbol table node
Parameters
sym_tabin: symbol table
strin: string with no quotes around it
lenin: string length

◆ sym_tab_create()

sym_tab_t * sym_tab_create ( mem_heap_t heap)

Creates a symbol table for a single stored procedure or query.

Returns
own: symbol table
Parameters
heapin: memory heap where to create

◆ sym_tab_free_private()

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.

Parameters
sym_tabin, own: symbol table

◆ sym_tab_rebind_lit()

sym_node_t * sym_tab_rebind_lit ( sym_node_t node,
const void *  address,
ulint  length 
)