~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/pars/pars0sym.c

Moved sql_common.h and my_time.h to libdrizzle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#include "mem0mem.h"
16
16
#include "data0type.h"
17
17
#include "data0data.h"
18
 
#ifndef PARS0GRM_H
19
 
# define PARS0GRM_H
20
 
# include "pars0grm.h"
21
 
#endif
 
18
#include "pars0grm.h"
22
19
#include "pars0pars.h"
23
20
#include "que0que.h"
24
21
#include "eval0eval.h"
26
23
 
27
24
/**********************************************************************
28
25
Creates a symbol table for a single stored procedure or query. */
29
 
UNIV_INTERN
 
26
 
30
27
sym_tab_t*
31
28
sym_tab_create(
32
29
/*===========*/
49
46
Frees the memory allocated dynamically AFTER parsing phase for variables
50
47
etc. in the symbol table. Does not free the mem heap where the table was
51
48
originally created. Frees also SQL explicit cursor definitions. */
52
 
UNIV_INTERN
 
49
 
53
50
void
54
51
sym_tab_free_private(
55
52
/*=================*/
85
82
 
86
83
/**********************************************************************
87
84
Adds an integer literal to a symbol table. */
88
 
UNIV_INTERN
 
85
 
89
86
sym_node_t*
90
87
sym_tab_add_int_lit(
91
88
/*================*/
105
102
 
106
103
        node->indirection = NULL;
107
104
 
108
 
        dtype_set(dfield_get_type(&node->common.val), DATA_INT, 0, 4);
 
105
        dtype_set(&(node->common.val.type), DATA_INT, 0, 4);
109
106
 
110
107
        data = mem_heap_alloc(sym_tab->heap, 4);
111
108
        mach_write_to_4(data, val);
125
122
 
126
123
/**********************************************************************
127
124
Adds a string literal to a symbol table. */
128
 
UNIV_INTERN
 
125
 
129
126
sym_node_t*
130
127
sym_tab_add_str_lit(
131
128
/*================*/
147
144
 
148
145
        node->indirection = NULL;
149
146
 
150
 
        dtype_set(dfield_get_type(&node->common.val),
151
 
                  DATA_VARCHAR, DATA_ENGLISH, 0);
 
147
        dtype_set(&(node->common.val.type), DATA_VARCHAR, DATA_ENGLISH, 0);
152
148
 
153
149
        if (len) {
154
150
                data = mem_heap_alloc(sym_tab->heap, len);
172
168
 
173
169
/**********************************************************************
174
170
Add a bound literal to a symbol table. */
175
 
UNIV_INTERN
 
171
 
176
172
sym_node_t*
177
173
sym_tab_add_bound_lit(
178
174
/*==================*/
230
226
                ut_error;
231
227
        }
232
228
 
233
 
        dtype_set(dfield_get_type(&node->common.val),
234
 
                  blit->type, blit->prtype, len);
 
229
        dtype_set(&(node->common.val.type), blit->type, blit->prtype, len);
235
230
 
236
231
        dfield_set_data(&(node->common.val), blit->address, blit->length);
237
232
 
248
243
 
249
244
/**********************************************************************
250
245
Adds an SQL null literal to a symbol table. */
251
 
UNIV_INTERN
 
246
 
252
247
sym_node_t*
253
248
sym_tab_add_null_lit(
254
249
/*=================*/
266
261
 
267
262
        node->indirection = NULL;
268
263
 
269
 
        dfield_get_type(&node->common.val)->mtype = DATA_ERROR;
 
264
        node->common.val.type.mtype = DATA_ERROR;
270
265
 
271
 
        dfield_set_null(&node->common.val);
 
266
        dfield_set_data(&(node->common.val), NULL, UNIV_SQL_NULL);
272
267
 
273
268
        node->common.val_buf_size = 0;
274
269
        node->prefetch_buf = NULL;
283
278
 
284
279
/**********************************************************************
285
280
Adds an identifier to a symbol table. */
286
 
UNIV_INTERN
 
281
 
287
282
sym_node_t*
288
283
sym_tab_add_id(
289
284
/*===========*/
306
301
 
307
302
        UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node);
308
303
 
309
 
        dfield_set_null(&node->common.val);
 
304
        dfield_set_data(&(node->common.val), NULL, UNIV_SQL_NULL);
310
305
 
311
306
        node->common.val_buf_size = 0;
312
307
        node->prefetch_buf = NULL;
319
314
 
320
315
/**********************************************************************
321
316
Add a bound identifier to a symbol table. */
322
 
UNIV_INTERN
 
317
 
323
318
sym_node_t*
324
319
sym_tab_add_bound_id(
325
320
/*===========*/
345
340
 
346
341
        UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node);
347
342
 
348
 
        dfield_set_null(&node->common.val);
 
343
        dfield_set_data(&(node->common.val), NULL, UNIV_SQL_NULL);
349
344
 
350
345
        node->common.val_buf_size = 0;
351
346
        node->prefetch_buf = NULL;