Drizzled Public API Documentation

pars0sym.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 1997, 2009, Innobase Oy. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15 St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
26 #pragma once
27 #ifndef pars0sym_h
28 #define pars0sym_h
29 
30 #include "univ.i"
31 #include "que0types.h"
32 #include "usr0types.h"
33 #include "dict0types.h"
34 #include "pars0types.h"
35 #include "row0types.h"
36 
37 /******************************************************************/
40 UNIV_INTERN
41 sym_tab_t*
43 /*===========*/
44  mem_heap_t* heap);
45 /******************************************************************/
49 UNIV_INTERN
50 void
52 /*=================*/
53  sym_tab_t* sym_tab);
54 /******************************************************************/
57 #ifdef __cplusplus
58 extern "C"
59 #endif
60 UNIV_INTERN
63 /*================*/
64  sym_tab_t* sym_tab,
65  ulint val);
66 /******************************************************************/
69 #ifdef __cplusplus
70 extern "C"
71 #endif
72 UNIV_INTERN
75 /*================*/
76  sym_tab_t* sym_tab,
77  byte* str,
79  ulint len);
80 /******************************************************************/
83 #ifdef __cplusplus
84 extern "C"
85 #endif
86 UNIV_INTERN
89 /*==================*/
90  sym_tab_t* sym_tab,
91  const char* name,
92  ulint* lit_type);
93 /******************************************************************/
96 #ifdef __cplusplus
97 extern "C"
98 #endif
99 UNIV_INTERN
100 sym_node_t*
102 /*=================*/
103  sym_tab_t* sym_tab);
104 /******************************************************************/
107 #ifdef __cplusplus
108 extern "C"
109 #endif
110 UNIV_INTERN
111 sym_node_t*
113 /*===========*/
114  sym_tab_t* sym_tab,
115  byte* name,
116  ulint len);
118 /******************************************************************/
121 #ifdef __cplusplus
122 extern "C"
123 #endif
124 UNIV_INTERN
125 sym_node_t*
127 /*===========*/
128  sym_tab_t* sym_tab,
129  const char* name);
132 #define SYM_CLUST_FIELD_NO 0
133 
134 #define SYM_SEC_FIELD_NO 1
135 
138  SYM_VAR = 91,
149 };
150 
155  /* NOTE: if the data field in 'common.val' is not NULL and the symbol
156  table node is not for a temporary column, the memory for the value has
157  been allocated from dynamic memory and it should be freed when the
158  symbol table is discarded */
159 
160  /* 'alias' and 'indirection' are almost the same, but not quite.
161  'alias' always points to the primary instance of the variable, while
162  'indirection' does the same only if we should use the primary
163  instance's values for the node's data. This is usually the case, but
164  when initializing a cursor (e.g., "DECLARE CURSOR c IS SELECT * FROM
165  t WHERE id = x;"), we copy the values from the primary instance to
166  the cursor's instance so that they are fixed for the duration of the
167  cursor, and set 'indirection' to NULL. If we did not, the value of
168  'x' could change between fetches and things would break horribly.
169 
170  TODO: It would be cleaner to make 'indirection' a boolean field and
171  always use 'alias' to refer to the primary node. */
172 
183  UT_LIST_NODE_T(sym_node_t) col_var_list;
187  ibool copy_val;
191  ulint field_nos[2];
203  ibool resolved;
210  const char* name;
211  ulint name_len;
215  ulint col_no;
224  ulint param_type;
230  UT_LIST_NODE_T(sym_node_t) sym_list;
232 };
233 
239  const char* sql_string;
241  size_t string_len;
248  sym_node_list_t sym_list;
252  func_node_list;
255  mem_heap_t* heap;
257 };
258 
259 #ifndef UNIV_NONINL
260 #include "pars0sym.ic"
261 #endif
262 
263 #endif
size_t string_len
Definition: pars0sym.h:241
UNIV_INTERN sym_node_t * sym_tab_add_id(sym_tab_t *sym_tab, byte *name, ulint len)
Definition: pars0sym.cc:321
UNIV_INTERN sym_node_t * sym_tab_add_str_lit(sym_tab_t *sym_tab, byte *str, ulint len)
Definition: pars0sym.cc:154
ibool copy_val
Definition: pars0sym.h:187
enum sym_tab_entry token_type
Definition: pars0sym.h:208
sel_node_t * cursor_def
Definition: pars0sym.h:221
int next_char_pos
Definition: pars0sym.h:243
ulint name_len
Definition: pars0sym.h:211
ulint param_type
Definition: pars0sym.h:224
UNIV_INTERN sym_tab_t * sym_tab_create(mem_heap_t *heap)
Definition: pars0sym.cc:49
const char * sql_string
Definition: pars0sym.h:239
UNIV_INTERN sym_node_t * sym_tab_add_null_lit(sym_tab_t *sym_tab)
Definition: pars0sym.cc:283
typedef UT_LIST_BASE_NODE_T(mutex_t) ut_list_base_node_t
UNIV_INTERN sym_node_t * sym_tab_add_bound_id(sym_tab_t *sym_tab, const char *name)
Definition: pars0sym.cc:360
sym_tab_t * sym_table
Definition: pars0sym.h:228
UNIV_INTERN sym_node_t * sym_tab_add_bound_lit(sym_tab_t *sym_tab, const char *name, ulint *lit_type)
Definition: pars0sym.cc:204
dict_table_t * table
Definition: pars0sym.h:212
sel_buf_t * prefetch_buf
Definition: pars0sym.h:217
sym_tab_entry
Definition: pars0sym.h:137
sym_node_list_t sym_list
Definition: pars0sym.h:248
UT_LIST_NODE_T(sym_node_t) col_var_list
UNIV_INTERN void sym_tab_free_private(sym_tab_t *sym_tab)
Definition: pars0sym.cc:71
pars_info_t * info
Definition: pars0sym.h:247
ibool resolved
Definition: pars0sym.h:203
sym_node_t * alias
Definition: pars0sym.h:178
que_common_t common
Definition: pars0sym.h:153
ulint field_nos[2]
Definition: pars0sym.h:191
que_t * query_graph
Definition: pars0sym.h:236
const char * name
Definition: pars0sym.h:210
UNIV_INTERN sym_node_t * sym_tab_add_int_lit(sym_tab_t *sym_tab, ulint val)
Definition: pars0sym.cc:111
sym_node_t * indirection
Definition: pars0sym.h:173