CUBRID Engine  latest
parse_tree.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /*
20  * parse_tree.h - Parse tree structures and types
21  */
22 
23 #ifndef _PARSE_TREE_H_
24 #define _PARSE_TREE_H_
25 
26 #if defined (SERVER_MODE)
27 #error Does not belong to server module
28 #endif /* SERVER_MODE */
29 
30 #ident "$Id$"
31 
32 #include <setjmp.h>
33 #include <assert.h>
34 
35 #include "class_object.h"
36 #include "compile_context.h"
37 #include "config.h"
38 #include "cursor.h"
39 #include "json_table_def.h"
40 #include "message_catalog.h"
41 #include "string_opfunc.h"
42 #include "system_parameter.h"
43 
44 // forward definitions
45 struct json_t;
46 
47 #define MAX_PRINT_ERROR_CONTEXT_LENGTH 64
48 
49 //this could be a variadic template function; directly use pt_frob_error() for formatted messages without catalog
50 #define pt_cat_error(parser, node, setNo, msgNo, ...) \
51  pt_frob_error(parser, node, msgcat_message(MSGCAT_CATALOG_CUBRID, setNo, msgNo), ##__VA_ARGS__)
52 
53 #if 1 //not necessary anymore thanks to new pt_cat_error() and existing pt_frob_error()
54 #define PT_ERROR(parser, node, msg) pt_frob_error(parser, node, msg)
55 #define PT_ERRORc(parser, node, msg) pt_frob_error( parser, node, "%s", msg)
56 
57 #define PT_ERRORf(parser, node, msg, arg1) pt_frob_error(parser, node, msg, arg1)
58 #define PT_ERRORf2(parser, node, msg, arg1, arg2) pt_frob_error(parser, node, msg, arg1, arg2)
59 #define PT_ERRORf3(parser, node, msg, arg1, arg2, arg3) pt_frob_error(parser, node, msg, arg1, arg2, arg3)
60 #define PT_ERRORf4(parser, node, msg, arg1, arg2, arg3, arg4) pt_frob_error(parser, node, msg, arg1, arg2, arg3, arg4)
61 #define PT_ERRORf5(parser, node, msg, arg1, arg2, arg3, arg4, arg5) pt_frob_error(parser, node, msg, arg1, arg2, arg3, arg4, arg5)
62 
63 #define PT_ERRORm(parser, node, setNo, msgNo) pt_cat_error(parser, node, setNo, msgNo)
64 #define PT_ERRORmf(parser, node, setNo, msgNo, arg1) pt_cat_error(parser, node, setNo, msgNo, arg1)
65 #define PT_ERRORmf2(parser, node, setNo, msgNo, arg1, arg2) pt_cat_error(parser, node, setNo, msgNo, arg1, arg2)
66 #define PT_ERRORmf3(parser, node, setNo, msgNo, arg1, arg2, arg3) pt_cat_error(parser, node, setNo, msgNo, arg1, arg2, arg3)
67 #define PT_ERRORmf4(parser, node, setNo, msgNo, arg1, arg2, arg3, arg4) pt_cat_error(parser, node, setNo, msgNo, arg1, arg2, arg3, arg4)
68 #define PT_ERRORmf5(parser, node, setNo, msgNo, arg1, arg2, arg3, arg4 , arg5) pt_cat_error(parser, node, setNo, msgNo, arg1, arg2, arg3, arg4, arg5)
69 #endif
70 
71 //this could be a variadic template function; directly use pt_frob_warning() for formatted messages without catalog
72 #define pt_cat_warning(parser, node, setNo, msgNo, ...) \
73  pt_frob_warning(parser, node, msgcat_message(MSGCAT_CATALOG_CUBRID, setNo, msgNo), ##__VA_ARGS__)
74 
75 #if 1 //not necessary anymore thanks to pt_cat_warning() and existing pt_frob_warning()
76 #define PT_WARNING( parser, node, msg ) pt_frob_warning(parser, node, msg)
77 #define PT_WARNINGm(parser, node, setNo, msgNo) pt_cat_warning(parser, node, setNo, msgNo)
78 #define PT_WARNINGc( parser, node, msg ) pt_frob_warning(parser, node, msg)
79 
80 #define PT_WARNINGf( parser, node, msg, arg1) pt_cat_warning(parser, node, msg, arg1)
81 #define PT_WARNINGf2( parser, node, msg, arg1, arg2) pt_cat_warning(parser, node, msg, arg1, arg2)
82 #define PT_WARNINGf3( parser, node, msg, arg1, arg2, arg3) pt_cat_warning(parser, node, msg, arg1, arg2, arg3)
83 
84 #define PT_WARNINGmf(parser, node, setNo, msgNo, arg1) pt_cat_warning(parser, node, setNo, msgNo, arg1)
85 #define PT_WARNINGmf2(parser, node, setNo, msgNo, arg1, arg2) pt_cat_warning(parser, node, setNo, msgNo, arg1, arg2)
86 #define PT_WARNINGmf3(parser, node, setNo, msgNo, arg1, arg2, arg3) pt_cat_warning(parser, node, setNo, msgNo, arg1, arg2, arg3)
87 #endif
88 
89 #define PT_SET_JMP_ENV(parser) \
90  do { \
91  if (setjmp((parser)->jmp_env) != 0) { \
92  pt_record_error((parser), (parser)->statement_number, \
93  (parser)->line, \
94  (parser)->column, \
95  msgcat_message (MSGCAT_CATALOG_CUBRID, \
96  MSGCAT_SET_PARSER_SEMANTIC, \
97  MSGCAT_SEMANTIC_OUT_OF_MEMORY), \
98  NULL); \
99  (parser)->jmp_env_active = 0; \
100  if ((parser)->au_save) \
101  AU_ENABLE((parser)->au_save); \
102  return NULL; \
103  } \
104  else (parser)->jmp_env_active = 1; \
105  } while(0)
106 
107 #define PT_CLEAR_JMP_ENV(parser) \
108  do { \
109  (parser)->jmp_env_active = 0; \
110  } while(0)
111 
112 #define PT_INTERNAL_ERROR(parser, what) \
113  pt_internal_error((parser), __FILE__, __LINE__, (what))
114 
115 #define PT_IS_QUERY_NODE_TYPE(x) \
116  ( (x) == PT_SELECT || (x) == PT_UNION \
117  || (x) == PT_DIFFERENCE || (x) == PT_INTERSECTION)
118 
119 #define PT_IS_CLASSOID_NAME(x) \
120  ( (x)->info.name.meta_class == PT_CLASSOID_ATTR)
121 
122 #define PT_IS_NULL_NODE(e) ((e)->type_enum==PT_TYPE_NA \
123  || (e)->type_enum==PT_TYPE_NULL)
124 
125 #define PT_IS_NUMERIC_TYPE(t) \
126  ( ((t) == PT_TYPE_INTEGER) || \
127  ((t) == PT_TYPE_BIGINT) || \
128  ((t) == PT_TYPE_FLOAT) || \
129  ((t) == PT_TYPE_DOUBLE) || \
130  ((t) == PT_TYPE_SMALLINT) || \
131  ((t) == PT_TYPE_MONETARY) || \
132  ((t) == PT_TYPE_LOGICAL) || \
133  ((t) == PT_TYPE_NUMERIC))
134 
135 #define PT_IS_DISCRETE_NUMBER_TYPE(t) \
136  ( ((t) == PT_TYPE_INTEGER) || \
137  ((t) == PT_TYPE_BIGINT) || \
138  ((t) == PT_TYPE_SMALLINT))
139 
140 #define PT_IS_COUNTER_TYPE(t) \
141  PT_IS_DISCRETE_NUMBER_TYPE(t)
142 
143 #define PT_IS_COLLECTION_TYPE(t) \
144  ( ((t) == PT_TYPE_SET) || \
145  ((t) == PT_TYPE_MULTISET) || \
146  ((t) == PT_TYPE_SEQUENCE))
147 
148 #define PT_IS_STRING_TYPE(t) \
149  ( ((t) == PT_TYPE_CHAR) || \
150  ((t) == PT_TYPE_VARCHAR) || \
151  ((t) == PT_TYPE_NCHAR) || \
152  ((t) == PT_TYPE_VARNCHAR) || \
153  ((t) == PT_TYPE_BIT) || \
154  ((t) == PT_TYPE_VARBIT))
155 
156 #define PT_IS_NATIONAL_CHAR_STRING_TYPE(t) \
157  ( ((t) == PT_TYPE_NCHAR) || \
158  ((t) == PT_TYPE_VARNCHAR))
159 
160 #define PT_IS_SIMPLE_CHAR_STRING_TYPE(t) \
161  ( ((t) == PT_TYPE_CHAR) || \
162  ((t) == PT_TYPE_VARCHAR))
163 
164 #define PT_IS_CHAR_STRING_TYPE(t) \
165  ( ((t) == PT_TYPE_CHAR) || \
166  ((t) == PT_TYPE_VARCHAR) || \
167  ((t) == PT_TYPE_NCHAR) || \
168  ((t) == PT_TYPE_VARNCHAR))
169 
170 #define PT_IS_BIT_STRING_TYPE(t) \
171  ( ((t) == PT_TYPE_BIT) || \
172  ((t) == PT_TYPE_VARBIT))
173 
174 #define PT_IS_COMPLEX_TYPE(t) \
175  ( ((t) == PT_TYPE_MONETARY) || \
176  ((t) == PT_TYPE_NUMERIC) || \
177  ((t) == PT_TYPE_CHAR) || \
178  ((t) == PT_TYPE_VARCHAR) || \
179  ((t) == PT_TYPE_NCHAR) || \
180  ((t) == PT_TYPE_VARNCHAR) || \
181  ((t) == PT_TYPE_BIT) || \
182  ((t) == PT_TYPE_VARBIT) || \
183  ((t) == PT_TYPE_OBJECT) || \
184  ((t) == PT_TYPE_SET) || \
185  ((t) == PT_TYPE_MULTISET) || \
186  ((t) == PT_TYPE_SEQUENCE) || \
187  ((t) == PT_TYPE_ENUMERATION))
188 
189 #define PT_IS_DATE_TIME_WITH_TZ_TYPE(t) \
190  ( (t) == PT_TYPE_TIMESTAMPTZ || \
191  (t) == PT_TYPE_TIMESTAMPLTZ || \
192  (t) == PT_TYPE_DATETIMETZ || \
193  (t) == PT_TYPE_DATETIMELTZ)
194 
195 #define PT_IS_DATE_TIME_TYPE(t) \
196  ( ((t) == PT_TYPE_DATE) || \
197  ((t) == PT_TYPE_TIME) || \
198  ((t) == PT_TYPE_TIMESTAMP) || \
199  ((t) == PT_TYPE_DATETIME) || \
200  ((t) == PT_TYPE_DATETIMETZ) || \
201  ((t) == PT_TYPE_DATETIMELTZ) || \
202  ((t) == PT_TYPE_TIMESTAMPTZ) || \
203  ((t) == PT_TYPE_TIMESTAMPLTZ))
204 
205 #define PT_HAS_DATE_PART(t) \
206  ( ((t) == PT_TYPE_DATE) || \
207  ((t) == PT_TYPE_TIMESTAMP) || \
208  ((t) == PT_TYPE_DATETIME) || \
209  ((t) == PT_TYPE_DATETIMETZ) || \
210  ((t) == PT_TYPE_DATETIMELTZ) || \
211  ((t) == PT_TYPE_TIMESTAMPTZ) || \
212  ((t) == PT_TYPE_TIMESTAMPLTZ))
213 
214 #define PT_HAS_TIME_PART(t) \
215  ( ((t) == PT_TYPE_TIME) || \
216  ((t) == PT_TYPE_TIMESTAMP) || \
217  ((t) == PT_TYPE_TIMESTAMPTZ) || \
218  ((t) == PT_TYPE_TIMESTAMPLTZ) || \
219  ((t) == PT_TYPE_DATETIME) || \
220  ((t) == PT_TYPE_DATETIMETZ) || \
221  ((t) == PT_TYPE_DATETIMELTZ))
222 
223 #define PT_IS_LTZ_TYPE(t) \
224  ((t) == PT_TYPE_TIMESTAMPLTZ || (t) == PT_TYPE_DATETIMELTZ)
225 
226 #define PT_IS_PRIMITIVE_TYPE(t) \
227  ( ((t) != PT_TYPE_OBJECT) && ((t) != PT_TYPE_NONE))
228 
229 #define PT_IS_PARAMETERIZED_TYPE(t) \
230  ( ((t) == PT_TYPE_NUMERIC) || \
231  ((t) == PT_TYPE_VARCHAR) || \
232  ((t) == PT_TYPE_CHAR) || \
233  ((t) == PT_TYPE_VARNCHAR) || \
234  ((t) == PT_TYPE_NCHAR) || \
235  ((t) == PT_TYPE_VARBIT) || \
236  ((t) == PT_TYPE_BIT) || \
237  ((t) == PT_TYPE_ENUMERATION))
238 
239 #define PT_IS_LOB_TYPE(t) \
240  ( ((t) == PT_TYPE_BLOB) || \
241  ((t) == PT_TYPE_CLOB))
242 
243 #define PT_HAS_COLLATION(t) \
244  ( ((t) == PT_TYPE_CHAR) || \
245  ((t) == PT_TYPE_VARCHAR) || \
246  ((t) == PT_TYPE_NCHAR) || \
247  ((t) == PT_TYPE_VARNCHAR) || \
248  ((t) == PT_TYPE_ENUMERATION))
249 
250 #define PT_VALUE_GET_BYTES(node) \
251  ((node) == NULL ? NULL : \
252  (node)->info.value.data_value.str->bytes)
253 
254 #define pt_is_select(n) PT_IS_SELECT(n)
255 #define pt_is_union(n) PT_IS_UNION(n)
256 #define pt_is_intersection(n) PT_IS_INTERSECTION(n)
257 #define pt_is_difference(n) PT_IS_DIFFERENCE(n)
258 #define pt_is_query(n) PT_IS_QUERY(n)
259 #define pt_is_correlated_subquery(n) PT_IS_CORRELATED_SUBQUERY(n)
260 #define pt_is_dot_node(n) PT_IS_DOT_NODE(n)
261 #define pt_is_expr_node(n) PT_IS_EXPR_NODE(n)
262 #define pt_is_function(n) PT_IS_FUNCTION(n)
263 #define pt_is_multi_col_term(n) PT_IS_MULTI_COL_TERM(n)
264 #define pt_is_name_node(n) PT_IS_NAME_NODE(n)
265 #define pt_is_oid_name(n) PT_IS_OID_NAME(n)
266 #define pt_is_value_node(n) PT_IS_VALUE_NODE(n)
267 #define pt_is_set_type(n) PT_IS_SET_TYPE(n)
268 #define pt_is_hostvar(n) PT_IS_HOSTVAR(n)
269 #define pt_is_input_hostvar(n) PT_IS_INPUT_HOSTVAR(n)
270 #define pt_is_output_hostvar(n) PT_IS_OUTPUT_HOSTVAR(n)
271 #define pt_is_const(n) PT_IS_CONST(n)
272 #define pt_is_parameter(n) PT_IS_PARAMETER(n)
273 #define pt_is_input_parameter(n) PT_IS_INPUT_PARAMETER(n)
274 #define pt_is_const_not_hostvar(n) PT_IS_CONST_NOT_HOSTVAR(n)
275 #define pt_is_const_input_hostvar(n) PT_IS_CONST_INPUT_HOSTVAR(n)
276 #define pt_is_cast_const_input_hostvar(n) PT_IS_CAST_CONST_INPUT_HOSTVAR(n)
277 #define pt_is_instnum(n) PT_IS_INSTNUM(n)
278 #define pt_is_orderbynum(n) PT_IS_ORDERBYNUM(n)
279 #define pt_is_distinct(n) PT_IS_DISTINCT(n)
280 #define pt_is_meta(n) PT_IS_META(n)
281 #define pt_is_update_object(n) PT_IS_UPDATE_OBJECT(n)
282 #define pt_is_unary(op) PT_IS_UNARY(op)
283 
284 #define PT_IS_SELECT(n) \
285  ( (n) && ((n)->node_type == PT_SELECT) )
286 
287 #define PT_IS_UNION(n) \
288  ( (n) && ((n)->node_type == PT_UNION) )
289 
290 #define PT_IS_INTERSECTION(n) \
291  ( (n) && ((n)->node_type == PT_INTERSECTION) )
292 
293 #define PT_IS_DIFFERENCE(n) \
294  ( (n) && ((n)->node_type == PT_DIFFERENCE) )
295 
296 #define PT_IS_QUERY(n) \
297  ( (n) && (PT_IS_QUERY_NODE_TYPE((n)->node_type)) )
298 
299 #define PT_IS_CORRELATED_SUBQUERY(n) \
300  ( PT_IS_QUERY((n)) && ((n)->info.query.correlation_level > 0) )
301 
302 #define PT_IS_DOT_NODE(n) \
303  ( (n) && ((n)->node_type == PT_DOT_) )
304 
305 #define PT_IS_EXPR_NODE(n) \
306  ( (n) && ((n)->node_type == PT_EXPR) )
307 
308 #define PT_IS_ASSIGN_NODE(n) \
309  ( (n) && ((n)->node_type == PT_EXPR && (n)->info.expr.op == PT_ASSIGN) )
310 
311 #define PT_IS_FUNCTION(n) \
312  ( (n) && ((n)->node_type == PT_FUNCTION) )
313 
314 #define PT_IS_MULTI_COL_TERM(n) \
315  ( (n) && \
316  PT_IS_FUNCTION((n)) && \
317  PT_IS_SET_TYPE ((n)) && \
318  (n)->info.function.function_type == F_SEQUENCE)
319 
320 #define PT_IS_NAME_NODE(n) \
321  ( (n) && ((n)->node_type == PT_NAME) )
322 
323 #define PT_IS_OID_NAME(n) \
324  ( (n) && \
325  ((n)->node_type == PT_NAME && \
326  ((n)->info.name.meta_class == PT_OID_ATTR || \
327  (n)->info.name.meta_class == PT_VID_ATTR) ) \
328  )
329 
330 #define PT_IS_VALUE_NODE(n) \
331  ( (n) && ((n)->node_type == PT_VALUE) )
332 
333 #define PT_IS_INSERT_VALUE_NODE(n) \
334  ( (n) && ((n)->node_type == PT_INSERT_VALUE) )
335 
336 #define PT_IS_SET_TYPE(n) \
337  ( (n) && ((n)->type_enum == PT_TYPE_SET || \
338  (n)->type_enum == PT_TYPE_MULTISET || \
339  (n)->type_enum == PT_TYPE_SEQUENCE) \
340  )
341 
342 #define PT_IS_HOSTVAR(n) \
343  ( (n) && ((n)->node_type == PT_HOST_VAR) )
344 
345 #define PT_IS_INPUT_HOSTVAR(n) \
346  ( (n) && ((n)->node_type == PT_HOST_VAR && \
347  (n)->info.host_var.var_type == PT_HOST_IN) \
348  )
349 
350 #define PT_IS_OUTPUT_HOSTVAR(n) \
351  ( (n) && ((n)->node_type == PT_HOST_VAR && \
352  (n)->info.host_var.var_type == PT_HOST_OUT) \
353  )
354 
355 #define PT_IS_PARAMETER(n) \
356  ( (n) && ((n)->node_type == PT_NAME && \
357  (n)->info.name.meta_class == PT_PARAMETER) )
358 
359 #define PT_IS_INPUT_PARAMETER(n) \
360  ( (n) && ((n)->node_type == PT_NAME && \
361  (n)->info.name.meta_class == PT_PARAMETER && \
362  (n)->info.name.resolved == NULL) )
363 
364 #define PT_IS_CONST(n) \
365  ( (n) && ((n)->node_type == PT_VALUE || \
366  (n)->node_type == PT_HOST_VAR || \
367  ((n)->node_type == PT_NAME && (n)->info.name.meta_class == PT_PARAMETER) ) \
368  )
369 
370 #define PT_IS_CONST_NOT_HOSTVAR(n) \
371  ( (n) && ((n)->node_type == PT_VALUE || \
372  ((n)->node_type == PT_NAME && (n)->info.name.meta_class == PT_PARAMETER) ) \
373  )
374 
375 #define PT_IS_CONST_INPUT_HOSTVAR(n) \
376  ( (n) && ((n)->node_type == PT_VALUE || \
377  ((n)->node_type == PT_NAME && (n)->info.name.meta_class == PT_PARAMETER) || \
378  ((n)->node_type == PT_HOST_VAR && (n)->info.host_var.var_type == PT_HOST_IN)) \
379  )
380 
381 #define PT_IS_CAST_CONST_INPUT_HOSTVAR(n) \
382  ( (n) && \
383  (n)->node_type == PT_EXPR && \
384  (n)->info.expr.op == PT_CAST && \
385  PT_IS_CONST_INPUT_HOSTVAR((n)->info.expr.arg1) )
386 
387 #define PT_IS_INSTNUM(n) \
388  ( (n) && ((n)->node_type == PT_EXPR && \
389  ((n)->info.expr.op == PT_INST_NUM || (n)->info.expr.op == PT_ROWNUM)) \
390  )
391 
392 #define PT_IS_ORDERBYNUM(n) \
393  ( (n) && ((n)->node_type == PT_EXPR && ((n)->info.expr.op == PT_ORDERBY_NUM)) )
394 
395 #define PT_IS_DISTINCT(n) \
396  ( (n) && PT_IS_QUERY_NODE_TYPE((n)->node_type) && (n)->info.query.all_distinct != PT_ALL )
397 
398 #define PT_IS_META(n) \
399  ( ((n) ? ((n)->node_type == PT_NAME ? \
400  ((n)->info.name.meta_class == PT_META_CLASS || \
401  (n)->info.name.meta_class == PT_META_ATTR || \
402  (n)->info.name.meta_class == PT_CLASSOID_ATTR || \
403  (n)->info.name.meta_class == PT_OID_ATTR) : \
404  ((n)->node_type == PT_SPEC && ((n)->info.spec.meta_class == PT_META_CLASS))) \
405  : false) )
406 #define PT_IS_HINT_NODE(n) \
407  ( (n) && ((n)->node_type == PT_NAME && (n)->info.name.meta_class == PT_HINT_NAME) )
408 
409 #define PT_IS_UPDATE_OBJECT(n) \
410  ( (n) && (n)->node_type == PT_UPDATE && (n)->info.update.spec == NULL )
411 
412 #define PT_IS_UNARY(op) \
413  ( (op) == PT_NOT || \
414  (op) == PT_IS_NULL || \
415  (op) == PT_IS_NOT_NULL || \
416  (op) == PT_EXISTS || \
417  (op) == PT_PRIOR || \
418  (op) == PT_CONNECT_BY_ROOT || \
419  (op) == PT_QPRIOR || \
420  (op) == PT_UNARY_MINUS) )
421 
422 #define PT_IS_N_COLUMN_UPDATE_EXPR(n) \
423  ( (n) && \
424  (n)->node_type == PT_EXPR && \
425  (n)->info.expr.op == PT_PATH_EXPR_SET )
426 
427 #define PT_DOES_FUNCTION_HAVE_DIFFERENT_ARGS(op) \
428  ((op) == PT_MODULUS || (op) == PT_SUBSTRING || \
429  (op) == PT_LPAD || (op) == PT_RPAD || (op) == PT_ADD_MONTHS || \
430  (op) == PT_TO_CHAR || (op) == PT_TO_NUMBER || \
431  (op) == PT_POWER || (op) == PT_ROUND || \
432  (op) == PT_TRUNC || (op) == PT_INSTR || \
433  (op) == PT_LEAST || (op) == PT_GREATEST || \
434  (op) == PT_FIELD || \
435  (op) == PT_REPEAT || (op) == PT_SUBSTRING_INDEX || \
436  (op) == PT_MAKEDATE || (op) == PT_MAKETIME || (op) == PT_IF || \
437  (op) == PT_STR_TO_DATE)
438 
439 #define PT_REQUIRES_HIERARCHICAL_QUERY(op) \
440  ( (op) == PT_LEVEL || \
441  (op) == PT_CONNECT_BY_ISCYCLE || \
442  (op) == PT_CONNECT_BY_ISLEAF || \
443  (op) == PT_PRIOR || \
444  (op) == PT_CONNECT_BY_ROOT || \
445  (op) == PT_QPRIOR || \
446  (op) == PT_SYS_CONNECT_BY_PATH )
447 
448 #define PT_CHECK_HQ_OP_EXCEPT_PRIOR(op) \
449  ( (op) == PT_LEVEL || \
450  (op) == PT_CONNECT_BY_ISCYCLE || \
451  (op) == PT_CONNECT_BY_ISLEAF || \
452  (op) == PT_CONNECT_BY_ROOT || \
453  (op) == PT_SYS_CONNECT_BY_PATH )
454 
455 #define PT_IS_NUMBERING_AFTER_EXECUTION(op) \
456  ( (op) == PT_INST_NUM || \
457  (op) == PT_ROWNUM || \
458  /*(int)(op) == (int)PT_GROUPBY_NUM || - TODO: this does not belong here. */ \
459  (op) == PT_ORDERBY_NUM )
460 
461 #define PT_IS_SERIAL(op) \
462  ( (op) == PT_CURRENT_VALUE || (op) == PT_NEXT_VALUE )
463 
464 #define PT_IS_EXPR_NODE_WITH_OPERATOR(n, op_type) \
465  ( (PT_IS_EXPR_NODE (n)) && ((n)->info.expr.op == (op_type)) )
466 
467 #define PT_IS_EXPR_WITH_PRIOR_ARG(x) (PT_IS_EXPR_NODE (x) && \
468  PT_IS_EXPR_NODE_WITH_OPERATOR ((x)->info.expr.arg1, PT_PRIOR))
469 
470 #define PT_NODE_DATA_TYPE(n) \
471  ( (n) ? (n)->data_type : NULL )
472 
473 #define PT_IS_SORT_SPEC_NODE(n) \
474  ( (n) && ((n)->node_type == PT_SORT_SPEC) )
475 
476 #define PT_IS_VALUE_QUERY(n) \
477  ((n)->flag.is_value_query == 1)
478 
479 #define PT_SET_VALUE_QUERY(n) \
480  ((n)->flag.is_value_query = 1)
481 
482 #define PT_IS_ORDER_DEPENDENT(n) \
483  ( (n) ? \
484  (PT_IS_EXPR_NODE (n) ? (n)->info.expr.is_order_dependent \
485  : (PT_IS_FUNCTION(n) ? (n)->info.function.is_order_dependent \
486  : (PT_IS_QUERY(n) ? (n)->info.query.is_order_dependent : false))) \
487  : false)
488 
489 #define PT_IS_ANALYTIC_NODE(n) \
490  ( (n) && (n)->node_type == PT_FUNCTION && \
491  (n)->info.function.analytic.is_analytic )
492 
493 #define PT_IS_POINTER_REF_NODE(n) \
494  ( (n) && (n)->node_type == PT_NODE_POINTER && \
495  (n)->info.pointer.type == PT_POINTER_REF )
496 
497 #define PT_IS_VACUUM_NODE(n) \
498  ( (n) && (n)->node_type == PT_VACUUM )
499 
500 #define PT_SET_ORDER_DEPENDENT_FLAG(n, f) \
501  do { \
502  if ((n)) \
503  { \
504  if (PT_IS_EXPR_NODE (n)) \
505  (n)->info.expr.is_order_dependent = (f); \
506  else if (PT_IS_FUNCTION (n)) \
507  (n)->info.function.is_order_dependent = (f); \
508  else if (PT_IS_QUERY (n)) \
509  (n)->info.query.is_order_dependent = (f); \
510  } \
511  } while (0)
512 
513 #if !defined (SERVER_MODE)
514 /* the following defines support host variable binding for internal statements.
515  internal statements can be generated on TEXT handling, and these statements
516  can include host variables derived from original statement. so, to look up
517  host variable table by internal statements at parser, keep the parser,
518  i.e parent_parser */
519 
520 #define CLEAR_HOST_VARIABLES(parser_) \
521  do { DB_VALUE *hv; int i; \
522  for (i = 0, hv = parser_->host_variables; \
523  i < (parser_->host_var_count + parser_->auto_param_count); i++, hv++) \
524  db_value_clear(hv); \
525  free_and_init(parser_->host_variables); \
526  free_and_init(parser_->host_var_expected_domains);} while (0)
527 
528 #define SET_HOST_VARIABLES_IF_INTERNAL_STATEMENT(parser_) \
529  do { if (parent_parser) { \
530  if (parser_->host_variables != NULL && \
531  parser_->host_variables != parent_parser->host_variables) { \
532  CLEAR_HOST_VARIABLES(parser_); } \
533  parser_->host_variables = parent_parser->host_variables; \
534  parser_->host_var_expected_domains = parent_parser->host_var_expected_domains; \
535  parser_->host_var_count = parent_parser->host_var_count; \
536  parser_->auto_param_count = parent_parser->auto_param_count; \
537  parser_->flag.set_host_var = 1; } } while (0)
538 
539 #define RESET_HOST_VARIABLES_IF_INTERNAL_STATEMENT(parser_) \
540  do { if (parent_parser) { \
541  parser_->host_variables = NULL; parser_->host_var_count = 0; \
542  parser_->host_var_expected_domains = NULL; \
543  parser_->auto_param_count = 0; parser_->flag.set_host_var = 0; } } while (0)
544 
545 #endif /* !SERVER_MODE */
546 
547 /* NODE FUNCTION DECLARATIONS */
548 #define IS_UPDATE_OBJ(node) (node->node_type == PT_UPDATE && node->info.update.object_parameter)
549 
550 #define PT_NODE_INIT_OUTERLINK(n) \
551  do { \
552  if ((n)) { \
553  (n)->next = NULL; \
554  (n)->or_next = NULL; \
555  (n)->etc = NULL; \
556  (n)->alias_print = NULL; \
557  } \
558  } while (0)
559 
560 #define PT_NODE_COPY_NUMBER_OUTERLINK(t, s) \
561  do { \
562  if ((t) && (s)) { \
563  (t)->line_number = (s)->line_number; \
564  (t)->column_number = (s)->column_number; \
565  (t)->next = (s)->next; \
566  (t)->or_next = (s)->or_next; \
567  (t)->etc = (s)->etc; \
568  (t)->alias_print = (s)->alias_print; \
569  } \
570  } while (0)
571 
572 #define PT_NODE_MOVE_NUMBER_OUTERLINK(t, s) \
573  do { \
574  PT_NODE_COPY_NUMBER_OUTERLINK((t), (s)); \
575  PT_NODE_INIT_OUTERLINK((s)); \
576  } while (0)
577 
578 #define PT_NODE_PRINT_TO_ALIAS(p, n, c) \
579  do { \
580  unsigned int save_custom; \
581  \
582  if (!(p) || !(n) || (n->alias_print)) \
583  break; \
584  save_custom = (p)->custom_print; \
585  (p)->custom_print |= (c); \
586  if (((p)->custom_print & PT_SHORT_PRINT) != 0) \
587  { \
588  (n)->alias_print = pt_short_print ((p), (n)); \
589  } \
590  else \
591  { \
592  (n)->alias_print = parser_print_tree ((p), (n)); \
593  } \
594  (p)->custom_print = save_custom; \
595  } while (0)
596 
597 #define PT_NODE_PRINT_VALUE_TO_TEXT(p, n) \
598  do { \
599  if (!(p) || !(n) || (n)->node_type != PT_VALUE \
600  || (n)->info.value.text) \
601  { \
602  break; \
603  } \
604  (n)->info.value.text = parser_print_tree ((p), (n)); \
605  } while (0)
606 
607 #define CAST_POINTER_TO_NODE(p) \
608  do { \
609  while ((p) && (p)->node_type == PT_NODE_POINTER && \
610  (p)->info.pointer.type == PT_POINTER_NORMAL) \
611  { \
612  (p) = (p)->info.pointer.node; \
613  } \
614  } while (0)
615 
616 #define PT_EMPTY INT_MAX
617 #define MAX_NUM_PLAN_TRACE 100
618 
619 #define PT_GET_COLLATION_MODIFIER(p) \
620  (((p)->node_type == PT_EXPR) ? ((p)->info.expr.coll_modifier - 1) : \
621  (((p)->node_type == PT_VALUE) ? ((p)->info.value.coll_modifier - 1) : \
622  (((p)->node_type == PT_NAME) ? ((p)->info.name.coll_modifier - 1) : \
623  (((p)->node_type == PT_FUNCTION) ? ((p)->info.function.coll_modifier - 1) :\
624  (((p)->node_type == PT_DOT_) ? ((p)->info.dot.coll_modifier - 1) : (-1))))))
625 
626 #define PT_SET_NODE_COLL_MODIFIER(p, coll) \
627  do { \
628  assert ((p) != NULL); \
629  if ((p)->node_type == PT_EXPR) \
630  { \
631  (p)->info.expr.coll_modifier = (coll) + 1; \
632  } \
633  else if ((p)->node_type == PT_VALUE) \
634  { \
635  (p)->info.value.coll_modifier = (coll) + 1; \
636  } \
637  else if ((p)->node_type == PT_NAME) \
638  { \
639  (p)->info.name.coll_modifier = (coll) + 1; \
640  } \
641  else if ((p)->node_type == PT_FUNCTION) \
642  { \
643  (p)->info.function.coll_modifier = (coll) + 1; \
644  } \
645  else \
646  { \
647  assert ((p)->node_type == PT_DOT_); \
648  (p)->info.dot.coll_modifier = (coll) + 1; \
649  } \
650  } while (0)
651 
652 /* Check if spec is flagged with any of flags_ */
653 #define PT_IS_SPEC_FLAG_SET(spec_, flags_) \
654  (((spec_)->info.spec.flag & (flags_)) != 0)
655 
656 #define PT_SPEC_SPECIAL_INDEX_SCAN(spec_) \
657  (((spec_)->info.spec.flag & \
658  (PT_SPEC_FLAG_KEY_INFO_SCAN | PT_SPEC_FLAG_BTREE_NODE_INFO_SCAN)) != 0)
659 
660 /* Obtain reserved name type from spec flag */
661 #define PT_SPEC_GET_RESERVED_NAME_TYPE(spec_) \
662  (((spec_) == NULL || (spec_)->node_type != PT_SPEC \
663  || (spec_)->info.spec.flag == 0) ? \
664  /* is spec is NULL or not a PT_SPEC or flag is 0, return invalid */ \
665  RESERVED_NAME_INVALID : \
666  /* else */ \
667  ((PT_IS_SPEC_FLAG_SET (spec_, PT_SPEC_FLAG_RECORD_INFO_SCAN)) ? \
668  /* if spec is flagged for record info */ \
669  RESERVED_NAME_RECORD_INFO : \
670  /* else */ \
671  ((PT_IS_SPEC_FLAG_SET (spec_, PT_SPEC_FLAG_PAGE_INFO_SCAN)) ? \
672  /* if spec is flagged for page info */ \
673  RESERVED_NAME_PAGE_INFO : \
674  /* else */ \
675  ((PT_IS_SPEC_FLAG_SET (spec_, PT_SPEC_FLAG_KEY_INFO_SCAN)) ? \
676  /* if spec is flagged for key info */ \
677  RESERVED_NAME_KEY_INFO : \
678  /* else */ \
679  ((PT_IS_SPEC_FLAG_SET(spec_, PT_SPEC_FLAG_BTREE_NODE_INFO_SCAN) ? \
680  /* if spec is flagged for b-tree node info */ \
681  RESERVED_NAME_BTREE_NODE_INFO : \
682  /* spec is not flagged for any type of reserved names */ \
683  RESERVED_NAME_INVALID))))))
684 
685 /* Check if according to spec flag should bind names as reserved */
686 #define PT_SHOULD_BIND_RESERVED_NAME(spec_) \
687  (PT_SPEC_GET_RESERVED_NAME_TYPE (spec_) != RESERVED_NAME_INVALID)
688 
689 /* PT_SPEC node contains a derived table */
690 #define PT_SPEC_IS_DERIVED(spec_) \
691  ((spec_)->info.spec.derived_table != NULL)
692 
693 /* PT_SPEC node contains a CTE pointer */
694 #define PT_SPEC_IS_CTE(spec_) \
695  ((spec_)->info.spec.cte_pointer != NULL)
696 
697 /* PT_SPEC node contains an entity spec */
698 #define PT_SPEC_IS_ENTITY(spec_) \
699  ((spec_)->info.spec.entity_name != NULL)
700 
701 #define PT_IS_FALSE_WHERE_VALUE(node) \
702  (((node) != NULL && (node)->node_type == PT_VALUE \
703  && ((node)->type_enum == PT_TYPE_NULL \
704  || ((node)->type_enum == PT_TYPE_SET \
705  && ((node)->info.value.data_value.set == NULL)))) ? true : false)
706 
707 #define PT_IS_SPEC_REAL_TABLE(spec_) PT_SPEC_IS_ENTITY(spec_)
708 
709 /*
710  Enumerated types of parse tree statements
711  WARNING ------ WARNING ----- WARNING
712  Member functions parser_new_node, parser_init_node, parser_print_tree, which take a node as an argument
713  are accessed by function tables indexed by node_type. The functions in
714  the tables must appear in EXACTLY the same order as the node types
715  defined below. If you add a new node type you must create the
716  functions to manipulate it and put these in the tables. Else crash and burn.
717 */
718 
719 /* enumeration for parser_walk_tree() */
720 enum
721 {
726 };
727 
728 enum
729 {
732 };
733 
735 {
737 
739 
740  PT_SUPPRESS_INTO = (0x1 << 2),
741 
742  PT_SUPPRESS_SELECTOR = (0x1 << 3),
743 
745 
746  PT_SUPPRESS_QUOTES = (0x1 << 5),
747 
748  PT_PRINT_ALIAS = (0x1 << 6),
749 
750  PT_PAD_BYTE = (0x1 << 7),
751 
752  PT_CONVERT_RANGE = (0x1 << 8),
753 
754  PT_PRINT_DB_VALUE = (0x1 << 9),
755 
756  PT_SUPPRESS_INDEX = (0x1 << 10),
757 
758  PT_SUPPRESS_ORDERING = (0x1 << 11),
759 
760  PT_PRINT_QUOTES = (0x1 << 12),
761 
762  /* PT_FORCE_ORIGINAL_TABLE_NAME is for PT_NAME nodes. prints original table name instead of printing resolved NOTE:
763  * spec_id must point to original table */
765 
767 
768  /* PT_PRINT_DIFFERENT_SYSTEM_PARAMETERS print session parameters */
770 
771  /* PT_NODE_PRINT_TO_ALIAS calls pt_short_print instead pt_print_tree */
772  PT_SHORT_PRINT = (0x1 << 16),
773 
774  PT_SUPPRESS_BIGINT_CAST = (0x1 << 17),
775 
776  PT_CHARSET_COLLATE_FULL = (0x1 << 18),
777 
779 
780  PT_PRINT_USER = (0x1 << 20),
781 
783 };
784 
785 /* all statement node types should be assigned their API statement enumeration */
787 {
818  /* should have separate pt node type for CUBRID_STMT_GET_TIMEOUT, It will also be tagged PT_GET_XACTION */
828 #if defined (ENABLE_UNUSED_FUNCTION)
829  PT_USE = CUBRID_STMT_USE,
830 #endif
833 
847 
848  PT_DIFFERENCE = CUBRID_MAX_STMT_TYPE, /* these enumerations must be distinct from statements */
849  PT_INTERSECTION, /* difference intersection and union are reported as CUBRID_STMT_SELECT. */
851 
900 
901  PT_NODE_NUMBER, /* This is the number of node types */
903 };
905 
906 /* Enumerated Data Types for expressions with a VALUE */
908 {
909  PT_TYPE_NONE = 1000, /* type not known yet */
911  /* primitive types */
931 
932  /* special values */
933  PT_TYPE_NA, /* in SELECT NA */
934  PT_TYPE_NULL, /* in assignment and defaults */
935  PT_TYPE_STAR, /* select (*), count (*), will be expanded later */
936 
937  /* non primitive types */
944 
945  PT_TYPE_EXPR_SET, /* type of parentheses expr set, avail for parser only */
947 
949 
953 
959 
961 };
963 
964 /* Enumerated priviledges for Grant, Revoke */
965 typedef enum
966 {
967  PT_NO_PRIV = 2000, /* this value to initialize the node */
974  /* PT_GRANT_OPTION_PRIV, avail for revoke only */
977  PT_REFERENCES_PRIV, /* for ANSI compatibility */
980 } PT_PRIV_TYPE;
981 
982 /* Enumerated Misc Types */
983 typedef enum
984 {
1000  /* PT_CLASSOID_ATTR is no longer used. The concept that it used to embody (the OID of the class of an instance is
1001  * now captured via a first class server function F_CLASS_OF which takes an arbitrary instance valued expression. */
1005  /* PT_META_CLASS is used to embody the concept of a class OID reference that is constant at compile time. (i.e. it
1006  * does not vary as instance OIDs vary across an inheritance hierarchy). Contrast this with the F_CLASS_OF function
1007  * which returns the class OID for any instance valued expression. F_CLASS_OF is a server side function. */
1011  PT_HINT_NAME, /* hint argument name */
1013  PT_RESERVED, /* reserved names for special attributes */
1014  PT_IS_SUBQUERY, /* query is sub-query, not directly producing result */
1015  PT_IS_UNION_SUBQUERY, /* in a union sub-query */
1016  PT_IS_UNION_QUERY, /* query directly producing result in top level union */
1018  PT_IS_CSELECT, /* query is CSELECT, not directly producing result */
1019  PT_IS_WHACKED_SPEC, /* ignore this one in xasl generation, no cross product */
1020  PT_IS_SUBINSERT, /* used by value clause of insert */
1021  PT_IS_VALUE, /* used by value clause of insert */
1027  PT_NO_ISOLATION_LEVEL, /* value for uninitialized isolation level */
1031  PT_ISOLATION_LEVEL, /* get transaction option */
1033  PT_HOST_IN, /* kind of host variable */
1036  PT_ACTIVE, /* trigger status */
1038  PT_BEFORE, /* trigger time */
1041  PT_REJECT, /* trigger action */
1045  PT_TRIGGER_TRACE, /* trigger options */
1047  PT_IS_CALL_STMT, /* is the method a call statement */
1048  PT_IS_MTHD_EXPR, /* is the method call part of an expr */
1049  PT_IS_CLASS_MTHD, /* is the method a class method */
1050  PT_IS_INST_MTHD, /* is the method an instance method */
1051  PT_METHOD_ENTITY, /* this entity arose from a method call */
1052  PT_IS_SELECTOR_SPEC, /* This is the 'real' correspondant of the whacked spec. down in the path entities
1053  * portion. */
1054  PT_PATH_INNER, /* types of join which may emulate path */
1057  PT_LOCAL, /* local or cascaded view check option */
1060 
1061  PT_CHAR_STRING, /* denotes the flavor of a literal string */
1065 
1067  PT_MATCH_FULL, /* values to support triggered actions for */
1068  PT_MATCH_PARTIAL, /* referential integrity constraints */
1074 
1075  PT_LEADING, /* trim operation qualifiers */
1082 
1083  PT_MILLISECOND, /* datetime components for extract operation */
1092  /* mysql units types */
1104 
1107 
1108  PT_OPT_LVL, /* Variants of "get/set optimization" statement */
1110 
1112  PT_SUBSTR, /* substring qualifier */
1113 
1115 
1121 
1124 
1127 
1131 
1133 
1138 
1139  PT_IS_SHOWSTMT, /* query is SHOWSTMT */
1142 
1143  PT_DERIVED_JSON_TABLE, // json table spec derivation
1144 
1145  // todo: separate into relevant enumerations
1146 } PT_MISC_TYPE;
1147 
1148 /* Enumerated join type */
1149 typedef enum
1150 {
1151  PT_JOIN_NONE = 0x00, /* 0000 0000 */
1152  PT_JOIN_CROSS = 0x01, /* 0000 0001 */
1153  PT_JOIN_NATURAL = 0x02, /* 0000 0010 -- not used */
1154  PT_JOIN_INNER = 0x04, /* 0000 0100 */
1155  PT_JOIN_LEFT_OUTER = 0x08, /* 0000 1000 */
1156  PT_JOIN_RIGHT_OUTER = 0x10, /* 0001 0000 */
1157  PT_JOIN_FULL_OUTER = 0x20, /* 0010 0000 -- not used */
1158  PT_JOIN_UNION = 0x40 /* 0100 0000 -- not used */
1159 } PT_JOIN_TYPE;
1160 
1161 typedef enum
1162 {
1163  PT_HINT_NONE = 0x00, /* 0000 0000 *//* no hint */
1164  PT_HINT_ORDERED = 0x01, /* 0000 0001 *//* force join left-to-right */
1165  PT_HINT_NO_INDEX_SS = 0x02, /* 0000 0010 *//* disable index skip scan */
1166  PT_HINT_INDEX_SS = 0x04, /* 0000 0100 *//* enable index skip scan */
1167  PT_HINT_SELECT_BTREE_NODE_INFO = 0x08, /* temporarily use the unused hint PT_HINT_Y */
1168  /* SELECT b-tree node information */
1169  PT_HINT_USE_NL = 0x10, /* 0001 0000 *//* force nl-join */
1170  PT_HINT_USE_IDX = 0x20, /* 0010 0000 *//* force idx-join */
1171  PT_HINT_USE_MERGE = 0x40, /* 0100 0000 *//* force m-join */
1172  PT_HINT_USE_HASH = 0x80, /* 1000 0000 -- not used */
1173  PT_HINT_RECOMPILE = 0x0100, /* 0000 0001 0000 0000 *//* recompile */
1174  PT_HINT_LK_TIMEOUT = 0x0200, /* 0000 0010 0000 0000 *//* lock_timeout */
1175  PT_HINT_NO_LOGGING = 0x0400, /* 0000 0100 0000 0000 *//* no_logging */
1176  PT_HINT_NO_HASH_LIST_SCAN = 0x0800, /* 0000 1000 0000 0000 *//* no hash list scan */
1177  PT_HINT_QUERY_CACHE = 0x1000, /* 0001 0000 0000 0000 *//* query_cache */
1178  PT_HINT_REEXECUTE = 0x2000, /* 0010 0000 0000 0000 *//* reexecute */
1179  PT_HINT_JDBC_CACHE = 0x4000, /* 0100 0000 0000 0000 *//* jdbc_cache */
1180  PT_HINT_USE_SBR = 0x8000, /* 1000 0000 0000 0000 *//* statement based replication */
1181  PT_HINT_USE_IDX_DESC = 0x10000, /* 0001 0000 0000 0000 0000 *//* descending index scan */
1182  PT_HINT_NO_COVERING_IDX = 0x20000, /* 0010 0000 0000 0000 0000 *//* do not use covering index scan */
1183  PT_HINT_INSERT_MODE = 0x40000, /* 0100 0000 0000 0000 0000 *//* set insert_executeion_mode */
1184  PT_HINT_NO_IDX_DESC = 0x80000, /* 1000 0000 0000 0000 0000 *//* do not use descending index scan */
1185  PT_HINT_NO_MULTI_RANGE_OPT = 0x100000, /* 0001 0000 0000 0000 0000 0000 */
1186  /* do not use multi range optimization */
1187  PT_HINT_USE_UPDATE_IDX = 0x200000, /* 0010 0000 0000 0000 0000 0000 */
1188  /* use index for merge update */
1189  PT_HINT_USE_INSERT_IDX = 0x400000, /* 0100 0000 0000 0000 0000 0000 */
1190  /* do not generate SORT-LIMIT plan */
1191  PT_HINT_NO_SORT_LIMIT = 0x800000, /* 1000 0000 0000 0000 0000 0000 */
1192  PT_HINT_NO_HASH_AGGREGATE = 0x1000000, /* 0001 0000 0000 0000 0000 0000 0000 */
1193  /* no hash aggregate evaluation */
1194  PT_HINT_SKIP_UPDATE_NULL = 0x2000000, /* 0010 0000 0000 0000 0000 0000 0000 */
1195  PT_HINT_NO_INDEX_LS = 0x4000000, /* 0100 0000 0000 0000 0000 0000 0000 *//* enable loose index scan */
1196  PT_HINT_INDEX_LS = 0x8000000, /* 1000 0000 0000 0000 0000 0000 0000 *//* disable loose index scan */
1197  PT_HINT_QUERY_NO_CACHE = 0x10000000, /* 0001 0000 0000 0000 0000 0000 0000 0000 *//* don't use the query cache */
1198  PT_HINT_SELECT_RECORD_INFO = 0x20000000, /* 0010 0000 0000 0000 0000 0000 0000 0000 */
1199  /* SELECT record info from tuple header instead of data */
1200  PT_HINT_SELECT_PAGE_INFO = 0x40000000, /* 0100 0000 0000 0000 0000 0000 0000 0000 */
1201  /* SELECT page header information from heap file instead of record data */
1202  PT_HINT_SELECT_KEY_INFO = 0x80000000 /* 1000 0000 0000 0000 0000 0000 0000 0000 */
1203  /* SELECT key information from index b-tree instead of table record data */
1204 } PT_HINT_ENUM;
1205 
1206 /* Codes for error messages */
1207 
1208 typedef enum
1209 {
1210  PT_NO_ERROR = 4000,
1220 } PT_ERROR_CODE;
1221 
1222 /* Codes for alter/add */
1223 
1224 typedef enum
1225 {
1258 #if defined (ENABLE_RENAME_CONSTRAINT)
1259  PT_RENAME_CONSTRAINT,
1260  PT_RENAME_INDEX,
1261 #endif
1268 } PT_ALTER_CODE;
1269 
1270 /* Codes for trigger event type */
1271 
1272 typedef enum
1273 {
1286 } PT_EVENT_TYPE;
1287 
1288 /* Codes for constraint types */
1289 
1290 typedef enum
1291 {
1300 
1301 typedef enum
1302 {
1307 
1308 typedef enum
1309 {
1319 
1320 typedef enum
1321 {
1332  PT_GT_INF, PT_LT_INF, /* internal use only */
1340  PT_ASSIGN, /* as in x=y */
1345  PT_RANGE, /* internal use only */
1367 
1371 
1373 
1376 
1378 
1380 
1383 
1398  /* datetime */
1399  PT_ADDDATE, /* 2 fixed parameter */
1400  PT_DATE_ADD, /* INTERVAL variant */
1429 
1434  PT_FUNCTION_HOLDER, /* special operator : wrapper for PT_FUNCTION node */
1442 
1446 
1447  /* rlike operator */
1450 
1451  /* inet */
1453 
1455 
1456  /* width_bucket */
1467 
1469 
1481 
1482  /* This is the last entry. Please add a new one before it. */
1484 } PT_OP_TYPE;
1485 
1486 /* the virtual query mechanism needs to put oid columns on non-updatable
1487  * virtual query guys, hence the "trust me" part.
1488  */
1489 typedef enum
1490 {
1495 
1496 typedef enum
1497 {
1502 
1503 typedef enum
1504 {
1508 } PT_ERROR_TYPE;
1509 
1510 typedef enum
1511 {
1515 
1516 /* Flags for spec structures */
1517 typedef enum
1518 {
1519  PT_SPEC_FLAG_NONE = 0x0, /* the spec will not be altered */
1520  PT_SPEC_FLAG_UPDATE = 0x01, /* the spec will be updated */
1521  PT_SPEC_FLAG_DELETE = 0x02, /* the spec will be deleted */
1522  PT_SPEC_FLAG_HAS_UNIQUE = 0x04, /* the spec has unique */
1523  PT_SPEC_FLAG_FROM_VCLASS = 0x08, /* applicable for derived tables, marks one as a rewritten view */
1524  PT_SPEC_FLAG_CONTAINS_OID = 0x10, /* classoid and oid were added in the derived table's select list */
1525  PT_SPEC_FLAG_FOR_UPDATE_CLAUSE = 0x20, /* Used with FOR UPDATE clause */
1526  PT_SPEC_FLAG_RECORD_INFO_SCAN = 0x40, /* spec will be scanned for record information instead of record data */
1527  PT_SPEC_FLAG_PAGE_INFO_SCAN = 0x80, /* spec's heap file will scanned page by page for page information. records
1528  * will not be scanned. */
1529  PT_SPEC_FLAG_KEY_INFO_SCAN = 0x100, /* one of the spec's indexes will be scanned for key information. */
1530  PT_SPEC_FLAG_BTREE_NODE_INFO_SCAN = 0x200, /* one of the spec's indexes will be scanned for b-tree node info */
1531  PT_SPEC_FLAG_MVCC_COND_REEV = 0x400, /* the spec is used in mvcc condition reevaluation */
1532  PT_SPEC_FLAG_MVCC_ASSIGN_REEV = 0x800, /* the spec is used in UPDATE assignment reevaluation */
1533  PT_SPEC_FLAG_DOESNT_HAVE_UNIQUE = 0x1000 /* the spec was checked and does not have any uniques */
1534 } PT_SPEC_FLAG;
1535 
1536 typedef enum
1537 {
1543 
1544 /* Enum used for insert statements. After checking if insert is allowed on
1545  * server, the result is saved to avoid the same check again.
1546  */
1547 typedef enum
1548 {
1553 
1554 /*
1555  * Type definitions
1556  */
1557 
1559 
1561 
1562 typedef struct parser_node PT_NODE;
1576 typedef struct pt_cte_info PT_CTE_INFO;
1584 typedef struct pt_dot_info PT_DOT_INFO;
1636 #if defined (ENABLE_UNUSED_FUNCTION)
1637 typedef struct pt_use_info PT_USE_INFO;
1638 #endif
1652 typedef struct pt_do_info PT_DO_INFO;
1657 
1664 
1666 typedef struct cursor_id PT_CURSOR_ID;
1667 typedef struct qfile_list_id PT_LIST_ID;
1671 typedef struct parser_hint PT_HINT;
1674 
1676 
1678 
1680 
1682 
1684 
1688 
1689 typedef PT_NODE *(*PT_NODE_WALK_FUNCTION) (PARSER_CONTEXT * p, PT_NODE * tree, void *arg, int *continue_walk);
1690 
1691 typedef PARSER_VARCHAR *(*PT_PRINT_VALUE_FUNC) (PARSER_CONTEXT * parser, const PT_NODE * val);
1692 
1693 /* This is for loose reference to init node function vector */
1694 typedef void (*PARSER_GENERIC_VOID_FUNCTION) ();
1695 
1697 
1699 {
1700  UINTPTR first_spec_id;
1703 };
1704 
1706 {
1707  PT_NODE *top_node; /* top_node_arg */
1708  PT_NODE *Oracle_outerjoin_spec; /* Oracle style outer join check */
1709  int Oracle_outerjoin_attr_num; /* Oracle style outer join check */
1710  int Oracle_outerjoin_subq_num; /* Oracle style outer join check */
1711  int Oracle_outerjoin_path_num; /* Oracle style outer join check */
1712  bool donot_fold; /* false - off, true - on */
1713  bool system_class; /* system class(es) is(are) referenced */
1714 };
1715 
1717 {
1718  DB_OBJECT *class_object; /* the nested view's class object */
1723 };
1724 
1726 {
1735  char **expressions;
1739 };
1740 
1742 {
1743  const char *tokens;
1746 };
1747 
1749 {
1750  PT_NODE *entity_name; /* PT_NAME */
1751  PT_ALTER_CODE code; /* value will be PT_ADD_ATTR, PT_DROP_ATTR ... */
1752  PT_MISC_TYPE entity_type; /* PT_VCLASS, ... */
1753  struct
1754  {
1755  PT_NODE *sup_class_list; /* PT_NAME */
1756  PT_NODE *resolution_list; /* PT_RESOLUTION */
1757  } super;
1758  union
1759  {
1760  struct
1761  {
1762  PT_NODE *query; /* PT_SELECT */
1763  PT_NODE *query_no_list; /* PT_VALUE(list) */
1764  PT_NODE *attr_def_list; /* to be filled in semantic check */
1765  PT_NODE *view_comment; /* PT_VALUE */
1766  } query;
1767  struct
1768  {
1769  PT_NODE *attr_def_list; /* PT_ATTR_DEF */
1770  PT_NODE *attr_old_name; /* PT_NAME used for CHANGE <old> <new> */
1771  PT_NODE *attr_mthd_name_list; /* PT_NAME(list) */
1772  PT_NODE *mthd_def_list; /* PT_METHOD_DEF */
1773  PT_NODE *mthd_file_list; /* PT_FILE_PATH */
1774  PT_NODE *mthd_name_list; /* PT_NAME(list) */
1775  PT_MISC_TYPE attr_type; /* PT_NORMAL_ATTR, PT_CLASS_ATTR */
1776  } attr_mthd;
1777  struct
1778  {
1779  PT_NODE *attr_name_list; /* PT_NAME(list) */
1780  PT_NODE *data_default_list; /* PT_DATA_DEFAULT(list) */
1781  } ch_attr_def;
1782  struct
1783  {
1784  PT_MISC_TYPE element_type; /* PT_ATTRIBUTE, PT_METHOD */
1785  PT_MISC_TYPE meta; /* PT_META, PT_NORMAL */
1789  PT_MISC_TYPE mthd_type; /* PT_META, PT_NORMAL */
1790  } rename;
1791  struct
1792  {
1793  PT_NODE *info; /* PT_PARTITION_INFO */
1794  PT_NODE *name_list; /* PT_NAME(list) */
1795  PT_NODE *parts; /* PT_PARTS_INFO(list) */
1796  PT_NODE *size; /* PT_VALUE */
1797  } partition;
1798  struct
1799  {
1800  int charset; /* charset for PT_CHANGE_COLLATION If the alter statement contains a valid charset
1801  * spec, it is saved into the corresponding member of the struct(charset) Otherwise,
1802  * charset = -1. */
1803  int collation_id; /* collation for PT_CHANGE_COLLATION If the alter statement contains a valid collation
1804  * spec, it is saved into the corresponding member of the struct, e.g. collation_id.
1805  * Otherwise, collation_id = -1. */
1806  } collation;
1807  struct
1808  {
1809  bool reverse;
1810  bool unique;
1811  } index;
1812  struct
1813  {
1815  } auto_increment;
1816  struct
1817  {
1818  PT_NODE *user_name; /* user name for PT_CHANGE_OWNER */
1819  } user;
1820  struct
1821  {
1822  PT_NODE *tbl_comment; /* PT_VALUE, comment for table/view */
1823  } comment;
1824  } alter_clause;
1825  PT_NODE *constraint_list; /* constraints from ADD and CHANGE clauses */
1826  PT_NODE *create_index; /* PT_CREATE_INDEX from ALTER ADD INDEX */
1827  PT_NODE *internal_stmts; /* internally created statements to handle TEXT */
1829 };
1830 
1831 /* ALTER USER INFO */
1833 {
1834  PT_NODE *user_name; /* PT_NAME */
1835  PT_NODE *password; /* PT_VALUE (string) */
1836  PT_NODE *comment; /* PT_VALUE */
1837 };
1838 
1839 /* Info for ALTER_TRIGGER */
1841 {
1842  PT_NODE *trigger_spec_list; /* PT_TRIGGER_SPEC_LIST */
1843  PT_NODE *trigger_priority; /* PT_VALUE */
1844  PT_NODE *trigger_owner; /* PT_NAME */
1845  PT_MISC_TYPE trigger_status; /* ACTIVE, INACTIVE */
1846  PT_NODE *comment; /* PT_VALUE */
1847 };
1848 
1849 /* Info for ATTACH & PREPARE TO COMMIT statements */
1851 {
1852  int trans_id; /* transaction id */
1853 };
1854 
1855 /* Info for ATTR_DEF */
1857 {
1858  PT_NODE *attr_name; /* PT_NAME */
1859  PT_NODE *data_default; /* PT_DATA_DEFAULT */
1861  PT_NODE *auto_increment; /* PT_AUTO_INCREMENT */
1862  PT_NODE *ordering_info; /* PT_ATTR_ORDERING */
1863  PT_NODE *comment; /* PT_VALUE */
1864  PT_MISC_TYPE attr_type; /* PT_NORMAL or PT_META */
1865  int size_constraint; /* max length of STRING */
1867 };
1868 
1869 /* Info for ALTER TABLE ADD COLUMN [FIRST | AFTER column_name ] */
1871 {
1872  PT_NODE *after; /* PT_NAME */
1873  bool first;
1874 };
1875 
1876 /* Info for AUTH_CMD */
1878 {
1879  PT_NODE *attr_mthd_list; /* PT_NAME (list of attr names) */
1880  PT_PRIV_TYPE auth_cmd; /* enum PT_SELECT_PRIV, PT_ALL_PRIV,... */
1881 };
1882 
1883 /* Info COMMIT WORK */
1885 {
1886  unsigned retain_lock:1; /* 0 = false, 1 = true */
1887 };
1888 
1889 typedef enum
1890 {
1895 
1896 /* Info for a CREATE ENTITY node */
1898 {
1899  PT_MISC_TYPE entity_type; /* enum PT_CLASS, PT_VCLASS .. */
1900  PT_MISC_TYPE with_check_option; /* 0, PT_LOCAL, or PT_CASCADED */
1901  PT_NODE *entity_name; /* PT_NAME */
1902  PT_NODE *supclass_list; /* PT_NAME (list) */
1903  PT_NODE *class_attr_def_list; /* PT_ATTR_DEF (list) */
1904  PT_NODE *attr_def_list; /* PT_ATTR_DEF (list) */
1905  PT_NODE *table_option_list; /* PT_TABLE_OPTION (list) */
1906  PT_NODE *method_def_list; /* PT_ATTR_DEF (list) */
1907  PT_NODE *method_file_list; /* PT_FILE_PATH (list) */
1908  PT_NODE *resolution_list; /* PT_RESOLUTION */
1909  PT_NODE *as_query_list; /* PT_SELECT (list) */
1910  PT_NODE *object_id_list; /* PT_NAME list */
1911  PT_NODE *update; /* PT_EXPR (list ) */
1912  PT_NODE *constraint_list; /* PT_CONSTRAINT (list) */
1913  PT_NODE *create_index; /* PT_CREATE_INDEX */
1914  PT_NODE *partition_info; /* PT_PARTITION_INFO */
1915  PT_NODE *internal_stmts; /* internally created statements to handle TEXT */
1916  PT_NODE *create_like; /* PT_NAME */
1917  PT_NODE *create_select; /* PT_SELECT or another type of select_expression */
1918  PT_NODE *vclass_comment; /* PT_VALUE, comment of vclass, see also: table_option_list for comment of class */
1919  PT_CREATE_SELECT_ACTION create_select_action; /* nothing | REPLACE | IGNORE for CREATE SELECT */
1920  unsigned or_replace:1; /* OR REPLACE clause for create view */
1921  unsigned if_not_exists:1; /* IF NOT EXISTS clause for create table | class */
1922 };
1923 
1924 /* CREATE/DROP INDEX INFO */
1926 {
1927  PT_NODE *indexed_class; /* PT_SPEC */
1928  PT_NODE *column_names; /* PT_SORT_SPEC (list) */
1929  PT_NODE *index_name; /* PT_NAME */
1930 #if defined (ENABLE_RENAME_CONSTRAINT)
1931  PT_NODE *new_name; /* PT_NAME */
1932 #endif
1933  PT_NODE *prefix_length; /* PT_NAME */
1934  PT_NODE *where; /* PT_EXPR */
1935  PT_NODE *function_expr; /* PT_EXPR - expression to be used in a function index */
1936  PT_NODE *comment; /* PT_VALUE */
1937  PT_ALTER_CODE code;
1938 
1939  int func_pos; /* the position of the expression in the function index's column list */
1940  int func_no_args; /* number of arguments in the function index expression */
1941  bool reverse; /* REVERSE */
1942  bool unique; /* UNIQUE specified? */
1943  SM_INDEX_STATUS index_status; /* Index status : NORMAL / ONLINE / INVISIBLE */
1945 };
1946 
1947 /* CREATE USER INFO */
1949 {
1950  PT_NODE *user_name; /* PT_NAME */
1951  PT_NODE *password; /* PT_VALUE (string) */
1952  PT_NODE *groups; /* PT_NAME list */
1953  PT_NODE *members; /* PT_NAME list */
1954  PT_NODE *comment; /* PT_VALUE */
1955 };
1956 
1957 /* CREATE TRIGGER INFO */
1959 {
1960  PT_NODE *trigger_name; /* PT_NAME */
1961  PT_NODE *trigger_priority; /* PT_VALUE */
1962  PT_MISC_TYPE trigger_status; /* ACTIVE, INACTIVE */
1963  PT_MISC_TYPE condition_time; /* BEFORE, AFTER, DEFERRED */
1964  PT_NODE *trigger_event; /* PT_EVENT_SPEC */
1965  PT_NODE *trigger_reference; /* PT_EVENT_OBJECT (list) */
1966  PT_NODE *trigger_condition; /* PT_EXPR or PT_METHOD_CALL */
1967  PT_NODE *trigger_action; /* PT_TRIGGER_ACTION */
1968  PT_MISC_TYPE action_time; /* BEFORE, AFTER, DEFERRED */
1969  PT_NODE *comment; /* PT_VALUE */
1970 };
1971 
1972 /* CTE(Common Table Expression) INFO */
1974 {
1975  PT_NODE *name; /* PT_NAME */
1976  PT_NODE *as_attr_list; /* PT_NAME */
1977  PT_NODE *non_recursive_part; /* the non-recursive subquery */
1978  PT_NODE *recursive_part; /* a recursive subquery */
1979  PT_MISC_TYPE only_all; /* Type of UNION between non-recursive and recursive parts */
1980  void *xasl; /* xasl proc pointer */
1981 };
1982 
1983 /* CREATE SERIAL INFO */
1985 {
1986  PT_NODE *serial_name; /* PT_NAME */
1987  PT_NODE *start_val; /* PT_VALUE */
1988  PT_NODE *increment_val; /* PT_VALUE */
1989  PT_NODE *max_val; /* PT_VALUE */
1990  PT_NODE *min_val; /* PT_VALUE */
1991  PT_NODE *cached_num_val; /* PT_VALUE */
1992  PT_NODE *comment; /* PT_VALUE */
1993  int cyclic;
1994  int no_max;
1995  int no_min;
1998  unsigned if_exists:1; /* IF EXISTS clause for drop serial */
1999 };
2000 
2001 /* Info for DATA_DEFAULT */
2003 {
2004  PT_NODE *default_value; /* PT_VALUE (list) */
2005  PT_MISC_TYPE shared; /* will PT_SHARED or PT_DEFAULT */
2006  DB_DEFAULT_EXPR_TYPE default_expr_type; /* if it is a pseudocolumn, do not evaluate expr */
2007 };
2008 
2009 /* Info for the AUTO_INCREMENT node */
2011 {
2012  PT_NODE *start_val; /* PT_VALUE */
2013  PT_NODE *increment_val; /* PT_VALUE */
2014 };
2015 
2016 /* Info for the PARTITION node */
2018 {
2022  PT_NODE *parts; /* PT_PARTS_INFO list */
2023  PT_PARTITION_TYPE type;
2024 };
2025 
2027 {
2028  PT_NODE *name; /* PT_NAME */
2029  PT_NODE *values; /* PT_VALUE (or list) */
2030  PT_PARTITION_TYPE type;
2031  PT_NODE *comment; /* PT_VALUE */
2032 };
2033 #define PARTITIONED_SUB_CLASS_TAG "__p__"
2034 
2035 /* Info for DATA_TYPE node */
2037 {
2038  PT_NODE *entity; /* class PT_NAME list for PT_TYPE_OBJECT */
2039  PT_NODE *enumeration; /* values list for PT_TYPE_ENUMERATION */
2040  DB_OBJECT *virt_object; /* virt class object if a vclass */
2041  PT_NODE *virt_data_type; /* for non-primitive types- sets, etc. */
2042  PT_TYPE_ENUM virt_type_enum; /* type enumeration tage PT_TYPE_??? */
2043  int precision; /* for float and int, length of char */
2044  int dec_precision; /* decimal precision for float */
2045  int units; /* for money (or string's codeset) */
2046  int collation_id; /* collation identifier (strings) */
2047  /* how the collation should be taken into account */
2049  bool has_coll_spec; /* this is used only when defining collatable types: true if collation was explicitly
2050  * set, false otherwise (collation defaulted to that of the system) */
2051  bool has_cs_spec; /* this is used only when defining collatable types: true if charset was explicitly
2052  * set, false otherwise (charset defaulted to that of the system) */
2053  PT_MISC_TYPE inout; /* input or output method parameter */
2055 };
2056 
2057 /* DELETE */
2059 {
2060  PT_NODE *target_classes; /* PT_NAME */
2061  PT_NODE *spec; /* PT_SPEC (list) */
2062  PT_NODE *class_specs; /* PT_SPEC list */
2063  PT_NODE *search_cond; /* PT_EXPR */
2064  PT_NODE *using_index; /* PT_NAME (list) */
2065  PT_NODE *cursor_name; /* PT_NAME */
2066  PT_NODE *internal_stmts; /* internally created statements to handle TEXT */
2067  PT_NODE *waitsecs_hint; /* lock timeout in seconds */
2068  PT_NODE *ordered_hint; /* ORDERED_HINT hint's arguments (PT_NAME list) */
2069  PT_NODE *use_nl_hint; /* USE_NL hint's arguments (PT_NAME list) */
2070  PT_NODE *use_idx_hint; /* USE_IDX hint's arguments (PT_NAME list) */
2071  PT_NODE *use_merge_hint; /* USE_MERGE hint's arguments (PT_NAME list) */
2072  PT_NODE *limit; /* PT_VALUE limit clause parameter */
2073  PT_NODE *del_stmt_list; /* list of DELETE statements after split */
2074  PT_HINT_ENUM hint; /* hint flag */
2075  PT_NODE *with; /* PT_WITH_CLAUSE */
2076  unsigned has_trigger:1; /* whether it has triggers */
2077  unsigned server_delete:1; /* whether it can be server-side deletion */
2078  unsigned rewrite_limit:1; /* need to rewrite the limit clause */
2079  unsigned execute_with_commit_allowed:1; /* true, if execute with commit allowed. */
2080 };
2081 
2082 /* DOT_INFO*/
2084 {
2085  PT_NODE *arg1; /* PT_EXPR etc. first argument */
2086  PT_NODE *arg2; /* PT_EXPR etc. possible second argument */
2087  PT_NODE *selector; /* only set if selector used A[SELECTOR].B */
2088  short tag_click_counter; /* 0: normal name, 1: click counter name */
2089  int coll_modifier; /* collation modifier = collation + 1 */
2090 };
2091 
2092 /* DROP ENTITY
2093  as in DROP VCLASS X,Y,Z; (different from ALTER .... or DROP VIEW )
2094  */
2096 {
2097  PT_NODE *spec_list; /* PT_SPEC (list) */
2098  PT_NODE *internal_stmts; /* internally created statements to handle TEXT */
2099  PT_MISC_TYPE entity_type; /* PT_VCLASS, PT_CLASS */
2100  bool if_exists; /* IF EXISTS clause for DROP TABLE */
2101  bool is_cascade_constraints; /* whether to drop cascade FK key */
2102 };
2103 
2104 /* DROP USER INFO */
2106 {
2107  PT_NODE *user_name; /* PT_NAME */
2108 };
2109 
2110 /* DROP TRIGGER */
2112 {
2113  PT_NODE *trigger_spec_list; /* PT_TRIGGER_SPEC_LIST */
2114 };
2115 
2116 /* DROP VARIABLE */
2118 {
2119  PT_NODE *var_names; /* PT_NAME (list) */
2120 };
2121 
2123 {
2124  PT_NODE *variables; /* PT_VALUE list */
2125 };
2126 
2127 /* Info for a ENTITY spec and spec_list */
2129 {
2130  PT_NODE *entity_name; /* PT_NAME */
2131  PT_NODE *cte_name; /* PT_NAME */
2132  PT_NODE *cte_pointer; /* PT_POINTER - points to the cte_definition */
2133  PT_NODE *except_list; /* PT_SPEC */
2134  PT_NODE *derived_table; /* a subquery */
2135  PT_NODE *range_var; /* PT_NAME */
2136  PT_NODE *as_attr_list; /* PT_NAME */
2137  PT_NODE *referenced_attrs; /* PT_NAME list of referenced attrs */
2138  PT_NODE *path_entities; /* PT_SPECs implied by path expr's */
2139  PT_NODE *path_conjuncts; /* PT_EXPR boolean nodes */
2140  PT_NODE *flat_entity_list; /* PT_NAME (list) resolved class's */
2141  PT_NODE *method_list; /* PT_METHOD_CALL list with this entity as the target */
2142  PT_NODE *partition; /* PT_NAME of the specified partition */
2143  PT_NODE *json_table; /* JSON TABLE definition tree */
2144  UINTPTR id; /* entity spec unique id # */
2145  PT_MISC_TYPE only_all; /* PT_ONLY or PT_ALL */
2146  PT_MISC_TYPE meta_class; /* enum 0 or PT_META */
2147  PT_MISC_TYPE derived_table_type; /* PT_IS_SUBQUERY, PT_IS_SET_EXPR, or PT_IS_CSELECT, PT_IS_SHOWSTMT */
2148  PT_MISC_TYPE flavor; /* enum 0 or PT_METHOD_ENTITY */
2150  PT_NODE *using_cond; /* -- does not support named columns join */
2152  short location; /* n-th position in FROM (start from 0); init val = -1 */
2153  bool natural; /* -- does not support natural join */
2154  DB_AUTH auth_bypass_mask; /* flag to bypass normal authorization : used only by SHOW statements currently */
2155  PT_SPEC_FLAG flag; /* flag wich marks this spec for DELETE or UPDATE operations */
2156 };
2157 
2158 /* Info for an EVALUATE object */
2160 {
2161  PT_NODE *expression; /* PT_EXPR or PT_METHOD_CALL */
2162  PT_NODE *into_var; /* PT_VALUE */
2163 };
2164 
2165 /* Info for an EVENT object */
2167 {
2168  PT_NODE *event_object; /* PT_NAME: current, new, old */
2169  PT_NODE *correlation_name; /* PT_NAME */
2170 };
2171 
2172 /* Info for an EVENT spec */
2174 {
2175  PT_NODE *event_target; /* PT_EVENT_TARGET */
2176  PT_EVENT_TYPE event_type;
2177 };
2178 
2179 /* Info for an EVENT target */
2181 {
2182  PT_NODE *class_name; /* PT_NAME */
2183  PT_NODE *attribute; /* PT_NAME or NULL */
2184 };
2185 
2186 /* EXECUTE TRIGGER */
2188 {
2189  PT_NODE *trigger_spec_list; /* PT_TRIGGER_SPEC_LIST */
2190 };
2191 
2192 /* Info for Expressions
2193  This includes binary and unary operations + * - etc
2194  */
2196 {
2197  PT_NODE *arg1; /* PT_EXPR etc. first argument */
2198  PT_NODE *arg2; /* PT_EXPR etc. possible second argument */
2199  PT_NODE *value; /* only set if we evaluate it */
2200  PT_OP_TYPE op; /* binary or unary op code */
2201  int paren_type; /* 0 - none, else - () */
2202  PT_NODE *arg3; /* possible third argument (like, between, or case) */
2203  PT_NODE *cast_type; /* PT_DATA_TYPE, resultant cast domain */
2204  PT_MISC_TYPE qualifier; /* trim qualifier (LEADING, TRAILING, BOTH), datetime extract field specifier (YEAR,
2205  * ..., SECOND), or case expr type specifier (NULLIF, COALESCE, SIMPLE_CASE,
2206  * SEARCHED_CASE) */
2207 #define PT_EXPR_INFO_CNF_DONE 1 /* CNF conversion has done? */
2208 #define PT_EXPR_INFO_EMPTY_RANGE 2 /* empty RANGE spec? */
2209 #define PT_EXPR_INFO_INSTNUM_C 4 /* compatible with inst_num() */
2210 #define PT_EXPR_INFO_INSTNUM_NC 8 /* not compatible with inst_num() */
2211 #define PT_EXPR_INFO_GROUPBYNUM_C 16 /* compatible with groupby_num() */
2212 #define PT_EXPR_INFO_GROUPBYNUM_NC 32 /* not compatible with groupby_num() */
2213 #define PT_EXPR_INFO_ORDERBYNUM_C \
2214  PT_EXPR_INFO_INSTNUM_C /* compatible with orderby_num() */
2215 #define PT_EXPR_INFO_ORDERBYNUM_NC \
2216  PT_EXPR_INFO_INSTNUM_NC /* not compatible with orderby_num() */
2217 #define PT_EXPR_INFO_TRANSITIVE 64 /* always true transitive join term ? */
2218 #define PT_EXPR_INFO_LEFT_OUTER 128 /* Oracle's left outer join operator */
2219 #define PT_EXPR_INFO_RIGHT_OUTER 256 /* Oracle's right outer join operator */
2220 #define PT_EXPR_INFO_COPYPUSH 512 /* term which is copy-pushed into the derived subquery ? is removed at the last
2221  * rewrite stage of query optimizer */
2222 #if 1 /* unused anymore - DO NOT DELETE ME */
2223 #define PT_EXPR_INFO_FULL_RANGE 1024 /* non-null full RANGE term ? */
2224 #endif
2225 #define PT_EXPR_INFO_CAST_NOFAIL 2048 /* flag for non failing cast operation; at runtime will return null DB_VALUE
2226  * instead of failing */
2227 #define PT_EXPR_INFO_CAST_SHOULD_FOLD 4096 /* flag which controls if a cast expr should be folded */
2228 
2229 #define PT_EXPR_INFO_FUNCTION_INDEX 8192 /* function index expression flag */
2230 
2231 #define PT_EXPR_INFO_CAST_COLL_MODIFIER 16384 /* CAST is for COLLATION modifier */
2232 
2233 #define PT_EXPR_INFO_GROUPBYNUM_LIMIT 32768 /* flag that marks if the expression resulted from a GROUP BY ... LIMIT
2234  * statement */
2235 #define PT_EXPR_INFO_DO_NOT_AUTOPARAM 65536 /* don't auto parameterize expr at qo_do_auto_parameterize() */
2236 #define PT_EXPR_INFO_CAST_WRAP 131072 /* 0x20000, CAST is wrapped by compiling */
2237  int flag; /* flags */
2238 #define PT_EXPR_INFO_IS_FLAGED(e, f) ((e)->info.expr.flag & (int) (f))
2239 #define PT_EXPR_INFO_SET_FLAG(e, f) (e)->info.expr.flag |= (int) (f)
2240 #define PT_EXPR_INFO_CLEAR_FLAG(e, f) (e)->info.expr.flag &= (int) ~(f)
2241 
2242  short continued_case; /* 0 - false, 1 - true */
2243  short location; /* 0 : WHERE; n : join condition of n-th FROM */
2244  bool is_order_dependent; /* true if expression is order dependent */
2245  PT_TYPE_ENUM recursive_type; /* common type for recursive expression arguments (like PT_GREATEST, PT_LEAST,...) */
2246  int coll_modifier; /* collation modifier = collation + 1 */
2247 };
2248 
2249 /* FILE PATH INFO */
2251 {
2252  PT_NODE *string; /* PT_VALUE: a C or ANSI string */
2253 };
2254 
2255 /* FUNCTIONS ( COUNT, AVG, ....) */
2257 {
2258  PT_NODE *arg_list; /* PT_EXPR(list) */
2259  FUNC_TYPE function_type; /* PT_COUNT, PT_AVG, ... */
2260  PT_MISC_TYPE all_or_distinct; /* will be PT_ALL or PT_DISTINCT */
2261  const char *generic_name; /* only for type PT_GENERIC */
2262  char hidden_column; /* used for updates and deletes for the class OID column */
2263  PT_NODE *order_by; /* ordering PT_SORT_SPEC for GROUP_CONCAT */
2264  PT_NODE *percentile; /* percentile for PERCENTILE_CONT, PERCENTILE_DISC */
2265  bool is_order_dependent; /* true if function is order dependent */
2266  bool is_type_checked; /* true if type is already checked, false otherwise... is this safe? */
2267  int coll_modifier; /* collation modifier = collation + 1 */
2268  struct
2269  {
2270  PT_NODE *partition_by; /* partition PT_SORT_SPEC list */
2271  PT_NODE *order_by; /* ordering PT_SORT_SPEC list */
2272  PT_NODE *default_value; /* LEAD/LAG function default value */
2273  PT_NODE *offset; /* LEAD/LAG/NTH_VALUE function offset */
2274  PT_NODE *expanded_list; /* reserved list when expand partition_by/order_by */
2275  bool adjusted; /* whether the partition_by/order_by be adjusted and expanded */
2276  bool from_last; /* determines whether the calculation begins at the last or first row */
2277  bool ignore_nulls; /* determines whether the calculation eliminate or includes null values */
2278  bool is_analytic; /* is analytic clause */
2279  } analytic;
2280 };
2281 
2282 /* Info for Get Optimization Level statement */
2284 {
2286  PT_NODE *into_var; /* PT_VALUE */
2287  PT_MISC_TYPE option; /* PT_OPT_LVL, PT_OPT_COST */
2288 };
2289 
2290 /* Info for Get Trigger statement */
2292 {
2293  PT_NODE *into_var; /* PT_VALUE */
2294  PT_MISC_TYPE option; /* PT_TRIGGER_DEPTH, PT_TRIGGER_TRACE */
2295 };
2296 
2297 /* Info for Get Transaction statement */
2299 {
2300  PT_NODE *into_var; /* PT_VALUE */
2301  PT_MISC_TYPE option; /* PT_ISOLATION_LEVEL or PT_LOCK_TIMEOUT */
2302 };
2303 
2304 /* GRANT INFO */
2306 {
2307  PT_NODE *auth_cmd_list; /* PT_AUTH_CMD(list) */
2308  PT_NODE *user_list; /* PT_NAME */
2309  PT_NODE *spec_list; /* PT_SPEC */
2310  PT_MISC_TYPE grant_option; /* = PT_GRANT_OPTION or PT_NO_GRANT_OPTION */
2311 };
2312 
2313 /* Info for Host_Var */
2315 {
2316  const char *str; /* ??? */
2317  PT_MISC_TYPE var_type; /* PT_HOST_IN, PT_HOST_OUT, */
2318  int index; /* for PT_HOST_VAR ordering */
2319 };
2320 
2321 /* Info for lists of PT_NODE */
2323 {
2324  PT_MISC_TYPE list_type; /* e.g. PT_IS_VALUE */
2325  PT_NODE *list; /* the list of nodes */
2326 };
2327 
2328 /* Info for Insert */
2330 {
2331  PT_NODE *spec; /* PT_SPEC */
2332  PT_NODE *class_specs; /* PT_SPEC list */
2333  PT_NODE *attr_list; /* PT_NAME */
2334  PT_NODE *value_clauses; /* PT_NODE_LIST(list) or PT_NODE_LIST(PT_SELECT) */
2335  PT_NODE *into_var; /* PT_VALUE */
2336  PT_MISC_TYPE is_subinsert; /* 0 or PT_IS_SUBINSERT(for printing) */
2337  PT_NODE *where; /* for view with check option checking */
2338  PT_NODE *internal_stmts; /* internally created statements to handle TEXT */
2339  PT_NODE *waitsecs_hint; /* lock timeout in seconds */
2340  PT_HINT_ENUM hint; /* hint flag */
2341  PT_NODE *odku_assignments; /* ON DUPLICATE KEY UPDATE assignments */
2342  bool do_replace; /* REPLACE statement was given */
2343  PT_NODE *insert_mode; /* insert execution mode */
2344  PT_NODE *non_null_attrs; /* attributes with not null constraint */
2345  PT_NODE *odku_non_null_attrs; /* attributes with not null constraint in odku assignments */
2346  int has_uniques; /* class has unique constraints */
2347  SERVER_INSERT_ALLOWED server_allowed; /* is insert allowed on server */
2348  unsigned execute_with_commit_allowed:1; /* true, if execute with commit allowed. */
2349 };
2350 
2351 /* Info for Transaction Isolation Level */
2353 {
2354  PT_MISC_TYPE schema;
2355  PT_MISC_TYPE instances;
2356  PT_NODE *level; /* PT_VALUE */
2357  unsigned async_ws:1; /* 0 = false, 1 = true */
2358 };
2359 
2360 /* Info for Method Call */
2362 {
2363  PT_NODE *method_name; /* PT_NAME or PT_METHOD_DEF */
2364  PT_NODE *arg_list; /* PT_EXPR (list ) */
2365  PT_NODE *on_call_target; /* PT_NAME */
2366  PT_NODE *to_return_var; /* PT_NAME */
2367  PT_MISC_TYPE call_or_expr; /* PT_IS_CALL_STMT or PT_IS_MTHD_EXPR */
2368  PT_MISC_TYPE class_or_inst; /* PT_IS_CLASS_MTHD or PT_IS_INST_MTHD */
2369  UINTPTR method_id; /* unique identifier so when copying we know if two methods are copies of the same
2370  * original method call. */
2371 };
2372 
2373 /* Info for METHOD DEFs */
2375 {
2376  PT_NODE *method_name; /* PT_NAME */
2377  PT_NODE *method_args_list; /* PT_DATA_TYPE (list) */
2378  PT_NODE *function_name; /* PT_VALUE (string) */
2379  PT_MISC_TYPE mthd_type; /* PT_NORMAL or ... */
2380 };
2381 
2382 /*
2383  * Reserved names section
2384  */
2385 
2386 /* Enumeration of reserved names categories */
2387 typedef enum
2388 {
2395 
2396 /* Enumeration of reserved name ids */
2397 typedef enum
2398 {
2399  /* Reserved record info names */
2408  /* leave MVCC attributes at the end of record information */
2413 
2414  /* Reserved page info names */
2427 
2428  /* Reserved key info names */
2437 
2438  /* Reserved b-tree node info names */
2445 
2446  /* leave this last to know how many reserved names are in pt_Reserved_name_table */
2448 
2449  /* make sure you update these values when adding or removing items */
2453 
2456 
2459 
2463 
2464 /* Reserved name info */
2467 {
2468  const char *name;
2469  PT_RESERVED_NAME_ID id;
2471 };
2472 
2473 /* Global reserved name table which stores info for each name */
2475 
2476 /* Obtain reserved name type from id */
2477 #define PT_GET_RESERVED_NAME_TYPE(reserved_id) \
2478  (((reserved_id) >= RESERVED_FIRST_RECORD_INFO \
2479  && (reserved_id) <= RESERVED_LAST_RECORD_INFO) ? \
2480  /* If reserved_id belongs to record info */ \
2481  RESERVED_NAME_RECORD_INFO : \
2482  /* else */ \
2483  (((reserved_id) >= RESERVED_FIRST_PAGE_INFO \
2484  && (reserved_id) <= RESERVED_LAST_PAGE_INFO) ? \
2485  /* If reserved_id belongs to page_info */ \
2486  RESERVED_NAME_PAGE_INFO : \
2487  /* else */ \
2488  (((reserved_id) >= RESERVED_FIRST_KEY_INFO \
2489  && (reserved_id) <= RESERVED_LAST_KEY_INFO) ? \
2490  /* If reserved_id belongs to key info */ \
2491  RESERVED_NAME_KEY_INFO : \
2492  /* else */ \
2493  (((reserved_id) >= RESERVED_FIRST_BT_NODE_INFO \
2494  && (reserved_id) <= RESERVED_LAST_BT_NODE_INFO) ? \
2495  /* If reserved_id belongs to b-tree node info */ \
2496  RESERVED_NAME_BTREE_NODE_INFO : \
2497  /* else must be invalid */ \
2498  RESERVED_NAME_INVALID))))
2499 
2500 /* Get first and last id for reserved name type */
2501 #define PT_GET_RESERVED_NAME_FIRST_AND_LAST(type, first, last) \
2502  switch (type) \
2503  { \
2504  case RESERVED_NAME_RECORD_INFO: \
2505  (first) = RESERVED_FIRST_RECORD_INFO; \
2506  (last) = RESERVED_LAST_RECORD_INFO; \
2507  break; \
2508  case RESERVED_NAME_PAGE_INFO: \
2509  (first) = RESERVED_FIRST_PAGE_INFO; \
2510  (last) = RESERVED_LAST_PAGE_INFO; \
2511  break; \
2512  case RESERVED_NAME_KEY_INFO: \
2513  (first) = RESERVED_FIRST_KEY_INFO; \
2514  (last) = RESERVED_LAST_KEY_INFO; \
2515  break; \
2516  case RESERVED_NAME_BTREE_NODE_INFO: \
2517  (first) = RESERVED_FIRST_BT_NODE_INFO; \
2518  (last) = RESERVED_LAST_BT_NODE_INFO; \
2519  break; \
2520  default: \
2521  assert (0); \
2522  break; \
2523  }
2524 
2525 /* After resolving to a reserved name, check the binding is correct according
2526  * to spec flag
2527  */
2528 #define PT_CHECK_RESERVED_NAME_BIND(spec_, reserved_id) \
2529  (PT_SPEC_GET_RESERVED_NAME_TYPE (spec_) \
2530  == PT_GET_RESERVED_NAME_TYPE (reserved_id))
2531 
2532 /* Info for Names
2533  This includes identifiers
2534  */
2535 
2536 #define NAME_FROM_PT_DOT 1
2537 #define NAME_FROM_CLASSNAME_DOT_STAR 2 /* classname.* */
2538 #define NAME_FROM_STAR 3 /* * */
2539 #define NAME_IN_PATH_EXPR 4
2540 
2542 {
2543  UINTPTR spec_id; /* unique identifier for entity specs */
2544  const char *original; /* the string of the original name */
2545  const char *resolved; /* the string of the resolved name */
2546  DB_OBJECT *db_object; /* the object, if this is a class or instance */
2548  DB_OBJECT *virt_object; /* the top level view this this class is being viewed through. */
2549  SM_PARTITION *partition; /* partition info reference */
2550  PT_NODE *path_correlation; /* as in a.b.c [path_correlation].d.e.f */
2551  PT_TYPE_ENUM virt_type_enum; /* type of oid's in ldb for proxies. */
2552  PT_MISC_TYPE meta_class; /* 0 or PT_META or PT_PARAMETER or PT_CLASS */
2553  PT_NODE *default_value; /* PT_VALUE the default value of the attribute */
2554  unsigned int custom_print;
2555  unsigned short correlation_level; /* for correlated attributes */
2556  char hidden_column; /* used for updates and deletes for the class OID column */
2557 
2558 #define PT_NAME_INFO_DOT_SPEC 1 /* x, y of x.y.z */
2559 #define PT_NAME_INFO_DOT_NAME 2 /* z of x.y.z */
2560 #define PT_NAME_INFO_STAR 4 /* * */
2561 #define PT_NAME_INFO_DOT_STAR 8 /* classname.* */
2562 #define PT_NAME_INFO_CONSTANT 16
2563 #define PT_NAME_INFO_EXTERNAL 32 /* in case of TEXT type at attr definition or attr.object at attr description */
2564 #define PT_NAME_INFO_DESC 64 /* DESC on an index column name */
2565 #define PT_NAME_INFO_FILL_DEFAULT 128 /* whether default_value should be filled in */
2566 #define PT_NAME_INFO_GENERATED_OID 256 /* set when a PT_NAME node that maps to an OID is generated internally for
2567  * statement processing and execution */
2568 #define PT_NAME_ALLOW_REUSABLE_OID 512 /* ignore the REUSABLE_OID restrictions for this name */
2569 #define PT_NAME_GENERATED_DERIVED_SPEC 1024 /* attribute generated from derived spec */
2570 #define PT_NAME_FOR_UPDATE 2048 /* Table name in FOR UPDATE clause */
2571 #define PT_NAME_DEFAULTF_ACCEPTS 4096 /* name of table/column that default function accepts: real table's, cte's */
2572 
2573  short flag;
2574 #define PT_NAME_INFO_IS_FLAGED(e, f) ((e)->info.name.flag & (short) (f))
2575 #define PT_NAME_INFO_SET_FLAG(e, f) (e)->info.name.flag |= (short) (f)
2576 #define PT_NAME_INFO_CLEAR_FLAG(e, f) (e)->info.name.flag &= (short) ~(f)
2577  short location; /* 0: WHERE; n: join condition of n-th FROM */
2578  short tag_click_counter; /* 0: normal name, 1: click counter name */
2579  PT_NODE *indx_key_limit; /* key limits for index name */
2580  int coll_modifier; /* collation modifier = collation + 1 */
2581  PT_RESERVED_NAME_ID reserved_id; /* used to identify reserved name */
2582  size_t json_table_column_index; /* will be used only for json_table to gather attributes in the correct order */
2583 };
2584 
2585 /*
2586  * information for arguments that has name and value
2587  */
2589 {
2590  PT_NODE *name; /* an identifier node for argument name */
2591  PT_NODE *value; /* argument value, may be string, int or identifier */
2592 };
2593 
2594 enum
2595 {
2602 };
2603 
2604 /* PT_IDX_HINT_ORDER is used in index hint rewrite, to sort the index hints
2605  * in the using_index clause in the order implied by this define; this is
2606  * needed in order to avoid additional loops through the hint list */
2607 #define PT_IDX_HINT_ORDER(hint_node) \
2608  ((hint_node->etc == (void *) PT_IDX_HINT_CLASS_NONE) ? 1 : \
2609  (hint_node->etc == (void *) PT_IDX_HINT_IGNORE ? 2 : \
2610  (hint_node->etc == (void *) PT_IDX_HINT_FORCE ? 3 : \
2611  (hint_node->etc == (void *) PT_IDX_HINT_USE ? 4 : 0))))
2612 
2613 /* REMOVE TRIGGER */
2615 {
2616  PT_NODE *trigger_spec_list; /* PT_TRIGGER_SPEC_LIST */
2617 };
2618 
2619 /* Info RENAME */
2621 {
2622  PT_NODE *old_name; /* PT_NAME */
2623  PT_NODE *in_class; /* PT_NAME */
2624  PT_NODE *new_name; /* PT_NAME */
2625  PT_MISC_TYPE meta;
2626  PT_MISC_TYPE attr_or_mthd;
2627  PT_MISC_TYPE entity_type;
2628 };
2629 
2630 /* Info for RENAME TRIGGER */
2632 {
2633  PT_NODE *old_name; /* PT_NAME */
2634  PT_NODE *new_name; /* PT_NAME */
2635 };
2636 
2637 /* Info for resolution list */
2639 {
2640  PT_NODE *attr_mthd_name; /* PT_NAME */
2641  PT_NODE *of_sup_class_name; /* PT_NAME */
2642  PT_NODE *as_attr_mthd_name; /* PT_NAME */
2643  PT_MISC_TYPE attr_type; /* enum PT_NORMAL or ... */
2644 };
2645 
2646 /* Info REVOKE */
2648 {
2652 };
2653 
2654 /* Info ROLLBACK */
2656 {
2657  PT_NODE *save_name; /* PT_NAME */
2658 };
2659 
2660 /* Info for a UNION/DIFFERENCE/INTERSECTION node */
2662 {
2663  PT_NODE *arg1; /* PT_SELECT_EXPR 1st argument */
2664  PT_NODE *arg2; /* PT_SELECT_EXPR 2nd argument */
2665  PT_NODE *select_list; /* select list of UNION query */
2666  unsigned is_leaf_node:1;
2667 };
2668 
2669 /* Info for an SAVEPOINT node */
2671 {
2672  PT_NODE *save_name; /* PT_NAME */
2673 };
2674 
2675 /* Info for a SCOPE node */
2677 {
2678  PT_NODE *from; /* pt_spec (list) */
2679  PT_NODE *stmt; /* pt_trigger_action, etc. */
2680 };
2681 
2682 /* Info for a SELECT node */
2684 {
2685  PT_NODE *list; /* PT_EXPR PT_NAME */
2686  PT_NODE *from; /* PT_SPEC (list) */
2687  PT_NODE *where; /* PT_EXPR */
2688  PT_NODE *group_by; /* PT_EXPR (list) */
2689  PT_NODE *connect_by; /* PT_EXPR */
2690  PT_NODE *start_with; /* PT_EXPR */
2691  PT_NODE *after_cb_filter; /* PT_EXPR */
2692  PT_NODE *having; /* PT_EXPR */
2693  PT_NODE *using_index; /* PT_NAME (list) */
2694  PT_NODE *with_increment; /* PT_NAME (list) */
2695  PT_NODE *ordered; /* PT_NAME (list) */
2696  PT_NODE *use_nl; /* PT_NAME (list) */
2697  PT_NODE *use_idx; /* PT_NAME (list) */
2698  PT_NODE *index_ss; /* PT_NAME (list) */
2699  PT_NODE *index_ls; /* PT_NAME (list) */
2700  PT_NODE *use_merge; /* PT_NAME (list) */
2701  PT_NODE *waitsecs_hint; /* lock timeout in seconds */
2702  PT_NODE *jdbc_life_time; /* jdbc cache life time */
2704  PT_NODE *check_where; /* with check option predicate */
2705  PT_NODE *for_update; /* FOR UPDATE clause tables list */
2706  QFILE_LIST_ID *push_list; /* list file descriptor pushed to server */
2708  int flavor;
2709  int flag; /* flags */
2710  PT_CONNECT_BY_CHECK_CYCLES check_cycles; /* CONNECT BY CHECK CYCLES */
2711  unsigned single_table_opt:1; /* hq optimized for single table */
2712 };
2713 
2714 #define PT_SELECT_INFO_ANSI_JOIN 0x01 /* has ANSI join? */
2715 #define PT_SELECT_INFO_ORACLE_OUTER 0x02 /* has Oracle's outer join operator? */
2716 #define PT_SELECT_INFO_DUMMY 0x04 /* is dummy (i.e., 'SELECT * FROM x') ? */
2717 #define PT_SELECT_INFO_HAS_AGG 0x08 /* has any type of aggregation? */
2718 #define PT_SELECT_INFO_HAS_ANALYTIC 0x10 /* has analytic functions */
2719 #define PT_SELECT_INFO_MULTI_UPDATE_AGG 0x20 /* is query for multi-table update using aggregate */
2720 #define PT_SELECT_INFO_IDX_SCHEMA 0x40 /* is show index query */
2721 #define PT_SELECT_INFO_COLS_SCHEMA 0x80 /* is show columns query */
2722 #define PT_SELECT_FULL_INFO_COLS_SCHEMA 0x0100 /* is show columns query */
2723 #define PT_SELECT_INFO_IS_MERGE_QUERY 0x0200 /* is a query of a merge stmt */
2724 #define PT_SELECT_INFO_LIST_PUSHER 0x0400 /* dummy subquery that pushes a list file descriptor to be used at
2725  * server as its own result */
2726 #define PT_SELECT_INFO_NO_STRICT_OID_CHECK 0x0800 /* normally, only OIDs of updatable views are allowed in parse
2727  * trees; however, for MERGE and UPDATE we sometimes want to
2728  * allow OIDs of partially updatable views */
2729 #define PT_SELECT_INFO_IS_UPD_DEL_QUERY 0x1000 /* set if select was built for an UPDATE or DELETE statement */
2730 #define PT_SELECT_INFO_FOR_UPDATE 0x2000 /* FOR UPDATE clause is active */
2731 #define PT_SELECT_INFO_DISABLE_LOOSE_SCAN 0x4000 /* loose scan not possible on query */
2732 #define PT_SELECT_INFO_MVCC_LOCK_NEEDED 0x8000 /* lock returned rows */
2733 #define PT_SELECT_INFO_READ_ONLY 0x010000 /* read-only system generated queries like show statement */
2734 
2735 #define PT_SELECT_INFO_IS_FLAGED(s, f) \
2736  ((s)->info.query.q.select.flag & (f))
2737 #define PT_SELECT_INFO_SET_FLAG(s, f) \
2738  (s)->info.query.q.select.flag |= (f)
2739 #define PT_SELECT_INFO_CLEAR_FLAG(s, f) \
2740  (s)->info.query.q.select.flag &= ~(f)
2741 
2742 /* common with union and select info */
2744 {
2745  int correlation_level; /* for correlated subqueries */
2746  PT_MISC_TYPE all_distinct; /* enum value is PT_ALL or PT_DISTINCT */
2747  PT_MISC_TYPE is_subquery; /* PT_IS_SUB_QUERY, PT_IS_UNION_QUERY, PT_IS_CTE_NON_REC_SUBQUERY,
2748  * PT_IS_CTE_REC_SUBQUERY or 0 */
2749  char is_view_spec; /* 0 - normal, 1 - view query spec */
2750  char oids_included; /* DB_NO_OIDS/0 DB_ROW_OIDS/1 */
2751  SCAN_OPERATION_TYPE scan_op_type; /* scan operation type */
2752  int upd_del_class_cnt; /* number of classes affected by update or delete in the generated SELECT statement */
2753  int mvcc_reev_extra_cls_cnt; /* number of extra OID - CLASS_OID pairs added to the select list for condition and
2754  * assignment reevaluation in MVCC */
2755  struct
2756  {
2757  unsigned has_outer_spec:1; /* has outer join spec ? */
2758  unsigned is_sort_spec:1; /* query is a sort spec expression */
2759  unsigned is_insert_select:1; /* query is a sub-select for insert statement */
2760  unsigned single_tuple:1; /* is single-tuple query ? */
2761  unsigned vspec_as_derived:1; /* is derived from vclass spec ? */
2762  unsigned reexecute:1; /* should be re-executed; not from the result caceh */
2763  unsigned do_cache:1; /* do cache the query result */
2764  unsigned do_not_cache:1; /* do not cache the query result */
2765  unsigned order_siblings:1; /* flag ORDER SIBLINGS BY */
2766  unsigned rewrite_limit:1; /* need to rewrite the limit clause */
2767  unsigned has_system_class:1; /* do not cache the query result */
2768  } flag;
2769  PT_NODE *order_by; /* PT_EXPR (list) */
2770  PT_NODE *orderby_for; /* PT_EXPR (list) */
2771  PT_NODE *into_list; /* PT_VALUE (list) */
2772  PT_NODE *qcache_hint; /* enable/disable query cache */
2773  PT_NODE *limit; /* PT_VALUE (list) limit clause parameter(s) */
2774  void *xasl; /* xasl proc pointer */
2775  UINTPTR id; /* query unique id # */
2776  PT_HINT_ENUM hint; /* hint flag */
2777  bool is_order_dependent; /* true if query is order dependent */
2778  PT_NODE *with; /* PT_WITH_CLAUSE */
2779  union
2780  {
2783  } q;
2784 };
2785 
2786 /* Info for Set Optimization Level statement */
2788 {
2789  PT_NODE *val; /* PT_VALUE */
2790  PT_MISC_TYPE option; /* PT_OPT_LVL, PT_OPT_COST */
2791 };
2792 
2793 /* Info for Set Parameters statement */
2795 {
2796  PT_NODE *val; /* PT_VALUE */
2797 };
2798 
2799 /* Info for Set Transaction statement */
2801 {
2802  PT_NODE *xaction_modes; /* PT_ISOLATION_LVL, PT_TIMEOUT (list) */
2803 };
2804 
2805 /* Info for Set Trigger statement */
2807 {
2808  PT_NODE *val; /* PT_VALUE */
2809  PT_MISC_TYPE option; /* PT_TRIGGER_DEPTH, PT_TRIGGER_TRACE */
2810 };
2811 
2812 /* Info for PT_SHOWSTMT node */
2814 {
2815  SHOWSTMT_TYPE show_type; /* show statement type */
2816  PT_NODE *show_args; /* show statement args */
2817 };
2818 
2820 {
2823 };
2824 
2825 /* Info for OrderBy/GroupBy */
2827 {
2828  PT_NODE *expr; /* PT_EXPR, PT_VALUE, PT_NAME */
2829  QFILE_TUPLE_VALUE_POSITION pos_descr; /* Value position descriptor */
2830  PT_MISC_TYPE asc_or_desc; /* enum value will be PT_ASC or PT_DESC */
2831  PT_MISC_TYPE nulls_first_or_last; /* enum value will be PT_NULLS_DEFAULT, PT_NULLS_FIRST or PT_NULLS_LAST */
2832 };
2833 
2834 /* Info for Transaction Timeout */
2836 {
2837  PT_NODE *val; /* PT_VALUE */
2838 };
2839 
2840 /* Info for Trigger Action */
2842 {
2843  PT_NODE *expression; /* parse tree for expression */
2844  PT_NODE *string; /* PT_PRINT string */
2845  PT_MISC_TYPE action_type; /* REJECT, INVALIDATE_XACTION, etc. */
2846 };
2847 
2848 /* Info for Trigger Spec List */
2850 {
2851  PT_NODE *trigger_name_list; /* PT_NAME (list), or */
2852  PT_NODE *event_list; /* PT_EVENT_SPEC (list), or */
2853  int all_triggers; /* 1 iff ALL TRIGGERS */
2854 };
2855 
2856 /* Info for UPDATE node */
2858 {
2859  PT_NODE *spec; /* SPEC */
2860  PT_NODE *class_specs; /* PT_SPEC list */
2861  PT_NODE *assignment; /* EXPR(list) */
2862  PT_NODE *search_cond; /* EXPR */
2863  PT_NODE *using_index; /* PT_NAME (list) */
2864  DB_OBJECT *object; /* for single object up */
2865  PT_NODE *object_parameter; /* parameter node */
2866  PT_NODE *cursor_name; /* PT_NAME */
2867  PT_NODE *check_where; /* with check option predicate */
2868  PT_NODE *internal_stmts; /* internally created statements to handle TEXT */
2869  PT_NODE *waitsecs_hint; /* lock timeout in seconds */
2870  PT_NODE *ordered_hint; /* USE_NL hint's arguments (PT_NAME list) */
2871  PT_NODE *use_nl_hint; /* USE_NL hint's arguments (PT_NAME list) */
2872  PT_NODE *use_idx_hint; /* USE_IDX hint's arguments (PT_NAME list) */
2873  PT_NODE *use_merge_hint; /* USE_MERGE hint's arguments (PT_NAME list) */
2874  PT_NODE *limit; /* PT_VALUE limit clause parameter */
2875  PT_NODE *order_by; /* PT_EXPR (list) */
2876  PT_NODE *orderby_for; /* PT_EXPR */
2877  PT_HINT_ENUM hint; /* hint flag */
2878  PT_NODE *with; /* PT_WITH_CLAUSE */
2879  unsigned has_trigger:1; /* whether it has triggers */
2880  unsigned has_unique:1; /* whether there's unique constraint */
2881  unsigned server_update:1; /* whether it can be server-side update */
2882  unsigned do_class_attrs:1; /* whether it is on class attributes */
2883  unsigned rewrite_limit:1; /* need to rewrite the limit clause */
2884  unsigned execute_with_commit_allowed:1; /* true, if execute with commit allowed. */
2885 };
2886 
2887 /* UPDATE STATISTICS INFO */
2889 {
2890  PT_NODE *class_list; /* PT_NAME */
2891  int all_classes; /* 1 iff ALL CLASSES */
2892  int with_fullscan; /* 1 iff WITH FULLSCAN */
2893 };
2894 
2895 /* GET STATISTICS INFO */
2897 {
2898  PT_NODE *class_; /* PT_NAME */
2899  PT_NODE *args; /* PT_VALUE character_string_literal */
2900  PT_NODE *into_var; /* PT_VALUE */
2901 };
2902 
2903 #if defined (ENABLE_UNUSED_FUNCTION)
2904 struct pt_use_info
2905 {
2906  PT_NODE *use_list;
2907  PT_NODE *exclude_list;
2908  PT_MISC_TYPE relative; /* 0 = absolute, PT_CURRENT = relative to current, or PT_DEFAULT = relative to default */
2909  char as_default; /* If non zero, change the default, instead of the current setting */
2910 };
2911 #endif
2912 
2913 /* Info for table options */
2915 {
2916  PT_TABLE_OPTION_TYPE option; /* The table option type */
2917  PT_NODE *val; /* PT_VALUE */
2918 };
2919 
2920 /* Info for MERGE statement */
2922 {
2923  PT_NODE *into; /* INTO PT_SPEC */
2924  PT_NODE *using_clause; /* USING PT_SPEC */
2925  PT_NODE *search_cond; /* PT_EXPR */
2926  struct
2927  {
2928  PT_NODE *assignment; /* PT_EXPR (list) */
2929  PT_NODE *search_cond; /* PT_EXPR */
2930  PT_NODE *del_search_cond; /* PT_EXPR */
2931  PT_NODE *index_hint; /* PT_NAME (list) */
2932  bool do_class_attrs; /* whether it is on class attributes */
2933  bool has_delete; /* whether it has a delete clause */
2934  } update;
2935  struct
2936  {
2937  PT_NODE *attr_list; /* PT_NAME */
2938  PT_NODE *value_clauses; /* PT_NODE_LIST (list) */
2939  PT_NODE *search_cond; /* PT_EXPR */
2940  PT_NODE *class_where; /* PT_EXPR */
2941  PT_NODE *index_hint; /* PT_NAME (list) */
2942  } insert;
2943  PT_NODE *check_where; /* check option */
2944  PT_NODE *waitsecs_hint; /* lock timeout in seconds */
2945  PT_HINT_ENUM hint; /* hint flag */
2946 #define PT_MERGE_INFO_HAS_UNIQUE 1 /* has unique constraints */
2947 #define PT_MERGE_INFO_SERVER_OP 2 /* server side operation */
2948 #define PT_MERGE_INFO_INSERT_ONLY 4 /* merge condition always false */
2949  short flags; /* statement specific flags */
2950 };
2951 
2952 /* Info for SET NAMES */
2954 {
2955  PT_NODE *charset_node; /* PT_VALUE */
2956  PT_NODE *collation_node; /* PT_VALUE */
2957 };
2958 
2960 {
2961  PT_NODE *timezone_node; /* PT_VALUE */
2962 };
2963 
2964 /* Info for VALUE nodes
2965  these are intended to parallel the definitions in dbi.h and be
2966  identical whenever possible
2967  */
2968 
2969 /* enum Time Zones */
2970 typedef enum pt_time_zones
2971 {
2976 } PT_TIMEZONE;
2977 
2978 /* typedefs for TIME and DATE */
2979 typedef long PT_TIME;
2980 typedef long PT_UTIME;
2982 typedef long PT_DATE;
2985 
2986 /* enum currency types */
2987 typedef enum pt_currency_types
2988 {
3014 } PT_CURRENCY;
3015 
3016 /* struct for money */
3018 {
3019  double amount;
3020  PT_CURRENCY type;
3021 };
3022 
3024 {
3025  unsigned short short_val;
3027 };
3028 
3029 /* Union of datavalues */
3031 {
3032  long i;
3034  float f;
3035  double d;
3036  PARSER_VARCHAR *str; /* keeps as string different data type: string data types (char, nchar, byte) date and
3037  * time data types numeric */
3038  void *p; /* what is this */
3040  PT_TIME time;
3041  PT_DATE date;
3042  PT_UTIME utime; /* used for TIMESTAMP and TIMESTAMPLTZ */
3043  PT_TIMESTAMPTZ timestamptz;
3044  PT_DATETIME datetime; /* used for DATETIME and DATETIMELTZ */
3045  PT_DATETIMETZ datetimetz;
3047  PT_NODE *set; /* constant sets */
3048  DB_ELO elo; /* ??? */
3049  int b;
3051 };
3052 
3053 /* Info for the VALUE node */
3055 {
3056  const char *text; /* printed text of a value or of an expression folded to a value. NOTE: this is not the
3057  * actual value of the node. Use value in data_value instead. */
3058  PT_DATA_VALUE data_value; /* see above UNION defs */
3062  short location; /* 0 : WHERE; n : join condition of n-th FROM */
3063  char string_type; /* ' ', 'N', 'B', or 'X' */
3066  bool has_cs_introducer; /* 1 if charset introducer is used for string node e.g. _utf8'a'; 0 otherwise. */
3067  bool is_collate_allowed; /* 1 if this is a PT_VALUE allowed to have the COLLATE modifier (the grammar context in
3068  * which is created allows it) */
3069  int coll_modifier; /* collation modifier = collation + 1 */
3070  int host_var_index; /* save the host_var index which it comes from. -1 means it is a normal value. it does
3071  * not come from any host_var. */
3072 };
3073 
3074 /* Info for the ZZ_ERROR_MSG node */
3076 {
3077  char *error_message; /* a helpful explanation of the error */
3078  int statement_number; /* statement where error was detected */
3079 };
3080 
3081 /* Info for the FOREIGN KEY node */
3083 {
3084  PT_NODE *attrs; /* List of attribute names */
3085  PT_NODE *referenced_class; /* Class name */
3086  PT_NODE *referenced_attrs; /* List of attribute names */
3087  PT_MISC_TYPE match_type; /* full or partial */
3088  PT_MISC_TYPE delete_action;
3089  PT_MISC_TYPE update_action;
3090 };
3091 
3092 /* Info for the CONSTRAINT node */
3094 {
3096  PT_CONSTRAINT_TYPE type;
3097  short deferrable;
3099  union
3100  {
3101  struct
3102  {
3103  PT_NODE *attrs; /* List of attribute names */
3104  } primary_key;
3106  struct
3107  {
3108  PT_NODE *attr; /* Attribute name */
3109  } not_null;
3110  struct
3111  {
3112  PT_NODE *attrs; /* List of attribute names */
3113  } unique;
3114  struct
3115  {
3116  PT_NODE *expr; /* Search condition */
3117  } check;
3118  } un;
3120 };
3121 
3122 /* POINTER node types */
3124 {
3125  PT_POINTER_NORMAL = 0, /* normal pointer, gets resolved to node */
3126  PT_POINTER_REF = 1 /* reference pointer - node gets walked by pt_walk_tree */
3127 };
3129 
3130 /* Info for the POINTER node */
3132 {
3133  PT_NODE *node; /* original node pointer */
3134  PT_POINTER_TYPE type; /* pointer type (normal pointer/reference) */
3135  double sel; /* selectivity factor of the predicate */
3136  int rank; /* rank factor for the same selectivity */
3137  bool do_walk; /* apply walk on node bool */
3138 };
3139 
3141 {
3146  PT_NODE *owner; /* for ALTER PROCEDURE/FUNCTION name OWNER TO new_owner */
3147  PT_MISC_TYPE type;
3148  unsigned or_replace:1; /* OR REPLACE clause */
3149  PT_TYPE_ENUM ret_type;
3150 };
3151 
3153 {
3154  PT_NODE *name; /* the name of the prepared statement */
3155  PT_NODE *statement; /* the string literal that defines the statement */
3156  PT_NODE *using_list; /* the list of values given for statement execution */
3157 };
3158 
3160 {
3161  PT_NODE *name; /* the name of the prepared statement */
3162  PT_NODE *query; /* the string literal that defines the statement */
3163  PT_NODE *using_list; /* the list of values given for statement execution */
3164  PT_NODE *into_list; /* for a prepared select using into */
3165  XASL_ID xasl_id; /* XASL id */
3166  CUBRID_STMT_TYPE stmt_type; /* statement type */
3167  int recompile; /* not 0 if this statement should be recompiled */
3168  int column_count; /* select list column count */
3169  int oids_included; /* OIDs included in select list */
3170 };
3171 
3173 {
3175  PT_MISC_TYPE mode;
3177 };
3178 
3179 /* TRUNCATE ENTITY INFO */
3181 {
3182  PT_NODE *spec; /* PT_SPEC */
3183 };
3184 
3185 /* DO ENTITY INFO */
3187 {
3188  PT_NODE *expr; /* PT_EXPR */
3189 };
3190 
3192 {
3194 };
3195 
3196 /* Retains expressions for check when 'with check option' option is specified. Used in update statement */
3198 {
3199  UINTPTR spec_id; /* id of spec for wich to check condition */
3200  PT_NODE *expr; /* condition to check */
3201 };
3202 
3203 /* info structure for a node which can be evaluated during constant folding as a value of a tuple from a cursor */
3205 {
3206  PT_NODE *name; /* name alias in the original query */
3207  CURSOR_ID *cursor_p; /* cursor from which the value can be read */
3208  int index; /* index of the value in cursor */
3209 };
3210 
3212 {
3213  PT_MISC_TYPE on_off;
3214  PT_MISC_TYPE format;
3215 };
3216 
3217 /* pt_with_clause_info - Parse tree node info which contains CTEs data(used by DML statements) */
3219 {
3221  PT_NODE *cte_definition_list; /* PT_CTE (list) */
3222 };
3223 
3224 /* pt_insert_value_info - Parse tree node info used to replace nodes in insert value list after being evaluated. */
3226 {
3227  PT_NODE *original_node; /* original node before first evaluation. if this is NULL, it is considered that
3228  * evaluated value cannot change on different execution, and reevaluation is not needed */
3229  DB_VALUE value; /* evaluated value */
3230  int is_evaluated; /* true if value was already evaluated */
3231  int replace_names; /* true if names in evaluated node need to be replaced */
3232 };
3233 
3235 {
3237  // domain is stored in parser node
3238  char *path;
3239  size_t index; // will be used to store the columns in the correct order
3243 };
3244 
3246 {
3249  char *path;
3250 };
3251 
3253 {
3257 };
3258 
3259 /* Info field of the basic NODE
3260  If 'xyz' is the name of the field, then the structure type should be
3261  struct PT_XYZ_INFO xyz;
3262  List in alphabetical order.
3263  */
3264 
3266 {
3355 #if defined (ENABLE_UNUSED_FUNCTION)
3356  PT_USE_INFO use;
3357 #endif
3363 };
3364 
3365 /*
3366  * auxiliary structures for tree walking operations related to aggregates
3367  */
3369 {
3370  PT_NODE *from; /* initial spec list */
3371  PT_NODE *group_by; /* group by list */
3372  int depth; /* current depth */
3373 };
3374 
3376 {
3377  PT_NODE *select_stack; /* SELECT statement stack (0 = base) */
3378  PT_NODE *from; /* initial spec list */
3379  PT_NODE *new_from; /* new spec */
3380  PT_NODE *derived_select; /* initial select (that is being derived) */
3381  int depth;
3382 };
3383 
3385 {
3386  PT_NODE *select_stack; /* SELECT statement stack (0 = base) */
3387  int base_count; /* # of aggregate functions that belong to the statement at the base of the stack */
3388  int out_of_context_count; /* # of aggregate functions that do not belong to any statement within the stack */
3389  bool stop_on_subquery; /* walk subqueries? */
3390  bool disable_loose_scan; /* true if loose index scan cannot be used */
3391 };
3392 
3394 {
3395  PT_NODE *select_stack; /* SELECT statement stack (0 = base) */
3396  int max_level; /* maximum level within the stack that is is referenced by PT_NAMEs */
3397  int name_count; /* # of PT_NAME nodes found */
3398 };
3399 
3401 {
3402  PT_NODE *atts; /* attributes */
3403  int atts_count; /* attributes count */
3404  int depth; /* expression depth */
3405  bool *is_null_atts; /* for each filter index attribute true, when "is null index_attribute" term is
3406  * contained in filter index expression */
3407  bool has_keys_in_expression; /* true, if an index key appear in expression */
3408  bool is_constant_expression; /* true, if expression is constant */
3409  bool is_valid_expr; /* true, if invalid filter index expression */
3410  bool has_not; /* true, when not operator is found in filter index expression */
3411 };
3412 
3414 {
3417 };
3418 
3420 {
3423 };
3424 
3425 /*
3426  * variable string for parser
3427  */
3429 {
3430  int length;
3431  unsigned char bytes[1];
3432 };
3433 
3434 /*
3435  * The parser node structure
3436  */
3438 {
3439  PT_NODE_TYPE node_type; /* the type of SQL statement this represents */
3440  int parser_id; /* which parser did I come from */
3441  int line_number; /* the user line number originating this */
3442  int column_number; /* the user column number originating this */
3443  int buffer_pos; /* position in the parse buffer of the string originating this */
3444  char *sql_user_text; /* user input sql string */
3445  int sql_user_text_len; /* user input sql string length (one statement) */
3446 
3447  PT_NODE *next; /* forward link for NULL terminated list */
3448  PT_NODE *or_next; /* forward link for DNF list */
3449  PT_NODE *next_row; /* for PT_VALUE,PT_NAME,PT_EXPR... that belongs to PT_NODE_LIST */
3450  void *etc; /* application specific info hook */
3451  UINTPTR spec_ident; /* entity spec equivalence class */
3452  TP_DOMAIN *expected_domain; /* expected domain for input marker */
3453  PT_NODE *data_type; /* for non-primitive types, Sets, objects stec. */
3454  XASL_ID *xasl_id; /* XASL_ID for this SQL statement */
3455  const char *alias_print; /* the column alias */
3456  PARSER_VARCHAR *expr_before_const_folding; /* text before constant folding (used by value, host var nodes) */
3457  PT_TYPE_ENUM type_enum; /* type enumeration tag PT_TYPE_??? */
3458  CACHE_TIME cache_time; /* client or server cache time */
3459  struct
3460  {
3461  unsigned recompile:1; /* the statement should be recompiled - used for plan cache */
3462  unsigned cannot_prepare:1; /* the statement cannot be prepared - used for plan cache */
3463  unsigned partition_pruned:1; /* partition pruning takes place */
3464  unsigned si_datetime:1; /* get server info; SYS_DATETIME */
3465  unsigned si_tran_id:1; /* get server info; LOCAL_TRANSACTION_ID */
3466  unsigned clt_cache_check:1; /* check client cache validity */
3467  unsigned clt_cache_reusable:1; /* client cache is reusable */
3468  unsigned use_plan_cache:1; /* used for plan cache */
3469  unsigned use_query_cache:1;
3470  unsigned is_hidden_column:1;
3471  unsigned is_paren:1;
3472  unsigned with_rollup:1; /* WITH ROLLUP clause for GROUP BY */
3473  unsigned force_auto_parameterize:1; /* forces a call to qo_do_auto_parameterize (); this is a special flag used for
3474  * processing ON DUPLICATE KEY UPDATE */
3475  unsigned do_not_fold:1; /* disables constant folding on the node */
3476  unsigned is_cnf_start:1;
3477  unsigned is_click_counter:1; /* INCR/DECR(click counter) */
3478  unsigned is_value_query:1; /* for PT_VALUE,PT_NAME,PT_EXPR... that belongs to PT_NODE_LIST for PT_SELECT that
3479  * "values" generated */
3480  unsigned do_not_replace_orderby:1; /* when checking query in create/alter view, do not replace order by */
3481  unsigned is_added_by_parser:1; /* is added by parser during parsing */
3482  unsigned is_alias_enabled_expr:1; /* node allowed to have alias */
3483  unsigned is_wrapped_res_for_coll:1; /* is a result node wrapped with CAST by collation inference */
3484  unsigned is_system_generated_stmt:1; /* is internally generated by system */
3485  unsigned use_auto_commit:1; /* use autocommit */
3486  } flag;
3487  PT_STATEMENT_INFO info; /* depends on 'node_type' field */
3488 };
3489 
3490 /* Values that describe the state of a client session across statements
3491  * execution.
3492  */
3495 {
3496  int row_count; /* The number of rows that were inserted, updated or deleted by the previously executed
3497  * statement. It is set to -1 on certain errors or if the previous statement did not
3498  * modify any rows. */
3499 };
3500 
3501 /* 20 (for the LOCAL_TRANSACTION_ID keyword) + null char + 3 for expansion */
3502 #define MAX_KEYWORD_SIZE (20 + 1 + 3)
3503 
3506 {
3507 #if defined(ENABLE_UNUSED_FUNCTION)
3508  short value;
3509 #else
3510  unsigned short hash_value;
3511 #endif
3512  char keyword[MAX_KEYWORD_SIZE];
3513  short unreserved; /* keyword can be used as an identifier, 0 means it is reserved and cannot be used as
3514  * an identifier, nonzero means it can be */
3515 };
3516 
3517 typedef struct pt_plan_trace_info
3518 {
3520  union
3521  {
3522  char *text_plan;
3523  struct json_t *json_plan;
3524  } trace;
3526 
3527 typedef int (*PT_CASECMP_FUN) (const char *s1, const char *s2);
3528 typedef int (*PT_INT_FUNCTION) (PARSER_CONTEXT * c);
3529 
3531 {
3532  PT_INT_FUNCTION next_char; /* the next character function */
3533  PT_INT_FUNCTION next_byte; /* the next byte function */
3534  PT_CASECMP_FUN casecmp; /* for case insensitive comparisons */
3535 
3536  int id; /* internal parser id */
3537  int statement_number; /* user-initialized, incremented by parser */
3538 
3539  const char *original_buffer; /* pointer to the original parse buffer */
3540  const char *buffer; /* for parse buffer */
3541  FILE *file; /* for parse file */
3542  int stack_top; /* parser stack top */
3543  int stack_size; /* total number of slots in node_stack */
3544  PT_NODE **node_stack; /* the parser stack */
3545  PT_NODE *orphans; /* list of parse tree fragments freed later */
3546 
3547  char *error_buffer; /* for parse error messages */
3548 
3549  PT_NODE **statements; /* array of statement pointers */
3550  PT_NODE *error_msgs; /* list of parsing error messages */
3551  PT_NODE *warnings; /* list of warning messages */
3552 
3554 
3555  jmp_buf jmp_env; /* environment for longjumping on out of memory errors. */
3556  unsigned int custom_print;
3557  int jmp_env_active; /* flag to indicate jmp_env status */
3558 
3559  QUERY_ID query_id; /* id assigned to current query */
3560  DB_VALUE *host_variables; /* host variables place holder; DB_VALUE array */
3561  TP_DOMAIN **host_var_expected_domains; /* expected domains for host variables */
3562  EXECUTION_STATE_VALUES execution_values; /* values kept across the execution of statements during a client
3563  * session. */
3564  int host_var_count; /* number of input host variables */
3565  int auto_param_count; /* number of auto parameterized variables */
3566  int dbval_cnt; /* to be assigned to XASL */
3567  int line, column; /* current input line and column */
3568 
3569  void *etc; /* application context */
3570 
3571  VIEW_CACHE_INFO *view_cache; /* parsing cache using in view transformation */
3572  struct symbol_info *symbols; /* a place to keep information used in generating query processing (xasl) procedures. */
3574 
3577 
3578  int au_save; /* authorization to restore if longjmp while authorization turned off */
3579 
3582 
3584 
3586  PT_INCLUDE_OID_TYPE oid_included; /* for update cursors */
3587 
3588  long int lrand; /* integer random value used by rand() */
3589  double drand; /* floating-point random value used by drand() */
3590 
3593 
3597 
3598  int max_print_len; /* for pt_short_print */
3599 
3600  struct
3601  {
3602  unsigned has_internal_error:1; /* 0 or 1 */
3603  unsigned abort:1; /* this flag is for aborting a transaction */
3604  /* if deadlock occurs during query execution */
3605  unsigned set_host_var:1; /* 1 if the user has set host variables */
3606  unsigned dont_prt_long_string:1; /* make pt_print_value fail if the string is too long to print */
3607  unsigned long_string_skipped:1; /* pt_print_value sets it to 1 when it skipped printing a long string */
3608  unsigned print_type_ambiguity:1; /* pt_print_value sets it to 1 when it printed a value whose type cannot be
3609  * clearly determined from the string representation */
3610  unsigned strings_have_no_escapes:1;
3611  unsigned is_in_and_list:1; /* set to 1 when the caller immediately above is pt_print_and_list(). Used because AND
3612  * lists (CNF trees) can be printed via print_and_list or straight via pt_print_expr().
3613  * We need to keep print_and_list because it could get called before we get a chance to
3614  * mark the CNF start nodes. */
3615  unsigned is_holdable:1; /* set to true if result must be available across commits */
3616  unsigned is_xasl_pinned_reference:1; /* set to 1 if the prepared xasl cache need to be pinned in server side. To
3617  * prevent other thread from preempting the xasl cache again. This will
3618  * happen when a jdbc/cci driver retries to prepare/execute a query due to
3619  * CAS_ER_STMT_POOLING. */
3620  unsigned recompile_xasl_pinned:1; /* set to 1 when recompile again even the xasl cache entry has been pinned */
3621  unsigned dont_collect_exec_stats:1;
3622  unsigned return_generated_keys:1;
3623  unsigned is_system_generated_stmt:1;
3624  unsigned is_auto_commit:1; /* set to true, if auto commit. */
3625  } flag;
3626 };
3627 
3628 /* used in assignments enumeration */
3631 {
3632  PARSER_CONTEXT *parser; /* parser context */
3633  PT_NODE *assignment; /* current assignment node in the assignments list */
3634  PT_NODE *lhs; /* left side of the assignment */
3635  PT_NODE *rhs; /* right side of the assignment */
3636  bool is_rhs_const; /* true if the right side is a constant */
3637  bool is_n_column; /* true if the assignment is a multi-column assignment */
3638 };
3639 
3640 /* Collation coercibility levels associated with parse tree nodes */
3642 {
3643  PT_COLLATION_L0_COERC = 0, /* expressions with COLLATE modifier */
3644  /* Columns */
3645  PT_COLLATION_L1_COERC, /* non-binary collations */
3646  PT_COLLATION_L1_ISO_BIN_COERC, /* with ISO binary coll */
3647  PT_COLLATION_L1_BIN_COERC, /* with binary collation */
3648  /* SELECT values, expressions */
3649  PT_COLLATION_L2_COERC, /* non-binary collations */
3650  PT_COLLATION_L2_BINARY_COERC, /* with binary collation */
3651  PT_COLLATION_L2_BIN_COERC, /* with ISO, UTF8 or EUCKR binary collation */
3652  /* special operators (USER()) */
3654  /* constants (string literals) */
3655  PT_COLLATION_L4_COERC, /* non-binary collations */
3656  PT_COLLATION_L4_BINARY_COERC, /* with binary collation */
3657  PT_COLLATION_L4_BIN_COERC, /* with ISO, UTF8 or EUCKR binary collation */
3658  /* HV, session variables */
3660  /* nodes not having collation (internal use) */
3662 
3666 };
3668 
3671 {
3672  int coll_id;
3674  PT_COLL_COERC_LEV coerc_level;
3675  bool can_force_cs; /* used as a weak-modifier for collation coercibility (when node is a host variable). +
3676  * for auto-CAST expressions around numbers: initially the string data type of CAST is
3677  * created with system charset by generic type checking but that charset can be forced
3678  * to another charset (of another argument) if this flag is set */
3679 
3680 #ifdef __cplusplus
3681  // *INDENT-OFF*
3682  pt_coll_infer ()
3683  : coll_id (-1)
3684  , codeset (INTL_CODESET_NONE)
3685  , coerc_level (PT_COLLATION_NOT_APPLICABLE)
3686  , can_force_cs (true)
3687  {
3688  //
3689  }
3690  // *INDENT-ON*
3691 #endif // c++
3692 };
3693 
3694 void pt_init_node (PT_NODE * node, PT_NODE_TYPE node_type);
3695 
3696 #ifdef __cplusplus
3697 extern "C"
3698 {
3699 #endif
3700  void *parser_allocate_string_buffer (const PARSER_CONTEXT * parser, const int length, const int align);
3701  bool pt_is_json_value_type (PT_TYPE_ENUM type);
3702  bool pt_is_json_doc_type (PT_TYPE_ENUM type);
3703 #ifdef __cplusplus
3704 }
3705 #endif
3706 
3707 #if !defined (SERVER_MODE)
3708 #ifdef __cplusplus
3709 extern "C"
3710 {
3711 #endif
3712  extern PARSER_CONTEXT *parent_parser;
3713 #ifdef __cplusplus
3714 }
3715 #endif
3716 #endif
3717 
3718 #endif /* _PARSE_TREE_H_ */
PT_NODE * except_list
Definition: parse_tree.h:2133
PT_MISC_TYPE attr_type
Definition: parse_tree.h:1864
PT_NODE * order_by
Definition: parse_tree.h:2769
bool pt_is_json_value_type(PT_TYPE_ENUM type)
Definition: parse_tree.c:1429
PT_GET_OPT_LVL_INFO get_opt_lvl
Definition: parse_tree.h:3302
PT_NODE * next
Definition: parse_tree.h:3447
PT_MISC_TYPE option
Definition: parse_tree.h:2294
PT_NODE * internal_stmts
Definition: parse_tree.h:2066
PT_NAME_INFO name
Definition: parse_tree.h:3318
PT_HINT_ENUM hint
Definition: parse_tree.h:2877
QFILE_TUPLE_VALUE_POSITION pos_descr
Definition: parse_tree.h:2829
PT_MISC_TYPE delete_action
Definition: parse_tree.h:3088
PT_MISC_TYPE format
Definition: parse_tree.h:3214
PT_NODE * target_classes
Definition: parse_tree.h:2060
int upd_del_class_cnt
Definition: parse_tree.h:2752
PT_EVENT_TYPE event_type
Definition: parse_tree.h:2176
PT_NODE * arg_list
Definition: parse_tree.h:2258
PT_ATTACH_INFO attach
Definition: parse_tree.h:3271
PT_UNION_INFO union_
Definition: parse_tree.h:2782
long int lrand
Definition: parse_tree.h:3588
pt_node_type
Definition: parse_tree.h:786
PT_NODE * trigger_reference
Definition: parse_tree.h:1965
PT_NODE * resolution_list
Definition: parse_tree.h:1908
PT_METHOD_CALL_INFO method_call
Definition: parse_tree.h:3316
PT_METHOD_DEF_INFO method_def
Definition: parse_tree.h:3317
PT_MISC_TYPE mthd_type
Definition: parse_tree.h:1789
PT_NODE * class_specs
Definition: parse_tree.h:2332
PT_UPDATE_INFO update
Definition: parse_tree.h:3353
NESTED_VIEW_VERSION_INFO * next
Definition: parse_tree.h:1722
PT_MERGE_INFO merge
Definition: parse_tree.h:3315
UINTPTR id
Definition: parse_tree.h:2144
char * sql_user_text
Definition: parse_tree.h:3444
long PT_DATE
Definition: parse_tree.h:2982
PT_NODE * as_attr_list
Definition: parse_tree.h:1976
PT_RENAME_INFO rename
Definition: parse_tree.h:3327
PT_NODE * query
Definition: parse_tree.h:3162
struct qo_summary * qo_summary
Definition: parse_tree.h:2703
PT_MISC_TYPE schema
Definition: parse_tree.h:2354
PT_CHECK_OPTION_INFO check_option
Definition: parse_tree.h:3276
PT_NODE * param_list
Definition: parse_tree.h:3143
size_t input_buffer_length
Definition: parse_tree.h:3575
PT_NODE * attr_name
Definition: parse_tree.h:1858
PT_MISC_TYPE action_time
Definition: parse_tree.h:1968
PT_STATEMENT_INFO info
Definition: parse_tree.h:3487
TP_DOMAIN * expected_domain
Definition: parse_tree.h:3452
DB_OBJECT * object
Definition: parse_tree.h:2864
PT_HINT_ENUM hint
Definition: parse_tree.h:1745
PT_UTIME utime
Definition: parse_tree.h:3042
PT_NODE * internal_stmts
Definition: parse_tree.h:1827
PT_NODE * show_args
Definition: parse_tree.h:2816
PT_NODE * spec_list
Definition: parse_tree.h:2309
PT_NODE * using_index
Definition: parse_tree.h:2693
PT_NODE * waitsecs_hint
Definition: parse_tree.h:2701
const char * str
Definition: parse_tree.h:2316
PT_DATETIMETZ datetimetz
Definition: parse_tree.h:3045
PT_NODE * into_list
Definition: parse_tree.h:2771
PT_NODE * values
Definition: parse_tree.h:2029
PT_NODE * default_value
Definition: parse_tree.h:2004
PT_MISC_TYPE var_type
Definition: parse_tree.h:2317
PT_NODE * assignment
Definition: parse_tree.h:2861
PT_NODE * table_option_list
Definition: parse_tree.h:1905
PARSER_VARCHAR * expr_before_const_folding
Definition: parse_tree.h:3456
PT_NODE * expr
Definition: parse_tree.h:3188
PT_NODE * spec
Definition: parse_tree.h:3182
PT_NODE * size
Definition: parse_tree.h:1796
PT_ATTR_ORDERING_INFO attr_ordering
Definition: parse_tree.h:3273
PT_NODE * waitsecs_hint
Definition: parse_tree.h:2339
PT_MISC_TYPE call_or_expr
Definition: parse_tree.h:2367
PT_NODE * val
Definition: parse_tree.h:2837
short location
Definition: parse_tree.h:2577
PT_NODE * arg_list
Definition: parse_tree.h:1744
PT_SERIAL_INFO serial
Definition: parse_tree.h:3334
PT_JSON_TABLE_COLUMN_INFO json_table_column_info
Definition: parse_tree.h:3314
size_t json_table_column_index
Definition: parse_tree.h:2582
jmp_buf jmp_env
Definition: parse_tree.h:3555
PT_PRIV_TYPE auth_cmd
Definition: parse_tree.h:1880
void * parser_allocate_string_buffer(const PARSER_CONTEXT *parser, const int length, const int align)
Definition: parse_tree.c:458
PT_NODE * from
Definition: parse_tree.h:2678
bool is_collate_allowed
Definition: parse_tree.h:3067
PT_MISC_TYPE
Definition: parse_tree.h:983
PT_NODE * index_hint
Definition: parse_tree.h:2931
PT_INT_FUNCTION next_byte
Definition: parse_tree.h:3533
size_t align(size_t v)
Definition: align.h:19
PT_NODE * into_list
Definition: parse_tree.h:3164
PT_NODE * where
Definition: parse_tree.h:2337
PT_NODE * Oracle_outerjoin_spec
Definition: parse_tree.h:1708
PT_NODE * trigger_priority
Definition: parse_tree.h:1843
DB_TYPE
Definition: dbtype_def.h:670
PT_NODE * xaction_modes
Definition: parse_tree.h:2802
PT_NODE * assignment
Definition: parse_tree.h:2928
PT_NODE * charset_node
Definition: parse_tree.h:2955
PT_MISC_TYPE match_type
Definition: parse_tree.h:3087
PT_TYPE_ENUM recursive_type
Definition: parse_tree.h:2245
unsigned int virtual_cache_snapshot_version
Definition: parse_tree.h:1721
PT_RESERVED_NAME_TYPE
Definition: parse_tree.h:2387
PT_MISC_TYPE all_or_distinct
Definition: parse_tree.h:2260
short location
Definition: parse_tree.h:2152
PT_MISC_TYPE flavor
Definition: parse_tree.h:2148
PT_HINT_ENUM hint
Definition: parse_tree.h:2340
PT_NODE * search_cond
Definition: parse_tree.h:2925
PT_GET_XACTION_INFO get_xaction
Definition: parse_tree.h:3305
PT_NODE * arg3
Definition: parse_tree.h:2202
PT_MISC_TYPE option
Definition: parse_tree.h:2301
PT_SPEC_INFO spec
Definition: parse_tree.h:3346
PT_HINT_ENUM hint
Definition: parse_tree.h:2074
QUERY_TRACE_FORMAT format
Definition: parse_tree.h:3519
DB_AUTH auth_bypass_mask
Definition: parse_tree.h:2154
PT_NODE * arg2
Definition: parse_tree.h:2664
int coll_modifier
Definition: parse_tree.h:2089
int correlation_level
Definition: parse_tree.h:2745
short continued_case
Definition: parse_tree.h:2242
const char * name
Definition: parse_tree.h:2468
PT_NODE * object_id_list
Definition: parse_tree.h:1910
PT_TABLE_OPTION_INFO table_option
Definition: parse_tree.h:3347
PT_NODE ** statements
Definition: parse_tree.h:3549
enum pt_type_enum PT_TYPE_ENUM
Definition: parse_tree.h:962
unsigned int virtual_cache_local_schema_id
Definition: parse_tree.h:1719
VIEW_CACHE_INFO * view_cache
Definition: parse_tree.h:3571
PT_MISC_TYPE entity_type
Definition: parse_tree.h:2099
PT_NODE * with
Definition: parse_tree.h:2075
PT_NODE * spec
Definition: parse_tree.h:2859
PT_EXPR_INFO expr
Definition: parse_tree.h:3299
FUNC_TYPE
PT_NODE * with_increment
Definition: parse_tree.h:2694
PT_MISC_TYPE meta_class
Definition: parse_tree.h:2552
PT_STORED_PROC_PARAM_INFO sp_param
Definition: parse_tree.h:3345
PT_GRANT_INFO grant
Definition: parse_tree.h:3306
PT_NODE * virt_data_type
Definition: parse_tree.h:2041
PT_NODE * serial_name
Definition: parse_tree.h:1986
PT_EXECUTE_INFO execute
Definition: parse_tree.h:3297
KILLSTMT_TYPE
PT_NODE * ordering_info
Definition: parse_tree.h:1862
PT_NODE * partition
Definition: parse_tree.h:2142
PT_NODE * path_correlation
Definition: parse_tree.h:2550
NESTED_VIEW_VERSION_INFO * nested_views
Definition: parse_tree.h:1738
unsigned int custom_print
Definition: parse_tree.h:2554
PT_SPEC_FLAG
Definition: parse_tree.h:1517
PT_NODE * class_specs
Definition: parse_tree.h:2062
PT_NODE * path_entities
Definition: parse_tree.h:2138
PT_NODE * vquery_for_partial_update
Definition: parse_tree.h:1732
PT_NODE * node
Definition: parse_tree.h:3133
PT_SCOPE_INFO scope
Definition: parse_tree.h:3333
KILLSTMT_TYPE kill_type
Definition: parse_tree.h:2821
PT_MISC_TYPE entity_type
Definition: parse_tree.h:2627
bool do_class_attrs
Definition: parse_tree.h:2932
PT_NODE * as_attr_mthd_name
Definition: parse_tree.h:2642
PT_NODE * class_
Definition: parse_tree.h:2898
struct xasl_node * parent_proc_xasl
Definition: parse_tree.h:3592
unsigned int custom_print
Definition: parse_tree.h:3556
PT_NODE * select_stack
Definition: parse_tree.h:3395
PT_NODE * group_by
Definition: parse_tree.h:2688
PT_DROP_USER_INFO drop_user
Definition: parse_tree.h:3291
PT_ERROR_TYPE
Definition: parse_tree.h:1503
PT_NODE * jdbc_life_time
Definition: parse_tree.h:2702
char * error_buffer
Definition: parse_tree.h:3547
PT_ALTER_CODE
Definition: parse_tree.h:1224
SHOWSTMT_TYPE show_type
Definition: parse_tree.h:2815
PT_NODE * insert_mode
Definition: parse_tree.h:2343
PT_CONNECT_BY_CHECK_CYCLES
Definition: parse_tree.h:1536
pt_custom_print
Definition: parse_tree.h:734
PT_NODE_LIST_INFO node_list
Definition: parse_tree.h:3320
PT_NODE * attr_mthd_name_list
Definition: parse_tree.h:1771
PT_NODE * attr_mthd_name
Definition: parse_tree.h:2640
PT_NODE * parts
Definition: parse_tree.h:1795
PT_MISC_TYPE mthd_type
Definition: parse_tree.h:2379
PT_NODE * indx_key_limit
Definition: parse_tree.h:2579
PT_INT_FUNCTION next_char
Definition: parse_tree.h:3532
SCAN_OPERATION_TYPE scan_op_type
Definition: parse_tree.h:2751
PT_NODE * into_var
Definition: parse_tree.h:2900
DB_DATETIME PT_DATETIME
Definition: parse_tree.h:2983
SHOWSTMT_TYPE
PT_REMOVE_TRIGGER_INFO remove_trigger
Definition: parse_tree.h:3326
PT_ATTACH_INFO prepare_to_commit
Definition: parse_tree.h:3324
PT_MISC_TYPE option
Definition: parse_tree.h:2287
PT_NODE * internal_stmts
Definition: parse_tree.h:2868
PT_NODE * function_expr
Definition: parse_tree.h:1935
PT_NODE * event_object
Definition: parse_tree.h:2168
PT_NODE * tran_id_list
Definition: parse_tree.h:2822
PT_NODE * attr_list
Definition: parse_tree.h:2333
DB_VALUE * host_variables
Definition: parse_tree.h:3560
PT_NODE * spec_list
Definition: parse_tree.h:2097
DB_OBJECT * virt_object
Definition: parse_tree.h:2548
PT_WITH_CLAUSE_INFO with_clause
Definition: parse_tree.h:3362
PT_NODE * class_specs
Definition: parse_tree.h:2860
PT_NODE * mthd_name_list
Definition: parse_tree.h:1774
PT_NODE * data_type
Definition: parse_tree.h:3453
enum pt_time_zones PT_TIMEZONE
PT_NODE * tbl_comment
Definition: parse_tree.h:1822
PT_NODE * new_name
Definition: parse_tree.h:2624
PT_NODE * del_stmt_list
Definition: parse_tree.h:2073
INTL_CODESET codeset
Definition: parse_tree.h:3673
PT_NODE * for_update
Definition: parse_tree.h:2705
PT_MISC_TYPE element_type
Definition: parse_tree.h:1784
DB_DEFAULT_EXPR_TYPE default_expr_type
Definition: parse_tree.h:2006
enum pt_pointer_type PT_POINTER_TYPE
Definition: parse_tree.h:3128
char hidden_column
Definition: parse_tree.h:2556
PT_DOT_INFO dot
Definition: parse_tree.h:3287
PT_NODE * arg2
Definition: parse_tree.h:2086
PT_FOREIGN_KEY_INFO foreign_key
Definition: parse_tree.h:3105
PT_MISC_TYPE trigger_status
Definition: parse_tree.h:1962
PT_RESERVED_NAME_ID id
Definition: parse_tree.h:2469
PT_NODE * index_ss
Definition: parse_tree.h:2698
PT_NODE * next_row
Definition: parse_tree.h:3449
PT_NODE * method_args_list
Definition: parse_tree.h:2377
PT_NODE * start_val
Definition: parse_tree.h:1987
PT_NODE * non_null_attrs
Definition: parse_tree.h:2344
PT_JSON_TABLE_INFO json_table_info
Definition: parse_tree.h:3312
SERVER_INSERT_ALLOWED server_allowed
Definition: parse_tree.h:2347
PT_CTE_INFO cte
Definition: parse_tree.h:3282
PT_NODE * name_list
Definition: parse_tree.h:1794
int(* PT_CASECMP_FUN)(const char *s1, const char *s2)
Definition: parse_tree.h:3527
PT_PRINT_VALUE_FUNC print_db_value
Definition: parse_tree.h:3553
PT_NODE * group_by
Definition: parse_tree.h:3371
PT_NODE * class_attr_def_list
Definition: parse_tree.h:1903
int Oracle_outerjoin_attr_num
Definition: parse_tree.h:1709
PT_CURRENCY type
Definition: parse_tree.h:3020
PT_KILLSTMT_INFO killstmt
Definition: parse_tree.h:3361
FUNC_TYPE function_type
Definition: parse_tree.h:2259
PT_NODE * collation_node
Definition: parse_tree.h:2956
PT_TYPE_ENUM type_enum
Definition: parse_tree.h:3457
PT_NODE * trigger_priority
Definition: parse_tree.h:1961
PT_NODE * use_merge_hint
Definition: parse_tree.h:2071
PT_NODE * indexed_class
Definition: parse_tree.h:1927
PT_NODE * or_next
Definition: parse_tree.h:3448
PT_NODE * derived_select
Definition: parse_tree.h:3380
enum query_trace_format QUERY_TRACE_FORMAT
void pt_init_node(PT_NODE *node, PT_NODE_TYPE node_type)
PT_NODE * class_where
Definition: parse_tree.h:2940
char oids_included
Definition: parse_tree.h:2750
PT_NODE * method_list
Definition: parse_tree.h:2141
PT_NODE * in_class
Definition: parse_tree.h:2623
PT_NODE * limit
Definition: parse_tree.h:2773
PT_MISC_TYPE class_or_inst
Definition: parse_tree.h:2368
PT_NODE * value
Definition: parse_tree.h:2199
PT_NODE * warnings
Definition: parse_tree.h:3551
int flag
Definition: xasl.h:954
PT_MISC_TYPE derived_table_type
Definition: parse_tree.h:2147
PT_NODE * partition_info
Definition: parse_tree.h:1914
PT_TIMESTAMPTZ timestamptz
Definition: parse_tree.h:3043
PT_NODE * cast_type
Definition: parse_tree.h:2203
PT_NODE * info
Definition: parse_tree.h:1793
PT_NODE * arg1
Definition: parse_tree.h:2663
enum pt_coll_coerc_lev PT_COLL_COERC_LEV
Definition: parse_tree.h:3667
PT_NODE * start_value
Definition: parse_tree.h:1814
PT_ALTER_INFO alter
Definition: parse_tree.h:3268
PT_NODE * using_cond
Definition: parse_tree.h:2150
PT_NODE * vquery_for_update
Definition: parse_tree.h:1730
PT_HINT_ENUM
Definition: parse_tree.h:1161
PT_NODE * arg2
Definition: parse_tree.h:2198
PT_MISC_TYPE instances
Definition: parse_tree.h:2355
PT_NODE * del_search_cond
Definition: parse_tree.h:2930
PT_NODE * index_name
Definition: parse_tree.h:1929
PT_NODE * cte_definition_list
Definition: parse_tree.h:3221
PT_CONNECT_BY_CHECK_CYCLES check_cycles
Definition: parse_tree.h:2710
short constrain_not_null
Definition: parse_tree.h:1866
PT_NODE * orphans
Definition: parse_tree.h:3545
DB_OBJECT * db_object
Definition: parse_tree.h:2546
PARSER_VARCHAR * json_schema
Definition: parse_tree.h:2054
PT_MISC_TYPE attr_type
Definition: parse_tree.h:1775
PT_NODE * constraint_list
Definition: parse_tree.h:1912
PT_NODE * resolution_list
Definition: parse_tree.h:1756
int Oracle_outerjoin_subq_num
Definition: parse_tree.h:1710
PT_NODE * referenced_attrs
Definition: parse_tree.h:3086
PT_MISC_TYPE qualifier
Definition: parse_tree.h:2204
PT_NODE * use_nl_hint
Definition: parse_tree.h:2871
PT_NODE * increment_val
Definition: parse_tree.h:1988
PARSER_CONTEXT * parser
Definition: parse_tree.h:3632
PT_NODE * query
Definition: parse_tree.h:1762
PT_PARTITION_TYPE type
Definition: parse_tree.h:2030
PT_SPEC_FLAG flag
Definition: parse_tree.h:2155
PT_NODE * method_name
Definition: parse_tree.h:2376
PT_POINTER_INFO pointer
Definition: parse_tree.h:3359
PT_MISC_TYPE asc_or_desc
Definition: parse_tree.h:2830
DB_OBJECT * op
Definition: parse_tree.h:3039
size_t input_buffer_position
Definition: parse_tree.h:3576
const char * buffer
Definition: parse_tree.h:3540
PT_TYPE_ENUM virt_type_enum
Definition: parse_tree.h:2042
PT_CREATE_TRIGGER_INFO create_trigger
Definition: parse_tree.h:3280
bool has_cs_introducer
Definition: parse_tree.h:3066
DB_VALUE db_value
Definition: parse_tree.h:3059
PT_NODE * odku_assignments
Definition: parse_tree.h:2341
TP_DOMAIN_COLL_ACTION
Definition: object_domain.h:62
PT_NODE * of_sup_class_name
Definition: parse_tree.h:2641
PT_MISC_TYPE grant_option
Definition: parse_tree.h:2310
PT_NODE * hashsize
Definition: parse_tree.h:2021
PT_MISC_TYPE with_check_option
Definition: parse_tree.h:1900
bool pt_is_json_doc_type(PT_TYPE_ENUM type)
Definition: parse_tree.c:1442
PT_NODE * vquery_for_query_in_gdb
Definition: parse_tree.h:1729
PT_NODE * offset
Definition: parse_tree.h:2273
PT_MISC_TYPE trigger_status
Definition: parse_tree.h:1845
PT_NODE * cte_pointer
Definition: parse_tree.h:2132
PT_NODE * on_cond
Definition: parse_tree.h:2149
PT_SET_XACTION_INFO set_xaction
Definition: parse_tree.h:3341
PT_NODE * entity
Definition: parse_tree.h:2038
short tag_click_counter
Definition: parse_tree.h:2088
PARSER_CONTEXT * parent_parser
PT_INCLUDE_OID_TYPE oid_included
Definition: parse_tree.h:3586
const char * tokens
Definition: parse_tree.h:1743
unsigned short short_val
Definition: parse_tree.h:3025
PT_DATA_VALUE data_value
Definition: parse_tree.h:3058
PT_NODE * recursive_part
Definition: parse_tree.h:1978
PT_ERROR_CODE
Definition: parse_tree.h:1208
PT_NODE * flat_entity_list
Definition: parse_tree.h:2140
PT_NODE * top_node
Definition: parse_tree.h:1707
PT_NODE * mthd_name
Definition: parse_tree.h:1788
PT_MISC_TYPE all_distinct
Definition: parse_tree.h:2746
PT_NODE * method_name
Definition: parse_tree.h:2363
const char * original
Definition: parse_tree.h:2544
PT_NODE * using_list
Definition: parse_tree.h:3156
PT_NODE * using_index
Definition: parse_tree.h:2064
PT_MISC_TYPE nulls_first_or_last
Definition: parse_tree.h:2831
PT_HINT_ENUM hint
Definition: parse_tree.h:2707
PT_NODE * into_var
Definition: parse_tree.h:2335
PT_PARTITION_INFO partition
Definition: parse_tree.h:3321
DB_VALUE local_transaction_id
Definition: parse_tree.h:3583
PT_NODE * max_val
Definition: parse_tree.h:1989
PT_NODE * comment
Definition: parse_tree.h:1992
PT_EVENT_TYPE
Definition: parse_tree.h:1272
bool print_collation
Definition: parse_tree.h:3065
PT_NODE * cte_name
Definition: parse_tree.h:2131
PT_NODE_TYPE node_type
Definition: parse_tree.h:3439
PT_DROP_SESSION_VAR_INFO drop_session_var
Definition: parse_tree.h:3289
DB_BIGINT bigint
Definition: parse_tree.h:3033
PT_PREPARE_INFO prepare
Definition: parse_tree.h:3323
PT_MISC_TYPE inout
Definition: parse_tree.h:2053
PT_NODE * string
Definition: parse_tree.h:2252
PT_POINTER_TYPE type
Definition: parse_tree.h:3134
PT_PARTITION_TYPE type
Definition: parse_tree.h:2023
PT_EXECUTE_TRIGGER_INFO execute_trigger
Definition: parse_tree.h:3298
DB_VALUE sys_epochtime
Definition: parse_tree.h:3581
PT_PARTS_INFO parts
Definition: parse_tree.h:3322
PT_FILE_PATH_INFO file_path
Definition: parse_tree.h:3300
PT_SHOWSTMT_INFO showstmt
Definition: parse_tree.h:3342
PT_NODE * having
Definition: parse_tree.h:2692
PT_NODE * from
Definition: parse_tree.h:2686
PT_ISOLATION_LVL_INFO isolation_lvl
Definition: parse_tree.h:3311
PT_HINT_ENUM hint
Definition: parse_tree.h:1828
PT_NODE * enumeration
Definition: parse_tree.h:2039
UINTPTR spec_id
Definition: parse_tree.h:2543
PT_NODE * use_merge_hint
Definition: parse_tree.h:2873
PT_NODE * value_clauses
Definition: parse_tree.h:2938
PT_NODE * limit
Definition: parse_tree.h:2072
PT_INCLUDE_OR_EXCLUDE_HIDDEN_COLUMNS
Definition: parse_tree.h:1510
PT_NODE * inverted_vquery_for_update
Definition: parse_tree.h:1733
PT_ALTER_CODE code
Definition: parse_tree.h:1937
PT_DATA_TYPE_INFO data_type
Definition: parse_tree.h:3284
PARSER_VARCHAR * str
Definition: parse_tree.h:3036
SP_PARSER_CTX * parser
PT_PARTITION_TYPE
Definition: parse_tree.h:1301
PT_NODE * arg1
Definition: parse_tree.h:2197
PT_ATTR_DEF_INFO attr_def
Definition: parse_tree.h:3272
PT_DO_INFO do_
Definition: parse_tree.h:3286
PT_NODE * min_val
Definition: parse_tree.h:1990
PT_RESERVED_NAME pt_Reserved_name_table[]
Definition: parse_tree.c:92
PT_NODE * comment
Definition: parse_tree.h:2031
PT_NODE * comment
Definition: parse_tree.h:1936
PT_ALTER_CODE code
Definition: parse_tree.h:1751
PT_NODE * as_attr_list
Definition: parse_tree.h:2136
PT_DATETIME datetime
Definition: parse_tree.h:3044
PT_GET_TRIGGER_INFO get_trigger
Definition: parse_tree.h:3304
PT_NODE * use_nl_hint
Definition: parse_tree.h:2069
PT_NODE * referenced_attrs
Definition: parse_tree.h:2137
PT_NODE * order_by
Definition: parse_tree.h:2875
PT_NODE * internal_stmts
Definition: parse_tree.h:2338
CACHE_TIME cache_time
Definition: parse_tree.h:3458
PT_NODE * value_clauses
Definition: parse_tree.h:2334
PT_MISC_TYPE is_subquery
Definition: parse_tree.h:2747
PT_INDEX_INFO index
Definition: parse_tree.h:3308
unsigned short hash_value
Definition: parse_tree.h:3510
PT_EVENT_OBJECT_INFO event_object
Definition: parse_tree.h:3294
PT_JSON_TABLE_NODE_INFO json_table_node_info
Definition: parse_tree.h:3313
PT_NODE * where
Definition: parse_tree.h:1934
PT_TABLE_OPTION_TYPE option
Definition: parse_tree.h:2916
PT_NODE * selector
Definition: parse_tree.h:2087
PT_MISC_TYPE action_type
Definition: parse_tree.h:2845
PT_NODE * new_name
Definition: parse_tree.h:1787
PT_CREATE_SELECT_ACTION create_select_action
Definition: parse_tree.h:1919
PT_CREATE_ENTITY_INFO create_entity
Definition: parse_tree.h:3279
PT_NODE * qcache_hint
Definition: parse_tree.h:2772
PT_ZZ_ERROR_MSG_INFO error_msg
Definition: parse_tree.h:3267
PT_NODE * trigger_spec_list
Definition: parse_tree.h:2113
PT_NODE * user_name
Definition: parse_tree.h:2107
PT_NODE * default_value
Definition: parse_tree.h:2272
PT_NODE * spec_list
Definition: parse_tree.h:2651
PT_CONSTRAINT_TYPE
Definition: parse_tree.h:1290
PT_NODE * select_list
Definition: parse_tree.h:2665
short db_value_is_in_workspace
Definition: parse_tree.h:3061
PT_AUTH_CMD_INFO auth_cmd
Definition: parse_tree.h:3274
DB_AUTH authorization
Definition: parse_tree.h:1737
PT_CREATE_SELECT_ACTION
Definition: parse_tree.h:1889
SCAN_OPERATION_TYPE
json_table_column_function
PT_NODE * with
Definition: parse_tree.h:2778
PT_NODE * vclass_comment
Definition: parse_tree.h:1918
PT_NODE * arg1
Definition: parse_tree.h:2085
PT_NODE * where
Definition: parse_tree.h:2687
PT_QUERY_INFO query
Definition: parse_tree.h:3325
short location
Definition: parse_tree.h:2243
PT_TRIGGER_SPEC_LIST_INFO trigger_spec_list
Definition: parse_tree.h:3350
PT_NODE * use_idx
Definition: parse_tree.h:2697
PT_NODE * into_var
Definition: parse_tree.h:2162
PT_EVENT_TARGET_INFO event_target
Definition: parse_tree.h:3296
PT_NODE * with
Definition: parse_tree.h:2878
PT_EVALUATE_INFO evaluate
Definition: parse_tree.h:3293
PT_AUTO_INCREMENT_INFO auto_increment
Definition: parse_tree.h:3275
PT_NODE * cursor_name
Definition: parse_tree.h:2065
PT_RENAME_TRIGGER_INFO rename_trigger
Definition: parse_tree.h:3328
PT_CONSTRAINT_TYPE type
Definition: parse_tree.h:3096
PT_NODE * spec
Definition: parse_tree.h:2331
const char * text
Definition: parse_tree.h:3056
PT_NODE * use_idx_hint
Definition: parse_tree.h:2872
TP_DOMAIN ** host_var_expected_domains
Definition: parse_tree.h:3561
PT_SET_NAMES_INFO set_names
Definition: parse_tree.h:3335
SM_INDEX_STATUS index_status
Definition: parse_tree.h:1943
PT_NODE * prefix_length
Definition: parse_tree.h:1933
PT_TUPLE_VALUE_INFO tuple_value
Definition: parse_tree.h:3352
PT_NODE * view_comment
Definition: parse_tree.h:1765
bool is_cascade_constraints
Definition: parse_tree.h:2101
PT_NODE * inverted_vquery_for_update_in_gdb
Definition: parse_tree.h:1734
PT_NODE * partition_by
Definition: parse_tree.h:2270
int64_t DB_BIGINT
Definition: dbtype_def.h:751
DB_DEFAULT_EXPR_TYPE on_update
Definition: parse_tree.h:1860
PT_NODE * expanded_list
Definition: parse_tree.h:2274
PT_NODE * check_where
Definition: parse_tree.h:2943
bool is_order_dependent
Definition: parse_tree.h:2777
PT_NODE * vquery_for_update_in_gdb
Definition: parse_tree.h:1731
PT_NODE * orderby_for
Definition: parse_tree.h:2876
const char * generic_name
Definition: parse_tree.h:2261
PT_SET_SYS_PARAMS_INFO set_sys_params
Definition: parse_tree.h:3338
COMPILE_CONTEXT context
Definition: parse_tree.h:3591
PT_NODE * check_where
Definition: parse_tree.h:2867
PT_NODE * column_names
Definition: parse_tree.h:1928
PT_NODE * internal_stmts
Definition: parse_tree.h:2098
PT_NODE * name
Definition: parse_tree.h:1975
short tag_click_counter
Definition: parse_tree.h:2578
PT_NODE * waitsecs_hint
Definition: parse_tree.h:2944
short db_value_is_initialized
Definition: parse_tree.h:3060
PT_UPDATE_STATS_INFO update_stats
Definition: parse_tree.h:3354
PT_NODE * referenced_class
Definition: parse_tree.h:3085
PT_SORT_SPEC_INFO sort_spec
Definition: parse_tree.h:3343
DB_AUTH
Definition: dbtype_def.h:239
PT_NODE * old_name
Definition: parse_tree.h:2622
PT_NODE * auto_increment
Definition: parse_tree.h:1861
unsigned int virtual_cache_global_schema_id
Definition: parse_tree.h:1720
PT_NODE * odku_non_null_attrs
Definition: parse_tree.h:2345
PT_NODE * index_ls
Definition: parse_tree.h:2699
CURSOR_ID * cursor_p
Definition: parse_tree.h:3207
PT_NODE * old_name
Definition: parse_tree.h:1786
long PT_UTIME
Definition: parse_tree.h:2980
PT_NODE * auth_cmd_list
Definition: parse_tree.h:2649
PT_MISC_TYPE option
Definition: parse_tree.h:2809
PT_DROP_INFO drop
Definition: parse_tree.h:3288
PT_NODE * user_list
Definition: parse_tree.h:2650
struct pt_plan_trace_info PT_PLAN_TRACE_INFO
PT_NODE * stmt
Definition: parse_tree.h:2679
bool is_order_dependent
Definition: parse_tree.h:2244
PT_NODE * ordered_hint
Definition: parse_tree.h:2068
enum pt_currency_types PT_CURRENCY
PT_COLL_COERC_LEV coerc_level
Definition: parse_tree.h:3674
PT_NODE * use_idx_hint
Definition: parse_tree.h:2070
PT_NODE * into
Definition: parse_tree.h:2923
PT_NODE * user_list
Definition: parse_tree.h:2308
PT_MISC_TYPE on_off
Definition: parse_tree.h:3213
PT_NODE * mthd_def_list
Definition: parse_tree.h:1772
PT_NODE * trigger_condition
Definition: parse_tree.h:1966
PT_NODE * to_return_var
Definition: parse_tree.h:2366
PT_NODE * internal_stmts
Definition: parse_tree.h:1915
SM_PARTITION * partition
Definition: parse_tree.h:2549
PT_NODE * using_index
Definition: parse_tree.h:2863
CUBRID_STMT_TYPE
Definition: cas_dbms_util.h:40
PT_NODE * name
Definition: parse_tree.h:3154
PT_MISC_TYPE update_action
Definition: parse_tree.h:3089
DB_VALUE sys_datetime
Definition: parse_tree.h:3580
QFILE_LIST_ID * push_list
Definition: parse_tree.h:2706
void(* PARSER_GENERIC_VOID_FUNCTION)()
Definition: parse_tree.h:1694
int Oracle_outerjoin_path_num
Definition: parse_tree.h:1711
bool print_charset
Definition: parse_tree.h:3064
PT_COMMIT_WORK_INFO commit_work
Definition: parse_tree.h:3277
PT_RESOLUTION_INFO resolution
Definition: parse_tree.h:3329
PT_NODE * default_value
Definition: parse_tree.h:2553
PT_NODE * non_recursive_part
Definition: parse_tree.h:1977
PT_NODE * attr_list
Definition: parse_tree.h:2937
const char * original_buffer
Definition: parse_tree.h:3539
PT_TABLE_OPTION_TYPE
Definition: parse_tree.h:1308
PT_OP_TYPE
Definition: parse_tree.h:1320
PT_NODE ** node_stack
Definition: parse_tree.h:3544
PT_MISC_TYPE entity_type
Definition: parse_tree.h:1899
PT_NODE * mthd_file_list
Definition: parse_tree.h:1773
PT_SET_TIMEZONE_INFO set_timezone
Definition: parse_tree.h:3336
PT_NODE * connect_by
Definition: parse_tree.h:2689
PT_ALTER_TRIGGER_INFO alter_trigger
Definition: parse_tree.h:3269
DB_OBJECT * virt_object
Definition: parse_tree.h:2040
PT_TRACE_INFO trace
Definition: parse_tree.h:3360
PT_MISC_TYPE option
Definition: parse_tree.h:2790
enum intl_codeset INTL_CODESET
Definition: intl_support.h:190
PT_NODE * function_name
Definition: parse_tree.h:2378
PT_ROLLBACK_WORK_INFO rollback_work
Definition: parse_tree.h:3331
PT_NODE * search_cond
Definition: parse_tree.h:2063
PT_MISC_TYPE shared
Definition: parse_tree.h:2005
pt_time_zones
Definition: parse_tree.h:2970
PT_MISC_TYPE entity_type
Definition: parse_tree.h:1752
PT_ALTER_USER_INFO alter_user
Definition: parse_tree.h:3270
PT_NODE * data_default_list
Definition: parse_tree.h:1780
PT_NODE * start_with
Definition: parse_tree.h:2690
PT_DROP_TRIGGER_INFO drop_trigger
Definition: parse_tree.h:3290
PT_NODE * select_stack
Definition: parse_tree.h:3377
PT_NODE * attrs
Definition: parse_tree.h:1727
PT_RESERVED_NAME_ID reserved_id
Definition: parse_tree.h:2581
PT_NODE * after_cb_filter
Definition: parse_tree.h:2691
PT_MISC_TYPE only_all
Definition: parse_tree.h:2145
PT_TYPE_ENUM virt_type_enum
Definition: parse_tree.h:2551
PT_MISC_TYPE list_type
Definition: parse_tree.h:2324
PT_GET_STATS_INFO get_stats
Definition: parse_tree.h:3303
PT_MISC_TYPE meta_class
Definition: parse_tree.h:2146
PT_NODE * method_def_list
Definition: parse_tree.h:1906
PT_NODE * password
Definition: parse_tree.h:1835
PT_DELETE_INFO delete_
Definition: parse_tree.h:3285
PT_NODE * limit
Definition: parse_tree.h:2874
PT_NODE * method_file_list
Definition: parse_tree.h:1907
PT_SET_OPT_LVL_INFO set_opt_lvl
Definition: parse_tree.h:3337
long PT_TIME
Definition: parse_tree.h:2979
void * etc
Definition: parse_tree.h:3450
PT_NODE * waitsecs_hint
Definition: parse_tree.h:2067
PT_NODE * error_msgs
Definition: parse_tree.h:3550
PT_NODE * timezone_node
Definition: parse_tree.h:2961
PT_NODE * spec
Definition: parse_tree.h:2061
PT_TYPE_ENUM ret_type
Definition: parse_tree.h:3149
PT_NODE * trigger_spec_list
Definition: parse_tree.h:2616
PT_NODE * ordered
Definition: parse_tree.h:2695
PT_NODE * correlation_name
Definition: parse_tree.h:2169
#define MAX_NUM_PLAN_TRACE
Definition: parse_tree.h:617
PT_VALUE_INFO value
Definition: parse_tree.h:3358
PT_NODE * select_stack
Definition: parse_tree.h:3386
PT_NODE * list
Definition: parse_tree.h:2685
PT_NODE * use_merge
Definition: parse_tree.h:2700
PT_NODE * expression
Definition: parse_tree.h:2161
XASL_ID * xasl_id
Definition: parse_tree.h:3454
PT_OP_TYPE op
Definition: parse_tree.h:2200
pt_type_enum
Definition: parse_tree.h:907
PARSER_VARCHAR *(* PT_PRINT_VALUE_FUNC)(PARSER_CONTEXT *parser, const PT_NODE *val)
Definition: parse_tree.h:1691
void * xasl
Definition: parse_tree.h:1980
PT_MONETARY money
Definition: parse_tree.h:3046
PT_NODE * sup_class_list
Definition: parse_tree.h:1755
unsigned short correlation_level
Definition: parse_tree.h:2555
PT_NODE * data_default
Definition: parse_tree.h:1859
pt_currency_types
Definition: parse_tree.h:2987
int mvcc_reev_extra_cls_cnt
Definition: parse_tree.h:2753
static WHEN_DESC on_error
pt_pointer_type
Definition: parse_tree.h:3123
PT_NODE * user_name
Definition: parse_tree.h:1818
PT_NODE * path_conjuncts
Definition: parse_tree.h:2139
PT_NODE * java_method
Definition: parse_tree.h:3144
PT_NODE * auth_cmd_list
Definition: parse_tree.h:2307
PT_MISC_TYPE attr_or_mthd
Definition: parse_tree.h:2626
PT_JOIN_TYPE
Definition: parse_tree.h:1149
DB_DATETIMETZ PT_DATETIMETZ
Definition: parse_tree.h:2984
PT_TRUNCATE_INFO truncate
Definition: parse_tree.h:3351
PT_NODE * orderby_for
Definition: parse_tree.h:2770
int sql_user_text_len
Definition: parse_tree.h:3445
PT_INCLUDE_OID_TYPE
Definition: parse_tree.h:1489
int(* PT_INT_FUNCTION)(PARSER_CONTEXT *c)
Definition: parse_tree.h:3528
PT_MISC_TYPE attr_type
Definition: parse_tree.h:2643
PT_NODE * create_index
Definition: parse_tree.h:1826
PT_NODE * attr_def_list
Definition: parse_tree.h:1764
PT_HINT_ENUM hint
Definition: parse_tree.h:2945
PT_DROP_VARIABLE_INFO drop_variable
Definition: parse_tree.h:3292
PT_NODE * query_no_list
Definition: parse_tree.h:1763
PT_SAVEPOINT_INFO savepoint
Definition: parse_tree.h:3332
PT_NODE * vquery_for_query
Definition: parse_tree.h:1728
const char * alias_print
Definition: parse_tree.h:3455
enum pt_node_type PT_NODE_TYPE
Definition: parse_tree.h:904
const char * resolved
Definition: parse_tree.h:2545
PT_NODE * trigger_spec_list
Definition: parse_tree.h:1842
PT_NAMED_ARG_INFO named_arg
Definition: parse_tree.h:3319
PT_NODE * entity_name
Definition: parse_tree.h:1750
PT_NODE * check_where
Definition: parse_tree.h:2704
PT_SET_TRIGGER_INFO set_trigger
Definition: parse_tree.h:3339
PARSER_VARCHAR * str_val
Definition: parse_tree.h:3026
PT_NODE * using_clause
Definition: parse_tree.h:2924
PT_DATE date
Definition: parse_tree.h:3041
PT_TRIGGER_ACTION_INFO trigger_action
Definition: parse_tree.h:3349
PT_CONSTRAINT_INFO constraint
Definition: parse_tree.h:3278
PT_NODE * using_list
Definition: parse_tree.h:3163
PT_NODE * json_table
Definition: parse_tree.h:2143
PT_NODE * use_nl
Definition: parse_tree.h:2696
PT_TIME time
Definition: parse_tree.h:3040
PT_REVOKE_INFO revoke
Definition: parse_tree.h:3330
PT_ENUM_ELEMENT enumeration
Definition: parse_tree.h:3050
struct symbol_info * symbols
Definition: parse_tree.h:3572
char ** expressions
Definition: parse_tree.h:1735
UINTPTR spec_ident
Definition: parse_tree.h:3451
PT_SET_SESSION_VARIABLE_INFO set_variables
Definition: parse_tree.h:3340
PT_MISC_TYPE is_subinsert
Definition: parse_tree.h:2336
int column_number
Definition: parse_tree.h:3442
CUBRID_STMT_TYPE stmt_type
Definition: parse_tree.h:3166
PT_NODE * entity_name
Definition: parse_tree.h:2130
PT_NODE * name
Definition: parse_tree.h:3161
PT_NODE * object_parameter
Definition: parse_tree.h:2865
PT_NODE * order_by
Definition: parse_tree.h:2263
PT_NODE * ordered_hint
Definition: parse_tree.h:2870
PT_NODE * statement
Definition: parse_tree.h:3155
PT_SELECT_INFO select
Definition: parse_tree.h:2781
PT_NODE * percentile
Definition: parse_tree.h:2264
PT_DATA_DEFAULT_INFO data_default
Definition: parse_tree.h:3283
PT_NODE * cached_num_val
Definition: parse_tree.h:1991
struct json_t * json_plan
Definition: parse_tree.h:3523
PT_EVENT_SPEC_INFO event_spec
Definition: parse_tree.h:3295
char ** lcks_classes
Definition: parse_tree.h:3573
PT_MISC_TYPE meta
Definition: parse_tree.h:1785
PT_INSERT_INFO insert
Definition: parse_tree.h:3309
pt_coll_coerc_lev
Definition: parse_tree.h:3641
#define MAX_KEYWORD_SIZE
Definition: parse_tree.h:3502
PT_HOST_VAR_INFO host_var
Definition: parse_tree.h:3307
PT_MISC_TYPE type
Definition: parse_tree.h:3147
PT_NODE * user_name
Definition: parse_tree.h:1834
PT_TIMEOUT_INFO timeout
Definition: parse_tree.h:3348
PT_PRIV_TYPE
Definition: parse_tree.h:965
TP_DOMAIN_COLL_ACTION collation_flag
Definition: parse_tree.h:2048
SM_INDEX_STATUS
Definition: class_object.h:510
PT_NODE * spec_parent
Definition: parse_tree.h:3421
SERVER_INSERT_ALLOWED
Definition: parse_tree.h:1547
PT_RESERVED_NAME_ID
Definition: parse_tree.h:2397
QUERY_ID query_id
Definition: parse_tree.h:3559
const char ** p
Definition: dynamic_load.c:945
PT_NODE * name
Definition: parse_tree.h:2028
PT_NODE * comment
Definition: parse_tree.h:1863
PT_MISC_TYPE condition_time
Definition: parse_tree.h:1963
DB_DEFAULT_EXPR_TYPE
Definition: dbtype_def.h:1181
PT_CREATE_USER_INFO create_user
Definition: parse_tree.h:3281
PT_NODE * waitsecs_hint
Definition: parse_tree.h:2869
PT_NODE * constraint_list
Definition: parse_tree.h:1825
PT_NODE * cursor_name
Definition: parse_tree.h:2866
PT_JOIN_TYPE join_type
Definition: parse_tree.h:2151
PT_COMP_TO_BETWEEN_OP_CODE_TYPE
Definition: parse_tree.h:1496
PT_NODE * on_call_target
Definition: parse_tree.h:2365
PT_HINT_ENUM hint
Definition: parse_tree.h:2776
PT_INSERT_VALUE_INFO insert_value
Definition: parse_tree.h:3310
PT_NODE * attr_old_name
Definition: parse_tree.h:1770
PT_NODE * attr_mthd_list
Definition: parse_tree.h:1879
PT_NODE * derived_table
Definition: parse_tree.h:2134
PT_NODE * original_node
Definition: parse_tree.h:3227
PT_CASECMP_FUN casecmp
Definition: parse_tree.h:3534
PT_NODE * save_name
Definition: parse_tree.h:2672
DB_TIMESTAMPTZ PT_TIMESTAMPTZ
Definition: parse_tree.h:2981
PT_STORED_PROC_INFO sp
Definition: parse_tree.h:3344
PT_NODE * attr_name_list
Definition: parse_tree.h:1779
PT_NODE * search_cond
Definition: parse_tree.h:2862
PT_NODE * range_var
Definition: parse_tree.h:2135
PT_NODE * keycol
Definition: parse_tree.h:2020
PT_MISC_TYPE meta
Definition: parse_tree.h:2625
PT_NODE * event_target
Definition: parse_tree.h:2175
EXECUTION_STATE_VALUES execution_values
Definition: parse_tree.h:3562
PT_MISC_TYPE only_all
Definition: parse_tree.h:1979