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 
236  que_t* query_graph;
239  const char* sql_string;
241  size_t string_len;
243  int next_char_pos;
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