CUBRID Engine  latest
stream_to_xasl.c
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  * stream_to_xasl.c - XASL tree restorer
21  */
22 
23 #ident "$Id$"
24 
25 #include "config.h"
26 
27 #include <assert.h>
28 #include <cstring>
29 #include <stdio.h>
30 #include <stdarg.h>
31 #include <stdlib.h>
32 #include <string.h>
33 
34 #include "stream_to_xasl.h"
35 
36 #include "dbtype.h"
37 #include "error_manager.h"
38 #include "query_aggregate.hpp"
39 #include "xasl.h"
40 #include "xasl_aggregate.hpp"
41 #include "xasl_analytic.hpp"
42 #include "xasl_predicate.hpp"
43 #include "xasl_stream.hpp"
44 #include "xasl_unpack_info.hpp"
45 
46 static ACCESS_SPEC_TYPE *stx_restore_access_spec_type (THREAD_ENTRY * thread_p, char **ptr, void *arg);
47 static AGGREGATE_TYPE *stx_restore_aggregate_type (THREAD_ENTRY * thread_p, char *ptr);
48 static FUNCTION_TYPE *stx_restore_function_type (THREAD_ENTRY * thread_p, char *ptr);
49 static ANALYTIC_TYPE *stx_restore_analytic_type (THREAD_ENTRY * thread_p, char *ptr);
50 static ANALYTIC_EVAL_TYPE *stx_restore_analytic_eval_type (THREAD_ENTRY * thread_p, char *ptr);
51 static QFILE_SORTED_LIST_ID *stx_restore_srlist_id (THREAD_ENTRY * thread_p, char *ptr);
52 static QFILE_LIST_ID *stx_restore_list_id (THREAD_ENTRY * thread_p, char *ptr);
53 static ARITH_TYPE *stx_restore_arith_type (THREAD_ENTRY * thread_p, char *ptr);
54 static INDX_INFO *stx_restore_indx_info (THREAD_ENTRY * thread_p, char *ptr);
55 static OUTPTR_LIST *stx_restore_outptr_list (THREAD_ENTRY * thread_p, char *ptr);
56 static SELUPD_LIST *stx_restore_selupd_list (THREAD_ENTRY * thread_p, char *ptr);
57 static UPDDEL_CLASS_INFO *stx_restore_update_class_info_array (THREAD_ENTRY * thread_p, char *ptr, int num_classes);
58 static UPDATE_ASSIGNMENT *stx_restore_update_assignment_array (THREAD_ENTRY * thread_p, char *ptr, int num_assigns);
59 static ODKU_INFO *stx_restore_odku_info (THREAD_ENTRY * thread_p, char *ptr);
60 static PRED_EXPR *stx_restore_pred_expr (THREAD_ENTRY * thread_p, char *ptr);
61 static REGU_VARIABLE *stx_restore_regu_variable (THREAD_ENTRY * thread_p, char *ptr);
63 static REGU_VARLIST_LIST stx_restore_regu_varlist_list (THREAD_ENTRY * thread_p, char *ptr);
64 static SORT_LIST *stx_restore_sort_list (THREAD_ENTRY * thread_p, char *ptr);
65 static VAL_LIST *stx_restore_val_list (THREAD_ENTRY * thread_p, char *ptr);
66 static DB_VALUE *stx_restore_db_value (THREAD_ENTRY * thread_p, char *ptr);
67 #if defined(ENABLE_UNUSED_FUNCTION)
68 static QPROC_DB_VALUE_LIST stx_restore_db_value_list (THREAD_ENTRY * thread_p, char *ptr);
69 #endif
70 static XASL_NODE *stx_restore_xasl_node (THREAD_ENTRY * thread_p, char *ptr);
72 static FUNC_PRED *stx_restore_func_pred (THREAD_ENTRY * thread_p, char *ptr);
73 static HEAP_CACHE_ATTRINFO *stx_restore_cache_attrinfo (THREAD_ENTRY * thread_p, char *ptr);
74 static DB_VALUE **stx_restore_db_value_array_extra (THREAD_ENTRY * thread_p, char *ptr, int size, int total_size);
75 static int *stx_restore_int_array (THREAD_ENTRY * thread_p, char *ptr, int size);
76 static OID *stx_restore_OID_array (THREAD_ENTRY * thread_p, char *ptr, int size);
77 static METHOD_SIG_LIST *stx_restore_method_sig_list (THREAD_ENTRY * thread_p, char *ptr);
78 static METHOD_SIG *stx_restore_method_sig (THREAD_ENTRY * thread_p, char *ptr, int size);
79 static KEY_RANGE *stx_restore_key_range_array (THREAD_ENTRY * thread_p, char *ptr, int size);
80 
81 static char *stx_build_xasl_node (THREAD_ENTRY * thread_p, char *tmp, XASL_NODE * ptr);
82 static char *stx_build_xasl_header (THREAD_ENTRY * thread_p, char *ptr, XASL_NODE_HEADER * xasl_header);
83 static char *stx_build_filter_pred_node (THREAD_ENTRY * thread_p, char *ptr, PRED_EXPR_WITH_CONTEXT * pred);
84 static char *stx_build_func_pred (THREAD_ENTRY * thread_p, char *tmp, FUNC_PRED * ptr);
85 static char *stx_build_cache_attrinfo (char *tmp);
86 static char *stx_build_list_id (THREAD_ENTRY * thread_p, char *tmp, QFILE_LIST_ID * ptr);
87 static char *stx_build_method_sig_list (THREAD_ENTRY * thread_p, char *tmp, METHOD_SIG_LIST * ptr);
88 static char *stx_build_method_sig (THREAD_ENTRY * thread_p, char *tmp, METHOD_SIG * ptr, int size);
89 static char *stx_build_union_proc (THREAD_ENTRY * thread_p, char *tmp, UNION_PROC_NODE * ptr);
90 static char *stx_build_fetch_proc (THREAD_ENTRY * thread_p, char *tmp, FETCH_PROC_NODE * ptr);
91 static char *stx_build_buildlist_proc (THREAD_ENTRY * thread_p, char *tmp, BUILDLIST_PROC_NODE * ptr);
92 static char *stx_build_buildvalue_proc (THREAD_ENTRY * thread_p, char *tmp, BUILDVALUE_PROC_NODE * ptr);
93 static char *stx_build_mergelist_proc (THREAD_ENTRY * thread_p, char *tmp, MERGELIST_PROC_NODE * ptr);
94 static char *stx_build_ls_merge_info (THREAD_ENTRY * thread_p, char *tmp, QFILE_LIST_MERGE_INFO * ptr);
95 static char *stx_build_update_class_info (THREAD_ENTRY * thread_p, char *tmp, UPDDEL_CLASS_INFO * ptr);
96 static char *stx_build_update_assignment (THREAD_ENTRY * thread_p, char *tmp, UPDATE_ASSIGNMENT * ptr);
97 static char *stx_build_update_proc (THREAD_ENTRY * thread_p, char *tmp, UPDATE_PROC_NODE * ptr);
98 static char *stx_build_delete_proc (THREAD_ENTRY * thread_p, char *tmp, DELETE_PROC_NODE * ptr);
99 static char *stx_build_insert_proc (THREAD_ENTRY * thread_p, char *tmp, INSERT_PROC_NODE * ptr);
100 static char *stx_build_merge_proc (THREAD_ENTRY * thread_p, char *tmp, MERGE_PROC_NODE * ptr);
101 static char *stx_build_cte_proc (THREAD_ENTRY * thread_p, char *tmp, CTE_PROC_NODE * ptr);
102 static char *stx_build_outptr_list (THREAD_ENTRY * thread_p, char *tmp, OUTPTR_LIST * ptr);
103 static char *stx_build_selupd_list (THREAD_ENTRY * thread_p, char *tmp, SELUPD_LIST * ptr);
104 static char *stx_build_pred_expr (THREAD_ENTRY * thread_p, char *tmp, PRED_EXPR * ptr);
105 static char *stx_build_pred (THREAD_ENTRY * thread_p, char *tmp, PRED * ptr);
106 static char *stx_build_eval_term (THREAD_ENTRY * thread_p, char *tmp, EVAL_TERM * ptr);
107 static char *stx_build_comp_eval_term (THREAD_ENTRY * thread_p, char *tmp, COMP_EVAL_TERM * ptr);
108 static char *stx_build_alsm_eval_term (THREAD_ENTRY * thread_p, char *tmp, ALSM_EVAL_TERM * ptr);
109 static char *stx_build_like_eval_term (THREAD_ENTRY * thread_p, char *tmp, LIKE_EVAL_TERM * ptr);
110 static char *stx_build_rlike_eval_term (THREAD_ENTRY * thread_p, char *tmp, RLIKE_EVAL_TERM * ptr);
111 static char *stx_build_access_spec_type (THREAD_ENTRY * thread_p, char *tmp, ACCESS_SPEC_TYPE * ptr, void *arg);
112 static char *stx_build_indx_info (THREAD_ENTRY * thread_p, char *tmp, INDX_INFO * ptr);
113 static char *stx_build_key_info (THREAD_ENTRY * thread_p, char *tmp, KEY_INFO * ptr);
114 static char *stx_build_cls_spec_type (THREAD_ENTRY * thread_p, char *tmp, CLS_SPEC_TYPE * ptr);
115 static char *stx_build_list_spec_type (THREAD_ENTRY * thread_p, char *tmp, LIST_SPEC_TYPE * ptr);
116 static char *stx_build_showstmt_spec_type (THREAD_ENTRY * thread_p, char *ptr, SHOWSTMT_SPEC_TYPE * spec);
117 static char *stx_build_rlist_spec_type (THREAD_ENTRY * thread_p, char *ptr, REGUVAL_LIST_SPEC_TYPE * spec,
118  OUTPTR_LIST * outptr_list);
119 static char *stx_build_set_spec_type (THREAD_ENTRY * thread_p, char *tmp, SET_SPEC_TYPE * ptr);
120 static char *stx_build_method_spec_type (THREAD_ENTRY * thread_p, char *tmp, METHOD_SPEC_TYPE * ptr);
121 static char *stx_build_val_list (THREAD_ENTRY * thread_p, char *tmp, VAL_LIST * ptr);
122 #if defined(ENABLE_UNUSED_FUNCTION)
123 static char *stx_build_db_value_list (THREAD_ENTRY * thread_p, char *tmp, QPROC_DB_VALUE_LIST ptr);
124 #endif
125 static char *stx_build_regu_variable (THREAD_ENTRY * thread_p, char *tmp, REGU_VARIABLE * ptr);
126 static char *stx_unpack_regu_variable_value (THREAD_ENTRY * thread_p, char *tmp, REGU_VARIABLE * ptr);
127 static char *stx_build_attr_descr (THREAD_ENTRY * thread_p, char *tmp, ATTR_DESCR * ptr);
128 static char *stx_build_pos_descr (char *tmp, QFILE_TUPLE_VALUE_POSITION * ptr);
129 static char *stx_build_arith_type (THREAD_ENTRY * thread_p, char *tmp, ARITH_TYPE * ptr);
130 static char *stx_build_aggregate_type (THREAD_ENTRY * thread_p, char *tmp, AGGREGATE_TYPE * ptr);
131 static char *stx_build_function_type (THREAD_ENTRY * thread_p, char *tmp, FUNCTION_TYPE * ptr);
132 static char *stx_build_analytic_type (THREAD_ENTRY * thread_p, char *tmp, ANALYTIC_TYPE * ptr);
133 static char *stx_build_analytic_eval_type (THREAD_ENTRY * thread_p, char *tmp, ANALYTIC_EVAL_TYPE * ptr);
134 static char *stx_build_srlist_id (THREAD_ENTRY * thread_p, char *tmp, QFILE_SORTED_LIST_ID * ptr);
135 static char *stx_build_sort_list (THREAD_ENTRY * thread_p, char *tmp, SORT_LIST * ptr);
136 static char *stx_build_connectby_proc (THREAD_ENTRY * thread_p, char *tmp, CONNECTBY_PROC_NODE * ptr);
137 
140 static char *stx_build_regu_value_list (THREAD_ENTRY * thread_p, char *ptr, REGU_VALUE_LIST * regu_value_list,
141  TP_DOMAIN * domain);
142 static void stx_init_regu_variable (REGU_VARIABLE * regu);
143 
144 static char *stx_build_regu_variable_list (THREAD_ENTRY * thread_p, char *ptr, REGU_VARIABLE_LIST * regu_var_list);
145 
146 #if defined(ENABLE_UNUSED_FUNCTION)
147 static char *stx_unpack_char (char *tmp, char *ptr);
148 static char *stx_unpack_long (char *tmp, long *ptr);
149 #endif
150 
151 /*
152  * stx_map_stream_to_xasl_node_header () - Obtain xasl node header from xasl
153  * stream.
154  *
155  * return : error code.
156  * thread_p (in) : thread entry.
157  * xasl_header_p (out) : pointer to xasl node header.
158  * xasl_stream (in) : xasl stream.
159  */
160 int
162 {
163  int xasl_stream_header_size = 0, offset = 0;
164  char *ptr = NULL;
165 
166  if (xasl_stream == NULL || xasl_header_p == NULL)
167  {
168  assert (0);
169  return ER_FAILED;
170  }
171  (void) or_unpack_int (xasl_stream, &xasl_stream_header_size);
172  offset = OR_INT_SIZE + /* xasl stream header size */
173  xasl_stream_header_size + /* xasl stream header data */
174  OR_INT_SIZE; /* xasl stream body size */
175  offset = xasl_stream_make_align (offset);
176  ptr = xasl_stream + offset;
177  OR_UNPACK_XASL_NODE_HEADER (ptr, xasl_header_p);
178  return NO_ERROR;
179 }
180 
181 /*
182  * stx_map_stream_to_xasl () -
183  * return: if successful, return 0, otherwise non-zero error code
184  * xasl_tree(in) : pointer to where to return the
185  * root of the unpacked XASL tree
186  * use_xasl_clone(in) : true, if XASL clone is used
187  * xasl_stream(in) : pointer to xasl stream
188  * xasl_stream_size(in) : # of bytes in xasl_stream
189  * xasl_unpack_info_ptr(in) : pointer to where to return the pack info
190  *
191  * Note: map the linear byte stream in disk representation to an XASL tree.
192  *
193  * Note: the caller is responsible for freeing the memory of
194  * xasl_unpack_info_ptr. The free function is free_xasl_unpack_info().
195  */
196 int
197 stx_map_stream_to_xasl (THREAD_ENTRY * thread_p, xasl_node ** xasl_tree, bool use_xasl_clone, char *xasl_stream,
198  int xasl_stream_size, XASL_UNPACK_INFO ** xasl_unpack_info_ptr)
199 {
200  XASL_NODE *xasl;
201  char *p;
202  int header_size;
203  int offset;
204  XASL_UNPACK_INFO *unpack_info_p = NULL;
205 
206  if (!xasl_tree || !xasl_stream || !xasl_unpack_info_ptr || xasl_stream_size <= 0)
207  {
209  }
210 
211  stx_set_xasl_errcode (thread_p, NO_ERROR);
212  stx_init_xasl_unpack_info (thread_p, xasl_stream, xasl_stream_size);
213  unpack_info_p = get_xasl_unpack_info_ptr (thread_p);
214  unpack_info_p->use_xasl_clone = use_xasl_clone;
215  unpack_info_p->track_allocated_bufers = 1;
216 
217  /* calculate offset to XASL tree in the stream buffer */
218  p = or_unpack_int (xasl_stream, &header_size);
219  offset = sizeof (int) /* [size of header data] */
220  + header_size /* [header data] */
221  + sizeof (int); /* [size of body data] */
222  offset = xasl_stream_make_align (offset);
223 
224  /* restore XASL tree from body data of the stream buffer */
225  xasl = stx_restore_xasl_node (thread_p, xasl_stream + offset);
226  if (xasl == NULL)
227  {
228  free_xasl_unpack_info (thread_p, unpack_info_p);
229  goto end;
230  }
231 
232  /* set result */
233  *xasl_tree = xasl;
234  *xasl_unpack_info_ptr = get_xasl_unpack_info_ptr (thread_p);
235 
236  /* restore header data of new XASL format */
237  p = or_unpack_int (p, &xasl->dbval_cnt);
238  OID_SET_NULL (&xasl->creator_oid);
239  xasl->n_oid_list = 0;
240  xasl->class_oid_list = NULL;
241  xasl->class_locks = NULL;
242  xasl->tcard_list = NULL;
243 
244  /* initialize the query in progress flag to FALSE. Note that this flag is not packed/unpacked. It is strictly a
245  * server side flag. */
246  xasl->query_in_progress = false;
247 end:
248  stx_free_visited_ptrs (thread_p);
249 #if defined(SERVER_MODE)
250  set_xasl_unpack_info_ptr (thread_p, NULL);
251 #endif /* SERVER_MODE */
252 
253  return stx_get_xasl_errcode (thread_p);
254 }
255 
256 /*
257  * stx_map_stream_to_filter_pred () -
258  * return: if successful, return 0, otherwise non-zero error code
259  * pred(in): pointer to where to return the root of the unpacked
260  * filter predicate tree
261  * pred_stream(in): pointer to predicate stream
262  * pred_stream_size(in): # of bytes in predicate stream
263  * pred_unpack_info_ptr(in): pointer to where to return the pack info
264  *
265  * Note: map the linear byte stream in disk representation to an predicate
266  * with context. The caller is responsible for freeing the memory of
267  * (*pred)->unpack_info by calling free_xasl_unpack_info().
268  * *pred is private_alloced separatedly of (*pred)->unpack_info and
269  * needs to be freed after it
270  */
271 int
272 stx_map_stream_to_filter_pred (THREAD_ENTRY * thread_p, pred_expr_with_context ** pred, char *pred_stream,
273  int pred_stream_size)
274 {
276  char *p = NULL;
277  int header_size;
278  int offset;
279  XASL_UNPACK_INFO *unpack_info_p = NULL;
280 
281  if (!pred || !pred_stream || pred_stream_size <= 0)
282  {
284  }
285 
286  stx_set_xasl_errcode (thread_p, NO_ERROR);
287  stx_init_xasl_unpack_info (thread_p, pred_stream, pred_stream_size);
288  unpack_info_p = get_xasl_unpack_info_ptr (thread_p);
289  unpack_info_p->use_xasl_clone = true;
290  unpack_info_p->track_allocated_bufers = 1;
291 
292  /* calculate offset to filter predicate in the stream buffer */
293  p = or_unpack_int (pred_stream, &header_size);
294  offset = sizeof (int) /* [size of header data] */
295  + header_size /* [header data] */
296  + sizeof (int); /* [size of body data] */
297  offset = xasl_stream_make_align (offset);
298 
299  /* restore XASL tree from body data of the stream buffer */
300  pwc = stx_restore_filter_pred_node (thread_p, pred_stream + offset);
301  if (pwc == NULL)
302  {
303  free_xasl_unpack_info (thread_p, unpack_info_p);
304  goto end;
305  }
306 
307  /* set result */
308  pwc->unpack_info = unpack_info_p;
309  *pred = pwc;
310 
311 end:
312  stx_free_visited_ptrs (thread_p);
313 #if defined(SERVER_MODE)
314  set_xasl_unpack_info_ptr (thread_p, NULL);
315 #endif /* SERVER_MODE */
316 
317  return stx_get_xasl_errcode (thread_p);
318 }
319 
320 /*
321  * stx_map_stream_to_func_pred () -
322  * return: if successful, return 0, otherwise non-zero error code
323  * xasl(in) : pointer to where to return the unpacked FUNC_PRED
324  * xasl_stream(in) : pointer to xasl stream
325  * xasl_stream_size(in) : # of bytes in xasl_stream
326  * xasl_unpack_info_ptr(in) : pointer to where to return the pack info
327  */
328 int
329 stx_map_stream_to_func_pred (THREAD_ENTRY * thread_p, func_pred ** xasl, char *xasl_stream, int xasl_stream_size,
330  XASL_UNPACK_INFO ** xasl_unpack_info_ptr)
331 {
332  FUNC_PRED *p_xasl = NULL;
333  char *p = NULL;
334  int header_size;
335  int offset;
336  XASL_UNPACK_INFO *unpack_info_p = NULL;
337 
338  if (!xasl || !xasl_stream || !xasl_unpack_info_ptr || xasl_stream_size <= 0)
339  {
341  }
342 
343  stx_set_xasl_errcode (thread_p, NO_ERROR);
344  stx_init_xasl_unpack_info (thread_p, xasl_stream, xasl_stream_size);
345  unpack_info_p = get_xasl_unpack_info_ptr (thread_p);
346  unpack_info_p->use_xasl_clone = false;
347  unpack_info_p->track_allocated_bufers = 1;
348 
349  /* calculate offset to expr XASL in the stream buffer */
350  p = or_unpack_int (xasl_stream, &header_size);
351  offset = sizeof (int) /* [size of header data] */
352  + header_size /* [header data] */
353  + sizeof (int); /* [size of body data] */
354  offset = xasl_stream_make_align (offset);
355 
356  /* restore XASL tree from body data of the stream buffer */
357  p_xasl = stx_restore_func_pred (thread_p, xasl_stream + offset);
358  if (p_xasl == NULL)
359  {
360  free_xasl_unpack_info (thread_p, unpack_info_p);
361  goto end;
362  }
363 
364  /* set result */
365  *xasl = p_xasl;
366  *xasl_unpack_info_ptr = unpack_info_p;
367 
368 end:
369  stx_free_visited_ptrs (thread_p);
370 #if defined(SERVER_MODE)
371  set_xasl_unpack_info_ptr (thread_p, NULL);
372 #endif /* SERVER_MODE */
373 
374  return stx_get_xasl_errcode (thread_p);
375 }
376 
377 /*
378  * stx_restore_func_postfix () -
379  * return: if successful, return the offset of position
380  * in disk object where the node is stored, otherwise
381  * return ER_FAILED and error code is set to xasl_errcode.
382  * ptr(in): pointer to an XASL tree node whose type is return type
383  *
384  * Note: store the XASL tree node pointed by 'ptr' into disk
385  * object with the help of stx_build_func_postfix to process
386  * the members of the node.
387  */
388 
389 static AGGREGATE_TYPE *
391 {
392  AGGREGATE_TYPE *aggregate;
393 
394  if (ptr == NULL)
395  {
396  return NULL;
397  }
398 
399  aggregate = (AGGREGATE_TYPE *) stx_get_struct_visited_ptr (thread_p, ptr);
400  if (aggregate != NULL)
401  {
402  return aggregate;
403  }
404 
405  aggregate = (AGGREGATE_TYPE *) stx_alloc_struct (thread_p, sizeof (*aggregate));
406  if (aggregate == NULL)
407  {
409  return NULL;
410  }
411 
412  if (stx_mark_struct_visited (thread_p, ptr, aggregate) == ER_FAILED
413  || stx_build_aggregate_type (thread_p, ptr, aggregate) == NULL)
414  {
415  return NULL;
416  }
417 
418  return aggregate;
419 }
420 
421 static FUNCTION_TYPE *
423 {
424  FUNCTION_TYPE *function;
425 
426  if (ptr == NULL)
427  {
428  return NULL;
429  }
430 
431  function = (FUNCTION_TYPE *) stx_get_struct_visited_ptr (thread_p, ptr);
432  if (function != NULL)
433  {
434  return function;
435  }
436 
437  function = (FUNCTION_TYPE *) stx_alloc_struct (thread_p, sizeof (*function));
438  if (function == NULL)
439  {
441  return NULL;
442  }
443 
444  if (stx_mark_struct_visited (thread_p, ptr, function) == ER_FAILED
445  || stx_build_function_type (thread_p, ptr, function) == NULL)
446  {
447  return NULL;
448  }
449 
450  return function;
451 }
452 
453 static ANALYTIC_TYPE *
455 {
456  ANALYTIC_TYPE *analytic;
457 
458  if (ptr == NULL)
459  {
460  return NULL;
461  }
462 
463  analytic = (ANALYTIC_TYPE *) stx_get_struct_visited_ptr (thread_p, ptr);
464  if (analytic != NULL)
465  {
466  return analytic;
467  }
468 
469  analytic = (ANALYTIC_TYPE *) stx_alloc_struct (thread_p, sizeof (*analytic));
470  if (analytic == NULL)
471  {
473  return NULL;
474  }
475 
476  if (stx_mark_struct_visited (thread_p, ptr, analytic) == ER_FAILED
477  || stx_build_analytic_type (thread_p, ptr, analytic) == NULL)
478  {
479  return NULL;
480  }
481 
482  analytic->init ();
483 
484  return analytic;
485 }
486 
487 static ANALYTIC_EVAL_TYPE *
489 {
490  ANALYTIC_EVAL_TYPE *analytic_eval;
491 
492  if (ptr == NULL)
493  {
494  return NULL;
495  }
496 
497  analytic_eval = (ANALYTIC_EVAL_TYPE *) stx_get_struct_visited_ptr (thread_p, ptr);
498  if (analytic_eval != NULL)
499  {
500  return analytic_eval;
501  }
502 
503  analytic_eval = (ANALYTIC_EVAL_TYPE *) stx_alloc_struct (thread_p, sizeof (*analytic_eval));
504  if (analytic_eval == NULL)
505  {
507  return NULL;
508  }
509 
510  if (stx_mark_struct_visited (thread_p, ptr, analytic_eval) == ER_FAILED
511  || stx_build_analytic_eval_type (thread_p, ptr, analytic_eval) == NULL)
512  {
513  return NULL;
514  }
515 
516  return analytic_eval;
517 }
518 
519 static QFILE_SORTED_LIST_ID *
520 stx_restore_srlist_id (THREAD_ENTRY * thread_p, char *ptr)
521 {
522  QFILE_SORTED_LIST_ID *sort_list_id;
523 
524  if (ptr == NULL)
525  {
526  return NULL;
527  }
528 
529  sort_list_id = (QFILE_SORTED_LIST_ID *) stx_get_struct_visited_ptr (thread_p, ptr);
530  if (sort_list_id != NULL)
531  {
532  return sort_list_id;
533  }
534 
535  sort_list_id = (QFILE_SORTED_LIST_ID *) stx_alloc_struct (thread_p, sizeof (*sort_list_id));
536  if (sort_list_id == NULL)
537  {
539  return NULL;
540  }
541 
542  if (stx_mark_struct_visited (thread_p, ptr, sort_list_id) == ER_FAILED
543  || stx_build_srlist_id (thread_p, ptr, sort_list_id) == NULL)
544  {
545  return NULL;
546  }
547 
548  return sort_list_id;
549 }
550 
551 static ARITH_TYPE *
552 stx_restore_arith_type (THREAD_ENTRY * thread_p, char *ptr)
553 {
554  ARITH_TYPE *arithmetic;
555 
556  if (ptr == NULL)
557  {
558  return NULL;
559  }
560 
561  arithmetic = (ARITH_TYPE *) stx_get_struct_visited_ptr (thread_p, ptr);
562  if (arithmetic != NULL)
563  {
564  return arithmetic;
565  }
566 
567  arithmetic = (ARITH_TYPE *) stx_alloc_struct (thread_p, sizeof (*arithmetic));
568  if (arithmetic == NULL)
569  {
571  return NULL;
572  }
573 
574  if (stx_mark_struct_visited (thread_p, ptr, arithmetic) == ER_FAILED
575  || stx_build_arith_type (thread_p, ptr, arithmetic) == NULL)
576  {
577  return NULL;
578  }
579 
580  return arithmetic;
581 }
582 
583 static INDX_INFO *
584 stx_restore_indx_info (THREAD_ENTRY * thread_p, char *ptr)
585 {
587 
588  if (ptr == NULL)
589  {
590  return NULL;
591  }
592 
593  indx_info = (INDX_INFO *) stx_get_struct_visited_ptr (thread_p, ptr);
594  if (indx_info != NULL)
595  {
596  return indx_info;
597  }
598 
599  indx_info = (INDX_INFO *) stx_alloc_struct (thread_p, sizeof (*indx_info));
600  if (indx_info == NULL)
601  {
603  return NULL;
604  }
605 
606  if (stx_mark_struct_visited (thread_p, ptr, indx_info) == ER_FAILED
607  || stx_build_indx_info (thread_p, ptr, indx_info) == NULL)
608  {
609  return NULL;
610  }
611 
612  return indx_info;
613 }
614 
615 static OUTPTR_LIST *
616 stx_restore_outptr_list (THREAD_ENTRY * thread_p, char *ptr)
617 {
618  OUTPTR_LIST *outptr_list;
619 
620  if (ptr == NULL)
621  {
622  return NULL;
623  }
624 
625  outptr_list = (OUTPTR_LIST *) stx_get_struct_visited_ptr (thread_p, ptr);
626  if (outptr_list != NULL)
627  {
628  return outptr_list;
629  }
630 
631  outptr_list = (OUTPTR_LIST *) stx_alloc_struct (thread_p, sizeof (*outptr_list));
632  if (outptr_list == NULL)
633  {
635  return NULL;
636  }
637 
638  if (stx_mark_struct_visited (thread_p, ptr, outptr_list) == ER_FAILED
639  || stx_build_outptr_list (thread_p, ptr, outptr_list) == NULL)
640  {
641  return NULL;
642  }
643 
644  return outptr_list;
645 }
646 
647 static SELUPD_LIST *
648 stx_restore_selupd_list (THREAD_ENTRY * thread_p, char *ptr)
649 {
651 
652  if (ptr == NULL)
653  {
654  return NULL;
655  }
656 
657  selupd_list = (SELUPD_LIST *) stx_get_struct_visited_ptr (thread_p, ptr);
658  if (selupd_list != NULL)
659  {
660  return selupd_list;
661  }
662 
663  selupd_list = (SELUPD_LIST *) stx_alloc_struct (thread_p, sizeof (*selupd_list));
664  if (selupd_list == NULL)
665  {
667  return NULL;
668  }
669 
670  if (stx_mark_struct_visited (thread_p, ptr, selupd_list) == ER_FAILED
671  || stx_build_selupd_list (thread_p, ptr, selupd_list) == NULL)
672  {
673  return NULL;
674  }
675 
676  return selupd_list;
677 }
678 
679 static PRED_EXPR *
680 stx_restore_pred_expr (THREAD_ENTRY * thread_p, char *ptr)
681 {
682  PRED_EXPR *pred_expr;
683 
684  if (ptr == NULL)
685  {
686  return NULL;
687  }
688 
689  pred_expr = (PRED_EXPR *) stx_get_struct_visited_ptr (thread_p, ptr);
690  if (pred_expr != NULL)
691  {
692  return pred_expr;
693  }
694 
695  pred_expr = (PRED_EXPR *) stx_alloc_struct (thread_p, sizeof (*pred_expr));
696  if (pred_expr == NULL)
697  {
699  return NULL;
700  }
701 
702  if (stx_mark_struct_visited (thread_p, ptr, pred_expr) == ER_FAILED
703  || stx_build_pred_expr (thread_p, ptr, pred_expr) == NULL)
704  {
705  return NULL;
706  }
707 
708  return pred_expr;
709 }
710 
711 static REGU_VARIABLE *
713 {
714  REGU_VARIABLE *regu_var;
715 
716  if (ptr == NULL)
717  {
718  return NULL;
719  }
720 
721  regu_var = (REGU_VARIABLE *) stx_get_struct_visited_ptr (thread_p, ptr);
722  if (regu_var != NULL)
723  {
724  return regu_var;
725  }
726 
727  regu_var = (REGU_VARIABLE *) stx_alloc_struct (thread_p, sizeof (*regu_var));
728  if (regu_var == NULL)
729  {
731  return NULL;
732  }
733 
734  if (stx_mark_struct_visited (thread_p, ptr, regu_var) == ER_FAILED
735  || stx_build_regu_variable (thread_p, ptr, regu_var) == NULL)
736  {
737  return NULL;
738  }
739 
740  return regu_var;
741 }
742 
743 static SORT_LIST *
744 stx_restore_sort_list (THREAD_ENTRY * thread_p, char *ptr)
745 {
747 
748  if (ptr == NULL)
749  {
750  return NULL;
751  }
752 
753  sort_list = (SORT_LIST *) stx_get_struct_visited_ptr (thread_p, ptr);
754  if (sort_list != NULL)
755  {
756  return sort_list;
757  }
758 
759  sort_list = (SORT_LIST *) stx_alloc_struct (thread_p, sizeof (*sort_list));
760  if (sort_list == NULL)
761  {
763  return NULL;
764  }
765 
766  if (stx_mark_struct_visited (thread_p, ptr, sort_list) == ER_FAILED
767  || stx_build_sort_list (thread_p, ptr, sort_list) == NULL)
768  {
769  return NULL;
770  }
771 
772  return sort_list;
773 }
774 
775 static VAL_LIST *
776 stx_restore_val_list (THREAD_ENTRY * thread_p, char *ptr)
777 {
778  VAL_LIST *val_list;
779 
780  if (ptr == NULL)
781  {
782  return NULL;
783  }
784 
785  val_list = (VAL_LIST *) stx_get_struct_visited_ptr (thread_p, ptr);
786  if (val_list != NULL)
787  {
788  return val_list;
789  }
790 
791  val_list = (VAL_LIST *) stx_alloc_struct (thread_p, sizeof (*val_list));
792  if (val_list == NULL)
793  {
795  return NULL;
796  }
797 
798  if (stx_mark_struct_visited (thread_p, ptr, val_list) == ER_FAILED
799  || stx_build_val_list (thread_p, ptr, val_list) == NULL)
800  {
801  return NULL;
802  }
803 
804  return val_list;
805 }
806 
807 static DB_VALUE *
808 stx_restore_db_value (THREAD_ENTRY * thread_p, char *ptr)
809 {
810  DB_VALUE *value;
811 
812  if (ptr == NULL)
813  {
814  return NULL;
815  }
816 
817  value = (DB_VALUE *) stx_get_struct_visited_ptr (thread_p, ptr);
818  if (value != NULL)
819  {
820  return value;
821  }
822 
823  value = (DB_VALUE *) stx_alloc_struct (thread_p, sizeof (*value));
824  if (value == NULL)
825  {
827  return NULL;
828  }
829 
830  if (stx_mark_struct_visited (thread_p, ptr, value) == ER_FAILED || stx_build_db_value (thread_p, ptr, value) == NULL)
831  {
832  return NULL;
833  }
834 
835  return value;
836 }
837 
838 #if defined(ENABLE_UNUSED_FUNCTION)
839 static QPROC_DB_VALUE_LIST
840 stx_restore_db_value_list (THREAD_ENTRY * thread_p, char *ptr)
841 {
842  QPROC_DB_VALUE_LIST value_list;
843 
844  if (ptr == NULL)
845  {
846  return NULL;
847  }
848 
849  value_list = (QPROC_DB_VALUE_LIST) stx_get_struct_visited_ptr (thread_p, ptr);
850  if (value_list != NULL)
851  {
852  return value_list;
853  }
854 
855  value_list = (QPROC_DB_VALUE_LIST) stx_alloc_struct (thread_p, sizeof (*value_list));
856  if (value_list == NULL)
857  {
859  return NULL;
860  }
861 
862  if (stx_mark_struct_visited (thread_p, ptr, value_list) == ER_FAILED
863  || stx_build_db_value_list (thread_p, ptr, value_list) == NULL)
864  {
865  return NULL;
866  }
867 
868  return value_list;
869 }
870 #endif
871 
872 static XASL_NODE *
873 stx_restore_xasl_node (THREAD_ENTRY * thread_p, char *ptr)
874 {
875  XASL_NODE *xasl;
876 
877  if (ptr == NULL)
878  {
879  return NULL;
880  }
881 
882  xasl = (XASL_NODE *) stx_get_struct_visited_ptr (thread_p, ptr);
883  if (xasl != NULL)
884  {
885  return xasl;
886  }
887 
888  xasl = (XASL_NODE *) stx_alloc_struct (thread_p, sizeof (*xasl));
889  if (xasl == NULL)
890  {
892  return NULL;
893  }
894 
895  if (stx_mark_struct_visited (thread_p, ptr, xasl) == ER_FAILED || stx_build_xasl_node (thread_p, ptr, xasl) == NULL)
896  {
897  return NULL;
898  }
899 
900  return xasl;
901 }
902 
903 /*
904  * stx_restore_filter_pred_node () -
905  * return: unpacked pred_expr_with_context
906  * thread_entry(in):
907  * ptr(in): pointer to stream
908  *
909  * Note: returned pred is private_alloced and should be freed separately after
910  * pred->unpack_info.
911  */
912 static PRED_EXPR_WITH_CONTEXT *
914 {
916 
917  if (ptr == NULL)
918  {
919  return NULL;
920  }
921 
922  pred = (PRED_EXPR_WITH_CONTEXT *) db_private_alloc (thread_p, sizeof (*pred));
923  if (pred == NULL)
924  {
926  return NULL;
927  }
928 
929  if (stx_build_filter_pred_node (thread_p, ptr, pred) == NULL)
930  {
931  return NULL;
932  }
933 
934  return pred;
935 }
936 
937 static FUNC_PRED *
938 stx_restore_func_pred (THREAD_ENTRY * thread_p, char *ptr)
939 {
941 
942  if (ptr == NULL)
943  {
944  return NULL;
945  }
946 
947  func_pred = (FUNC_PRED *) stx_get_struct_visited_ptr (thread_p, ptr);
948  if (func_pred != NULL)
949  {
950  return func_pred;
951  }
952 
953  func_pred = (FUNC_PRED *) stx_alloc_struct (thread_p, sizeof (*func_pred));
954  if (func_pred == NULL)
955  {
957  return NULL;
958  }
959 
960  if (stx_mark_struct_visited (thread_p, ptr, func_pred) == ER_FAILED
961  || stx_build_func_pred (thread_p, ptr, func_pred) == NULL)
962  {
963  return NULL;
964  }
965 
966  return func_pred;
967 }
968 
969 static HEAP_CACHE_ATTRINFO *
971 {
972  HEAP_CACHE_ATTRINFO *cache_attrinfo;
973 
974  if (ptr == NULL)
975  {
976  return NULL;
977  }
978 
979  cache_attrinfo = (HEAP_CACHE_ATTRINFO *) stx_get_struct_visited_ptr (thread_p, ptr);
980  if (cache_attrinfo != NULL)
981  {
982  return cache_attrinfo;
983  }
984 
985  cache_attrinfo = (HEAP_CACHE_ATTRINFO *) stx_alloc_struct (thread_p, sizeof (*cache_attrinfo));
986  if (cache_attrinfo == NULL)
987  {
989  return NULL;
990  }
991 
992  if (stx_mark_struct_visited (thread_p, ptr, cache_attrinfo) == ER_FAILED || stx_build_cache_attrinfo (ptr) == NULL)
993  {
994  return NULL;
995  }
996 
997  return cache_attrinfo;
998 }
999 
1000 #if 0
1001 /* there are currently no pointers to these type of structures in xasl
1002  * so there is no need to have a separate restore function.
1003  */
1004 
1005 static MERGELIST_PROC_NODE *
1006 stx_restore_merge_list_info (char *ptr)
1007 {
1008  MERGELIST_PROC_NODE *merge_list_info;
1009 
1010  if (ptr == NULL)
1011  {
1012  return NULL;
1013  }
1014 
1015  merge_list_info = stx_get_struct_visited_ptr (thread_p, ptr);
1016  if (merge_list_info != NULL)
1017  {
1018  return merge_list_info;
1019  }
1020 
1021  merge_list_info = (MERGELIST_PROC_NODE *) stx_alloc_struct (sizeof (*merge_list_info));
1022  if (merge_list_info == NULL)
1023  {
1025  return NULL;
1026  }
1027 
1028  if (stx_mark_struct_visited (ptr, merge_list_info) == ER_FAILED
1029  || stx_build_merge_list_info (ptr, merge_list_info) == NULL)
1030  {
1031  return NULL;
1032  }
1033 
1034  return merge_list_info;
1035 }
1036 
1037 static QFILE_LIST_MERGE_INFO *
1038 stx_restore_ls_merge_info (char *ptr)
1039 {
1040  QFILE_LIST_MERGE_INFO *list_merge_info;
1041 
1042  if (ptr == NULL)
1043  {
1044  return NULL;
1045  }
1046 
1047  list_merge_info = stx_get_struct_visited_ptr (thread_p, ptr);
1048  if (list_merge_info != NULL)
1049  {
1050  return list_merge_info;
1051  }
1052 
1053  list_merge_info = (QFILE_LIST_MERGE_INFO *) stx_alloc_struct (sizeof (*list_merge_info));
1054  if (list_merge_info == NULL)
1055  {
1057  return NULL;
1058  }
1059 
1060  if (stx_mark_struct_visited (ptr, list_merge_info) == ER_FAILED
1061  || stx_build_ls_merge_info (ptr, list_merge_info) == NULL)
1062  {
1063  return NULL;
1064  }
1065 
1066  return list_merge_info;
1067 }
1068 
1069 static UPDATE_PROC_NODE *
1070 stx_restore_update_info (char *ptr)
1071 {
1072  UPDATE_PROC_NODE *update_info;
1073 
1074  if (ptr == NULL)
1075  {
1076  return NULL;
1077  }
1078 
1079  update_info = stx_get_struct_visited_ptr (thread_p, ptr);
1080  if (update_info != NULL)
1081  {
1082  return update_info;
1083  }
1084 
1085  update_info = (UPDATE_PROC_NODE *) stx_alloc_struct (sizeof (*update_info));
1086  if (update_info == NULL)
1087  {
1089  return NULL;
1090  }
1091 
1092  if (stx_mark_struct_visited (ptr, update_info) == ER_FAILED || stx_build_update_info (ptr, update_info) == NULL)
1093  {
1094  return NULL;
1095  }
1096 
1097  return update_info;
1098 }
1099 
1100 static DELETE_PROC_NODE *
1101 stx_restore_delete_info (char *ptr)
1102 {
1103  DELETE_PROC_NODE *delete_info;
1104 
1105  if (ptr == NULL)
1106  {
1107  return NULL;
1108  }
1109 
1110  delete_info = stx_get_struct_visited_ptr (thread_p, ptr);
1111  if (delete_info != NULL)
1112  {
1113  return delete_info;
1114  }
1115 
1116  delete_info = (DELETE_PROC_NODE *) stx_alloc_struct (sizeof (*delete_info));
1117  if (delete_info == NULL)
1118  {
1120  return NULL;
1121  }
1122 
1123  if (stx_mark_struct_visited (ptr, delete_info) == ER_FAILED || stx_build_delete_info (ptr, delete_info) == NULL)
1124  {
1125  return NULL;
1126  }
1127 
1128  return delete_info;
1129 }
1130 
1131 static INSERT_PROC_NODE *
1132 stx_restore_insert_info (char *ptr)
1133 {
1134  INSERT_PROC_NODE *insert_info;
1135 
1136  if (ptr == NULL)
1137  {
1138  return NULL;
1139  }
1140 
1141  insert_info = stx_get_struct_visited_ptr (thread_p, ptr);
1142  if (insert_info != NULL)
1143  {
1144  return insert_info;
1145  }
1146 
1147  insert_info = (INSERT_PROC_NODE *) stx_alloc_struct (sizeof (*insert_info));
1148  if (insert_info == NULL)
1149  {
1151  return NULL;
1152  }
1153 
1154  if (stx_mark_struct_visited (ptr, insert_info) == ER_FAILED || stx_build_insert_info (ptr, insert_info) == NULL)
1155  {
1156  return NULL;
1157  }
1158 
1159  return insert_info;
1160 }
1161 #endif /* 0 */
1162 
1163 static QFILE_LIST_ID *
1164 stx_restore_list_id (THREAD_ENTRY * thread_p, char *ptr)
1165 {
1166  QFILE_LIST_ID *list_id;
1167 
1168  if (ptr == NULL)
1169  {
1170  return NULL;
1171  }
1172 
1173  list_id = (QFILE_LIST_ID *) stx_get_struct_visited_ptr (thread_p, ptr);
1174  if (list_id != NULL)
1175  {
1176  return list_id;
1177  }
1178 
1179  list_id = (QFILE_LIST_ID *) stx_alloc_struct (thread_p, sizeof (QFILE_LIST_ID));
1180  if (list_id == NULL)
1181  {
1183  return NULL;
1184  }
1185  if (stx_mark_struct_visited (thread_p, ptr, list_id) == ER_FAILED
1186  || stx_build_list_id (thread_p, ptr, list_id) == NULL)
1187  {
1188  return NULL;
1189  }
1190 
1191  return list_id;
1192 }
1193 
1194 /*
1195  * stx_restore_method_sig_list () -
1196  *
1197  * Note: do not use or_unpack_method_sig_list ()
1198  */
1199 static METHOD_SIG_LIST *
1201 {
1203 
1204  if (ptr == NULL)
1205  {
1206  return NULL;
1207  }
1208 
1209  method_sig_list = (METHOD_SIG_LIST *) stx_get_struct_visited_ptr (thread_p, ptr);
1210  if (method_sig_list != NULL)
1211  {
1212  return method_sig_list;
1213  }
1214 
1215  method_sig_list = (METHOD_SIG_LIST *) stx_alloc_struct (thread_p, sizeof (METHOD_SIG_LIST));
1216  if (method_sig_list == NULL)
1217  {
1219  return NULL;
1220  }
1221  if (stx_mark_struct_visited (thread_p, ptr, method_sig_list) == ER_FAILED
1222  || stx_build_method_sig_list (thread_p, ptr, method_sig_list) == NULL)
1223  {
1224  return NULL;
1225  }
1226 
1227  return method_sig_list;
1228 }
1229 
1230 static METHOD_SIG *
1231 stx_restore_method_sig (THREAD_ENTRY * thread_p, char *ptr, int count)
1232 {
1233  METHOD_SIG *method_sig;
1234 
1235  if (ptr == NULL)
1236  {
1237  assert (count == 0);
1238  return NULL;
1239  }
1240 
1241  assert (count > 0);
1242 
1243  method_sig = (METHOD_SIG *) stx_get_struct_visited_ptr (thread_p, ptr);
1244  if (method_sig != NULL)
1245  {
1246  return method_sig;
1247  }
1248 
1249  method_sig = (METHOD_SIG *) stx_alloc_struct (thread_p, sizeof (METHOD_SIG));
1250  if (method_sig == NULL)
1251  {
1253  return NULL;
1254  }
1255 
1256  if (stx_mark_struct_visited (thread_p, ptr, method_sig) == ER_FAILED
1257  || stx_build_method_sig (thread_p, ptr, method_sig, count) == NULL)
1258  {
1259  return NULL;
1260  }
1261 
1262  return method_sig;
1263 }
1264 
1265 static DB_VALUE **
1266 stx_restore_db_value_array_extra (THREAD_ENTRY * thread_p, char *ptr, int nelements, int total_nelements)
1267 {
1268  DB_VALUE **value_array;
1269  int *ints;
1270  int i;
1271  int offset;
1273 
1274  value_array = (DB_VALUE **) stx_alloc_struct (thread_p, sizeof (DB_VALUE *) * total_nelements);
1275  if (value_array == NULL)
1276  {
1278  return NULL;
1279  }
1280  ints = stx_restore_int_array (thread_p, ptr, nelements);
1281  if (ints == NULL)
1282  {
1283  return NULL;
1284  }
1285 
1286  for (i = 0; i < nelements; i++)
1287  {
1288  offset = ints[i];
1289  value_array[i] = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1290  if (value_array[i] == NULL)
1291  {
1293  return NULL;
1294  }
1295  assert (value_array[i]->need_clear == false);
1296  }
1297 
1298  for (; i < total_nelements; ++i)
1299  {
1300  value_array[i] = NULL;
1301  }
1302  return value_array;
1303 }
1304 
1305 #if defined(ENABLE_UNUSED_FUNCTION)
1306 static TP_DOMAIN **
1307 stx_restore_domain_array (THREAD_ENTRY * thread_p, char *ptr, int nelements)
1308 {
1309  int i;
1310  TP_DOMAIN **domains;
1311 
1312  domains = (TP_DOMAIN **) stx_alloc_struct (thread_p, nelements * sizeof (TP_DOMAIN *));
1313  if (domains == NULL)
1314  {
1316  return NULL;
1317  }
1318  for (i = 0; i < nelements; ++i)
1319  {
1320  ptr = or_unpack_domain (ptr, &domains[i], NULL);
1321  }
1322 
1323  return domains;
1324 }
1325 #endif
1326 
1327 static int *
1328 stx_restore_int_array (THREAD_ENTRY * thread_p, char *ptr, int nelements)
1329 {
1330  int *int_array;
1331  int i;
1332 
1333  int_array = (int *) stx_alloc_struct (thread_p, sizeof (int) * nelements);
1334  if (int_array == NULL)
1335  {
1337  return NULL;
1338  }
1339  for (i = 0; i < nelements; ++i)
1340  {
1341  ptr = or_unpack_int (ptr, &int_array[i]);
1342  }
1343 
1344  return int_array;
1345 }
1346 
1347 static HFID *
1348 stx_restore_hfid_array (THREAD_ENTRY * thread_p, char *ptr, int nelements)
1349 {
1350  HFID *hfid_array;
1351  int i;
1352 
1353  hfid_array = (HFID *) stx_alloc_struct (thread_p, sizeof (HFID) * nelements);
1354  if (hfid_array == NULL)
1355  {
1357  return NULL;
1358  }
1359  for (i = 0; i < nelements; ++i)
1360  {
1361  ptr = or_unpack_hfid (ptr, &hfid_array[i]);
1362  }
1363 
1364  return hfid_array;
1365 }
1366 
1367 static OID *
1368 stx_restore_OID_array (THREAD_ENTRY * thread_p, char *ptr, int nelements)
1369 {
1370  OID *oid_array;
1371  int i;
1372 
1373  oid_array = (OID *) stx_alloc_struct (thread_p, sizeof (OID) * nelements);
1374  if (oid_array == NULL)
1375  {
1377  return NULL;
1378  }
1379  for (i = 0; i < nelements; i++)
1380  {
1381  ptr = or_unpack_oid (ptr, &oid_array[i]);
1382  }
1383 
1384  return oid_array;
1385 }
1386 
1387 #if defined(ENABLE_UNUSED_FUNCTION)
1388 static char *
1389 stx_restore_input_vals (THREAD_ENTRY * thread_p, char *ptr, int nelements)
1390 {
1391  char *input_vals;
1392 
1393  input_vals = stx_alloc_struct (thread_p, nelements);
1394  if (input_vals == NULL)
1395  {
1397  return NULL;
1398  }
1399  memmove (input_vals, ptr, nelements);
1400 
1401  return input_vals;
1402 }
1403 #endif
1404 
1405 /*
1406  * Restore the regu_variable_list as an array to avoid recursion in the server.
1407  * The array size is restored first, then the array.
1408  */
1409 static REGU_VARIABLE_LIST
1411 {
1412  REGU_VARIABLE_LIST regu_var_list;
1413  int offset;
1414  int total;
1415  int i;
1416  char *ptr2;
1418 
1419  regu_var_list = (REGU_VARIABLE_LIST) stx_get_struct_visited_ptr (thread_p, ptr);
1420  if (regu_var_list != NULL)
1421  {
1422  return regu_var_list;
1423  }
1424 
1425  ptr2 = or_unpack_int (ptr, &total);
1426  regu_var_list = (REGU_VARIABLE_LIST) stx_alloc_struct (thread_p, sizeof (struct regu_variable_list_node) * total);
1427  if (regu_var_list == NULL)
1428  {
1430  return NULL;
1431  }
1432  if (stx_mark_struct_visited (thread_p, ptr, regu_var_list) == ER_FAILED)
1433  {
1434  return NULL;
1435  }
1436 
1437  ptr = ptr2;
1438  for (i = 0; i < total; i++)
1439  {
1440  ptr = or_unpack_int (ptr, &offset);
1441  if (stx_build_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset], &regu_var_list[i].value) == NULL)
1442  {
1443  return NULL;
1444  }
1445 
1446  if (i < total - 1)
1447  {
1448  regu_var_list[i].next = (struct regu_variable_list_node *) &regu_var_list[i + 1];
1449  }
1450  else
1451  {
1452  regu_var_list[i].next = NULL;
1453  }
1454  }
1455 
1456  return regu_var_list;
1457 }
1458 
1459 static REGU_VARLIST_LIST
1461 {
1462  REGU_VARLIST_LIST regu_var_list_list;
1463  int offset;
1464  int total;
1465  int i;
1466  char *ptr2;
1468 
1469  regu_var_list_list = (REGU_VARLIST_LIST) stx_get_struct_visited_ptr (thread_p, ptr);
1470  if (regu_var_list_list != NULL)
1471  {
1472  return regu_var_list_list;
1473  }
1474 
1475  ptr2 = or_unpack_int (ptr, &total);
1476  regu_var_list_list = (REGU_VARLIST_LIST) stx_alloc_struct (thread_p, sizeof (struct regu_varlist_list_node) * total);
1477  if (regu_var_list_list == NULL)
1478  {
1480  return NULL;
1481  }
1482  if (stx_mark_struct_visited (thread_p, ptr, regu_var_list_list) == ER_FAILED)
1483  {
1484  return NULL;
1485  }
1486 
1487  ptr = ptr2;
1488  for (i = 0; i < total; i++)
1489  {
1490  ptr = or_unpack_int (ptr, &offset);
1491  regu_var_list_list[i].list = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1492  if (i < total - 1)
1493  {
1494  regu_var_list_list[i].next = (REGU_VARLIST_LIST) (&regu_var_list_list[i + 1]);
1495  }
1496  else
1497  {
1498  regu_var_list_list[i].next = NULL;
1499  }
1500  }
1501 
1502  return regu_var_list_list;
1503 }
1504 
1505 static KEY_RANGE *
1506 stx_restore_key_range_array (THREAD_ENTRY * thread_p, char *ptr, int nelements)
1507 {
1508  KEY_RANGE *key_range_array;
1509  int *ints;
1510  int i, j, offset;
1512 
1513  key_range_array = (KEY_RANGE *) stx_alloc_struct (thread_p, sizeof (KEY_RANGE) * nelements);
1514  if (key_range_array == NULL)
1515  {
1516  goto error;
1517  }
1518 
1519  ints = stx_restore_int_array (thread_p, ptr, 3 * nelements);
1520  if (ints == NULL)
1521  {
1522  return NULL;
1523  }
1524 
1525  for (i = 0, j = 0; i < nelements; i++, j++)
1526  {
1527  key_range_array[i].range = (RANGE) ints[j];
1528 
1529  offset = ints[++j];
1530  if (offset)
1531  {
1532  key_range_array[i].key1 = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1533  if (key_range_array[i].key1 == NULL)
1534  {
1535  goto error;
1536  }
1537  }
1538  else
1539  {
1540  key_range_array[i].key1 = NULL;
1541  }
1542 
1543  offset = ints[++j];
1544  if (offset)
1545  {
1546  key_range_array[i].key2 = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1547  if (key_range_array[i].key2 == NULL)
1548  {
1549  goto error;
1550  }
1551  }
1552  else
1553  {
1554  key_range_array[i].key2 = NULL;
1555  }
1556  }
1557 
1558  return key_range_array;
1559 
1560 error:
1562  return NULL;
1563 }
1564 
1565 /*
1566  * Restore access spec type list as an array to avoid recursion in the server.
1567  * The array size is restored first, then the array.
1568  */
1569 static ACCESS_SPEC_TYPE *
1570 stx_restore_access_spec_type (THREAD_ENTRY * thread_p, char **ptr, void *arg)
1571 {
1572  ACCESS_SPEC_TYPE *access_spec_type = NULL;
1573  int total, i;
1574 
1575  *ptr = or_unpack_int (*ptr, &total);
1576  if (total > 0)
1577  {
1578  access_spec_type = (ACCESS_SPEC_TYPE *) stx_alloc_struct (thread_p, sizeof (ACCESS_SPEC_TYPE) * total);
1579  if (access_spec_type == NULL)
1580  {
1582  return NULL;
1583  }
1584  }
1585 
1586  for (i = 0; i < total; i++)
1587  {
1588  *ptr = stx_build_access_spec_type (thread_p, *ptr, &access_spec_type[i], arg);
1589  if (*ptr == NULL)
1590  {
1592  return NULL;
1593  }
1594  if (i < total - 1)
1595  {
1596  access_spec_type[i].next = (ACCESS_SPEC_TYPE *) (&access_spec_type[i + 1]);
1597  }
1598  else
1599  {
1600  access_spec_type[i].next = NULL;
1601  }
1602  }
1603 
1604  return access_spec_type;
1605 }
1606 
1607 /*
1608  * stx_build_xasl_header () - Unpack XASL node header from buffer.
1609  *
1610  * return : buffer pointer after the unpacked XASL node header
1611  * thread_p (in) : thread entry
1612  * ptr (in) : buffer pointer where XASL node header is packed
1613  * xasl_header (out) : Unpacked XASL node header
1614  */
1615 static char *
1616 stx_build_xasl_header (THREAD_ENTRY * thread_p, char *ptr, XASL_NODE_HEADER * xasl_header)
1617 {
1618  if (ptr == NULL)
1619  {
1620  return NULL;
1621  }
1622  ASSERT_ALIGN (ptr, INT_ALIGNMENT);
1623 
1624  OR_UNPACK_XASL_NODE_HEADER (ptr, xasl_header);
1625  return ptr;
1626 }
1627 
1628 static char *
1629 stx_build_xasl_node (THREAD_ENTRY * thread_p, char *ptr, XASL_NODE * xasl)
1630 {
1631  int offset;
1632  int tmp;
1634 
1635  /* initialize query_in_progress flag */
1636  xasl->query_in_progress = false;
1637 
1638  /* XASL node header is packed first */
1639  ptr = stx_build_xasl_header (thread_p, ptr, &xasl->header);
1640 
1641  ptr = or_unpack_int (ptr, &tmp);
1642  xasl->type = (PROC_TYPE) tmp;
1643 
1644  ptr = or_unpack_int (ptr, &xasl->flag);
1645 
1646  /* initialize xasl status */
1647  xasl->status = XASL_INITIALIZED;
1648 
1649  ptr = or_unpack_int (ptr, &offset);
1650  if (offset == 0)
1651  {
1652  xasl->list_id = NULL;
1653  }
1654  else
1655  {
1656  xasl->list_id = stx_restore_list_id (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1657  if (xasl->list_id == NULL)
1658  {
1659  goto error;
1660  }
1661  }
1662 
1663  ptr = or_unpack_int (ptr, &offset);
1664  if (offset == 0)
1665  {
1666  xasl->after_iscan_list = NULL;
1667  }
1668  else
1669  {
1670  xasl->after_iscan_list = stx_restore_sort_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1671  if (xasl->after_iscan_list == NULL)
1672  {
1673  goto error;
1674  }
1675  }
1676 
1677  ptr = or_unpack_int (ptr, &offset);
1678  if (offset == 0)
1679  {
1680  xasl->orderby_list = NULL;
1681  }
1682  else
1683  {
1684  xasl->orderby_list = stx_restore_sort_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1685  if (xasl->orderby_list == NULL)
1686  {
1687  goto error;
1688  }
1689  }
1690 
1691  ptr = or_unpack_int (ptr, &offset);
1692  if (offset == 0)
1693  {
1694  xasl->ordbynum_pred = NULL;
1695  }
1696  else
1697  {
1698  xasl->ordbynum_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1699  if (xasl->ordbynum_pred == NULL)
1700  {
1701  goto error;
1702  }
1703  }
1704 
1705  ptr = or_unpack_int (ptr, &offset);
1706  if (offset == 0)
1707  {
1708  xasl->ordbynum_val = NULL;
1709  }
1710  else
1711  {
1712  xasl->ordbynum_val = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1713  if (xasl->ordbynum_val == NULL)
1714  {
1715  goto error;
1716  }
1717  assert (xasl->ordbynum_val->need_clear == false);
1718  }
1719 
1720  ptr = or_unpack_int (ptr, &offset);
1721  if (offset == 0)
1722  {
1723  xasl->orderby_limit = NULL;
1724  }
1725  else
1726  {
1727  xasl->orderby_limit = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1728  if (xasl->orderby_limit == NULL)
1729  {
1730  goto error;
1731  }
1732  }
1733 
1734  ptr = or_unpack_int (ptr, (int *) &xasl->ordbynum_flag);
1735 
1736  xasl->topn_items = NULL;
1737 
1738  ptr = or_unpack_int (ptr, &offset);
1739  if (offset == 0)
1740  {
1741  xasl->limit_offset = NULL;
1742  }
1743  else
1744  {
1745  xasl->limit_offset = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1746  if (xasl->limit_offset == NULL)
1747  {
1748  goto error;
1749  }
1750  }
1751 
1752  ptr = or_unpack_int (ptr, &offset);
1753  if (offset == 0)
1754  {
1755  xasl->limit_row_count = NULL;
1756  }
1757  else
1758  {
1759  xasl->limit_row_count = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1760  if (xasl->limit_row_count == NULL)
1761  {
1762  goto error;
1763  }
1764  }
1765 
1766  ptr = or_unpack_int (ptr, &offset);
1767  if (offset == 0)
1768  {
1769  xasl->single_tuple = NULL;
1770  }
1771  else
1772  {
1773  xasl->single_tuple = stx_restore_val_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1774  if (xasl->single_tuple == NULL)
1775  {
1776  goto error;
1777  }
1778  }
1779 
1780  ptr = or_unpack_int (ptr, &xasl->is_single_tuple);
1781 
1782  ptr = or_unpack_int (ptr, &tmp);
1783  xasl->option = (QUERY_OPTIONS) tmp;
1784 
1785  ptr = or_unpack_int (ptr, &offset);
1786  if (offset == 0)
1787  {
1788  xasl->outptr_list = NULL;
1789  }
1790  else
1791  {
1792  xasl->outptr_list = stx_restore_outptr_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1793  if (xasl->outptr_list == NULL)
1794  {
1795  goto error;
1796  }
1797  }
1798 
1799  ptr = or_unpack_int (ptr, &offset);
1800  if (offset == 0)
1801  {
1802  xasl->selected_upd_list = NULL;
1803  }
1804  else
1805  {
1806  xasl->selected_upd_list = stx_restore_selupd_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1807  if (xasl->selected_upd_list == NULL)
1808  {
1809  goto error;
1810  }
1811  }
1812 
1813  xasl->spec_list = stx_restore_access_spec_type (thread_p, &ptr, (void *) xasl->outptr_list);
1814 
1815  xasl->merge_spec = stx_restore_access_spec_type (thread_p, &ptr, NULL);
1816  if (ptr == NULL)
1817  {
1819  return NULL;
1820  }
1821 
1822  ptr = or_unpack_int (ptr, &offset);
1823  if (offset == 0)
1824  {
1825  xasl->val_list = NULL;
1826  }
1827  else
1828  {
1829  xasl->val_list = stx_restore_val_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1830  if (xasl->val_list == NULL)
1831  {
1832  goto error;
1833  }
1834  }
1835 
1836  ptr = or_unpack_int (ptr, &offset);
1837  if (offset == 0)
1838  {
1839  xasl->merge_val_list = NULL;
1840  }
1841  else
1842  {
1843  xasl->merge_val_list = stx_restore_val_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1844  if (xasl->merge_val_list == NULL)
1845  {
1846  goto error;
1847  }
1848  }
1849 
1850  ptr = or_unpack_int (ptr, &offset);
1851  if (offset == 0)
1852  {
1853  xasl->aptr_list = NULL;
1854  }
1855  else
1856  {
1857  xasl->aptr_list = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1858  if (xasl->aptr_list == NULL)
1859  {
1860  goto error;
1861  }
1862  }
1863 
1864  ptr = or_unpack_int (ptr, &offset);
1865  if (offset == 0)
1866  {
1867  xasl->bptr_list = NULL;
1868  }
1869  else
1870  {
1871  xasl->bptr_list = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1872  if (xasl->bptr_list == NULL)
1873  {
1874  goto error;
1875  }
1876  }
1877 
1878  ptr = or_unpack_int (ptr, &offset);
1879  if (offset == 0)
1880  {
1881  xasl->dptr_list = NULL;
1882  }
1883  else
1884  {
1885  xasl->dptr_list = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1886  if (xasl->dptr_list == NULL)
1887  {
1888  goto error;
1889  }
1890  }
1891 
1892  ptr = or_unpack_int (ptr, &offset);
1893  if (offset == 0)
1894  {
1895  xasl->after_join_pred = NULL;
1896  }
1897  else
1898  {
1899  xasl->after_join_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1900  if (xasl->after_join_pred == NULL)
1901  {
1902  goto error;
1903  }
1904  }
1905 
1906  ptr = or_unpack_int (ptr, &offset);
1907  if (offset == 0)
1908  {
1909  xasl->if_pred = NULL;
1910  }
1911  else
1912  {
1913  xasl->if_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1914  if (xasl->if_pred == NULL)
1915  {
1916  goto error;
1917  }
1918  }
1919 
1920  ptr = or_unpack_int (ptr, &offset);
1921  if (offset == 0)
1922  {
1923  xasl->instnum_pred = NULL;
1924  }
1925  else
1926  {
1927  xasl->instnum_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1928  if (xasl->instnum_pred == NULL)
1929  {
1930  goto error;
1931  }
1932  }
1933 
1934  ptr = or_unpack_int (ptr, &offset);
1935  if (offset == 0)
1936  {
1937  xasl->instnum_val = NULL;
1938  }
1939  else
1940  {
1941  xasl->instnum_val = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1942  if (xasl->instnum_val == NULL)
1943  {
1944  goto error;
1945  }
1946  assert (xasl->instnum_val->need_clear == false);
1947  }
1948 
1949  ptr = or_unpack_int (ptr, &offset);
1950  if (offset == 0)
1951  {
1952  xasl->save_instnum_val = NULL;
1953  }
1954  else
1955  {
1956  xasl->save_instnum_val = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1957  if (xasl->save_instnum_val == NULL)
1958  {
1959  goto error;
1960  }
1961  assert (xasl->save_instnum_val->need_clear == false);
1962  }
1963 
1964  ptr = or_unpack_int (ptr, (int *) &xasl->instnum_flag);
1965 
1966  ptr = or_unpack_int (ptr, &offset);
1967  if (offset == 0)
1968  {
1969  xasl->fptr_list = NULL;
1970  }
1971  else
1972  {
1973  xasl->fptr_list = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1974  if (xasl->fptr_list == NULL)
1975  {
1976  goto error;
1977  }
1978  }
1979 
1980  ptr = or_unpack_int (ptr, &offset);
1981  if (offset == 0)
1982  {
1983  xasl->scan_ptr = NULL;
1984  }
1985  else
1986  {
1987  xasl->scan_ptr = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
1988  if (xasl->scan_ptr == NULL)
1989  {
1990  goto error;
1991  }
1992  }
1993 
1994  ptr = or_unpack_int (ptr, &offset);
1995  if (offset == 0)
1996  {
1997  xasl->connect_by_ptr = NULL;
1998  }
1999  else
2000  {
2001  xasl->connect_by_ptr = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2002  if (xasl->connect_by_ptr == NULL)
2003  {
2004  goto error;
2005  }
2006  }
2007 
2008  ptr = or_unpack_int (ptr, &offset);
2009  if (offset == 0)
2010  {
2011  xasl->level_val = NULL;
2012  }
2013  else
2014  {
2015  xasl->level_val = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2016  if (xasl->level_val == NULL)
2017  {
2018  goto error;
2019  }
2020  assert (xasl->level_val->need_clear == false);
2021  }
2022 
2023  ptr = or_unpack_int (ptr, &offset);
2024  if (offset == 0)
2025  {
2026  xasl->level_regu = NULL;
2027  }
2028  else
2029  {
2030  xasl->level_regu = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2031  if (xasl->level_regu == NULL)
2032  {
2033  goto error;
2034  }
2035  }
2036 
2037  ptr = or_unpack_int (ptr, &offset);
2038  if (offset == 0)
2039  {
2040  xasl->isleaf_val = NULL;
2041  }
2042  else
2043  {
2044  xasl->isleaf_val = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2045  if (xasl->isleaf_val == NULL)
2046  {
2047  goto error;
2048  }
2049  assert (xasl->isleaf_val->need_clear == false);
2050  }
2051 
2052  ptr = or_unpack_int (ptr, &offset);
2053  if (offset == 0)
2054  {
2055  xasl->isleaf_regu = NULL;
2056  }
2057  else
2058  {
2059  xasl->isleaf_regu = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2060  if (xasl->isleaf_regu == NULL)
2061  {
2062  goto error;
2063  }
2064  }
2065 
2066  ptr = or_unpack_int (ptr, &offset);
2067  if (offset == 0)
2068  {
2069  xasl->iscycle_val = NULL;
2070  }
2071  else
2072  {
2073  xasl->iscycle_val = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2074  if (xasl->iscycle_val == NULL)
2075  {
2076  goto error;
2077  }
2078  assert (xasl->iscycle_val->need_clear == false);
2079  }
2080 
2081  ptr = or_unpack_int (ptr, &offset);
2082  if (offset == 0)
2083  {
2084  xasl->iscycle_regu = NULL;
2085  }
2086  else
2087  {
2088  xasl->iscycle_regu = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2089  if (xasl->iscycle_regu == NULL)
2090  {
2091  goto error;
2092  }
2093  }
2094 
2095  xasl->curr_spec = stx_restore_access_spec_type (thread_p, &ptr, NULL);
2096 
2097  ptr = or_unpack_int (ptr, &xasl->next_scan_on);
2098 
2099  ptr = or_unpack_int (ptr, &xasl->next_scan_block_on);
2100 
2101  ptr = or_unpack_int (ptr, &xasl->cat_fetched);
2102 
2103  ptr = or_unpack_int (ptr, &tmp);
2104  xasl->scan_op_type = (SCAN_OPERATION_TYPE) tmp;
2105 
2106  ptr = or_unpack_int (ptr, &xasl->upd_del_class_cnt);
2107 
2108  ptr = or_unpack_int (ptr, &xasl->mvcc_reev_extra_cls_cnt);
2109 
2110 #if defined (ENABLE_COMPOSITE_LOCK)
2111  /*
2112  * Note that the composite lock block is strictly a server side block
2113  * and was not packed. We'll simply clear the memory.
2114  */
2115  memset (&xasl->composite_lock, 0, sizeof (LK_COMPOSITE_LOCK));
2116 #endif /* defined (ENABLE_COMPOSITE_LOCK) */
2117 
2118  switch (xasl->type)
2119  {
2120  case CONNECTBY_PROC:
2121  ptr = stx_build_connectby_proc (thread_p, ptr, &xasl->proc.connect_by);
2122  break;
2123 
2124  case BUILDLIST_PROC:
2125  ptr = stx_build_buildlist_proc (thread_p, ptr, &xasl->proc.buildlist);
2126  break;
2127 
2128  case BUILDVALUE_PROC:
2129  ptr = stx_build_buildvalue_proc (thread_p, ptr, &xasl->proc.buildvalue);
2130  break;
2131 
2132  case MERGELIST_PROC:
2133  ptr = stx_build_mergelist_proc (thread_p, ptr, &xasl->proc.mergelist);
2134  break;
2135 
2136  case UPDATE_PROC:
2137  ptr = stx_build_update_proc (thread_p, ptr, &xasl->proc.update);
2138  break;
2139 
2140  case DELETE_PROC:
2141  ptr = stx_build_delete_proc (thread_p, ptr, &xasl->proc.delete_);
2142  break;
2143 
2144  case INSERT_PROC:
2145  ptr = stx_build_insert_proc (thread_p, ptr, &xasl->proc.insert);
2146  break;
2147 
2148  case UNION_PROC:
2149  case DIFFERENCE_PROC:
2150  case INTERSECTION_PROC:
2151  ptr = stx_build_union_proc (thread_p, ptr, &xasl->proc.union_);
2152  break;
2153 
2154  case OBJFETCH_PROC:
2155  ptr = stx_build_fetch_proc (thread_p, ptr, &xasl->proc.fetch);
2156  break;
2157 
2158  case SCAN_PROC:
2159  break;
2160 
2161  case DO_PROC:
2162  break;
2163 
2164  case BUILD_SCHEMA_PROC:
2165  break;
2166 
2167  case MERGE_PROC:
2168  ptr = stx_build_merge_proc (thread_p, ptr, &xasl->proc.merge);
2169  break;
2170 
2171  case CTE_PROC:
2172  ptr = stx_build_cte_proc (thread_p, ptr, &xasl->proc.cte);
2173  break;
2174 
2175  default:
2177  return NULL;
2178  }
2179 
2180  if (ptr == NULL)
2181  {
2182  return NULL;
2183  }
2184 
2185  ptr = or_unpack_int (ptr, (int *) &xasl->projected_size);
2186  ptr = or_unpack_double (ptr, (double *) &xasl->cardinality);
2187 
2188  ptr = or_unpack_int (ptr, &tmp);
2189  xasl->iscan_oid_order = (bool) tmp;
2190 
2191  xasl->query_alias = stx_restore_string (thread_p, ptr);
2192  assert (xasl->query_alias != NULL);
2193 
2194  ptr = or_unpack_int (ptr, &offset);
2195  if (offset == 0)
2196  {
2197  xasl->next = NULL;
2198  }
2199  else
2200  {
2201  xasl->next = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2202  if (xasl->next == NULL)
2203  {
2204  goto error;
2205  }
2206  }
2207 
2208  memset (&xasl->orderby_stats, 0, sizeof (xasl->orderby_stats));
2209  memset (&xasl->groupby_stats, 0, sizeof (xasl->groupby_stats));
2210  memset (&xasl->xasl_stats, 0, sizeof (xasl->xasl_stats));
2211  xasl->max_iterations = -1;
2212 
2213  return ptr;
2214 
2215 error:
2217  return NULL;
2218 }
2219 
2220 static char *
2222 {
2223  int offset;
2225 
2226  ptr = or_unpack_int (ptr, &offset);
2227  if (offset == 0)
2228  {
2229  pred->pred = NULL;
2230  }
2231  else
2232  {
2233  pred->pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2234  if (pred->pred == NULL)
2235  {
2236  goto error;
2237  }
2238  }
2239 
2240  ptr = or_unpack_int (ptr, &pred->num_attrs_pred);
2241  ptr = or_unpack_int (ptr, &offset);
2242  if (offset == 0 || pred->num_attrs_pred == 0)
2243  {
2244  pred->attrids_pred = NULL;
2245  }
2246  else
2247  {
2248  pred->attrids_pred =
2249  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], pred->num_attrs_pred);
2250  if (pred->attrids_pred == NULL)
2251  {
2252  goto error;
2253  }
2254  }
2255 
2256  ptr = or_unpack_int (ptr, &offset);
2257  if (offset == 0)
2258  {
2259  pred->cache_pred = NULL;
2260  }
2261  else
2262  {
2263  pred->cache_pred = stx_restore_cache_attrinfo (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2264  if (pred->cache_pred == NULL)
2265  {
2266  goto error;
2267  }
2268  }
2269 
2270  return ptr;
2271 error:
2273  return NULL;
2274 }
2275 
2276 static char *
2278 {
2279  int offset;
2281 
2282  ptr = or_unpack_int (ptr, &offset);
2283  if (offset == 0)
2284  {
2285  func_pred->func_regu = NULL;
2286  }
2287  else
2288  {
2289  func_pred->func_regu = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2290  if (func_pred->func_regu == NULL)
2291  {
2292  goto error;
2293  }
2294  }
2295 
2296  ptr = or_unpack_int (ptr, &offset);
2297  if (offset == 0)
2298  {
2299  func_pred->cache_attrinfo = NULL;
2300  }
2301  else
2302  {
2303  func_pred->cache_attrinfo = stx_restore_cache_attrinfo (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2304  if (func_pred->cache_attrinfo == NULL)
2305  {
2306  goto error;
2307  }
2308  }
2309 
2310  return ptr;
2311 error:
2313  return NULL;
2314 }
2315 
2316 static char *
2318 {
2319  int dummy;
2320 
2321  /* unpack the zero int that is sent mainly as a placeholder */
2322  ptr = or_unpack_int (ptr, &dummy);
2323 
2324  return ptr;
2325 }
2326 
2327 static char *
2328 stx_build_list_id (THREAD_ENTRY * thread_p, char *ptr, QFILE_LIST_ID * listid)
2329 {
2330  ptr = or_unpack_listid (ptr, listid);
2331 
2332  if (listid->type_list.type_cnt < 0)
2333  {
2334  goto error;
2335  }
2336 
2337  assert_release (listid->type_list.type_cnt == 0);
2338  assert_release (listid->type_list.domp == NULL);
2339 
2340 #if 0 /* DEAD CODE - for defense code */
2341  if (listid->type_list.type_cnt > 0)
2342  {
2343  int count, i;
2344 
2345  count = listid->type_list.type_cnt;
2346 
2347  /* TODO - need to replace with stx_alloc_struct to make tracking */
2348  listid->type_list.domp = (TP_DOMAIN **) db_private_alloc (thread_p, sizeof (TP_DOMAIN *) * count);
2349 
2350  if (listid->type_list.domp == NULL)
2351  {
2352  goto error;
2353  }
2354 
2355  for (i = 0; i < count; i++)
2356  {
2357  ptr = or_unpack_domain (ptr, &listid->type_list.domp[i], NULL);
2358  }
2359  }
2360 #endif
2361 
2362  return ptr;
2363 error:
2365  return NULL;
2366 }
2367 
2368 static char *
2370 {
2371  int offset;
2373 
2374  ptr = or_unpack_int (ptr, (int *) &method_sig_list->num_methods);
2375 
2376  ptr = or_unpack_int (ptr, &offset);
2377  if (offset == 0)
2378  {
2379  method_sig_list->method_sig = NULL;
2380  }
2381  else
2382  {
2383  method_sig_list->method_sig =
2384  stx_restore_method_sig (thread_p, &xasl_unpack_info->packed_xasl[offset], method_sig_list->num_methods);
2385  if (method_sig_list->method_sig == NULL)
2386  {
2387  goto error;
2388  }
2389  }
2390 
2391 #if !defined(NDEBUG)
2392  {
2393  int i = 0;
2394  METHOD_SIG *sig;
2395 
2396  for (sig = method_sig_list->method_sig; sig; sig = sig->next)
2397  {
2398  i++;
2399  }
2400  assert (method_sig_list->num_methods == i);
2401  }
2402 #endif
2403 
2404  return ptr;
2405 
2406 error:
2408  return NULL;
2409 }
2410 
2411 static char *
2412 stx_build_method_sig (THREAD_ENTRY * thread_p, char *ptr, METHOD_SIG * method_sig, int count)
2413 {
2414  int offset;
2415  int num_args, n;
2417 
2418  method_sig->method_name = stx_restore_string (thread_p, ptr);
2419  if (method_sig->method_name == NULL)
2420  {
2421  assert (false);
2422  goto error;
2423  }
2424 
2425  /* is can be null */
2426  method_sig->class_name = stx_restore_string (thread_p, ptr);
2427 
2428  ptr = or_unpack_int (ptr, (int *) &method_sig->method_type);
2429  ptr = or_unpack_int (ptr, &method_sig->num_method_args);
2430 
2431  num_args = method_sig->num_method_args + 1;
2432 
2433  method_sig->method_arg_pos = (int *) stx_alloc_struct (thread_p, sizeof (int) * num_args);
2434  if (method_sig->method_arg_pos == NULL)
2435  {
2436  goto error;
2437  }
2438 
2439  for (n = 0; n < num_args; n++)
2440  {
2441  ptr = or_unpack_int (ptr, &(method_sig->method_arg_pos[n]));
2442  }
2443 
2444  ptr = or_unpack_int (ptr, &offset);
2445  if (offset == 0)
2446  {
2447  method_sig->next = NULL;
2448  }
2449  else
2450  {
2451  method_sig->next = stx_restore_method_sig (thread_p, &xasl_unpack_info->packed_xasl[offset], count - 1);
2452  if (method_sig->next == NULL)
2453  {
2454  goto error;
2455  }
2456  }
2457 
2458  return ptr;
2459 
2460 error:
2462  return NULL;
2463 }
2464 
2465 static char *
2466 stx_build_union_proc (THREAD_ENTRY * thread_p, char *ptr, UNION_PROC_NODE * union_proc)
2467 {
2468  int offset;
2470 
2471  ptr = or_unpack_int (ptr, &offset);
2472  if (offset == 0)
2473  {
2474  union_proc->left = NULL;
2475  }
2476  else
2477  {
2478  union_proc->left = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2479  if (union_proc->left == NULL)
2480  {
2482  return NULL;
2483  }
2484  }
2485 
2486  ptr = or_unpack_int (ptr, &offset);
2487  if (offset == 0)
2488  {
2489  union_proc->right = NULL;
2490  }
2491  else
2492  {
2493  union_proc->right = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2494  if (union_proc->right == NULL)
2495  {
2497  return NULL;
2498  }
2499  }
2500 
2501  return ptr;
2502 }
2503 
2504 static char *
2505 stx_build_fetch_proc (THREAD_ENTRY * thread_p, char *ptr, FETCH_PROC_NODE * obj_set_fetch_proc)
2506 {
2507  int offset;
2509  int i;
2510 
2511  ptr = or_unpack_int (ptr, &offset);
2512  if (offset == 0)
2513  {
2514  obj_set_fetch_proc->arg = NULL;
2515  }
2516  else
2517  {
2518  obj_set_fetch_proc->arg = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2519  if (obj_set_fetch_proc->arg == NULL)
2520  {
2522  return NULL;
2523  }
2524  assert (obj_set_fetch_proc->arg->need_clear == false);
2525  }
2526 
2527  ptr = or_unpack_int (ptr, &i);
2528  obj_set_fetch_proc->fetch_res = (bool) i;
2529 
2530  ptr = or_unpack_int (ptr, &offset);
2531  if (offset == 0)
2532  {
2533  obj_set_fetch_proc->set_pred = NULL;
2534  }
2535  else
2536  {
2537  obj_set_fetch_proc->set_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2538  if (obj_set_fetch_proc->set_pred == NULL)
2539  {
2541  return NULL;
2542  }
2543  }
2544 
2545  ptr = or_unpack_int (ptr, &i);
2546  obj_set_fetch_proc->ql_flag = (bool) i;
2547 
2548  return ptr;
2549 }
2550 
2551 static char *
2552 stx_build_buildlist_proc (THREAD_ENTRY * thread_p, char *ptr, BUILDLIST_PROC_NODE * stx_build_list_proc)
2553 {
2554  int offset;
2556 
2557  stx_build_list_proc->output_columns = (DB_VALUE **) 0;
2558  stx_build_list_proc->upddel_oid_locator_ehids = NULL;
2559 
2560  ptr = or_unpack_int (ptr, &offset);
2561  if (offset == 0)
2562  {
2563  stx_build_list_proc->eptr_list = NULL;
2564  }
2565  else
2566  {
2567  stx_build_list_proc->eptr_list = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2568  if (stx_build_list_proc->eptr_list == NULL)
2569  {
2570  goto error;
2571  }
2572  }
2573 
2574  ptr = or_unpack_int (ptr, &offset);
2575  if (offset == 0)
2576  {
2577  stx_build_list_proc->groupby_list = NULL;
2578  }
2579  else
2580  {
2581  stx_build_list_proc->groupby_list = stx_restore_sort_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2582  if (stx_build_list_proc->groupby_list == NULL)
2583  {
2584  goto error;
2585  }
2586  }
2587 
2588  ptr = or_unpack_int (ptr, &offset);
2589  if (offset == 0)
2590  {
2591  stx_build_list_proc->after_groupby_list = NULL;
2592  }
2593  else
2594  {
2595  stx_build_list_proc->after_groupby_list =
2596  stx_restore_sort_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2597  if (stx_build_list_proc->after_groupby_list == NULL)
2598  {
2599  goto error;
2600  }
2601  }
2602 
2603  ptr = or_unpack_int (ptr, &offset);
2604  if (offset == 0)
2605  {
2606  stx_build_list_proc->push_list_id = NULL;
2607  }
2608  else
2609  {
2610  stx_build_list_proc->push_list_id = stx_restore_list_id (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2611  if (stx_build_list_proc->push_list_id == NULL)
2612  {
2613  goto error;
2614  }
2615  }
2616 
2617  ptr = or_unpack_int (ptr, &offset);
2618  if (offset == 0)
2619  {
2620  stx_build_list_proc->g_outptr_list = NULL;
2621  }
2622  else
2623  {
2624  stx_build_list_proc->g_outptr_list = stx_restore_outptr_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2625  if (stx_build_list_proc->g_outptr_list == NULL)
2626  {
2627  goto error;
2628  }
2629  }
2630 
2631  ptr = or_unpack_int (ptr, &offset);
2632  if (offset == 0)
2633  {
2634  stx_build_list_proc->g_regu_list = NULL;
2635  }
2636  else
2637  {
2638  stx_build_list_proc->g_regu_list =
2639  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2640  if (stx_build_list_proc->g_regu_list == NULL)
2641  {
2642  goto error;
2643  }
2644  }
2645 
2646  ptr = or_unpack_int (ptr, &offset);
2647  if (offset == 0)
2648  {
2649  stx_build_list_proc->g_val_list = NULL;
2650  }
2651  else
2652  {
2653  stx_build_list_proc->g_val_list = stx_restore_val_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2654  if (stx_build_list_proc->g_val_list == NULL)
2655  {
2656  goto error;
2657  }
2658  }
2659 
2660  ptr = or_unpack_int (ptr, &offset);
2661  if (offset == 0)
2662  {
2663  stx_build_list_proc->g_having_pred = NULL;
2664  }
2665  else
2666  {
2667  stx_build_list_proc->g_having_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2668  if (stx_build_list_proc->g_having_pred == NULL)
2669  {
2670  goto error;
2671  }
2672  }
2673 
2674  ptr = or_unpack_int (ptr, &offset);
2675  if (offset == 0)
2676  {
2677  stx_build_list_proc->g_grbynum_pred = NULL;
2678  }
2679  else
2680  {
2681  stx_build_list_proc->g_grbynum_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2682  if (stx_build_list_proc->g_grbynum_pred == NULL)
2683  {
2684  goto error;
2685  }
2686  }
2687 
2688  ptr = or_unpack_int (ptr, &offset);
2689  if (offset == 0)
2690  {
2691  stx_build_list_proc->g_grbynum_val = NULL;
2692  }
2693  else
2694  {
2695  stx_build_list_proc->g_grbynum_val = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2696  if (stx_build_list_proc->g_grbynum_val == NULL)
2697  {
2698  goto error;
2699  }
2700  assert (stx_build_list_proc->g_grbynum_val->need_clear == false);
2701  }
2702 
2703  ptr = or_unpack_int (ptr, (int *) &stx_build_list_proc->g_hash_eligible);
2704  stx_build_list_proc->agg_hash_context =
2705  (AGGREGATE_HASH_CONTEXT *) stx_alloc_struct (thread_p, sizeof (*stx_build_list_proc->agg_hash_context));
2706  std::memset (stx_build_list_proc->agg_hash_context, 0, sizeof (*stx_build_list_proc->agg_hash_context));
2707 
2708  ptr = or_unpack_int (ptr, (int *) &stx_build_list_proc->g_output_first_tuple);
2709  ptr = or_unpack_int (ptr, (int *) &stx_build_list_proc->g_hkey_size);
2710 
2711  ptr = or_unpack_int (ptr, &offset);
2712  if (offset == 0)
2713  {
2714  stx_build_list_proc->g_hk_scan_regu_list = NULL;
2715  }
2716  else
2717  {
2718  stx_build_list_proc->g_hk_scan_regu_list =
2719  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2720  if (stx_build_list_proc->g_hk_scan_regu_list == NULL)
2721  {
2722  goto error;
2723  }
2724  }
2725 
2726  ptr = or_unpack_int (ptr, &offset);
2727  if (offset == 0)
2728  {
2729  stx_build_list_proc->g_hk_sort_regu_list = NULL;
2730  }
2731  else
2732  {
2733  stx_build_list_proc->g_hk_sort_regu_list =
2734  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2735  if (stx_build_list_proc->g_hk_sort_regu_list == NULL)
2736  {
2737  goto error;
2738  }
2739  }
2740 
2741  ptr = or_unpack_int (ptr, &offset);
2742  if (offset == 0)
2743  {
2744  stx_build_list_proc->g_scan_regu_list = NULL;
2745  }
2746  else
2747  {
2748  stx_build_list_proc->g_scan_regu_list =
2749  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2750  if (stx_build_list_proc->g_scan_regu_list == NULL)
2751  {
2752  goto error;
2753  }
2754  }
2755 
2756  ptr = or_unpack_int (ptr, (int *) &stx_build_list_proc->g_func_count);
2757  ptr = or_unpack_int (ptr, (int *) &stx_build_list_proc->g_grbynum_flag);
2758  ptr = or_unpack_int (ptr, (int *) &stx_build_list_proc->g_with_rollup);
2759 
2760  ptr = or_unpack_int (ptr, &offset);
2761  if (offset == 0)
2762  {
2763  stx_build_list_proc->g_agg_list = NULL;
2764  }
2765  else
2766  {
2767  stx_build_list_proc->g_agg_list = stx_restore_aggregate_type (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2768  if (stx_build_list_proc->g_agg_list == NULL)
2769  {
2770  goto error;
2771  }
2772  }
2773 
2774  ptr = or_unpack_int (ptr, &offset);
2775  if (offset == 0)
2776  {
2777  stx_build_list_proc->a_eval_list = NULL;
2778  }
2779  else
2780  {
2781  stx_build_list_proc->a_eval_list =
2782  stx_restore_analytic_eval_type (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2783  if (stx_build_list_proc->a_eval_list == NULL)
2784  {
2785  goto error;
2786  }
2787  }
2788 
2789  ptr = or_unpack_int (ptr, &offset);
2790  if (offset == 0)
2791  {
2792  stx_build_list_proc->a_regu_list = NULL;
2793  }
2794  else
2795  {
2796  stx_build_list_proc->a_regu_list =
2797  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2798  if (stx_build_list_proc->a_regu_list == NULL)
2799  {
2800  goto error;
2801  }
2802  }
2803 
2804  ptr = or_unpack_int (ptr, &offset);
2805  if (offset == 0)
2806  {
2807  stx_build_list_proc->a_outptr_list = NULL;
2808  }
2809  else
2810  {
2811  stx_build_list_proc->a_outptr_list = stx_restore_outptr_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2812  if (stx_build_list_proc->a_outptr_list == NULL)
2813  {
2814  goto error;
2815  }
2816  }
2817 
2818  ptr = or_unpack_int (ptr, &offset);
2819  if (offset == 0)
2820  {
2821  stx_build_list_proc->a_outptr_list_ex = NULL;
2822  }
2823  else
2824  {
2825  stx_build_list_proc->a_outptr_list_ex =
2826  stx_restore_outptr_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2827  if (stx_build_list_proc->a_outptr_list_ex == NULL)
2828  {
2829  goto error;
2830  }
2831  }
2832 
2833  ptr = or_unpack_int (ptr, &offset);
2834  if (offset == 0)
2835  {
2836  stx_build_list_proc->a_outptr_list_interm = NULL;
2837  }
2838  else
2839  {
2840  stx_build_list_proc->a_outptr_list_interm =
2841  stx_restore_outptr_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2842  if (stx_build_list_proc->a_outptr_list_interm == NULL)
2843  {
2844  goto error;
2845  }
2846  }
2847 
2848  ptr = or_unpack_int (ptr, &offset);
2849  if (offset == 0)
2850  {
2851  stx_build_list_proc->a_val_list = NULL;
2852  }
2853  else
2854  {
2855  stx_build_list_proc->a_val_list = stx_restore_val_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2856  if (stx_build_list_proc->a_val_list == NULL)
2857  {
2858  goto error;
2859  }
2860  }
2861 
2862  return ptr;
2863 
2864 error:
2866  return NULL;
2867 }
2868 
2869 static char *
2870 stx_build_buildvalue_proc (THREAD_ENTRY * thread_p, char *ptr, BUILDVALUE_PROC_NODE * stx_build_value_proc)
2871 {
2872  int offset;
2874 
2875  ptr = or_unpack_int (ptr, &offset);
2876  if (offset == 0)
2877  {
2878  stx_build_value_proc->having_pred = NULL;
2879  }
2880  else
2881  {
2882  stx_build_value_proc->having_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2883  if (stx_build_value_proc->having_pred == NULL)
2884  {
2886  return NULL;
2887  }
2888  }
2889 
2890  ptr = or_unpack_int (ptr, &offset);
2891  if (offset == 0)
2892  {
2893  stx_build_value_proc->grbynum_val = NULL;
2894  }
2895  else
2896  {
2897  stx_build_value_proc->grbynum_val = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2898  if (stx_build_value_proc->grbynum_val == NULL)
2899  {
2901  return NULL;
2902  }
2903  assert (stx_build_value_proc->grbynum_val->need_clear == false);
2904  }
2905 
2906  ptr = or_unpack_int (ptr, &offset);
2907  if (offset == 0)
2908  {
2909  stx_build_value_proc->agg_list = NULL;
2910  }
2911  else
2912  {
2913  stx_build_value_proc->agg_list = stx_restore_aggregate_type (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2914  if (stx_build_value_proc->agg_list == NULL)
2915  {
2917  return NULL;
2918  }
2919  }
2920 
2921  ptr = or_unpack_int (ptr, &offset);
2922  if (offset == 0)
2923  {
2924  stx_build_value_proc->outarith_list = NULL;
2925  }
2926  else
2927  {
2928  stx_build_value_proc->outarith_list = stx_restore_arith_type (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2929  if (stx_build_value_proc->outarith_list == NULL)
2930  {
2932  return NULL;
2933  }
2934  }
2935 
2936  ptr = or_unpack_int (ptr, &stx_build_value_proc->is_always_false);
2937 
2938  return ptr;
2939 }
2940 
2941 static char *
2942 stx_build_mergelist_proc (THREAD_ENTRY * thread_p, char *ptr, MERGELIST_PROC_NODE * merge_list_info)
2943 {
2944  int offset;
2946 
2947  ptr = or_unpack_int (ptr, &offset);
2948  if (offset == 0)
2949  {
2950  merge_list_info->outer_xasl = NULL;
2951  }
2952  else
2953  {
2954  merge_list_info->outer_xasl = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2955  if (merge_list_info->outer_xasl == NULL)
2956  {
2957  goto error;
2958  }
2959  }
2960 
2961  merge_list_info->outer_spec_list = stx_restore_access_spec_type (thread_p, &ptr, NULL);
2962  if (ptr == NULL)
2963  {
2965  return NULL;
2966  }
2967 
2968  ptr = or_unpack_int (ptr, &offset);
2969  if (offset == 0)
2970  {
2971  merge_list_info->outer_val_list = NULL;
2972  }
2973  else
2974  {
2975  merge_list_info->outer_val_list = stx_restore_val_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2976  if (merge_list_info->outer_val_list == NULL)
2977  {
2978  goto error;
2979  }
2980  }
2981 
2982  ptr = or_unpack_int (ptr, &offset);
2983  if (offset == 0)
2984  {
2985  merge_list_info->inner_xasl = NULL;
2986  }
2987  else
2988  {
2989  merge_list_info->inner_xasl = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
2990  if (merge_list_info->inner_xasl == NULL)
2991  {
2992  goto error;
2993  }
2994  }
2995 
2996  merge_list_info->inner_spec_list = stx_restore_access_spec_type (thread_p, &ptr, NULL);
2997 
2998  ptr = or_unpack_int (ptr, &offset);
2999  if (offset == 0)
3000  {
3001  merge_list_info->inner_val_list = NULL;
3002  }
3003  else
3004  {
3005  merge_list_info->inner_val_list = stx_restore_val_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3006  if (merge_list_info->inner_val_list == NULL)
3007  {
3008  goto error;
3009  }
3010  }
3011 
3012  ptr = stx_build_ls_merge_info (thread_p, ptr, &merge_list_info->ls_merge);
3013 
3014  return ptr;
3015 
3016 error:
3018  return NULL;
3019 }
3020 
3021 static char *
3022 stx_build_ls_merge_info (THREAD_ENTRY * thread_p, char *ptr, QFILE_LIST_MERGE_INFO * list_merge_info)
3023 {
3024  int tmp, offset;
3025  int single_fetch;
3027 
3028  ptr = or_unpack_int (ptr, &tmp);
3029  list_merge_info->join_type = (JOIN_TYPE) tmp;
3030 
3031  ptr = or_unpack_int (ptr, &single_fetch);
3032  list_merge_info->single_fetch = (QPROC_SINGLE_FETCH) single_fetch;
3033 
3034  ptr = or_unpack_int (ptr, &list_merge_info->ls_column_cnt);
3035 
3036  ptr = or_unpack_int (ptr, &offset);
3037  if (offset == 0 || list_merge_info->ls_column_cnt == 0)
3038  {
3039  list_merge_info->ls_outer_column = NULL;
3040  }
3041  else
3042  {
3043  list_merge_info->ls_outer_column =
3044  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], list_merge_info->ls_column_cnt);
3045  if (list_merge_info->ls_outer_column == NULL)
3046  {
3047  goto error;
3048  }
3049  }
3050 
3051  ptr = or_unpack_int (ptr, &offset);
3052  if (offset == 0 || list_merge_info->ls_column_cnt == 0)
3053  {
3054  list_merge_info->ls_outer_unique = NULL;
3055  }
3056  else
3057  {
3058  list_merge_info->ls_outer_unique =
3059  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], list_merge_info->ls_column_cnt);
3060  if (list_merge_info->ls_outer_unique == NULL)
3061  {
3062  goto error;
3063  }
3064  }
3065 
3066  ptr = or_unpack_int (ptr, &offset);
3067  if (offset == 0 || list_merge_info->ls_column_cnt == 0)
3068  {
3069  list_merge_info->ls_inner_column = NULL;
3070  }
3071  else
3072  {
3073  list_merge_info->ls_inner_column =
3074  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], list_merge_info->ls_column_cnt);
3075  if (list_merge_info->ls_inner_column == NULL)
3076  {
3077  goto error;
3078  }
3079  }
3080 
3081  ptr = or_unpack_int (ptr, &offset);
3082  if ((offset == 0) || (list_merge_info->ls_column_cnt == 0))
3083  {
3084  list_merge_info->ls_inner_unique = NULL;
3085  }
3086  else
3087  {
3088  list_merge_info->ls_inner_unique =
3089  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], list_merge_info->ls_column_cnt);
3090  if (list_merge_info->ls_inner_unique == NULL)
3091  {
3092  goto error;
3093  }
3094  }
3095 
3096  ptr = or_unpack_int (ptr, &list_merge_info->ls_pos_cnt);
3097 
3098  ptr = or_unpack_int (ptr, &offset);
3099  if ((offset == 0) || (list_merge_info->ls_pos_cnt == 0))
3100  {
3101  list_merge_info->ls_pos_list = NULL;
3102  }
3103  else
3104  {
3105  list_merge_info->ls_pos_list =
3106  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], list_merge_info->ls_pos_cnt);
3107  if (list_merge_info->ls_pos_list == NULL)
3108  {
3109  goto error;
3110  }
3111  }
3112 
3113  ptr = or_unpack_int (ptr, &offset);
3114  if (offset == 0 || list_merge_info->ls_pos_cnt == 0)
3115  {
3116  list_merge_info->ls_outer_inner_list = NULL;
3117  }
3118  else
3119  {
3120  list_merge_info->ls_outer_inner_list =
3121  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], list_merge_info->ls_pos_cnt);
3122  if (list_merge_info->ls_outer_inner_list == NULL)
3123  {
3124  goto error;
3125  }
3126  }
3127 
3128  return ptr;
3129 
3130 error:
3132  return NULL;
3133 }
3134 
3135 static char *
3137 {
3138  int offset = 0;
3139  int i;
3140  char *p;
3141 
3143 
3144  /* num_subclasses */
3145  ptr = or_unpack_int (ptr, &upd_cls->num_subclasses);
3146 
3147  /* class_oid */
3148  ptr = or_unpack_int (ptr, &offset);
3149  if (offset == 0 || upd_cls->num_subclasses == 0)
3150  {
3151  upd_cls->class_oid = NULL;
3152  }
3153  else
3154  {
3155  upd_cls->class_oid =
3156  stx_restore_OID_array (thread_p, &xasl_unpack_info->packed_xasl[offset], upd_cls->num_subclasses);
3157  if (upd_cls->class_oid == NULL)
3158  {
3159  return NULL;
3160  }
3161  }
3162 
3163  /* class_hfid */
3164  ptr = or_unpack_int (ptr, &offset);
3165  if (offset == 0 || upd_cls->num_subclasses == 0)
3166  {
3167  upd_cls->class_hfid = NULL;
3168  }
3169  else
3170  {
3171  upd_cls->class_hfid =
3172  stx_restore_hfid_array (thread_p, &xasl_unpack_info->packed_xasl[offset], upd_cls->num_subclasses);
3173  if (upd_cls->class_hfid == NULL)
3174  {
3175  return NULL;
3176  }
3177  }
3178 
3179  /* num_attrs & att_id */
3180  ptr = or_unpack_int (ptr, &upd_cls->num_attrs);
3181  ptr = or_unpack_int (ptr, &offset);
3182  if (offset == 0 || upd_cls->num_attrs == 0)
3183  {
3184  upd_cls->att_id = NULL;
3185  }
3186  else
3187  {
3188  upd_cls->att_id =
3189  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset],
3190  upd_cls->num_attrs * upd_cls->num_subclasses);
3191  if (upd_cls->att_id == NULL)
3192  {
3193  return NULL;
3194  }
3195  }
3196 
3197  /* partition pruning info */
3198  ptr = or_unpack_int (ptr, &upd_cls->needs_pruning);
3199  /* has_uniques */
3200  ptr = or_unpack_int (ptr, &upd_cls->has_uniques);
3201 
3202  /* num_lob_attrs */
3203  ptr = or_unpack_int (ptr, &offset);
3204  if (offset == 0 || upd_cls->num_subclasses == 0)
3205  {
3206  upd_cls->num_lob_attrs = NULL;
3207  }
3208  else
3209  {
3210  upd_cls->num_lob_attrs =
3211  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], upd_cls->num_subclasses);
3212  if (upd_cls->num_lob_attrs == NULL)
3213  {
3214  return NULL;
3215  }
3216  }
3217  /* lob_attr_ids */
3218  ptr = or_unpack_int (ptr, &offset);
3219  if (offset == 0 || upd_cls->num_subclasses == 0)
3220  {
3221  upd_cls->lob_attr_ids = NULL;
3222  }
3223  else
3224  {
3225  upd_cls->lob_attr_ids = (int **) stx_alloc_struct (thread_p, upd_cls->num_subclasses * sizeof (int *));
3226  if (!upd_cls->lob_attr_ids)
3227  {
3229  return NULL;
3230  }
3231  p = &xasl_unpack_info->packed_xasl[offset];
3232  for (i = 0; i < upd_cls->num_subclasses; i++)
3233  {
3234  p = or_unpack_int (p, &offset);
3235  if (offset == 0 || upd_cls->num_lob_attrs[i] == 0)
3236  {
3237  upd_cls->lob_attr_ids[i] = NULL;
3238  }
3239  else
3240  {
3241  upd_cls->lob_attr_ids[i] =
3242  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], upd_cls->num_lob_attrs[i]);
3243  if (upd_cls->lob_attr_ids[i] == NULL)
3244  {
3245  return NULL;
3246  }
3247  }
3248  }
3249  }
3250  /* make sure num_lob_attrs and lob_attr_ids are both NULL or are both not NULL */
3251  assert ((upd_cls->num_lob_attrs && upd_cls->lob_attr_ids) || (!upd_cls->num_lob_attrs && !upd_cls->lob_attr_ids));
3252 
3253  /* num_extra_assign_reev & mvcc_extra_assign_reev */
3254  ptr = or_unpack_int (ptr, &upd_cls->num_extra_assign_reev);
3255  ptr = or_unpack_int (ptr, &offset);
3256  if (offset == 0 || upd_cls->num_extra_assign_reev == 0)
3257  {
3258  upd_cls->mvcc_extra_assign_reev = NULL;
3259  }
3260  else
3261  {
3262  upd_cls->mvcc_extra_assign_reev =
3263  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], upd_cls->num_extra_assign_reev);
3264  if (upd_cls->mvcc_extra_assign_reev == NULL)
3265  {
3266  return NULL;
3267  }
3268  }
3269 
3270  return ptr;
3271 }
3272 
3273 static UPDDEL_CLASS_INFO *
3274 stx_restore_update_class_info_array (THREAD_ENTRY * thread_p, char *ptr, int num_classes)
3275 {
3276  int idx;
3277  UPDDEL_CLASS_INFO *classes = NULL;
3278 
3279  classes = (UPDDEL_CLASS_INFO *) stx_alloc_struct (thread_p, sizeof (*classes) * num_classes);
3280  if (classes == NULL)
3281  {
3283  return NULL;
3284  }
3285 
3286  for (idx = 0; idx < num_classes; idx++)
3287  {
3288  ptr = stx_build_update_class_info (thread_p, ptr, &classes[idx]);
3289  if (ptr == NULL)
3290  {
3291  return NULL;
3292  }
3293  }
3294 
3295  return classes;
3296 }
3297 
3298 static char *
3300 {
3301  int offset = 0;
3302  XASL_UNPACK_INFO *xasl_unpack_info_p = get_xasl_unpack_info_ptr (thread_p);
3303 
3304  /* cls_idx */
3305  ptr = or_unpack_int (ptr, &assign->cls_idx);
3306 
3307  /* att_idx */
3308  ptr = or_unpack_int (ptr, &assign->att_idx);
3309 
3310  /* constant */
3311  assign->clear_value_at_clone_decache = false;
3312  ptr = or_unpack_int (ptr, &offset);
3313  if (offset == 0)
3314  {
3315  assign->constant = NULL;
3316  }
3317  else
3318  {
3319  assign->constant = stx_restore_db_value (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
3320  if (assign->constant == NULL)
3321  {
3322  return NULL;
3323  }
3324  if (xasl_unpack_info_p->use_xasl_clone && !db_value_is_null (assign->constant))
3325  {
3326  assign->clear_value_at_clone_decache = true;
3327  }
3328  }
3329 
3330  /* regu_var */
3331  ptr = or_unpack_int (ptr, &offset);
3332  if (offset == 0)
3333  {
3334  assign->regu_var = NULL;
3335  }
3336  else
3337  {
3338  assign->regu_var = stx_restore_regu_variable (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
3339  if (assign->regu_var == NULL)
3340  {
3341  return NULL;
3342  }
3343  }
3344 
3345  return ptr;
3346 }
3347 
3348 static UPDATE_ASSIGNMENT *
3349 stx_restore_update_assignment_array (THREAD_ENTRY * thread_p, char *ptr, int num_assigns)
3350 {
3351  int idx;
3352  UPDATE_ASSIGNMENT *assigns = NULL;
3353 
3354  assigns = (UPDATE_ASSIGNMENT *) stx_alloc_struct (thread_p, sizeof (*assigns) * num_assigns);
3355  if (assigns == NULL)
3356  {
3358  return NULL;
3359  }
3360 
3361  for (idx = 0; idx < num_assigns; idx++)
3362  {
3363  ptr = stx_build_update_assignment (thread_p, ptr, &assigns[idx]);
3364  if (ptr == NULL)
3365  {
3366  return NULL;
3367  }
3368  }
3369 
3370  return assigns;
3371 }
3372 
3373 static ODKU_INFO *
3374 stx_restore_odku_info (THREAD_ENTRY * thread_p, char *ptr)
3375 {
3377  int offset;
3378 
3380 
3381  odku_info = (ODKU_INFO *) stx_alloc_struct (thread_p, sizeof (ODKU_INFO));
3382  if (odku_info == NULL)
3383  {
3385  return NULL;
3386  }
3387 
3388  /* num_assigns */
3389  ptr = or_unpack_int (ptr, &odku_info->num_assigns);
3390 
3391  /* attr_ids */
3392  ptr = or_unpack_int (ptr, &offset);
3393  if (offset == 0)
3394  {
3395  odku_info->attr_ids = NULL;
3396  }
3397  else
3398  {
3399  odku_info->attr_ids =
3400  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], odku_info->num_assigns);
3401  if (odku_info->attr_ids == NULL)
3402  {
3403  return NULL;
3404  }
3405  }
3406 
3407  /* assignments */
3408  ptr = or_unpack_int (ptr, &offset);
3409  if (offset == 0)
3410  {
3411  odku_info->assignments = NULL;
3412  }
3413  else
3414  {
3415  odku_info->assignments =
3416  stx_restore_update_assignment_array (thread_p, &xasl_unpack_info->packed_xasl[offset], odku_info->num_assigns);
3417  if (odku_info->assignments == NULL)
3418  {
3419  return NULL;
3420  }
3421  }
3422 
3423  /* constraint predicate */
3424  ptr = or_unpack_int (ptr, &offset);
3425  if (offset == 0)
3426  {
3427  odku_info->cons_pred = NULL;
3428  }
3429  else
3430  {
3431  odku_info->cons_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3432  if (odku_info->cons_pred == NULL)
3433  {
3434  return NULL;
3435  }
3436  }
3437 
3438  /* cache attr info */
3439  ptr = or_unpack_int (ptr, &offset);
3440  if (offset == 0)
3441  {
3442  odku_info->attr_info = NULL;
3443  }
3444  else
3445  {
3446  odku_info->attr_info = stx_restore_cache_attrinfo (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3447  if (odku_info->attr_info == NULL)
3448  {
3449  return NULL;
3450  }
3451  }
3452 
3453  return odku_info;
3454 }
3455 
3456 static char *
3457 stx_build_update_proc (THREAD_ENTRY * thread_p, char *ptr, UPDATE_PROC_NODE * update_info)
3458 {
3459  int offset;
3461 
3462  /* classes */
3463  ptr = or_unpack_int (ptr, &update_info->num_classes);
3464  ptr = or_unpack_int (ptr, &offset);
3465  if (offset == 0 || update_info->num_classes == 0)
3466  {
3468  return NULL;
3469  }
3470  else
3471  {
3472  update_info->classes =
3473  stx_restore_update_class_info_array (thread_p, &xasl_unpack_info->packed_xasl[offset],
3474  update_info->num_classes);
3475  if (update_info->classes == NULL)
3476  {
3477  goto error;
3478  }
3479  }
3480 
3481  /* assigns */
3482  ptr = or_unpack_int (ptr, &update_info->num_assigns);
3483  ptr = or_unpack_int (ptr, &offset);
3484  if (offset == 0 || update_info->num_classes == 0)
3485  {
3486  update_info->assigns = NULL;
3487  }
3488  else
3489  {
3490  update_info->assigns =
3491  stx_restore_update_assignment_array (thread_p, &xasl_unpack_info->packed_xasl[offset],
3492  update_info->num_assigns);
3493  if (update_info->assigns == NULL)
3494  {
3495  goto error;
3496  }
3497  }
3498 
3499  /* cons_pred */
3500  ptr = or_unpack_int (ptr, &offset);
3501  if (offset == 0)
3502  {
3503  update_info->cons_pred = NULL;
3504  }
3505  else
3506  {
3507  update_info->cons_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3508  if (update_info->cons_pred == NULL)
3509  {
3510  goto error;
3511  }
3512  }
3513 
3514  ptr = or_unpack_int (ptr, &update_info->wait_msecs);
3515  ptr = or_unpack_int (ptr, &update_info->no_logging);
3516  ptr = or_unpack_int (ptr, &update_info->num_orderby_keys);
3517 
3518  /* restore MVCC condition reevaluation data */
3519  ptr = or_unpack_int (ptr, &update_info->num_assign_reev_classes);
3520  ptr = or_unpack_int (ptr, &update_info->num_reev_classes);
3521  ptr = or_unpack_int (ptr, &offset);
3522  if (offset == 0 || update_info->num_reev_classes == 0)
3523  {
3524  update_info->mvcc_reev_classes = NULL;
3525  }
3526  else
3527  {
3528  update_info->mvcc_reev_classes =
3529  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], update_info->num_reev_classes);
3530  if (update_info->mvcc_reev_classes == NULL)
3531  {
3532  goto error;
3533  }
3534  }
3535 
3536  return ptr;
3537 
3538 error:
3540  return NULL;
3541 }
3542 
3543 static char *
3544 stx_build_delete_proc (THREAD_ENTRY * thread_p, char *ptr, DELETE_PROC_NODE * delete_info)
3545 {
3546  int offset;
3548 
3549  ptr = or_unpack_int (ptr, &delete_info->num_classes);
3550 
3551  ptr = or_unpack_int (ptr, &offset);
3552  if (offset == 0 || delete_info->num_classes == 0)
3553  {
3554  delete_info->classes = NULL;
3555  }
3556  else
3557  {
3558  delete_info->classes =
3559  stx_restore_update_class_info_array (thread_p, &xasl_unpack_info->packed_xasl[offset],
3560  delete_info->num_classes);
3561  if (delete_info->classes == NULL)
3562  {
3563  goto error;
3564  }
3565  }
3566 
3567  ptr = or_unpack_int (ptr, &delete_info->wait_msecs);
3568  ptr = or_unpack_int (ptr, &delete_info->no_logging);
3569 
3570  /* restore MVCC condition reevaluation data */
3571  ptr = or_unpack_int (ptr, &delete_info->num_reev_classes);
3572  ptr = or_unpack_int (ptr, &offset);
3573  if (offset == 0 || delete_info->num_reev_classes == 0)
3574  {
3575  delete_info->mvcc_reev_classes = NULL;
3576  }
3577  else
3578  {
3579  delete_info->mvcc_reev_classes =
3580  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], delete_info->num_reev_classes);
3581  if (delete_info->mvcc_reev_classes == NULL)
3582  {
3583  goto error;
3584  }
3585  }
3586 
3587  return ptr;
3588 
3589 error:
3591  return NULL;
3592 }
3593 
3594 static char *
3595 stx_build_insert_proc (THREAD_ENTRY * thread_p, char *ptr, INSERT_PROC_NODE * insert_info)
3596 {
3597  int offset;
3598  int i;
3600 
3601  ptr = or_unpack_oid (ptr, &insert_info->class_oid);
3602 
3603  ptr = or_unpack_hfid (ptr, &insert_info->class_hfid);
3604 
3605  ptr = or_unpack_int (ptr, &insert_info->num_vals);
3606 
3607  ptr = or_unpack_int (ptr, &insert_info->num_default_expr);
3608 
3609  ptr = or_unpack_int (ptr, &offset);
3610  if (offset == 0 || insert_info->num_vals == 0)
3611  {
3612  insert_info->att_id = NULL;
3613  }
3614  else
3615  {
3616  insert_info->att_id =
3617  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], insert_info->num_vals);
3618  if (insert_info->att_id == NULL)
3619  {
3620  goto error;
3621  }
3622  }
3623 
3624  /* Make space for the subquery values. */
3625  insert_info->vals = (DB_VALUE **) stx_alloc_struct (thread_p, sizeof (DB_VALUE *) * insert_info->num_vals);
3626  if (insert_info->num_vals)
3627  {
3628  if (insert_info->vals == NULL)
3629  {
3630  goto error;
3631  }
3632  for (i = 0; i < insert_info->num_vals; ++i)
3633  {
3634  insert_info->vals[i] = (DB_VALUE *) 0;
3635  }
3636  }
3637 
3638  ptr = or_unpack_int (ptr, &offset);
3639  if (offset == 0)
3640  {
3641  insert_info->cons_pred = NULL;
3642  }
3643  else
3644  {
3645  insert_info->cons_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3646  if (insert_info->cons_pred == NULL)
3647  {
3648  goto error;
3649  }
3650  }
3651 
3652  ptr = or_unpack_int (ptr, &insert_info->has_uniques);
3653  ptr = or_unpack_int (ptr, &insert_info->wait_msecs);
3654  ptr = or_unpack_int (ptr, &insert_info->no_logging);
3655  ptr = or_unpack_int (ptr, &insert_info->do_replace);
3656  ptr = or_unpack_int (ptr, &insert_info->pruning_type);
3657 
3658  ptr = or_unpack_int (ptr, &offset);
3659  if (offset == 0)
3660  {
3661  insert_info->odku = NULL;
3662  }
3663  else
3664  {
3665  insert_info->odku = stx_restore_odku_info (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3666  if (insert_info->odku == NULL)
3667  {
3668  return NULL;
3669  }
3670  }
3671 
3672  ptr = or_unpack_int (ptr, &insert_info->num_val_lists);
3673  if (insert_info->num_val_lists == 0)
3674  {
3675  insert_info->valptr_lists = NULL;
3676  }
3677  else
3678  {
3679  assert (insert_info->num_val_lists > 0);
3680 
3681  insert_info->valptr_lists =
3682  (OUTPTR_LIST **) stx_alloc_struct (thread_p, sizeof (OUTPTR_LIST *) * insert_info->num_val_lists);
3683  if (insert_info->valptr_lists == NULL)
3684  {
3686  return NULL;
3687  }
3688  for (i = 0; i < insert_info->num_val_lists; i++)
3689  {
3690  ptr = or_unpack_int (ptr, &offset);
3691  if (ptr == 0)
3692  {
3693  assert (0);
3694  return NULL;
3695  }
3696  else
3697  {
3698  insert_info->valptr_lists[i] = stx_restore_outptr_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3699  if (insert_info->valptr_lists[i] == NULL)
3700  {
3701  return NULL;
3702  }
3703  }
3704  }
3705  }
3706 
3707  ptr = or_unpack_int (ptr, &offset);
3708  if (offset == 0)
3709  {
3710  insert_info->obj_oid = NULL;
3711  }
3712  else
3713  {
3714  insert_info->obj_oid = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3715  if (insert_info->obj_oid == NULL)
3716  {
3717  return NULL;
3718  }
3719  assert (insert_info->obj_oid->need_clear == false);
3720  }
3721 
3722  return ptr;
3723 
3724 error:
3726  return NULL;
3727 }
3728 
3729 static char *
3730 stx_build_merge_proc (THREAD_ENTRY * thread_p, char *ptr, MERGE_PROC_NODE * merge_info)
3731 {
3732  int offset;
3734  int tmp;
3735 
3736  ptr = or_unpack_int (ptr, &offset);
3737  if (offset == 0)
3738  {
3739  merge_info->update_xasl = NULL;
3740  }
3741  else
3742  {
3743  merge_info->update_xasl = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3744  if (merge_info->update_xasl == NULL)
3745  {
3746  goto error;
3747  }
3748  }
3749 
3750  ptr = or_unpack_int (ptr, &offset);
3751  if (offset == 0)
3752  {
3753  merge_info->insert_xasl = NULL;
3754  }
3755  else
3756  {
3757  merge_info->insert_xasl = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3758  if (merge_info->insert_xasl == NULL)
3759  {
3760  goto error;
3761  }
3762  }
3763 
3764  ptr = or_unpack_int (ptr, &tmp);
3765  merge_info->has_delete = (bool) tmp;
3766 
3767  return ptr;
3768 
3769 error:
3771  return NULL;
3772 }
3773 
3774 static char *
3775 stx_build_cte_proc (THREAD_ENTRY * thread_p, char *ptr, CTE_PROC_NODE * cte_info)
3776 {
3777  int offset;
3779 
3780  ptr = or_unpack_int (ptr, &offset);
3781  if (offset == 0)
3782  {
3783  cte_info->non_recursive_part = NULL; /* may have false_where */
3784  }
3785  else
3786  {
3787  cte_info->non_recursive_part = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3788 
3789  if (cte_info->non_recursive_part == NULL)
3790  {
3791  goto error;
3792  }
3793  }
3794 
3795  ptr = or_unpack_int (ptr, &offset);
3796  if (offset == 0)
3797  {
3798  cte_info->recursive_part = NULL;
3799  }
3800  else
3801  {
3802  cte_info->recursive_part = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3803  if (cte_info->recursive_part == NULL)
3804  {
3805  goto error;
3806  }
3807  }
3808 
3809  return ptr;
3810 
3811 error:
3813  return NULL;
3814 }
3815 
3816 static char *
3817 stx_build_outptr_list (THREAD_ENTRY * thread_p, char *ptr, OUTPTR_LIST * outptr_list)
3818 {
3819  int offset;
3821 
3822  ptr = or_unpack_int (ptr, &outptr_list->valptr_cnt);
3823 
3824  ptr = or_unpack_int (ptr, &offset);
3825  if (offset == 0)
3826  {
3827  outptr_list->valptrp = NULL;
3828  }
3829  else
3830  {
3831  outptr_list->valptrp = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3832  if (outptr_list->valptrp == NULL)
3833  {
3835  return NULL;
3836  }
3837  }
3838 
3839  return ptr;
3840 }
3841 
3842 static char *
3844 {
3845  int offset;
3847 
3848  ptr = or_unpack_oid (ptr, &selupd_list->class_oid);
3849  ptr = or_unpack_hfid (ptr, &selupd_list->class_hfid);
3850  ptr = or_unpack_int (ptr, &selupd_list->select_list_size);
3851  ptr = or_unpack_int (ptr, &selupd_list->wait_msecs);
3852 
3853  ptr = or_unpack_int (ptr, &offset);
3854  selupd_list->select_list = stx_restore_regu_varlist_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3855 
3856  ptr = or_unpack_int (ptr, &offset);
3857  if (offset == 0)
3858  {
3859  selupd_list->next = NULL;
3860  }
3861  else
3862  {
3863  selupd_list->next = stx_restore_selupd_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3864  if (selupd_list->next == NULL)
3865  {
3867  return NULL;
3868  }
3869  }
3870 
3871  return ptr;
3872 }
3873 
3874 static char *
3875 stx_build_pred_expr (THREAD_ENTRY * thread_p, char *ptr, PRED_EXPR * pred_expr)
3876 {
3877  int tmp, offset;
3879 
3880  ptr = or_unpack_int (ptr, &tmp);
3881  pred_expr->type = (TYPE_PRED_EXPR) tmp;
3882 
3883  switch (pred_expr->type)
3884  {
3885  case T_PRED:
3886  ptr = stx_build_pred (thread_p, ptr, &pred_expr->pe.m_pred);
3887  break;
3888 
3889  case T_EVAL_TERM:
3890  ptr = stx_build_eval_term (thread_p, ptr, &pred_expr->pe.m_eval_term);
3891  break;
3892 
3893  case T_NOT_TERM:
3894  ptr = or_unpack_int (ptr, &offset);
3895  if (offset == 0)
3896  {
3897  pred_expr->pe.m_not_term = NULL;
3898  }
3899  else
3900  {
3901  pred_expr->pe.m_not_term = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3902  if (pred_expr->pe.m_not_term == NULL)
3903  {
3905  return NULL;
3906  }
3907  }
3908  break;
3909 
3910  default:
3912  return NULL;
3913  }
3914 
3915  return ptr;
3916 }
3917 
3918 static char *
3919 stx_build_pred (THREAD_ENTRY * thread_p, char *ptr, PRED * pred)
3920 {
3921  int tmp, offset;
3922  int rhs_type;
3923  PRED_EXPR *rhs;
3925 
3926  /* lhs */
3927  ptr = or_unpack_int (ptr, &offset);
3928  if (offset == 0)
3929  {
3930  pred->lhs = NULL;
3931  }
3932  else
3933  {
3934  pred->lhs = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3935  if (pred->lhs == NULL)
3936  {
3937  goto error;
3938  }
3939  }
3940 
3941  ptr = or_unpack_int (ptr, &tmp);
3942  pred->bool_op = (BOOL_OP) tmp;
3943 
3944  ptr = or_unpack_int (ptr, &rhs_type); /* rhs-type */
3945 
3946  /* Traverse right-linear chains of AND/OR terms */
3947  while (rhs_type == T_PRED)
3948  {
3949  pred->rhs = (PRED_EXPR *) stx_alloc_struct (thread_p, sizeof (PRED_EXPR));
3950  if (pred->rhs == NULL)
3951  {
3952  goto error;
3953  }
3954 
3955  rhs = pred->rhs;
3956 
3957  rhs->type = T_PRED;
3958 
3959  pred = &rhs->pe.m_pred;
3960 
3961  /* lhs */
3962  ptr = or_unpack_int (ptr, &offset);
3963  if (offset == 0)
3964  {
3965  pred->lhs = NULL;
3966  }
3967  else
3968  {
3969  pred->lhs = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3970  if (pred->lhs == NULL)
3971  {
3972  goto error;
3973  }
3974  }
3975 
3976  ptr = or_unpack_int (ptr, &tmp);
3977  pred->bool_op = (BOOL_OP) tmp; /* bool_op */
3978 
3979  ptr = or_unpack_int (ptr, &rhs_type); /* rhs-type */
3980  }
3981 
3982  /* rhs */
3983  ptr = or_unpack_int (ptr, &offset);
3984  if (offset == 0)
3985  {
3986  pred->rhs = NULL;
3987  }
3988  else
3989  {
3990  pred->rhs = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
3991  if (pred->rhs == NULL)
3992  {
3993  goto error;
3994  }
3995  }
3996 
3997  return ptr;
3998 
3999 error:
4001  return NULL;
4002 }
4003 
4004 static char *
4005 stx_build_eval_term (THREAD_ENTRY * thread_p, char *ptr, EVAL_TERM * eval_term)
4006 {
4007  int tmp;
4008 
4009  ptr = or_unpack_int (ptr, &tmp);
4010  eval_term->et_type = (TYPE_EVAL_TERM) tmp;
4011 
4012  switch (eval_term->et_type)
4013  {
4014  case T_COMP_EVAL_TERM:
4015  ptr = stx_build_comp_eval_term (thread_p, ptr, &eval_term->et.et_comp);
4016  break;
4017 
4018  case T_ALSM_EVAL_TERM:
4019  ptr = stx_build_alsm_eval_term (thread_p, ptr, &eval_term->et.et_alsm);
4020  break;
4021 
4022  case T_LIKE_EVAL_TERM:
4023  ptr = stx_build_like_eval_term (thread_p, ptr, &eval_term->et.et_like);
4024  break;
4025 
4026  case T_RLIKE_EVAL_TERM:
4027  ptr = stx_build_rlike_eval_term (thread_p, ptr, &eval_term->et.et_rlike);
4028  break;
4029 
4030  default:
4032  return NULL;
4033  }
4034 
4035  return ptr;
4036 }
4037 
4038 static char *
4039 stx_build_comp_eval_term (THREAD_ENTRY * thread_p, char *ptr, COMP_EVAL_TERM * comp_eval_term)
4040 {
4041  int tmp, offset;
4043 
4044  ptr = or_unpack_int (ptr, &offset);
4045  if (offset == 0)
4046  {
4047  comp_eval_term->lhs = NULL;
4048  }
4049  else
4050  {
4051  comp_eval_term->lhs = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4052  if (comp_eval_term->lhs == NULL)
4053  {
4055  return NULL;
4056  }
4057  }
4058 
4059  ptr = or_unpack_int (ptr, &offset);
4060  if (offset == 0)
4061  {
4062  comp_eval_term->rhs = NULL;
4063  }
4064  else
4065  {
4066  comp_eval_term->rhs = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4067  if (comp_eval_term->rhs == NULL)
4068  {
4070  return NULL;
4071  }
4072  }
4073 
4074  ptr = or_unpack_int (ptr, &tmp);
4075  comp_eval_term->rel_op = (REL_OP) tmp;
4076 
4077  ptr = or_unpack_int (ptr, &tmp);
4078  comp_eval_term->type = (DB_TYPE) tmp;
4079 
4080  return ptr;
4081 }
4082 
4083 static char *
4084 stx_build_alsm_eval_term (THREAD_ENTRY * thread_p, char *ptr, ALSM_EVAL_TERM * alsm_eval_term)
4085 {
4086  int tmp, offset;
4088 
4089  ptr = or_unpack_int (ptr, &offset);
4090  if (offset == 0)
4091  {
4092  alsm_eval_term->elem = NULL;
4093  }
4094  else
4095  {
4096  alsm_eval_term->elem = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4097  if (alsm_eval_term->elem == NULL)
4098  {
4100  return NULL;
4101  }
4102  }
4103 
4104  ptr = or_unpack_int (ptr, &offset);
4105  if (offset == 0)
4106  {
4107  alsm_eval_term->elemset = NULL;
4108  }
4109  else
4110  {
4111  alsm_eval_term->elemset = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4112  if (alsm_eval_term->elemset == NULL)
4113  {
4115  return NULL;
4116  }
4117  }
4118 
4119  ptr = or_unpack_int (ptr, &tmp);
4120  alsm_eval_term->eq_flag = (QL_FLAG) tmp;
4121 
4122  ptr = or_unpack_int (ptr, &tmp);
4123  alsm_eval_term->rel_op = (REL_OP) tmp;
4124 
4125  ptr = or_unpack_int (ptr, &tmp);
4126  alsm_eval_term->item_type = (DB_TYPE) tmp;
4127 
4128  return ptr;
4129 }
4130 
4131 static char *
4132 stx_build_like_eval_term (THREAD_ENTRY * thread_p, char *ptr, LIKE_EVAL_TERM * like_eval_term)
4133 {
4134  int offset;
4136 
4137  ptr = or_unpack_int (ptr, &offset);
4138  if (offset == 0)
4139  {
4140  like_eval_term->src = NULL;
4141  }
4142  else
4143  {
4144  like_eval_term->src = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4145  if (like_eval_term->src == NULL)
4146  {
4147  goto error;
4148  }
4149  }
4150 
4151  ptr = or_unpack_int (ptr, &offset);
4152  if (offset == 0)
4153  {
4154  like_eval_term->pattern = NULL;
4155  }
4156  else
4157  {
4158  like_eval_term->pattern = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4159  if (like_eval_term->pattern == NULL)
4160  {
4161  goto error;
4162  }
4163  }
4164 
4165  ptr = or_unpack_int (ptr, &offset);
4166  if (offset == 0)
4167  {
4168  like_eval_term->esc_char = NULL;
4169  }
4170  else
4171  {
4172  like_eval_term->esc_char = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4173  if (like_eval_term->esc_char == NULL)
4174  {
4175  goto error;
4176  }
4177  }
4178 
4179  return ptr;
4180 
4181 error:
4183  return NULL;
4184 }
4185 
4186 static char *
4187 stx_build_rlike_eval_term (THREAD_ENTRY * thread_p, char *ptr, RLIKE_EVAL_TERM * rlike_eval_term)
4188 {
4189  int offset;
4191 
4192  ptr = or_unpack_int (ptr, &offset);
4193  if (offset == 0)
4194  {
4195  rlike_eval_term->src = NULL;
4196  }
4197  else
4198  {
4199  rlike_eval_term->src = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4200  if (rlike_eval_term->src == NULL)
4201  {
4202  goto error;
4203  }
4204  }
4205 
4206  ptr = or_unpack_int (ptr, &offset);
4207  if (offset == 0)
4208  {
4209  rlike_eval_term->pattern = NULL;
4210  }
4211  else
4212  {
4213  rlike_eval_term->pattern = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4214  if (rlike_eval_term->pattern == NULL)
4215  {
4216  goto error;
4217  }
4218  }
4219 
4220  ptr = or_unpack_int (ptr, &offset);
4221  if (offset == 0)
4222  {
4223  rlike_eval_term->case_sensitive = NULL;
4224  }
4225  else
4226  {
4227  rlike_eval_term->case_sensitive = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4228  if (rlike_eval_term->case_sensitive == NULL)
4229  {
4230  goto error;
4231  }
4232  }
4233 
4234  /* initialize regex object pointer */
4235  rlike_eval_term->compiled_regex = NULL;
4236  rlike_eval_term->compiled_pattern = NULL;
4237 
4238  return ptr;
4239 
4240 error:
4242  return NULL;
4243 }
4244 
4245 
4246 static char *
4247 stx_build_access_spec_type (THREAD_ENTRY * thread_p, char *ptr, ACCESS_SPEC_TYPE * access_spec, void *arg)
4248 {
4249  int tmp, offset;
4250  int val;
4251  OUTPTR_LIST *outptr_list = NULL;
4252 
4254 
4255  ptr = or_unpack_int (ptr, &tmp);
4256  access_spec->type = (TARGET_TYPE) tmp;
4257 
4258  ptr = or_unpack_int (ptr, &tmp);
4259  access_spec->access = (ACCESS_METHOD) tmp;
4260 
4261  ptr = or_unpack_int (ptr, &offset);
4262  if (offset == 0)
4263  {
4264  access_spec->indexptr = NULL;
4265  }
4266  else
4267  {
4268  access_spec->indexptr = stx_restore_indx_info (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4269  if (access_spec->indexptr == NULL)
4270  {
4271  goto error;
4272  }
4273  /* backup index id */
4274  access_spec->btid = access_spec->indexptr->btid;
4275  }
4276 
4277  ptr = or_unpack_int (ptr, &offset);
4278  if (offset == 0)
4279  {
4280  access_spec->where_key = NULL;
4281  }
4282  else
4283  {
4284  access_spec->where_key = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4285  if (access_spec->where_key == NULL)
4286  {
4287  goto error;
4288  }
4289  }
4290 
4291  ptr = or_unpack_int (ptr, &offset);
4292  if (offset == 0)
4293  {
4294  access_spec->where_pred = NULL;
4295  }
4296  else
4297  {
4298  access_spec->where_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4299  if (access_spec->where_pred == NULL)
4300  {
4301  goto error;
4302  }
4303  }
4304 
4305  ptr = or_unpack_int (ptr, &offset);
4306  if (offset == 0)
4307  {
4308  access_spec->where_range = NULL;
4309  }
4310  else
4311  {
4312  access_spec->where_range = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4313  if (access_spec->where_range == NULL)
4314  {
4315  goto error;
4316  }
4317  }
4318 
4319  switch (access_spec->type)
4320  {
4321  case TARGET_CLASS:
4322  case TARGET_CLASS_ATTR:
4323  ptr = stx_build_cls_spec_type (thread_p, ptr, &ACCESS_SPEC_CLS_SPEC (access_spec));
4324  break;
4325 
4326  case TARGET_LIST:
4327  ptr = stx_build_list_spec_type (thread_p, ptr, &ACCESS_SPEC_LIST_SPEC (access_spec));
4328  break;
4329 
4330  case TARGET_SHOWSTMT:
4331  ptr = stx_build_showstmt_spec_type (thread_p, ptr, &ACCESS_SPEC_SHOWSTMT_SPEC (access_spec));
4332  break;
4333 
4334  case TARGET_REGUVAL_LIST:
4335  /* only for the customized type, arg is valid for the transition of customized outptr info */
4336  outptr_list = (OUTPTR_LIST *) arg;
4337  ptr = stx_build_rlist_spec_type (thread_p, ptr, &ACCESS_SPEC_RLIST_SPEC (access_spec), outptr_list);
4338  break;
4339 
4340  case TARGET_SET:
4341  ptr = stx_build_set_spec_type (thread_p, ptr, &ACCESS_SPEC_SET_SPEC (access_spec));
4342  break;
4343 
4344  case TARGET_METHOD:
4345  ptr = stx_build_method_spec_type (thread_p, ptr, &ACCESS_SPEC_METHOD_SPEC (access_spec));
4346  break;
4347 
4348  case TARGET_JSON_TABLE:
4349  ptr = stx_build (thread_p, ptr, ACCESS_SPEC_JSON_TABLE_SPEC (access_spec));
4350  break;
4351 
4352  default:
4354  return NULL;
4355  }
4356 
4357  if (ptr == NULL)
4358  {
4359  return NULL;
4360  }
4361 
4362  /* access_spec_type->s_id not sent to server */
4363  memset (&access_spec->s_id, '\0', sizeof (SCAN_ID));
4364  access_spec->s_id.status = S_CLOSED;
4365 
4366  if (access_spec->type == TARGET_JSON_TABLE)
4367  {
4368  // also initialize scan part; it is enough to call it once here, not on each query execution
4369  // since we initialize the json table here, we also have to initialize s_id.type
4370  access_spec->s_id.type = S_JSON_TABLE_SCAN;
4371  access_spec->s_id.s.jtid.init (access_spec->s.json_table_node);
4372  }
4373 
4374  access_spec->grouped_scan = false;
4375  access_spec->fixed_scan = false;
4376 
4377  ptr = or_unpack_int (ptr, &tmp);
4378  access_spec->single_fetch = (QPROC_SINGLE_FETCH) tmp;
4379 
4380  ptr = or_unpack_int (ptr, &access_spec->pruning_type);
4381  access_spec->parts = NULL;
4382  access_spec->curent = NULL;
4383  access_spec->pruned = false;
4384 
4385  access_spec->clear_value_at_clone_decache = xasl_unpack_info->use_xasl_clone;
4386  ptr = or_unpack_int (ptr, &offset);
4387  if (offset == 0)
4388  {
4389  access_spec->s_dbval = NULL;
4390  }
4391  else
4392  {
4393  access_spec->s_dbval = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4394  if (access_spec->s_dbval == NULL)
4395  {
4396  goto error;
4397  }
4398  }
4399 
4400  access_spec->parts = NULL;
4401  access_spec->curent = NULL;
4402  access_spec->pruned = false;
4403 
4404  ptr = or_unpack_int (ptr, &val);
4405  access_spec->flags = (ACCESS_SPEC_FLAG) val;
4406 
4407  return ptr;
4408 
4409 error:
4411  return NULL;
4412 }
4413 
4414 static char *
4416 {
4417  int tmp, offset;
4419 
4420  ptr = or_unpack_btid (ptr, &indx_info->btid);
4421 
4422  ptr = or_unpack_int (ptr, &indx_info->coverage);
4423 
4424  ptr = or_unpack_int (ptr, &tmp);
4425  indx_info->range_type = (RANGE_TYPE) tmp;
4426 
4427  ptr = stx_build_key_info (thread_p, ptr, &indx_info->key_info);
4428  if (ptr == NULL)
4429  {
4430  return NULL;
4431  }
4432 
4433  ptr = or_unpack_int (ptr, &indx_info->orderby_desc);
4434 
4435  ptr = or_unpack_int (ptr, &indx_info->groupby_desc);
4436 
4437  ptr = or_unpack_int (ptr, &indx_info->use_desc_index);
4438 
4439  ptr = or_unpack_int (ptr, &indx_info->orderby_skip);
4440 
4441  ptr = or_unpack_int (ptr, &indx_info->groupby_skip);
4442 
4443  ptr = or_unpack_int (ptr, &indx_info->use_iss);
4444 
4445  ptr = or_unpack_int (ptr, &indx_info->ils_prefix_len);
4446 
4447  ptr = or_unpack_int (ptr, &indx_info->func_idx_col_id);
4448 
4449  if (indx_info->use_iss)
4450  {
4451  ptr = or_unpack_int (ptr, &tmp);
4452  indx_info->iss_range.range = (RANGE) tmp;
4453 
4454  ptr = or_unpack_int (ptr, &offset);
4455  if (offset == 0)
4456  {
4457  /* can't go on without correct range */
4458  return NULL;
4459  }
4460  else
4461  {
4462  indx_info->iss_range.key1 = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4463  if (indx_info->iss_range.key1 == NULL)
4464  {
4466  return NULL;
4467  }
4468  }
4469 
4470  indx_info->iss_range.key2 = NULL;
4471  }
4472 
4473  return ptr;
4474 }
4475 
4476 static char *
4478 {
4479  int offset;
4480  int i;
4482 
4483  ptr = or_unpack_int (ptr, &key_info->key_cnt);
4484 
4485  ptr = or_unpack_int (ptr, &offset);
4486  if (offset == 0 || key_info->key_cnt == 0)
4487  {
4488  key_info->key_ranges = NULL;
4489  }
4490  else
4491  {
4492  key_info->key_ranges =
4493  stx_restore_key_range_array (thread_p, &xasl_unpack_info->packed_xasl[offset], key_info->key_cnt);
4494  if (key_info->key_ranges == NULL)
4495  {
4497  return NULL;
4498  }
4499  }
4500 
4501  ptr = or_unpack_int (ptr, &i);
4502  key_info->is_constant = (bool) i;
4503 
4504  ptr = or_unpack_int (ptr, &i);
4505  key_info->key_limit_reset = (bool) i;
4506 
4507  ptr = or_unpack_int (ptr, &i);
4508  key_info->is_user_given_keylimit = (bool) i;
4509 
4510  ptr = or_unpack_int (ptr, &offset);
4511  if (offset == 0)
4512  {
4513  key_info->key_limit_l = NULL;
4514  }
4515  else
4516  {
4517  key_info->key_limit_l = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4518  if (key_info->key_limit_l == NULL)
4519  {
4521  return NULL;
4522  }
4523  }
4524 
4525  ptr = or_unpack_int (ptr, &offset);
4526  if (offset == 0)
4527  {
4528  key_info->key_limit_u = NULL;
4529  }
4530  else
4531  {
4532  key_info->key_limit_u = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4533  if (key_info->key_limit_u == NULL)
4534  {
4536  return NULL;
4537  }
4538  }
4539 
4540  return ptr;
4541 }
4542 
4543 static char *
4544 stx_build_cls_spec_type (THREAD_ENTRY * thread_p, char *ptr, CLS_SPEC_TYPE * cls_spec)
4545 {
4546  int tmp, offset;
4548 
4549  ptr = or_unpack_hfid (ptr, &cls_spec->hfid);
4550  ptr = or_unpack_oid (ptr, &cls_spec->cls_oid);
4551 
4552  ptr = or_unpack_int (ptr, &offset);
4553  if (offset == 0)
4554  {
4555  cls_spec->cls_regu_list_key = NULL;
4556  }
4557  else
4558  {
4559  cls_spec->cls_regu_list_key = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4560  if (cls_spec->cls_regu_list_key == NULL)
4561  {
4562  goto error;
4563  }
4564  }
4565 
4566  ptr = or_unpack_int (ptr, &offset);
4567  if (offset == 0)
4568  {
4569  cls_spec->cls_regu_list_pred = NULL;
4570  }
4571  else
4572  {
4573  cls_spec->cls_regu_list_pred = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4574  if (cls_spec->cls_regu_list_pred == NULL)
4575  {
4576  goto error;
4577  }
4578  }
4579 
4580  ptr = or_unpack_int (ptr, &offset);
4581  if (offset == 0)
4582  {
4583  cls_spec->cls_regu_list_rest = NULL;
4584  }
4585  else
4586  {
4587  cls_spec->cls_regu_list_rest = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4588  if (cls_spec->cls_regu_list_rest == NULL)
4589  {
4590  goto error;
4591  }
4592  }
4593 
4594  ptr = or_unpack_int (ptr, &offset);
4595  if (offset == 0)
4596  {
4597  cls_spec->cls_regu_list_range = NULL;
4598  }
4599  else
4600  {
4601  cls_spec->cls_regu_list_range = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4602  if (cls_spec->cls_regu_list_range == NULL)
4603  {
4604  goto error;
4605  }
4606  }
4607 
4608  ptr = or_unpack_int (ptr, &offset);
4609  if (offset == 0)
4610  {
4611  cls_spec->cls_output_val_list = NULL;
4612  }
4613  else
4614  {
4615  cls_spec->cls_output_val_list = stx_restore_outptr_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4616  if (cls_spec->cls_output_val_list == NULL)
4617  {
4618  goto error;
4619  }
4620  }
4621 
4622  ptr = or_unpack_int (ptr, &offset);
4623  if (offset == 0)
4624  {
4625  cls_spec->cls_regu_val_list = NULL;
4626  }
4627  else
4628  {
4629  cls_spec->cls_regu_val_list = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4630  if (cls_spec->cls_regu_val_list == NULL)
4631  {
4632  goto error;
4633  }
4634  }
4635 
4636  ptr = or_unpack_int (ptr, &cls_spec->num_attrs_key);
4637  ptr = or_unpack_int (ptr, &offset);
4638  if (offset == 0 || cls_spec->num_attrs_key == 0)
4639  {
4640  cls_spec->attrids_key = NULL;
4641  }
4642  else
4643  {
4644  cls_spec->attrids_key =
4645  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], cls_spec->num_attrs_key);
4646  if (cls_spec->attrids_key == NULL)
4647  {
4648  goto error;
4649  }
4650  }
4651 
4652  ptr = or_unpack_int (ptr, &offset);
4653  if (offset == 0)
4654  {
4655  cls_spec->cache_key = NULL;
4656  }
4657  else
4658  {
4659  cls_spec->cache_key = stx_restore_cache_attrinfo (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4660  if (cls_spec->cache_key == NULL)
4661  {
4662  goto error;
4663  }
4664  }
4665 
4666  ptr = or_unpack_int (ptr, &cls_spec->num_attrs_pred);
4667  ptr = or_unpack_int (ptr, &offset);
4668  if (offset == 0 || cls_spec->num_attrs_pred == 0)
4669  {
4670  cls_spec->attrids_pred = NULL;
4671  }
4672  else
4673  {
4674  cls_spec->attrids_pred =
4675  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], cls_spec->num_attrs_pred);
4676  if (cls_spec->attrids_pred == NULL)
4677  {
4678  goto error;
4679  }
4680  }
4681 
4682  ptr = or_unpack_int (ptr, &offset);
4683  if (offset == 0)
4684  {
4685  cls_spec->cache_pred = NULL;
4686  }
4687  else
4688  {
4689  cls_spec->cache_pred = stx_restore_cache_attrinfo (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4690  if (cls_spec->cache_pred == NULL)
4691  {
4692  goto error;
4693  }
4694  }
4695 
4696  ptr = or_unpack_int (ptr, &cls_spec->num_attrs_rest);
4697  ptr = or_unpack_int (ptr, &offset);
4698  if (offset == 0 || cls_spec->num_attrs_rest == 0)
4699  {
4700  cls_spec->attrids_rest = NULL;
4701  }
4702  else
4703  {
4704  cls_spec->attrids_rest =
4705  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], cls_spec->num_attrs_rest);
4706  if (cls_spec->attrids_rest == NULL)
4707  {
4708  goto error;
4709  }
4710  }
4711 
4712  ptr = or_unpack_int (ptr, &offset);
4713  if (offset == 0)
4714  {
4715  cls_spec->cache_rest = NULL;
4716  }
4717  else
4718  {
4719  cls_spec->cache_rest = stx_restore_cache_attrinfo (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4720  if (cls_spec->cache_rest == NULL)
4721  {
4722  goto error;
4723  }
4724  }
4725 
4726  ptr = or_unpack_int (ptr, &tmp);
4727  cls_spec->schema_type = (ACCESS_SCHEMA_TYPE) tmp;
4728 
4729  ptr = or_unpack_int (ptr, &cls_spec->num_attrs_reserved);
4730 
4731  ptr = or_unpack_int (ptr, &offset);
4732  if (offset == 0)
4733  {
4734  cls_spec->cache_reserved = NULL;
4735  }
4736  else
4737  {
4738  cls_spec->cache_reserved =
4739  stx_restore_db_value_array_extra (thread_p, &xasl_unpack_info->packed_xasl[offset],
4740  cls_spec->num_attrs_reserved, cls_spec->num_attrs_reserved);
4741  if (cls_spec->cache_reserved == NULL)
4742  {
4743  goto error;
4744  }
4745  }
4746 
4747  ptr = or_unpack_int (ptr, &offset);
4748  if (offset == 0)
4749  {
4750  cls_spec->cls_regu_list_reserved = NULL;
4751  }
4752  else
4753  {
4754  cls_spec->cls_regu_list_reserved =
4755  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4756  if (cls_spec->cls_regu_list_reserved == NULL)
4757  {
4758  goto error;
4759  }
4760  }
4761 
4762  ptr = or_unpack_int (ptr, &cls_spec->num_attrs_range);
4763  ptr = or_unpack_int (ptr, &offset);
4764  if (offset == 0 || cls_spec->num_attrs_range == 0)
4765  {
4766  cls_spec->attrids_range = NULL;
4767  }
4768  else
4769  {
4770  cls_spec->attrids_range =
4771  stx_restore_int_array (thread_p, &xasl_unpack_info->packed_xasl[offset], cls_spec->num_attrs_range);
4772  if (cls_spec->attrids_range == NULL)
4773  {
4774  goto error;
4775  }
4776  }
4777 
4778  ptr = or_unpack_int (ptr, &offset);
4779  if (offset == 0)
4780  {
4781  cls_spec->cache_range = NULL;
4782  }
4783  else
4784  {
4785  cls_spec->cache_range = stx_restore_cache_attrinfo (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4786  if (cls_spec->cache_range == NULL)
4787  {
4788  goto error;
4789  }
4790  }
4791 
4792  return ptr;
4793 
4794 error:
4796  return NULL;
4797 }
4798 
4799 static char *
4800 stx_build_list_spec_type (THREAD_ENTRY * thread_p, char *ptr, LIST_SPEC_TYPE * list_spec_type)
4801 {
4802  int offset;
4804 
4805  ptr = or_unpack_int (ptr, &offset);
4806  if (offset == 0)
4807  {
4808  list_spec_type->xasl_node = NULL;
4809  }
4810  else
4811  {
4812  list_spec_type->xasl_node = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4813  if (list_spec_type->xasl_node == NULL)
4814  {
4815  goto error;
4816  }
4817  }
4818 
4819  ptr = or_unpack_int (ptr, &offset);
4820  if (offset == 0)
4821  {
4822  list_spec_type->list_regu_list_pred = NULL;
4823  }
4824  else
4825  {
4826  list_spec_type->list_regu_list_pred =
4827  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4828  if (list_spec_type->list_regu_list_pred == NULL)
4829  {
4830  goto error;
4831  }
4832  }
4833 
4834  ptr = or_unpack_int (ptr, &offset);
4835  if (offset == 0)
4836  {
4837  list_spec_type->list_regu_list_rest = NULL;
4838  }
4839  else
4840  {
4841  list_spec_type->list_regu_list_rest =
4842  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4843  if (list_spec_type->list_regu_list_rest == NULL)
4844  {
4845  goto error;
4846  }
4847  }
4848 
4849  ptr = or_unpack_int (ptr, &offset);
4850  if (offset == 0)
4851  {
4852  list_spec_type->list_regu_list_build = NULL;
4853  }
4854  else
4855  {
4856  list_spec_type->list_regu_list_build =
4857  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4858  if (list_spec_type->list_regu_list_build == NULL)
4859  {
4860  goto error;
4861  }
4862  }
4863 
4864  ptr = or_unpack_int (ptr, &offset);
4865  if (offset == 0)
4866  {
4867  list_spec_type->list_regu_list_probe = NULL;
4868  }
4869  else
4870  {
4871  list_spec_type->list_regu_list_probe =
4872  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4873  if (list_spec_type->list_regu_list_probe == NULL)
4874  {
4875  goto error;
4876  }
4877  }
4878 
4879  ptr = or_unpack_int (ptr, (int *) &list_spec_type->hash_list_scan_yn);
4880 
4881  return ptr;
4882 
4883 error:
4885  return NULL;
4886 }
4887 
4888 static char *
4889 stx_build_showstmt_spec_type (THREAD_ENTRY * thread_p, char *ptr, SHOWSTMT_SPEC_TYPE * showstmt_spec_type)
4890 {
4891  int offset;
4892  int val;
4894 
4895  ptr = or_unpack_int (ptr, &val);
4896  showstmt_spec_type->show_type = (SHOWSTMT_TYPE) val;
4897 
4898  ptr = or_unpack_int (ptr, &offset);
4899  if (offset == 0)
4900  {
4901  showstmt_spec_type->arg_list = NULL;
4902  }
4903  else
4904  {
4905  showstmt_spec_type->arg_list = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4906  if (showstmt_spec_type->arg_list == NULL)
4907  {
4908  goto error;
4909  }
4910  }
4911 
4912  return ptr;
4913 
4914 error:
4916  return NULL;
4917 }
4918 
4919 static char *
4920 stx_build_rlist_spec_type (THREAD_ENTRY * thread_p, char *ptr, REGUVAL_LIST_SPEC_TYPE * spec, OUTPTR_LIST * outptr_list)
4921 {
4922  assert (ptr != NULL && spec != NULL);
4923 
4924  if (outptr_list == NULL)
4925  {
4927  return NULL;
4928  }
4929  spec->valptr_list = outptr_list;
4930 
4931  return ptr;
4932 }
4933 
4934 static char *
4935 stx_build_set_spec_type (THREAD_ENTRY * thread_p, char *ptr, SET_SPEC_TYPE * set_spec)
4936 {
4937  int offset;
4939 
4940  ptr = or_unpack_int (ptr, &offset);
4941  if (offset == 0)
4942  {
4943  set_spec->set_ptr = NULL;
4944  }
4945  else
4946  {
4947  set_spec->set_ptr = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4948  if (set_spec->set_ptr == NULL)
4949  {
4951  return NULL;
4952  }
4953  }
4954 
4955  ptr = or_unpack_int (ptr, &offset);
4956  if (offset == 0)
4957  {
4958  set_spec->set_regu_list = NULL;
4959  }
4960  else
4961  {
4962  set_spec->set_regu_list = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4963  if (set_spec->set_regu_list == NULL)
4964  {
4966  return NULL;
4967  }
4968  }
4969 
4970  return ptr;
4971 }
4972 
4973 static char *
4974 stx_build_method_spec_type (THREAD_ENTRY * thread_p, char *ptr, METHOD_SPEC_TYPE * method_spec)
4975 {
4976  int offset;
4978 
4979  ptr = or_unpack_int (ptr, &offset);
4980  if (offset == 0)
4981  {
4982  method_spec->xasl_node = NULL;
4983  }
4984  else
4985  {
4986  method_spec->xasl_node = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
4987  if (method_spec->xasl_node == NULL)
4988  {
4990  return NULL;
4991  }
4992  }
4993 
4994  ptr = or_unpack_int (ptr, &offset);
4995  if (offset == 0)
4996  {
4997  method_spec->method_regu_list = NULL;
4998  }
4999  else
5000  {
5001  method_spec->method_regu_list = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5002  if (method_spec->method_regu_list == NULL)
5003  {
5005  return NULL;
5006  }
5007  }
5008 
5009  ptr = or_unpack_int (ptr, &offset);
5010  if (offset == 0)
5011  {
5012  method_spec->method_sig_list = NULL;
5013  }
5014  else
5015  {
5016  method_spec->method_sig_list = stx_restore_method_sig_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5017  if (method_spec->method_sig_list == NULL)
5018  {
5020  return NULL;
5021  }
5022  }
5023 
5024  return ptr;
5025 }
5026 
5027 static char *
5028 stx_build_val_list (THREAD_ENTRY * thread_p, char *ptr, VAL_LIST * val_list)
5029 {
5030  int offset, i;
5031  QPROC_DB_VALUE_LIST value_list = NULL;
5033 
5034  ptr = or_unpack_int (ptr, &val_list->val_cnt);
5035 
5036  value_list =
5037  (QPROC_DB_VALUE_LIST) stx_alloc_struct (thread_p, sizeof (struct qproc_db_value_list) * val_list->val_cnt);
5038  if (val_list->val_cnt)
5039  {
5040  if (value_list == NULL)
5041  {
5043  return NULL;
5044  }
5045  }
5046 
5047  for (i = 0; i < val_list->val_cnt; i++)
5048  {
5049  ptr = or_unpack_int (ptr, &offset);
5050  if (offset == 0)
5051  {
5052  value_list[i].val = NULL;
5053  }
5054  else
5055  {
5056  value_list[i].val = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5057  if (value_list[i].val == NULL)
5058  {
5060  return NULL;
5061  }
5062  assert (value_list[i].val->need_clear == false);
5063  }
5064 
5065  if (i < val_list->val_cnt - 1)
5066  {
5067  value_list[i].next = (QPROC_DB_VALUE_LIST) (&value_list[i + 1]);
5068  }
5069  else
5070  {
5071  value_list[i].next = NULL;
5072  }
5073  }
5074 
5075  val_list->valp = value_list;
5076 
5077  return ptr;
5078 }
5079 
5080 #if defined(ENABLE_UNUSED_FUNCTION)
5081 static char *
5082 stx_build_db_value_list (THREAD_ENTRY * thread_p, char *ptr, QPROC_DB_VALUE_LIST value_list)
5083 {
5084  int offset;
5085  XASL_UNPACK_INFO *xasl_unpack_info = stx_get_xasl_unpack_info_ptr (thread_p);
5086 
5087  ptr = or_unpack_int (ptr, &offset);
5088  if (offset == 0)
5089  {
5090  value_list->next = NULL;
5091  }
5092  else
5093  {
5094  value_list->next = stx_restore_db_value_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5095  if (value_list->next == NULL)
5096  {
5098  return NULL;
5099  }
5100  }
5101 
5102  ptr = or_unpack_int (ptr, &offset);
5103  if (offset == 0)
5104  {
5105  value_list->val = NULL;
5106  }
5107  else
5108  {
5109  value_list->val = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5110  if (value_list->val == NULL)
5111  {
5113  return NULL;
5114  }
5115  }
5116 
5117  return ptr;
5118 }
5119 #endif
5120 
5121 static char *
5122 stx_build_regu_variable (THREAD_ENTRY * thread_p, char *ptr, REGU_VARIABLE * regu_var)
5123 {
5124  int tmp, offset;
5125 
5127 
5128  ptr = or_unpack_domain (ptr, &regu_var->domain, NULL);
5129  /* save the original domain */
5130  regu_var->original_domain = regu_var->domain;
5131 
5132  ptr = or_unpack_int (ptr, &tmp);
5133  regu_var->type = (REGU_DATATYPE) tmp;
5134 
5135  ptr = or_unpack_int (ptr, &regu_var->flags);
5138 
5139  ptr = or_unpack_int (ptr, &offset);
5140  if (offset == 0)
5141  {
5142  regu_var->vfetch_to = NULL;
5143  }
5144  else
5145  {
5146  regu_var->vfetch_to = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5147  if (regu_var->vfetch_to == NULL)
5148  {
5149  goto error;
5150  }
5151  }
5152 
5153  ptr = or_unpack_int (ptr, &offset);
5154  if (offset == 0)
5155  {
5156  regu_var->xasl = NULL;
5157  }
5158  else
5159  {
5160  regu_var->xasl = stx_restore_xasl_node (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5161  if (regu_var->xasl == NULL)
5162  {
5163  goto error;
5164  }
5165  }
5166 
5167  ptr = stx_unpack_regu_variable_value (thread_p, ptr, regu_var);
5168 
5169  return ptr;
5170 
5171 error:
5173  return NULL;
5174 }
5175 
5176 static char *
5177 stx_unpack_regu_variable_value (THREAD_ENTRY * thread_p, char *ptr, REGU_VARIABLE * regu_var)
5178 {
5179  REGU_VALUE_LIST *regu_list;
5180  REGU_VARIABLE_LIST regu_var_list = NULL;
5181  int offset;
5182  XASL_UNPACK_INFO *xasl_unpack_info_p = get_xasl_unpack_info_ptr (thread_p);
5183 
5184  assert (ptr != NULL && regu_var != NULL);
5185 
5186  switch (regu_var->type)
5187  {
5188  case TYPE_REGU_VAR_LIST:
5189  ptr = stx_build_regu_variable_list (thread_p, ptr, &regu_var_list);
5190  if (ptr == NULL)
5191  {
5192  goto error;
5193  }
5194  regu_var->value.regu_var_list = regu_var_list;
5195  break;
5196 
5197  case TYPE_REGUVAL_LIST:
5198  regu_list = stx_regu_value_list_alloc_and_init (thread_p);
5199 
5200  if (regu_list == NULL)
5201  {
5202  goto error;
5203  }
5204 
5205  ptr = stx_build_regu_value_list (thread_p, ptr, regu_list, regu_var->domain);
5206  if (ptr == NULL)
5207  {
5208  goto error;
5209  }
5210 
5211  regu_var->value.reguval_list = regu_list;
5212  break;
5213 
5214  case TYPE_DBVAL:
5215  ptr = stx_build_db_value (thread_p, ptr, &regu_var->value.dbval);
5216  if (xasl_unpack_info_p->use_xasl_clone && !db_value_is_null (&regu_var->value.dbval))
5217  {
5219  }
5220  break;
5221 
5222  case TYPE_CONSTANT:
5223  case TYPE_ORDERBY_NUM:
5224  ptr = or_unpack_int (ptr, &offset);
5225  if (offset == 0)
5226  {
5227  regu_var->value.dbvalptr = NULL;
5228  }
5229  else
5230  {
5231  regu_var->value.dbvalptr = stx_restore_db_value (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
5232  if (regu_var->value.dbvalptr == NULL)
5233  {
5234  goto error;
5235  }
5236  if (xasl_unpack_info_p->use_xasl_clone && regu_var->value.dbvalptr->need_clear)
5237  {
5239  }
5240  }
5241  break;
5242 
5243  case TYPE_INARITH:
5244  case TYPE_OUTARITH:
5245  ptr = or_unpack_int (ptr, &offset);
5246  if (offset == 0)
5247  {
5248  regu_var->value.arithptr = NULL;
5249  }
5250  else
5251  {
5252  regu_var->value.arithptr = stx_restore_arith_type (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
5253  if (regu_var->value.arithptr == NULL)
5254  {
5255  goto error;
5256  }
5257  }
5258  break;
5259 
5260  case TYPE_FUNC:
5261  ptr = or_unpack_int (ptr, &offset);
5262  if (offset == 0)
5263  {
5264  regu_var->value.funcp = NULL;
5265  }
5266  else
5267  {
5268  regu_var->value.funcp = stx_restore_function_type (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
5269  if (regu_var->value.funcp == NULL)
5270  {
5271  goto error;
5272  }
5273  }
5274  break;
5275 
5276  case TYPE_ATTR_ID:
5277  case TYPE_SHARED_ATTR_ID:
5278  case TYPE_CLASS_ATTR_ID:
5279  ptr = stx_build_attr_descr (thread_p, ptr, &regu_var->value.attr_descr);
5280  break;
5281 
5282  case TYPE_LIST_ID:
5283  ptr = or_unpack_int (ptr, &offset);
5284  if (offset == 0)
5285  {
5286  regu_var->value.srlist_id = NULL;
5287  }
5288  else
5289  {
5290  regu_var->value.srlist_id = stx_restore_srlist_id (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
5291  if (regu_var->value.srlist_id == NULL)
5292  {
5293  goto error;
5294  }
5295  }
5296  break;
5297 
5298  case TYPE_POSITION:
5299  ptr = stx_build_pos_descr (ptr, &regu_var->value.pos_descr);
5300  break;
5301 
5302  case TYPE_POS_VALUE:
5303  ptr = or_unpack_int (ptr, &regu_var->value.val_pos);
5304  break;
5305 
5306  case TYPE_OID:
5307  case TYPE_CLASSOID:
5308  break;
5309 
5310  default:
5312  return NULL;
5313  }
5314 
5315  return ptr;
5316 
5317 error:
5319  return NULL;
5320 }
5321 
5322 static char *
5323 stx_build_attr_descr (THREAD_ENTRY * thread_p, char *ptr, ATTR_DESCR * attr_descr)
5324 {
5325  int tmp, offset;
5327 
5328  ptr = or_unpack_int (ptr, &tmp);
5329  attr_descr->id = (CL_ATTR_ID) tmp;
5330 
5331  ptr = or_unpack_int (ptr, &tmp);
5332  attr_descr->type = (DB_TYPE) tmp;
5333 
5334  ptr = or_unpack_int (ptr, &offset);
5335  if (offset == 0)
5336  {
5337  attr_descr->cache_attrinfo = NULL;
5338  }
5339  else
5340  {
5341  attr_descr->cache_attrinfo = stx_restore_cache_attrinfo (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5342  if (attr_descr->cache_attrinfo == NULL)
5343  {
5345  return NULL;
5346  }
5347  }
5348 
5349  attr_descr->cache_dbvalp = NULL;
5350 
5351  return ptr;
5352 }
5353 
5354 static char *
5356 {
5357  ptr = or_unpack_int (ptr, &position_descr->pos_no);
5358  ptr = or_unpack_domain (ptr, &position_descr->dom, NULL);
5359  position_descr->original_domain = position_descr->dom;
5360 
5361  return ptr;
5362 }
5363 
5364 static char *
5365 stx_build_arith_type (THREAD_ENTRY * thread_p, char *ptr, ARITH_TYPE * arith_type)
5366 {
5367  int tmp, offset;
5369 
5370  ptr = or_unpack_domain (ptr, &arith_type->domain, NULL);
5371  /* save the original domain */
5372  arith_type->original_domain = arith_type->domain;
5373 
5374  ptr = or_unpack_int (ptr, &offset);
5375  if (offset == 0)
5376  {
5377  arith_type->value = NULL;
5378  }
5379  else
5380  {
5381  arith_type->value = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5382  if (arith_type->value == NULL)
5383  {
5384  goto error;
5385  }
5386  assert (arith_type->value->need_clear == false);
5387  }
5388 
5389  ptr = or_unpack_int (ptr, &tmp);
5390  arith_type->opcode = (OPERATOR_TYPE) tmp;
5391 
5392  ptr = or_unpack_int (ptr, &offset);
5393  if (offset == 0)
5394  {
5395  arith_type->leftptr = NULL;
5396  }
5397  else
5398  {
5399  arith_type->leftptr = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5400  if (arith_type->leftptr == NULL)
5401  {
5402  goto error;
5403  }
5404  }
5405 
5406  ptr = or_unpack_int (ptr, &offset);
5407  if (offset == 0)
5408  {
5409  arith_type->rightptr = NULL;
5410  }
5411  else
5412  {
5413  arith_type->rightptr = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5414  if (arith_type->rightptr == NULL)
5415  {
5416  goto error;
5417  }
5418  }
5419 
5420  ptr = or_unpack_int (ptr, &offset);
5421  if (offset == 0)
5422  {
5423  arith_type->thirdptr = NULL;
5424  }
5425  else
5426  {
5427  arith_type->thirdptr = stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5428  if (arith_type->thirdptr == NULL)
5429  {
5430  goto error;
5431  }
5432  }
5433 
5434  ptr = or_unpack_int (ptr, &tmp);
5435  arith_type->misc_operand = (MISC_OPERAND) tmp;
5436 
5437  if (arith_type->opcode == T_CASE || arith_type->opcode == T_DECODE || arith_type->opcode == T_PREDICATE
5438  || arith_type->opcode == T_IF)
5439  {
5440  ptr = or_unpack_int (ptr, &offset);
5441  if (offset == 0)
5442  {
5443  arith_type->pred = NULL;
5444  }
5445  else
5446  {
5447  arith_type->pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5448  if (arith_type->pred == NULL)
5449  {
5450  goto error;
5451  }
5452  }
5453  }
5454  else
5455  {
5456  arith_type->pred = NULL;
5457  }
5458 
5459  /* This member is only used on server internally. */
5460  arith_type->rand_seed = NULL;
5461 
5462  return ptr;
5463 
5464 error:
5466  return NULL;
5467 }
5468 
5469 static char *
5470 stx_build_aggregate_type (THREAD_ENTRY * thread_p, char *ptr, AGGREGATE_TYPE * aggregate)
5471 {
5472  int offset;
5473  int tmp;
5474  XASL_UNPACK_INFO *xasl_unpack_info_p = get_xasl_unpack_info_ptr (thread_p);
5475 
5476  assert (ptr != NULL && aggregate != NULL);
5477 
5478  /* domain */
5479  ptr = or_unpack_domain (ptr, &aggregate->domain, NULL);
5480  aggregate->original_domain = aggregate->domain;
5481 
5482  /* accumulator */
5483  aggregate->accumulator.clear_value_at_clone_decache = false;
5484  ptr = or_unpack_int (ptr, &offset);
5485  if (offset == 0)
5486  {
5487  aggregate->accumulator.value = NULL;
5488  }
5489  else
5490  {
5491  aggregate->accumulator.value = stx_restore_db_value (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
5492  if (aggregate->accumulator.value == NULL)
5493  {
5494  goto error;
5495  }
5496  if (xasl_unpack_info_p->use_xasl_clone && !db_value_is_null (aggregate->accumulator.value))
5497  {
5498  aggregate->accumulator.clear_value_at_clone_decache = true;
5499  }
5500  }
5501 
5502  aggregate->accumulator.clear_value2_at_clone_decache = false;
5503  ptr = or_unpack_int (ptr, &offset);
5504  if (offset == 0)
5505  {
5506  aggregate->accumulator.value2 = NULL;
5507  }
5508  else
5509  {
5510  aggregate->accumulator.value2 = stx_restore_db_value (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
5511  if (aggregate->accumulator.value2 == NULL)
5512  {
5513  goto error;
5514  }
5515  if (xasl_unpack_info_p->use_xasl_clone && !db_value_is_null (aggregate->accumulator.value2))
5516  {
5517  aggregate->accumulator.clear_value2_at_clone_decache = true;
5518  }
5519  }
5520 
5521  ptr = or_unpack_int (ptr, &aggregate->accumulator.curr_cnt);
5522 
5523  /* next */
5524  ptr = or_unpack_int (ptr, &offset);
5525  if (offset == 0)
5526  {
5527  aggregate->next = NULL;
5528  }
5529  else
5530  {
5531  aggregate->next = stx_restore_aggregate_type (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
5532  if (aggregate->next == NULL)
5533  {
5534  goto error;
5535  }
5536  }
5537 
5538  /* function */
5539  ptr = or_unpack_int (ptr, &tmp);
5540  aggregate->function = (FUNC_TYPE) tmp;
5541 
5542  /* option */
5543  ptr = or_unpack_int (ptr, &tmp);
5544  aggregate->option = (QUERY_OPTIONS) tmp;
5545 
5546  /* opr_dbtype */
5547  ptr = or_unpack_int (ptr, &tmp);
5548  aggregate->opr_dbtype = (DB_TYPE) tmp;
5549  aggregate->original_opr_dbtype = aggregate->opr_dbtype;
5550 
5551  ptr = stx_build_regu_variable_list (thread_p, ptr, &aggregate->operands);
5552  if (ptr == NULL)
5553  {
5554  return NULL;
5555  }
5556 
5557  /* list_id */
5558  ptr = or_unpack_int (ptr, &offset);
5559  if (offset == 0)
5560  {
5561  aggregate->list_id = NULL;
5562  }
5563  else
5564  {
5565  aggregate->list_id = stx_restore_list_id (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
5566  if (aggregate->list_id == NULL)
5567  {
5568  goto error;
5569  }
5570  }
5571 
5572  /* flag_agg_optimize */
5573  ptr = or_unpack_int (ptr, (int *) &aggregate->flag_agg_optimize);
5574 
5575  /* btid */
5576  ptr = or_unpack_btid (ptr, &aggregate->btid);
5577 
5578  /* sort_list */
5579  ptr = or_unpack_int (ptr, &offset);
5580  if (offset == 0)
5581  {
5582  aggregate->sort_list = NULL;
5583  }
5584  else
5585  {
5586  aggregate->sort_list = stx_restore_sort_list (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
5587  if (aggregate->sort_list == NULL)
5588  {
5589  goto error;
5590  }
5591  }
5592 
5593  /* info */
5594  if (aggregate->function == PT_PERCENTILE_CONT || aggregate->function == PT_PERCENTILE_DISC)
5595  {
5596  ptr = or_unpack_int (ptr, &offset);
5597  if (offset > 0)
5598  {
5599  aggregate->info.percentile.percentile_reguvar =
5600  stx_restore_regu_variable (thread_p, &xasl_unpack_info_p->packed_xasl[offset]);
5601  if (aggregate->info.percentile.percentile_reguvar == NULL)
5602  {
5603  goto error;
5604  }
5605  }
5606  else
5607  {
5608  goto error;
5609  }
5610  }
5611  else if (aggregate->function == PT_CUME_DIST || aggregate->function == PT_PERCENT_RANK)
5612  {
5613  /* init info.dist_percent */
5614  aggregate->info.dist_percent.const_array = NULL;
5615  aggregate->info.dist_percent.list_len = 0;
5616  aggregate->info.dist_percent.nlargers = 0;
5617  }
5618  else
5619  {
5620  /* Other functions need specific variables if any in the future */
5621  ;
5622  }
5623 
5624  /* accumulator_domain */
5625  aggregate->accumulator_domain.value_dom = NULL;
5626  aggregate->accumulator_domain.value2_dom = NULL;
5627 
5628  return ptr;
5629 
5630 error:
5632  return NULL;
5633 }
5634 
5635 static char *
5636 stx_build_function_type (THREAD_ENTRY * thread_p, char *ptr, FUNCTION_TYPE * function)
5637 {
5638  int tmp, offset;
5640 
5641  ptr = or_unpack_int (ptr, &offset);
5642  if (offset == 0)
5643  {
5644  function->value = NULL;
5645  }
5646  else
5647  {
5648  function->value = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5649  if (function->value == NULL)
5650  {
5652  return NULL;
5653  }
5654  assert (function->value->need_clear == false);
5655  }
5656 
5657  ptr = or_unpack_int (ptr, &tmp);
5658  function->ftype = (FUNC_TYPE) tmp;
5659 
5660  ptr = or_unpack_int (ptr, &offset);
5661  if (offset == 0)
5662  {
5663  function->operand = NULL;
5664  }
5665  else
5666  {
5667  function->operand = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5668  if (function->operand == NULL)
5669  {
5671  return NULL;
5672  }
5673  }
5674 
5675  function->tmp_obj = NULL;
5676 
5677  return ptr;
5678 }
5679 
5680 static char *
5681 stx_build_analytic_type (THREAD_ENTRY * thread_p, char *ptr, ANALYTIC_TYPE * analytic)
5682 {
5683  int offset;
5684  int tmp_i;
5686 
5687  assert (ptr != NULL && analytic != NULL);
5688 
5689  /* domain */
5690  ptr = or_unpack_domain (ptr, &analytic->domain, NULL);
5691  analytic->original_domain = analytic->domain;
5692 
5693  /* value */
5694  ptr = or_unpack_int (ptr, &offset);
5695  if (offset == 0)
5696  {
5697  analytic->value = NULL;
5698  }
5699  else
5700  {
5701  analytic->value = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5702  if (analytic->value == NULL)
5703  {
5704  goto error;
5705  }
5706  assert (analytic->value->need_clear == false);
5707  }
5708 
5709  /* value2 */
5710  ptr = or_unpack_int (ptr, &offset);
5711  if (offset == 0)
5712  {
5713  analytic->value2 = NULL;
5714  }
5715  else
5716  {
5717  analytic->value2 = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5718  if (analytic->value2 == NULL)
5719  {
5720  goto error;
5721  }
5722  assert (analytic->value2->need_clear == false);
5723  }
5724 
5725  /* out_value */
5726  ptr = or_unpack_int (ptr, &offset);
5727  if (offset == 0)
5728  {
5729  analytic->out_value = NULL;
5730  }
5731  else
5732  {
5733  analytic->out_value = stx_restore_db_value (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5734  if (analytic->out_value == NULL)
5735  {
5736  goto error;
5737  }
5738  assert (analytic->out_value->need_clear == false);
5739  }
5740 
5741  /* offset_idx */
5742  ptr = or_unpack_int (ptr, &analytic->offset_idx);
5743 
5744  /* default_idx */
5745  ptr = or_unpack_int (ptr, &analytic->default_idx);
5746 
5747  /* next */
5748  ptr = or_unpack_int (ptr, &offset);
5749  if (offset == 0)
5750  {
5751  analytic->next = NULL;
5752  }
5753  else
5754  {
5755  analytic->next = stx_restore_analytic_type (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5756  if (analytic->next == NULL)
5757  {
5758  goto error;
5759  }
5760  }
5761 
5762  /* function */
5763  ptr = or_unpack_int (ptr, &tmp_i);
5764  analytic->function = (FUNC_TYPE) tmp_i;
5765 
5766  /* option */
5767  ptr = or_unpack_int (ptr, &tmp_i);
5768  analytic->option = (QUERY_OPTIONS) tmp_i;
5769 
5770  /* opr_dbtype */
5771  ptr = or_unpack_int (ptr, &tmp_i);
5772  analytic->opr_dbtype = (DB_TYPE) tmp_i;
5773  analytic->original_opr_dbtype = analytic->opr_dbtype;
5774 
5775  /* operand */
5776  ptr = stx_build_regu_variable (thread_p, ptr, &analytic->operand);
5777  if (ptr == NULL)
5778  {
5779  return NULL;
5780  }
5781 
5782  /* list_id */
5783  ptr = or_unpack_int (ptr, &offset);
5784  if (offset == 0)
5785  {
5786  analytic->list_id = NULL;
5787  }
5788  else
5789  {
5790  analytic->list_id = stx_restore_list_id (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5791  if (analytic->list_id == NULL)
5792  {
5793  goto error;
5794  }
5795  }
5796 
5797  /* sort_prefix_size */
5798  ptr = or_unpack_int (ptr, &analytic->sort_prefix_size);
5799 
5800  /* sort_list_size */
5801  ptr = or_unpack_int (ptr, &analytic->sort_list_size);
5802 
5803  /* flag */
5804  ptr = or_unpack_int (ptr, &analytic->flag);
5805 
5806  /* from_last */
5807  ptr = or_unpack_int (ptr, &tmp_i);
5808  analytic->from_last = (bool) tmp_i;
5809 
5810  /* ignore_nulls */
5811  ptr = or_unpack_int (ptr, &tmp_i);
5812  analytic->ignore_nulls = (bool) tmp_i;
5813 
5814  /* is_const_operand */
5815  ptr = or_unpack_int (ptr, &tmp_i);
5816  analytic->is_const_operand = (bool) tmp_i;
5817 
5818  if (analytic->function == PT_PERCENTILE_CONT || analytic->function == PT_PERCENTILE_DISC)
5819  {
5820  ptr = or_unpack_int (ptr, &offset);
5821 
5822  if (offset > 0)
5823  {
5824  analytic->info.percentile.percentile_reguvar =
5825  stx_restore_regu_variable (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5826  if (analytic->info.percentile.percentile_reguvar == NULL)
5827  {
5828  goto error;
5829  }
5830  }
5831  else
5832  {
5833  goto error;
5834  }
5835  }
5836  else
5837  {
5838  /* Other functions need specific variables if any in the future */
5839  ;
5840  }
5841 
5842  return ptr;
5843 
5844 error:
5846  return NULL;
5847 }
5848 
5849 static char *
5850 stx_build_analytic_eval_type (THREAD_ENTRY * thread_p, char *ptr, ANALYTIC_EVAL_TYPE * analytic_eval)
5851 {
5852  int offset;
5854 
5855  ptr = or_unpack_int (ptr, &offset);
5856 
5857  assert (offset != 0); /* head should exist */
5858 
5859  analytic_eval->head = stx_restore_analytic_type (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5860  if (analytic_eval->head == NULL)
5861  {
5862  goto error;
5863  }
5864 
5865  ptr = or_unpack_int (ptr, &offset);
5866  if (offset == 0)
5867  {
5868  analytic_eval->sort_list = NULL;
5869  }
5870  else
5871  {
5872  analytic_eval->sort_list = stx_restore_sort_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5873  if (analytic_eval->sort_list == NULL)
5874  {
5875  goto error;
5876  }
5877  }
5878 
5879  ptr = or_unpack_int (ptr, &offset);
5880  if (offset == 0)
5881  {
5882  analytic_eval->next = NULL;
5883  }
5884  else
5885  {
5886  analytic_eval->next = stx_restore_analytic_eval_type (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5887  if (analytic_eval->next == NULL)
5888  {
5889  goto error;
5890  }
5891  }
5892 
5893  return ptr;
5894 
5895 error:
5897  return NULL;
5898 }
5899 
5900 static char *
5901 stx_build_srlist_id (THREAD_ENTRY * thread_p, char *ptr, QFILE_SORTED_LIST_ID * sort_list_id)
5902 {
5903  int offset;
5905 
5906  ptr = or_unpack_int (ptr, &sort_list_id->sorted);
5907 
5908  ptr = or_unpack_int (ptr, &offset);
5909  if (offset == 0)
5910  {
5911  sort_list_id->list_id = NULL;
5912  }
5913  else
5914  {
5915  sort_list_id->list_id = stx_restore_list_id (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5916  if (sort_list_id->list_id == NULL)
5917  {
5919  return NULL;
5920  }
5921  }
5922 
5923  return ptr;
5924 }
5925 
5926 static char *
5928 {
5929  int tmp, offset;
5931 
5932  ptr = or_unpack_int (ptr, &offset);
5933  if (offset == 0)
5934  {
5935  sort_list->next = NULL;
5936  }
5937  else
5938  {
5939  sort_list->next = stx_restore_sort_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5940  if (sort_list->next == NULL)
5941  {
5943  return NULL;
5944  }
5945  }
5946 
5947  ptr = stx_build_pos_descr (ptr, &sort_list->pos_descr);
5948  if (ptr == NULL)
5949  {
5950  return NULL;
5951  }
5952 
5953  ptr = or_unpack_int (ptr, &tmp);
5954  sort_list->s_order = (SORT_ORDER) tmp;
5955 
5956  ptr = or_unpack_int (ptr, &tmp);
5957  sort_list->s_nulls = (SORT_NULLS) tmp;
5958 
5959  return ptr;
5960 }
5961 
5962 static char *
5963 stx_build_connectby_proc (THREAD_ENTRY * thread_p, char *ptr, CONNECTBY_PROC_NODE * stx_connectby_proc)
5964 {
5965  int offset;
5966  int tmp;
5967 
5969 
5970  ptr = or_unpack_int (ptr, &offset);
5971  if (offset == 0)
5972  {
5973  stx_connectby_proc->start_with_pred = NULL;
5974  }
5975  else
5976  {
5977  stx_connectby_proc->start_with_pred = stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5978  if (stx_connectby_proc->start_with_pred == NULL)
5979  {
5980  goto error;
5981  }
5982  }
5983 
5984  ptr = or_unpack_int (ptr, &offset);
5985  if (offset == 0)
5986  {
5987  stx_connectby_proc->after_connect_by_pred = NULL;
5988  }
5989  else
5990  {
5991  stx_connectby_proc->after_connect_by_pred =
5992  stx_restore_pred_expr (thread_p, &xasl_unpack_info->packed_xasl[offset]);
5993  if (stx_connectby_proc->after_connect_by_pred == NULL)
5994  {
5995  goto error;
5996  }
5997  }
5998 
5999  ptr = or_unpack_int (ptr, &offset);
6000  if (offset == 0)
6001  {
6002  stx_connectby_proc->input_list_id = NULL;
6003  }
6004  else
6005  {
6006  stx_connectby_proc->input_list_id = stx_restore_list_id (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6007  if (stx_connectby_proc->input_list_id == NULL)
6008  {
6009  goto error;
6010  }
6011  }
6012 
6013  ptr = or_unpack_int (ptr, &offset);
6014  if (offset == 0)
6015  {
6016  stx_connectby_proc->start_with_list_id = NULL;
6017  }
6018  else
6019  {
6020  stx_connectby_proc->start_with_list_id = stx_restore_list_id (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6021  if (stx_connectby_proc->start_with_list_id == NULL)
6022  {
6023  goto error;
6024  }
6025  }
6026 
6027  ptr = or_unpack_int (ptr, &offset);
6028  if (offset == 0)
6029  {
6030  stx_connectby_proc->regu_list_pred = NULL;
6031  }
6032  else
6033  {
6034  stx_connectby_proc->regu_list_pred =
6035  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6036  if (stx_connectby_proc->regu_list_pred == NULL)
6037  {
6038  goto error;
6039  }
6040  }
6041 
6042  ptr = or_unpack_int (ptr, &offset);
6043  if (offset == 0)
6044  {
6045  stx_connectby_proc->regu_list_rest = NULL;
6046  }
6047  else
6048  {
6049  stx_connectby_proc->regu_list_rest =
6050  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6051  if (stx_connectby_proc->regu_list_rest == NULL)
6052  {
6053  goto error;
6054  }
6055  }
6056 
6057  ptr = or_unpack_int (ptr, &offset);
6058  if (offset == 0)
6059  {
6060  stx_connectby_proc->prior_val_list = NULL;
6061  }
6062  else
6063  {
6064  stx_connectby_proc->prior_val_list = stx_restore_val_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6065  if (stx_connectby_proc->prior_val_list == NULL)
6066  {
6067  goto error;
6068  }
6069  }
6070 
6071  ptr = or_unpack_int (ptr, &offset);
6072  if (offset == 0)
6073  {
6074  stx_connectby_proc->prior_outptr_list = NULL;
6075  }
6076  else
6077  {
6078  stx_connectby_proc->prior_outptr_list =
6079  stx_restore_outptr_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6080  if (stx_connectby_proc->prior_outptr_list == NULL)
6081  {
6082  goto error;
6083  }
6084  }
6085 
6086  ptr = or_unpack_int (ptr, &offset);
6087  if (offset == 0)
6088  {
6089  stx_connectby_proc->prior_regu_list_pred = NULL;
6090  }
6091  else
6092  {
6093  stx_connectby_proc->prior_regu_list_pred =
6094  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6095  if (stx_connectby_proc->prior_regu_list_pred == NULL)
6096  {
6097  goto error;
6098  }
6099  }
6100 
6101  ptr = or_unpack_int (ptr, &offset);
6102  if (offset == 0)
6103  {
6104  stx_connectby_proc->prior_regu_list_rest = NULL;
6105  }
6106  else
6107  {
6108  stx_connectby_proc->prior_regu_list_rest =
6109  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6110  if (stx_connectby_proc->prior_regu_list_rest == NULL)
6111  {
6112  goto error;
6113  }
6114  }
6115 
6116  ptr = or_unpack_int (ptr, &offset);
6117  if (offset == 0)
6118  {
6119  stx_connectby_proc->after_cb_regu_list_pred = NULL;
6120  }
6121  else
6122  {
6123  stx_connectby_proc->after_cb_regu_list_pred =
6124  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6125  if (stx_connectby_proc->after_cb_regu_list_pred == NULL)
6126  {
6127  goto error;
6128  }
6129  }
6130 
6131  ptr = or_unpack_int (ptr, &offset);
6132  if (offset == 0)
6133  {
6134  stx_connectby_proc->after_cb_regu_list_rest = NULL;
6135  }
6136  else
6137  {
6138  stx_connectby_proc->after_cb_regu_list_rest =
6139  stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6140  if (stx_connectby_proc->after_cb_regu_list_rest == NULL)
6141  {
6142  goto error;
6143  }
6144  }
6145 
6146  ptr = or_unpack_int (ptr, &tmp);
6147  stx_connectby_proc->single_table_opt = (bool) tmp;
6148  stx_connectby_proc->curr_tuple = NULL;
6149 
6150  return ptr;
6151 
6152 error:
6154  return NULL;
6155 }
6156 
6157 /* stx_regu_value_list_alloc_and_init () -
6158  * return:
6159  * thread_p(in)
6160  */
6161 static REGU_VALUE_LIST *
6163 {
6165 
6166  regu_value_list = (REGU_VALUE_LIST *) stx_alloc_struct (thread_p, sizeof (REGU_VALUE_LIST));
6167 
6168  if (regu_value_list == NULL)
6169  {
6171  }
6172  else
6173  {
6174  regu_value_list->count = 0;
6175  regu_value_list->current_value = NULL;
6176  regu_value_list->regu_list = NULL;
6177  }
6178 
6179  return regu_value_list;
6180 }
6181 
6182 /* stx_regu_value_item_alloc_and_init () -
6183  * return:
6184  * thread_p(in)
6185  */
6186 static REGU_VALUE_ITEM *
6188 {
6190 
6191  regu_value_item = (REGU_VALUE_ITEM *) stx_alloc_struct (thread_p, sizeof (REGU_VALUE_ITEM));
6192 
6193  if (regu_value_item == NULL)
6194  {
6196  }
6197  else
6198  {
6199  regu_value_item->next = NULL;
6200  regu_value_item->value = NULL;
6201  }
6202 
6203  return regu_value_item;
6204 }
6205 
6206 /* stx_build_regu_value_list () -
6207  * return:
6208  * thread_p(in)
6209  * tmp(in) :
6210  * ptr(in) : pointer to REGU_VALUE_LIST
6211  */
6212 static char *
6214 {
6215  int i, count, tmp;
6216  REGU_VALUE_ITEM *list_node;
6217  REGU_VARIABLE *regu;
6218 
6219  assert (ptr != NULL && regu_value_list != NULL);
6220 
6221  ptr = or_unpack_int (ptr, &count);
6222  if (count <= 0)
6223  {
6225  goto error;
6226  }
6227 
6228  for (i = 0; i < count; ++i)
6229  {
6230  list_node = stx_regu_value_item_alloc_and_init (thread_p);
6231  if (list_node == NULL)
6232  {
6233  goto error;
6234  }
6235 
6236  regu = (REGU_VARIABLE *) stx_get_struct_visited_ptr (thread_p, ptr);
6237  if (regu == NULL)
6238  {
6239  regu = (REGU_VARIABLE *) stx_alloc_struct (thread_p, sizeof (REGU_VARIABLE));
6240  if (regu == NULL)
6241  {
6243  goto error;
6244  }
6245 
6246  if (stx_mark_struct_visited (thread_p, ptr, regu) == ER_FAILED)
6247  {
6248  goto error;
6249  }
6250  }
6251 
6252  /* Now, we got a REGU_VARIABLE successfully */
6253  stx_init_regu_variable (regu);
6254  list_node->value = regu;
6255 
6256  if (regu_value_list->current_value == NULL)
6257  {
6258  regu_value_list->regu_list = list_node;
6259  }
6260  else
6261  {
6262  regu_value_list->current_value->next = list_node;
6263  }
6264 
6265  regu_value_list->current_value = list_node;
6266 
6267  ptr = or_unpack_int (ptr, &tmp);
6268  regu->type = (REGU_DATATYPE) tmp;
6269  regu->domain = domain;
6270  /* save te original domain */
6271  regu->original_domain = domain;
6272 
6273  if (regu->type != TYPE_DBVAL && regu->type != TYPE_INARITH && regu->type != TYPE_POS_VALUE)
6274  {
6276  goto error;
6277  }
6278  ptr = stx_unpack_regu_variable_value (thread_p, ptr, regu);
6279  if (ptr == NULL)
6280  {
6281  goto error;
6282  }
6283 
6284  regu_value_list->count += 1;
6285  }
6286  regu_value_list->current_value = regu_value_list->regu_list;
6287 
6288  return ptr;
6289 
6290 error:
6291  return NULL;
6292 }
6293 
6294 /* stx_build_regu_variable_list () -
6295  * return:
6296  * thread_p(in)
6297  * ptr(out):
6298  * regu_var_list(in): pointer to REGU_VARIABLE_LIST
6299  */
6300 static char *
6301 stx_build_regu_variable_list (THREAD_ENTRY * thread_p, char *ptr, REGU_VARIABLE_LIST * regu_var_list)
6302 {
6303  int offset;
6305 
6306  assert (ptr != NULL && regu_var_list != NULL);
6307 
6308  ptr = or_unpack_int (ptr, &offset);
6309  if (offset == 0)
6310  {
6311  *regu_var_list = NULL;
6312  }
6313  else
6314  {
6315  *regu_var_list = stx_restore_regu_variable_list (thread_p, &xasl_unpack_info->packed_xasl[offset]);
6316  if (*regu_var_list == NULL)
6317  {
6318  return NULL;
6319  }
6320  }
6321 
6322  return ptr;
6323 }
6324 
6325 /*
6326  * init_regu_variable () -
6327  * return:
6328  * regu(in): :
6329  */
6330 static void
6332 {
6333  assert (regu);
6334 
6335  regu->type = TYPE_POS_VALUE;
6336  regu->flags = 0;
6337  regu->value.val_pos = 0;
6338  regu->vfetch_to = NULL;
6339  regu->domain = NULL;
6340  regu->xasl = NULL;
6341 }
6342 
6343 #if defined(ENABLE_UNUSED_FUNCTION)
6344 /*
6345  * stx_unpack_char () -
6346  * return:
6347  * tmp(in) :
6348  * ptr(in) :
6349  */
6350 static char *
6351 stx_unpack_char (char *tmp, char *ptr)
6352 {
6353  int i;
6354 
6355  tmp = or_unpack_int (tmp, &i);
6356  *ptr = i;
6357 
6358  return tmp;
6359 }
6360 
6361 /*
6362  * stx_unpack_long () -
6363  * return:
6364  * tmp(in) :
6365  * ptr(in) :
6366  */
6367 static char *
6368 stx_unpack_long (char *tmp, long *ptr)
6369 {
6370  int i;
6371 
6372  tmp = or_unpack_int (tmp, &i);
6373  *ptr = i;
6374 
6375  return tmp;
6376 }
6377 #endif
6378 
6379 char *
6380 stx_build (THREAD_ENTRY * thread_p, char *ptr, regu_variable_node & reguvar)
6381 {
6382  return stx_build_regu_variable (thread_p, ptr, &reguvar);
6383 }
void REGU_VARIABLE_SET_FLAG(regu_variable_node *regu, int flag)
Definition: regu_var.hpp:259
QPROC_SINGLE_FETCH single_fetch
Definition: query_list.h:339
pred_expr * lhs
char * stx_alloc_struct(THREAD_ENTRY *thread_p, int size)
regu_variable_node * key1
Definition: access_spec.hpp:67
int stx_map_stream_to_xasl(THREAD_ENTRY *thread_p, xasl_node **xasl_tree, bool use_xasl_clone, char *xasl_stream, int xasl_stream_size, XASL_UNPACK_INFO **xasl_unpack_info_ptr)
static ARITH_TYPE * stx_restore_arith_type(THREAD_ENTRY *thread_p, char *ptr)
int * mvcc_extra_assign_reev
Definition: xasl.h:243
int stx_map_stream_to_xasl_node_header(THREAD_ENTRY *thread_p, xasl_node_header *xasl_header_p, char *xasl_stream)
OUTPTR_LIST * outptr_list
Definition: xasl.h:968
static char * stx_build_val_list(THREAD_ENTRY *thread_p, char *tmp, VAL_LIST *ptr)
REGU_VARIABLE_LIST prior_regu_list_pred
Definition: xasl.h:427
int stx_init_xasl_unpack_info(THREAD_ENTRY *thread_p, char *xasl_stream, int xasl_stream_size)
Definition: xasl_stream.cpp:72
int num_extra_assign_reev
Definition: xasl.h:242
SORT_LIST * orderby_list
Definition: xasl.h:957
char * or_unpack_oid(char *ptr, OID *oid)
static char * stx_build_filter_pred_node(THREAD_ENTRY *thread_p, char *ptr, PRED_EXPR_WITH_CONTEXT *pred)
REGU_VALUE_ITEM * regu_list
Definition: regu_var.hpp:105
#define NO_ERROR
Definition: error_code.h:46
aggregate_specific_function_info info
static ANALYTIC_TYPE * stx_restore_analytic_type(THREAD_ENTRY *thread_p, char *ptr)
PRED_EXPR * set_pred
Definition: xasl.h:298
static char * stx_build_sort_list(THREAD_ENTRY *thread_p, char *tmp, SORT_LIST *ptr)
VAL_LIST * prior_val_list
Definition: xasl.h:425
int stx_get_xasl_errcode(THREAD_ENTRY *thread_p)
Definition: xasl_stream.cpp:39
HEAP_CACHE_ATTRINFO * cache_pred
Definition: xasl.h:733
static KEY_RANGE * stx_restore_key_range_array(THREAD_ENTRY *thread_p, char *ptr, int size)
XASL_NODE * fptr_list
Definition: xasl.h:984
key_range * key_ranges
Definition: access_spec.hpp:75
static char * stx_build_ls_merge_info(THREAD_ENTRY *thread_p, char *tmp, QFILE_LIST_MERGE_INFO *ptr)
static char * stx_build_outptr_list(THREAD_ENTRY *thread_p, char *tmp, OUTPTR_LIST *ptr)
SORT_NULLS
Definition: query_list.h:404
DB_VALUE * save_instnum_val
Definition: xasl.h:981
static char * stx_build_analytic_type(THREAD_ENTRY *thread_p, char *tmp, ANALYTIC_TYPE *ptr)
ACCESS_SPEC_TYPE * merge_spec
Definition: xasl.h:971
regu_variable_node * key_limit_u
Definition: access_spec.hpp:81
QFILE_TUPLE_VALUE_TYPE_LIST type_list
Definition: query_list.h:428
REGU_VARIABLE_LIST cls_regu_list_key
Definition: xasl.h:719
REGU_VARIABLE * rightptr
Definition: regu_var.hpp:129
static char * stx_build_union_proc(THREAD_ENTRY *thread_p, char *tmp, UNION_PROC_NODE *ptr)
QL_FLAG
VAL_LIST * a_val_list
Definition: xasl.h:327
int g_hash_eligible
Definition: xasl.h:330
RANGE_TYPE
REGU_VARIABLE * value
Definition: regu_var.hpp:96
OUTPTR_LIST * a_outptr_list_interm
Definition: xasl.h:326
METHOD_SIG * method_sig
Definition: method_def.hpp:69
static OUTPTR_LIST * stx_restore_outptr_list(THREAD_ENTRY *thread_p, char *ptr)
PRED_EXPR * if_pred
Definition: xasl.h:978
int needs_pruning
Definition: xasl.h:236
BUILDVALUE_PROC_NODE buildvalue
Definition: xasl.h:1020
static char * stx_build_update_proc(THREAD_ENTRY *thread_p, char *tmp, UPDATE_PROC_NODE *ptr)
int val_cnt
Definition: xasl.h:208
int ils_prefix_len
analytic_list_node * head
QPROC_SINGLE_FETCH
Definition: query_list.h:326
char * method_name
Definition: method_def.hpp:57
ATTR_ID * attrids_key
Definition: xasl.h:728
static ANALYTIC_EVAL_TYPE * stx_restore_analytic_eval_type(THREAD_ENTRY *thread_p, char *ptr)
static char * stx_build_regu_value_list(THREAD_ENTRY *thread_p, char *ptr, REGU_VALUE_LIST *regu_value_list, TP_DOMAIN *domain)
int n_oid_list
Definition: xasl.h:1035
DB_TYPE
Definition: dbtype_def.h:670
static SELUPD_LIST * stx_restore_selupd_list(THREAD_ENTRY *thread_p, char *ptr)
regu_variable_node * src
INDX_INFO * indexptr
Definition: xasl.h:927
static HFID * stx_restore_hfid_array(THREAD_ENTRY *thread_p, char *ptr, int nelements)
DB_VALUE ** cache_reserved
Definition: xasl.h:738
#define ER_FAILED
Definition: error_code.h:47
TYPE_EVAL_TERM et_type
static METHOD_SIG * stx_restore_method_sig(THREAD_ENTRY *thread_p, char *ptr, int size)
REGU_VARIABLE_LIST next
Definition: regu_var.hpp:221
bool ql_flag
Definition: xasl.h:300
int wait_msecs
Definition: xasl.h:224
static REGU_VALUE_ITEM * stx_regu_value_item_alloc_and_init(THREAD_ENTRY *thread_p)
int * mvcc_reev_classes
Definition: xasl.h:412
UPDDEL_CLASS_INFO * classes
Definition: xasl.h:407
REGU_VARIABLE * limit_row_count
Definition: xasl.h:983
#define ACCESS_SPEC_SHOWSTMT_SPEC(ptr)
Definition: xasl.h:812
static void stx_init_regu_variable(REGU_VARIABLE *regu)
union xasl_node::@155 proc
ATTR_ID * attrids_pred
Definition: xasl.h:1060
bool has_delete
Definition: xasl.h:440
int orderby_desc
Definition: access_spec.hpp:92
static char * stx_build_connectby_proc(THREAD_ENTRY *thread_p, char *tmp, CONNECTBY_PROC_NODE *ptr)
REGU_VARIABLE * leftptr
Definition: regu_var.hpp:128
#define ER_QPROC_INVALID_XASLNODE
Definition: error_code.h:532
int no_logging
Definition: xasl.h:410
QFILE_LIST_MERGE_INFO ls_merge
Definition: xasl.h:363
static QFILE_SORTED_LIST_ID * stx_restore_srlist_id(THREAD_ENTRY *thread_p, char *ptr)
#define OR_UNPACK_XASL_NODE_HEADER(PTR, X)
Definition: xasl.h:86
REGU_VARIABLE_LIST set_regu_list
Definition: xasl.h:764
int num_assign_reev_classes
Definition: xasl.h:377
SHOWSTMT_TYPE show_type
Definition: xasl.h:758
regu_variable_node * elem
#define ACCESS_SPEC_METHOD_SPEC(ptr)
Definition: xasl.h:842
analytic_eval_type * next
PRED_EXPR * g_grbynum_pred
Definition: xasl.h:316
int num_val_lists
Definition: xasl.h:399
static char * stx_build_srlist_id(THREAD_ENTRY *thread_p, char *tmp, QFILE_SORTED_LIST_ID *ptr)
#define assert_release(e)
Definition: error_manager.h:96
XASL_UNPACK_INFO * get_xasl_unpack_info_ptr(THREAD_ENTRY *thread_p)
TARGET_TYPE type
Definition: xasl.h:925
ATTR_ID * attrids_pred
Definition: xasl.h:732
FUNC_TYPE
METHOD_TYPE method_type
Definition: method_def.hpp:59
REGU_VARLIST_LIST select_list
Definition: xasl.h:223
static char * stx_build_key_info(THREAD_ENTRY *thread_p, char *tmp, KEY_INFO *ptr)
XASL_NODE * inner_xasl
Definition: xasl.h:359
REGU_VARIABLE * orderby_limit
Definition: xasl.h:960
CL_ATTR_ID id
Definition: regu_var.hpp:76
int select_list_size
Definition: xasl.h:222
QUERY_OPTIONS option
Definition: xasl.h:967
TYPE_EVAL_TERM
int num_default_expr
Definition: xasl.h:389
UNION_PROC_NODE union_
Definition: xasl.h:1017
int * mvcc_reev_classes
Definition: xasl.h:379
#define OID_SET_NULL(oidp)
Definition: oid.h:85
ANALYTIC_EVAL_TYPE * a_eval_list
Definition: xasl.h:322
VALPTR_LIST ** valptr_lists
Definition: xasl.h:400
static HEAP_CACHE_ATTRINFO * stx_restore_cache_attrinfo(THREAD_ENTRY *thread_p, char *ptr)
int projected_size
Definition: xasl.h:1034
int groupby_desc
Definition: access_spec.hpp:93
static OID * stx_restore_OID_array(THREAD_ENTRY *thread_p, char *ptr, int size)
bool REGU_VARIABLE_IS_FLAGED(const regu_variable_node *regu, int flag)
Definition: regu_var.hpp:253
aggregate_accumulator accumulator
int has_uniques
Definition: xasl.h:237
#define ACCESS_SPEC_LIST_SPEC(ptr)
Definition: xasl.h:809
static char * stx_build_buildvalue_proc(THREAD_ENTRY *thread_p, char *tmp, BUILDVALUE_PROC_NODE *ptr)
XASL_NODE * update_xasl
Definition: xasl.h:438
MERGELIST_PROC_NODE mergelist
Definition: xasl.h:1021
int cat_fetched
Definition: xasl.h:1001
XASL_NODE * aptr_list
Definition: xasl.h:974
PROC_TYPE type
Definition: xasl.h:953
static PRED_EXPR * stx_restore_pred_expr(THREAD_ENTRY *thread_p, char *ptr)
REL_OP
OID class_oid
Definition: xasl.h:386
UPDDEL_CLASS_INFO * classes
Definition: xasl.h:370
SORT_ORDER
Definition: query_list.h:398
#define bool
Definition: dbi_compat.h:31
SHOWSTMT_TYPE
int no_logging
Definition: xasl.h:375
DB_VALUE * arg
Definition: xasl.h:297
int num_reev_classes
Definition: xasl.h:411
BUILDLIST_PROC_NODE buildlist
Definition: xasl.h:1019
static char * stx_build_insert_proc(THREAD_ENTRY *thread_p, char *tmp, INSERT_PROC_NODE *ptr)
Definition: xasl.h:189
int * attr_ids
Definition: xasl.h:266
regu_variable_node operand
JOIN_TYPE
Definition: query_list.h:32
cub_regex_object * compiled_regex
int * att_id
Definition: xasl.h:390
HYBRID_NODE s
Definition: xasl.h:932
UPDATE_PROC_NODE update
Definition: xasl.h:1022
regu_variable_node * lhs
ACCESS_SPEC_TYPE * inner_spec_list
Definition: xasl.h:360
static DB_VALUE ** stx_restore_db_value_array_extra(THREAD_ENTRY *thread_p, char *ptr, int size, int total_size)
struct qproc_db_value_list * QPROC_DB_VALUE_LIST
Definition: xasl.h:192
METHOD_SIG * next
Definition: method_def.hpp:56
XASL_NODE_HEADER header
Definition: xasl.h:951
DELETE_PROC_NODE delete_
Definition: xasl.h:1024
const int REGU_VARIABLE_FETCH_NOT_CONST
Definition: regu_var.hpp:164
DB_VALUE * g_grbynum_val
Definition: xasl.h:317
SORT_ORDER s_order
Definition: query_list.h:417
int num_attrs_reserved
Definition: xasl.h:739
SELUPD_LIST * selected_upd_list
Definition: xasl.h:969
int is_single_tuple
Definition: xasl.h:965
ACCESS_SCHEMA_TYPE
Definition: xasl.h:703
char * stx_restore_string(THREAD_ENTRY *thread_p, char *&ptr)
VAL_LIST * val_list
Definition: xasl.h:972
PRED_EXPR * ordbynum_pred
Definition: xasl.h:958
REGU_VARIABLE_LIST list_regu_list_probe
Definition: xasl.h:751
bool iscan_oid_order
Definition: xasl.h:1041
static char * stx_build_like_eval_term(THREAD_ENTRY *thread_p, char *tmp, LIKE_EVAL_TERM *ptr)
REGU_VARIABLE_LIST list_regu_list_build
Definition: xasl.h:750
static FUNC_PRED * stx_restore_func_pred(THREAD_ENTRY *thread_p, char *ptr)
static ODKU_INFO * stx_restore_odku_info(THREAD_ENTRY *thread_p, char *ptr)
static char * stx_build_list_spec_type(THREAD_ENTRY *thread_p, char *tmp, LIST_SPEC_TYPE *ptr)
void THREAD_ENTRY
int xasl_stream_make_align(int x)
static char * stx_build_set_spec_type(THREAD_ENTRY *thread_p, char *tmp, SET_SPEC_TYPE *ptr)
DB_VALUE * val
Definition: xasl.h:196
int no_logging
Definition: xasl.h:396
static REGU_VARLIST_LIST stx_restore_regu_varlist_list(THREAD_ENTRY *thread_p, char *ptr)
TP_DOMAIN * original_domain
Definition: regu_var.hpp:126
static char * stx_build_access_spec_type(THREAD_ENTRY *thread_p, char *tmp, ACCESS_SPEC_TYPE *ptr, void *arg)
HEAP_CACHE_ATTRINFO * attr_info
Definition: xasl.h:265
RANGE range
Definition: access_spec.hpp:69
OPERATOR_TYPE opcode
Definition: regu_var.hpp:131
KEY_INFO key_info
Definition: access_spec.hpp:91
ACCESS_METHOD access
Definition: xasl.h:926
ACCESS_METHOD
Definition: xasl.h:687
SCAN_OPERATION_TYPE scan_op_type
Definition: xasl.h:1005
DB_VALUE * cache_dbvalp
Definition: regu_var.hpp:79
static REGU_VARIABLE_LIST stx_restore_regu_variable_list(THREAD_ENTRY *thread_p, char *ptr)
XASL_NODE * next
Definition: xasl.h:952
static VAL_LIST * stx_restore_val_list(THREAD_ENTRY *thread_p, char *ptr)
static char * stx_build_method_sig_list(THREAD_ENTRY *thread_p, char *tmp, METHOD_SIG_LIST *ptr)
static char * stx_build_func_pred(THREAD_ENTRY *thread_p, char *tmp, FUNC_PRED *ptr)
HEAP_CACHE_ATTRINFO * cache_rest
Definition: xasl.h:735
bool single_table_opt
Definition: xasl.h:431
DB_VALUE * s_dbval
Definition: xasl.h:934
static char * stx_build_merge_proc(THREAD_ENTRY *thread_p, char *tmp, MERGE_PROC_NODE *ptr)
int flag
Definition: xasl.h:954
static QFILE_LIST_ID * stx_restore_list_id(THREAD_ENTRY *thread_p, char *ptr)
static DB_VALUE * stx_restore_db_value(THREAD_ENTRY *thread_p, char *ptr)
XASL_NODE * recursive_part
Definition: xasl.h:447
static char * stx_build_rlike_eval_term(THREAD_ENTRY *thread_p, char *tmp, RLIKE_EVAL_TERM *ptr)
ACCESS_SPEC_TYPE * next
Definition: xasl.h:935
static char * stx_build_cache_attrinfo(char *tmp)
static PRED_EXPR_WITH_CONTEXT * stx_restore_filter_pred_node(THREAD_ENTRY *thread_p, char *ptr)
PRED_EXPR * start_with_pred
Definition: xasl.h:419
cubxasl::pred_expr * pred
Definition: regu_var.hpp:133
QFILE_TUPLE curr_tuple
Definition: xasl.h:432
int num_assigns
Definition: xasl.h:372
analytic_percentile_function_info percentile
KEY_RANGE iss_range
Definition: access_spec.hpp:99
XASL_NODE * outer_xasl
Definition: xasl.h:356
void * stx_get_struct_visited_ptr(THREAD_ENTRY *thread_p, const void *ptr)
MISC_OPERAND misc_operand
Definition: regu_var.hpp:132
static char * stx_build_selupd_list(THREAD_ENTRY *thread_p, char *tmp, SELUPD_LIST *ptr)
#define ACCESS_SPEC_JSON_TABLE_SPEC(ptr)
Definition: xasl.h:845
#define assert(x)
ACCESS_SPEC_TYPE * curr_spec
Definition: xasl.h:996
REGU_VARIABLE * func_regu
Definition: xasl.h:277
int ordbynum_flag
Definition: xasl.h:961
CONNECTBY_PROC_NODE connect_by
Definition: xasl.h:1025
static UPDATE_ASSIGNMENT * stx_restore_update_assignment_array(THREAD_ENTRY *thread_p, char *ptr, int num_assigns)
int use_desc_index
Definition: access_spec.hpp:94
static char * stx_build_list_id(THREAD_ENTRY *thread_p, char *tmp, QFILE_LIST_ID *ptr)
#define ASSERT_ALIGN(ptr, alignment)
char * or_unpack_btid(char *buf, BTID *btid)
XASL_NODE * dptr_list
Definition: xasl.h:976
REGU_VARIABLE_LIST after_cb_regu_list_rest
Definition: xasl.h:430
OPERATOR_TYPE
static char * stx_build_cte_proc(THREAD_ENTRY *thread_p, char *tmp, CTE_PROC_NODE *ptr)
#define ER_GENERIC_ERROR
Definition: error_code.h:49
PRED_EXPR * where_range
Definition: xasl.h:931
PRED_EXPR * cons_pred
Definition: xasl.h:392
int num_vals
Definition: xasl.h:388
INSERT_PROC_NODE insert
Definition: xasl.h:1023
ACCESS_SPEC_FLAG
Definition: xasl.h:711
static ACCESS_SPEC_TYPE * stx_restore_access_spec_type(THREAD_ENTRY *thread_p, char **ptr, void *arg)
struct sort_list * next
Definition: query_list.h:415
comp_eval_term et_comp
#define ER_OUT_OF_VIRTUAL_MEMORY
Definition: error_code.h:50
REGU_VARIABLE value
Definition: regu_var.hpp:222
bool clear_value_at_clone_decache
Definition: xasl.h:255
char * or_unpack_hfid(char *ptr, HFID *hfid)
QFILE_LIST_ID * list_id
Definition: xasl.h:955
REGU_VARIABLE_LIST list_regu_list_pred
Definition: xasl.h:748
HEAP_CACHE_ATTRINFO * cache_range
Definition: xasl.h:742
const int REGU_VARIABLE_CLEAR_AT_CLONE_DECACHE
Definition: regu_var.hpp:165
union cubxasl::pred_expr::@185 pe
static char * stx_build_cls_spec_type(THREAD_ENTRY *thread_p, char *tmp, CLS_SPEC_TYPE *ptr)
static char * stx_build_rlist_spec_type(THREAD_ENTRY *thread_p, char *ptr, REGUVAL_LIST_SPEC_TYPE *spec, OUTPTR_LIST *outptr_list)
OID class_oid
Definition: xasl.h:220
char * stx_build(THREAD_ENTRY *thread_p, char *ptr, regu_variable_node &reguvar)
regu_variable_node * percentile_reguvar
ACCESS_SPEC_FLAG flags
Definition: xasl.h:937
int orderby_skip
Definition: access_spec.hpp:95
static char * stx_build_regu_variable(THREAD_ENTRY *thread_p, char *tmp, REGU_VARIABLE *ptr)
UPDATE_ASSIGNMENT * assigns
Definition: xasl.h:373
REGU_VARIABLE_LIST cls_regu_val_list
Definition: xasl.h:725
struct drand48_data * rand_seed
Definition: regu_var.hpp:136
json_table_spec_node json_table_node
Definition: xasl.h:790
#define ACCESS_SPEC_CLS_SPEC(ptr)
Definition: xasl.h:797
struct regu_varlist_list_node * REGU_VARLIST_LIST
Definition: regu_var.hpp:225
int next_scan_on
Definition: xasl.h:998
REGU_VARIABLE_LIST method_regu_list
Definition: xasl.h:770
REGU_VARIABLE * level_regu
Definition: xasl.h:989
int * method_arg_pos
Definition: method_def.hpp:61
ARITH_TYPE * outarith_list
Definition: xasl.h:348
REGU_VARIABLE_LIST a_regu_list
Definition: xasl.h:323
int stx_map_stream_to_func_pred(THREAD_ENTRY *thread_p, func_pred **xasl, char *xasl_stream, int xasl_stream_size, XASL_UNPACK_INFO **xasl_unpack_info_ptr)
XASL_NODE * xasl_node
Definition: xasl.h:771
REGU_VALUE_ITEM * next
Definition: regu_var.hpp:97
int pruning_type
Definition: xasl.h:398
REGU_VARIABLE * iscycle_regu
Definition: xasl.h:994
PRED_EXPR * after_connect_by_pred
Definition: xasl.h:420
int stx_mark_struct_visited(THREAD_ENTRY *thread_p, const void *ptr, void *str)
int wait_msecs
Definition: xasl.h:374
DB_VALUE * isleaf_val
Definition: xasl.h:991
#define NULL
Definition: freelistheap.h:34
int next_scan_block_on
Definition: xasl.h:999
int * att_id
Definition: xasl.h:235
ATTR_ID * attrids_rest
Definition: xasl.h:734
int ** lob_attr_ids
Definition: xasl.h:240
XASL_NODE * connect_by_ptr
Definition: xasl.h:987
int groupby_skip
Definition: access_spec.hpp:96
REGU_VARIABLE_LIST regu_list_rest
Definition: xasl.h:424
ACCESS_SCHEMA_TYPE schema_type
Definition: xasl.h:737
REGU_VARIABLE_LIST regu_list_pred
Definition: xasl.h:423
static char * stx_build_fetch_proc(THREAD_ENTRY *thread_p, char *tmp, FETCH_PROC_NODE *ptr)
OUTPTR_LIST * a_outptr_list_ex
Definition: xasl.h:325
VAL_LIST * single_tuple
Definition: xasl.h:963
TYPE_PRED_EXPR
int num_assigns
Definition: xasl.h:263
REGU_VARIABLE_LIST after_cb_regu_list_pred
Definition: xasl.h:429
regu_variable_node * rhs
QFILE_TUPLE_VALUE_POSITION pos_descr
Definition: query_list.h:416
REGU_DATATYPE
Definition: regu_var.hpp:42
HFID class_hfid
Definition: xasl.h:221
VAL_LIST * g_val_list
Definition: xasl.h:314
static FUNCTION_TYPE * stx_restore_function_type(THREAD_ENTRY *thread_p, char *ptr)
aggregate_list_node * next
XASL_NODE * insert_xasl
Definition: xasl.h:439
REGU_VARIABLE_LIST list_regu_list_rest
Definition: xasl.h:749
char * or_unpack_int(char *ptr, int *number)
SCAN_OPERATION_TYPE
DB_VALUE * value
Definition: regu_var.hpp:127
static char * stx_build_pred(THREAD_ENTRY *thread_p, char *tmp, PRED *ptr)
AGGREGATE_TYPE * agg_list
Definition: xasl.h:347
regu_variable_node * src
#define db_private_alloc(thrd, size)
Definition: memory_alloc.h:227
bool fetch_res
Definition: xasl.h:299
int func_idx_col_id
Definition: access_spec.hpp:98
QFILE_LIST_ID * push_list_id
Definition: xasl.h:311
int query_in_progress
Definition: xasl.h:1002
need_clear_type need_clear
Definition: dbtype_def.h:1084
REGU_VALUE_ITEM * current_value
Definition: regu_var.hpp:106
int num_orderby_keys
Definition: xasl.h:376
int num_attrs_key
Definition: xasl.h:730
int count(int &result, const cub_regex_object &reg, const std::string &src, const int position, const INTL_CODESET codeset)
VALPTR_LIST * valptr_list
Definition: xasl.h:779
static char * stx_build_function_type(THREAD_ENTRY *thread_p, char *tmp, FUNCTION_TYPE *ptr)
DB_TYPE type
Definition: regu_var.hpp:77
OID * class_oid
Definition: xasl.h:232
static char * stx_build_alsm_eval_term(THREAD_ENTRY *thread_p, char *tmp, ALSM_EVAL_TERM *ptr)
FETCH_PROC_NODE fetch
Definition: xasl.h:1018
static SORT_LIST * stx_restore_sort_list(THREAD_ENTRY *thread_p, char *ptr)
AGGREGATE_TYPE * g_agg_list
Definition: xasl.h:318
char * or_unpack_listid(char *ptr, void *listid_ptr)
int num_attrs_rest
Definition: xasl.h:736
static char * stx_build_mergelist_proc(THREAD_ENTRY *thread_p, char *tmp, MERGELIST_PROC_NODE *ptr)
PRED_EXPR * where_pred
Definition: xasl.h:930
PRED_EXPR * after_join_pred
Definition: xasl.h:977
static char * stx_build_analytic_eval_type(THREAD_ENTRY *thread_p, char *tmp, ANALYTIC_EVAL_TYPE *ptr)
static char * stx_build_pos_descr(char *tmp, QFILE_TUPLE_VALUE_POSITION *ptr)
CTE_PROC_NODE cte
Definition: xasl.h:1027
XASL_NODE * eptr_list
Definition: xasl.h:308
OID creator_oid
Definition: xasl.h:1033
void free_xasl_unpack_info(THREAD_ENTRY *thread_p, REFPTR(XASL_UNPACK_INFO, xasl_unpack_info))
static char * stx_build_method_spec_type(THREAD_ENTRY *thread_p, char *tmp, METHOD_SPEC_TYPE *ptr)
static void error(const char *msg)
Definition: gencat.c:331
PRED_EXPR * cons_pred
Definition: xasl.h:371
int g_grbynum_flag
Definition: xasl.h:328
static char * stx_build_aggregate_type(THREAD_ENTRY *thread_p, char *tmp, AGGREGATE_TYPE *ptr)
#define ACCESS_SPEC_SET_SPEC(ptr)
Definition: xasl.h:833
double cardinality
Definition: xasl.h:1030
int g_output_first_tuple
Definition: xasl.h:331
bool db_value_is_null(const DB_VALUE *value)
struct regu_variable_list_node * REGU_VARIABLE_LIST
Definition: regu_var.hpp:65
analytic_function_info info
XASL_NODE * left
Definition: xasl.h:289
const char * query_alias
Definition: xasl.h:1039
VAL_LIST * outer_val_list
Definition: xasl.h:358
static char * stx_unpack_regu_variable_value(THREAD_ENTRY *thread_p, char *tmp, REGU_VARIABLE *ptr)
XASL_NODE * right
Definition: xasl.h:290
OUTPTR_LIST * prior_outptr_list
Definition: xasl.h:426
regu_variable_node * key2
Definition: access_spec.hpp:68
int instnum_flag
Definition: xasl.h:997
bool key_limit_reset
Definition: access_spec.hpp:78
DB_VALUE * level_val
Definition: xasl.h:988
OID * class_oid_list
Definition: xasl.h:1036
int CL_ATTR_ID
Definition: regu_var.hpp:71
OUTPTR_LIST * g_outptr_list
Definition: xasl.h:312
XASL_NODE * xasl_node
Definition: xasl.h:753
PRED_EXPR * having_pred
Definition: xasl.h:345
regu_variable_node * elemset
DB_VALUE * ordbynum_val
Definition: xasl.h:959
void set_xasl_unpack_info_ptr(THREAD_ENTRY *thread_p, XASL_UNPACK_INFO *ptr)
RANGE_TYPE range_type
Definition: access_spec.hpp:90
XASL_NODE * scan_ptr
Definition: xasl.h:985
REGU_VARIABLE_LIST list
Definition: regu_var.hpp:229
SORT_LIST * after_groupby_list
Definition: xasl.h:310
ACCESS_SPEC_TYPE * spec_list
Definition: xasl.h:970
ODKU_INFO * odku
Definition: xasl.h:393
bool is_user_given_keylimit
Definition: access_spec.hpp:79
SELUPD_LIST * next
Definition: xasl.h:219
int num_subclasses
Definition: xasl.h:231
HEAP_CACHE_ATTRINFO * cache_attrinfo
Definition: regu_var.hpp:78
void stx_free_visited_ptrs(THREAD_ENTRY *thread_p)
OUTPTR_LIST * a_outptr_list
Definition: xasl.h:324
int num_classes
Definition: xasl.h:408
int mvcc_reev_extra_cls_cnt
Definition: xasl.h:1008
static int * stx_restore_int_array(THREAD_ENTRY *thread_p, char *ptr, int size)
int hash_list_scan_yn
Definition: xasl.h:752
static char * stx_build_update_assignment(THREAD_ENTRY *thread_p, char *tmp, UPDATE_ASSIGNMENT *ptr)
QPROC_DB_VALUE_LIST valp
Definition: xasl.h:207
QFILE_LIST_ID * input_list_id
Definition: xasl.h:421
REGU_VARIABLE_LIST g_hk_scan_regu_list
Definition: xasl.h:319
#define INT_ALIGNMENT
Definition: memory_alloc.h:61
OUTPTR_LIST * cls_output_val_list
Definition: xasl.h:724
int * num_lob_attrs
Definition: xasl.h:239
class regu_variable_node REGU_VARIABLE
Definition: regu_var.hpp:64
HEAP_CACHE_ATTRINFO * cache_attrinfo
Definition: xasl.h:278
REGU_VARIABLE_LIST g_hk_sort_regu_list
Definition: xasl.h:320
static char * stx_build_update_class_info(THREAD_ENTRY *thread_p, char *tmp, UPDDEL_CLASS_INFO *ptr)
PRED_EXPR * where_key
Definition: xasl.h:929
static char * stx_build_xasl_node(THREAD_ENTRY *thread_p, char *tmp, XASL_NODE *ptr)
UPDATE_ASSIGNMENT * assignments
Definition: xasl.h:264
int upd_del_class_cnt
Definition: xasl.h:1006
REGU_VARIABLE_LIST cls_regu_list_pred
Definition: xasl.h:720
DB_VALUE * grbynum_val
Definition: xasl.h:346
REGU_VARIABLE * regu_var
Definition: xasl.h:254
PRED_EXPR * cons_pred
Definition: xasl.h:262
static REGU_VARIABLE * stx_restore_regu_variable(THREAD_ENTRY *thread_p, char *ptr)
PRED_EXPR * pred
Definition: xasl.h:1058
static char * stx_build_pred_expr(THREAD_ENTRY *thread_p, char *tmp, PRED_EXPR *ptr)
int i
Definition: dynamic_load.c:954
PROC_TYPE
Definition: xasl.h:172
OID cls_oid
Definition: xasl.h:727
static AGGREGATE_TYPE * stx_restore_aggregate_type(THREAD_ENTRY *thread_p, char *ptr)
HFID * class_hfid
Definition: xasl.h:233
REGU_VARIABLE_LIST cls_regu_list_rest
Definition: xasl.h:721
int has_uniques
Definition: xasl.h:394
PRED_EXPR * instnum_pred
Definition: xasl.h:979
#define ACCESS_SPEC_RLIST_SPEC(ptr)
Definition: xasl.h:815
int dbval_cnt
Definition: xasl.h:1040
QPROC_DB_VALUE_LIST next
Definition: xasl.h:195
REGU_VARIABLE_LIST prior_regu_list_rest
Definition: xasl.h:428
VAL_LIST * merge_val_list
Definition: xasl.h:973
int wait_msecs
Definition: xasl.h:409
static char * stx_build_buildlist_proc(THREAD_ENTRY *thread_p, char *tmp, BUILDLIST_PROC_NODE *ptr)
int wait_msecs
Definition: xasl.h:395
ATTR_ID * attrids_range
Definition: xasl.h:741
TYPE_PRED_EXPR type
SORT_LIST * groupby_list
Definition: xasl.h:309
const int REGU_VARIABLE_FETCH_ALL_CONST
Definition: regu_var.hpp:163
HFID hfid
Definition: xasl.h:726
int * class_locks
Definition: xasl.h:1037
REGU_VARIABLE_LIST cls_regu_list_range
Definition: xasl.h:722
analytic_list_node * next
REGU_VARIABLE_LIST arg_list
Definition: xasl.h:759
static XASL_NODE * stx_restore_xasl_node(THREAD_ENTRY *thread_p, char *ptr)
static char * stx_build_regu_variable_list(THREAD_ENTRY *thread_p, char *ptr, REGU_VARIABLE_LIST *regu_var_list)
void stx_set_xasl_errcode(THREAD_ENTRY *thread_p, int errcode)
Definition: xasl_stream.cpp:54
static UPDDEL_CLASS_INFO * stx_restore_update_class_info_array(THREAD_ENTRY *thread_p, char *ptr, int num_classes)
static char * stx_build_arith_type(THREAD_ENTRY *thread_p, char *tmp, ARITH_TYPE *ptr)
REGU_VARIABLE * thirdptr
Definition: regu_var.hpp:130
alsm_eval_term et_alsm
static char * stx_build_delete_proc(THREAD_ENTRY *thread_p, char *tmp, DELETE_PROC_NODE *ptr)
REGU_VARIABLE * limit_offset
Definition: xasl.h:982
regu_variable_node * pattern
union cubxasl::eval_term::@184 et
QFILE_LIST_ID * start_with_list_id
Definition: xasl.h:422
static char * stx_build_attr_descr(THREAD_ENTRY *thread_p, char *tmp, ATTR_DESCR *ptr)
char * or_unpack_double(char *ptr, double *number)
SORT_NULLS s_nulls
Definition: query_list.h:418
like_eval_term et_like
regu_variable_node * pattern
REGU_VARIABLE_LIST g_regu_list
Definition: xasl.h:313
QPROC_SINGLE_FETCH single_fetch
Definition: xasl.h:933
pred_expr * rhs
REGU_VARIABLE_LIST g_scan_regu_list
Definition: xasl.h:321
PRED_EXPR * g_having_pred
Definition: xasl.h:315
XASL_NODE * bptr_list
Definition: xasl.h:975
ACCESS_SPEC_TYPE * outer_spec_list
Definition: xasl.h:357
char * or_unpack_domain(char *ptr, struct tp_domain **domain_ptr, int *is_null)
RANGE
Definition: access_spec.hpp:32
REGU_VARLIST_LIST next
Definition: regu_var.hpp:228
static METHOD_SIG_LIST * stx_restore_method_sig_list(THREAD_ENTRY *thread_p, char *ptr)
HEAP_CACHE_ATTRINFO * cache_key
Definition: xasl.h:729
regu_variable_node * esc_char
static char * stx_build_comp_eval_term(THREAD_ENTRY *thread_p, char *tmp, COMP_EVAL_TERM *ptr)
int max_iterations
Definition: xasl.h:1043
Definition: xasl.h:186
TARGET_TYPE
Definition: xasl.h:675
VAL_LIST * inner_val_list
Definition: xasl.h:361
static char * stx_build_xasl_header(THREAD_ENTRY *thread_p, char *ptr, XASL_NODE_HEADER *xasl_header)
int pruning_type
Definition: xasl.h:936
DB_VALUE * iscycle_val
Definition: xasl.h:993
MERGE_PROC_NODE merge
Definition: xasl.h:1026
METHOD_SIG_LIST * method_sig_list
Definition: xasl.h:774
REGU_VARIABLE_LIST valptrp
Definition: regu_var.hpp:116
DB_VALUE ** output_columns
Definition: xasl.h:306
DB_VALUE * instnum_val
Definition: xasl.h:980
rlike_eval_term et_rlike
SORT_LIST * after_iscan_list
Definition: xasl.h:956
int num_classes
Definition: xasl.h:369
int num_attrs_pred
Definition: xasl.h:731
int num_attrs_range
Definition: xasl.h:743
int stx_map_stream_to_filter_pred(THREAD_ENTRY *thread_p, pred_expr_with_context **pred, char *pred_stream, int pred_stream_size)
static char * stx_build_showstmt_spec_type(THREAD_ENTRY *thread_p, char *ptr, SHOWSTMT_SPEC_TYPE *spec)
static INDX_INFO * stx_restore_indx_info(THREAD_ENTRY *thread_p, char *ptr)
const char ** p
Definition: dynamic_load.c:945
HFID class_hfid
Definition: xasl.h:387
MISC_OPERAND
REGU_VARIABLE * isleaf_regu
Definition: xasl.h:992
REGU_VARIABLE_LIST cls_regu_list_reserved
Definition: xasl.h:740
XASL_NODE * non_recursive_part
Definition: xasl.h:446
static char * stx_build_indx_info(THREAD_ENTRY *thread_p, char *tmp, INDX_INFO *ptr)
int num_reev_classes
Definition: xasl.h:378
regu_variable_list_node * operands
HEAP_CACHE_ATTRINFO * cache_pred
Definition: xasl.h:1061
DB_VALUE ** vals
Definition: xasl.h:391
char * stx_build_db_value(THREAD_ENTRY *thread_p, char *ptr, DB_VALUE *value)
REGU_VARIABLE * set_ptr
Definition: xasl.h:765
bool g_with_rollup
Definition: xasl.h:329
int * tcard_list
Definition: xasl.h:1038
static char * stx_build_method_sig(THREAD_ENTRY *thread_p, char *tmp, METHOD_SIG *ptr, int size)
DB_VALUE * constant
Definition: xasl.h:253
int do_replace
Definition: xasl.h:397
regu_variable_node * case_sensitive
DB_VALUE * obj_oid
Definition: xasl.h:401
static REGU_VALUE_LIST * stx_regu_value_list_alloc_and_init(THREAD_ENTRY *thread_p)
bool is_constant
Definition: access_spec.hpp:77
XASL_UNPACK_INFO * unpack_info
Definition: xasl.h:1062
BOOL_OP
QFILE_LIST_ID * list_id
Definition: query_list.h:533
static char * stx_build_eval_term(THREAD_ENTRY *thread_p, char *tmp, EVAL_TERM *ptr)
regu_variable_node * key_limit_l
Definition: access_spec.hpp:80
QUERY_OPTIONS
TP_DOMAIN * domain
Definition: regu_var.hpp:125