~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/pars0pars.h

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
#define PARS_OUTPUT     1
75
75
#define PARS_NOT_PARAM  2
76
76
 
77
 
int
78
 
yyparse(void);
79
77
 
80
78
/*****************************************************************
81
79
Parses an SQL string returning the query graph. */
82
 
UNIV_INTERN
 
80
 
83
81
que_t*
84
82
pars_sql(
85
83
/*=====*/
88
86
        const char*     str);   /* in: SQL string */
89
87
/*****************************************************************
90
88
Retrieves characters to the lexical analyzer. */
91
 
UNIV_INTERN
 
89
 
92
90
void
93
91
pars_get_lex_chars(
94
92
/*===============*/
98
96
                                in the buffer */
99
97
/*****************************************************************
100
98
Called by yyparse on error. */
101
 
UNIV_INTERN
 
99
 
102
100
void
103
101
yyerror(
104
102
/*====*/
105
103
        const char*     s);     /* in: error message string */
106
104
/*************************************************************************
107
105
Parses a variable declaration. */
108
 
UNIV_INTERN
 
106
 
109
107
sym_node_t*
110
108
pars_variable_declaration(
111
109
/*======================*/
116
114
        pars_res_word_t* type); /* in: pointer to a type token */
117
115
/*************************************************************************
118
116
Parses a function expression. */
119
 
UNIV_INTERN
 
117
 
120
118
func_node_t*
121
119
pars_func(
122
120
/*======*/
125
123
        que_node_t*     arg);   /* in: first argument in the argument list */
126
124
/*************************************************************************
127
125
Parses an operator expression. */
128
 
UNIV_INTERN
 
126
 
129
127
func_node_t*
130
128
pars_op(
131
129
/*====*/
136
134
                                operator */
137
135
/*************************************************************************
138
136
Parses an ORDER BY clause. Order by a single column only is supported. */
139
 
UNIV_INTERN
 
137
 
140
138
order_node_t*
141
139
pars_order_by(
142
140
/*==========*/
146
144
/*************************************************************************
147
145
Parses a select list; creates a query graph node for the whole SELECT
148
146
statement. */
149
 
UNIV_INTERN
 
147
 
150
148
sel_node_t*
151
149
pars_select_list(
152
150
/*=============*/
156
154
        sym_node_t*     into_list);     /* in: variables list or NULL */
157
155
/*************************************************************************
158
156
Parses a cursor declaration. */
159
 
UNIV_INTERN
 
157
 
160
158
que_node_t*
161
159
pars_cursor_declaration(
162
160
/*====================*/
166
164
        sel_node_t*     select_node);   /* in: select node */
167
165
/*************************************************************************
168
166
Parses a function declaration. */
169
 
UNIV_INTERN
 
167
 
170
168
que_node_t*
171
169
pars_function_declaration(
172
170
/*======================*/
175
173
                                        table */
176
174
/*************************************************************************
177
175
Parses a select statement. */
178
 
UNIV_INTERN
 
176
 
179
177
sel_node_t*
180
178
pars_select_statement(
181
179
/*==================*/
191
189
        order_node_t*   order_by);      /* in: NULL or an order-by node */
192
190
/*************************************************************************
193
191
Parses a column assignment in an update. */
194
 
UNIV_INTERN
 
192
 
195
193
col_assign_node_t*
196
194
pars_column_assignment(
197
195
/*===================*/
200
198
        que_node_t*     exp);   /* in: value to assign */
201
199
/*************************************************************************
202
200
Parses a delete or update statement start. */
203
 
UNIV_INTERN
 
201
 
204
202
upd_node_t*
205
203
pars_update_statement_start(
206
204
/*========================*/
212
210
                                        if delete */
213
211
/*************************************************************************
214
212
Parses an update or delete statement. */
215
 
UNIV_INTERN
 
213
 
216
214
upd_node_t*
217
215
pars_update_statement(
218
216
/*==================*/
224
222
        que_node_t*     search_cond);   /* in: search condition or NULL */
225
223
/*************************************************************************
226
224
Parses an insert statement. */
227
 
UNIV_INTERN
 
225
 
228
226
ins_node_t*
229
227
pars_insert_statement(
230
228
/*==================*/
235
233
        sel_node_t*     select);        /* in: select condition or NULL */
236
234
/*************************************************************************
237
235
Parses a procedure parameter declaration. */
238
 
UNIV_INTERN
 
236
 
239
237
sym_node_t*
240
238
pars_parameter_declaration(
241
239
/*=======================*/
248
246
        pars_res_word_t* type); /* in: pointer to a type token */
249
247
/*************************************************************************
250
248
Parses an elsif element. */
251
 
UNIV_INTERN
 
249
 
252
250
elsif_node_t*
253
251
pars_elsif_element(
254
252
/*===============*/
257
255
        que_node_t*     stat_list);     /* in: statement list */
258
256
/*************************************************************************
259
257
Parses an if-statement. */
260
 
UNIV_INTERN
 
258
 
261
259
if_node_t*
262
260
pars_if_statement(
263
261
/*==============*/
267
265
        que_node_t*     else_part);     /* in: else-part statement list */
268
266
/*************************************************************************
269
267
Parses a for-loop-statement. */
270
 
UNIV_INTERN
 
268
 
271
269
for_node_t*
272
270
pars_for_statement(
273
271
/*===============*/
278
276
        que_node_t*     stat_list);     /* in: statement list */
279
277
/*************************************************************************
280
278
Parses a while-statement. */
281
 
UNIV_INTERN
 
279
 
282
280
while_node_t*
283
281
pars_while_statement(
284
282
/*=================*/
287
285
        que_node_t*     stat_list);     /* in: statement list */
288
286
/*************************************************************************
289
287
Parses an exit statement. */
290
 
UNIV_INTERN
 
288
 
291
289
exit_node_t*
292
290
pars_exit_statement(void);
293
291
/*=====================*/
294
292
                                        /* out: exit statement node */
295
293
/*************************************************************************
296
294
Parses a return-statement. */
297
 
UNIV_INTERN
 
295
 
298
296
return_node_t*
299
297
pars_return_statement(void);
300
298
/*=======================*/
301
299
                                        /* out: return-statement node */
302
300
/*************************************************************************
303
301
Parses a procedure call. */
304
 
UNIV_INTERN
 
302
 
305
303
func_node_t*
306
304
pars_procedure_call(
307
305
/*================*/
310
308
        que_node_t*     args);  /* in: argument list */
311
309
/*************************************************************************
312
310
Parses an assignment statement. */
313
 
UNIV_INTERN
 
311
 
314
312
assign_node_t*
315
313
pars_assignment_statement(
316
314
/*======================*/
320
318
/*************************************************************************
321
319
Parses a fetch statement. into_list or user_func (but not both) must be
322
320
non-NULL. */
323
 
UNIV_INTERN
 
321
 
324
322
fetch_node_t*
325
323
pars_fetch_statement(
326
324
/*=================*/
330
328
        sym_node_t*     user_func);     /* in: user function name, or NULL */
331
329
/*************************************************************************
332
330
Parses an open or close cursor statement. */
333
 
UNIV_INTERN
 
331
 
334
332
open_node_t*
335
333
pars_open_statement(
336
334
/*================*/
340
338
        sym_node_t*     cursor);        /* in: cursor node */
341
339
/*************************************************************************
342
340
Parses a row_printf-statement. */
343
 
UNIV_INTERN
 
341
 
344
342
row_printf_node_t*
345
343
pars_row_printf_statement(
346
344
/*======================*/
348
346
        sel_node_t*     sel_node);      /* in: select node */
349
347
/*************************************************************************
350
348
Parses a commit statement. */
351
 
UNIV_INTERN
 
349
 
352
350
commit_node_t*
353
351
pars_commit_statement(void);
354
352
/*=======================*/
355
353
/*************************************************************************
356
354
Parses a rollback statement. */
357
 
UNIV_INTERN
 
355
 
358
356
roll_node_t*
359
357
pars_rollback_statement(void);
360
358
/*=========================*/
361
359
/*************************************************************************
362
360
Parses a column definition at a table creation. */
363
 
UNIV_INTERN
 
361
 
364
362
sym_node_t*
365
363
pars_column_def(
366
364
/*============*/
377
375
                                                is of type NOT NULL. */
378
376
/*************************************************************************
379
377
Parses a table creation operation. */
380
 
UNIV_INTERN
 
378
 
381
379
tab_node_t*
382
380
pars_create_table(
383
381
/*==============*/
397
395
                                        from disk */
398
396
/*************************************************************************
399
397
Parses an index creation operation. */
400
 
UNIV_INTERN
 
398
 
401
399
ind_node_t*
402
400
pars_create_index(
403
401
/*==============*/
411
409
        sym_node_t*     column_list);   /* in: list of column names */
412
410
/*************************************************************************
413
411
Parses a procedure definition. */
414
 
UNIV_INTERN
 
412
 
415
413
que_fork_t*
416
414
pars_procedure_definition(
417
415
/*======================*/
426
424
procedure, that is, the client issues a procedure call directly.
427
425
In MySQL/InnoDB, stored InnoDB procedures are invoked via the
428
426
parsed procedure tree, not via InnoDB SQL, so this function is not used. */
429
 
UNIV_INTERN
 
427
 
430
428
que_fork_t*
431
429
pars_stored_procedure_call(
432
430
/*=======================*/
435
433
/**********************************************************************
436
434
Completes a query graph by adding query thread and fork nodes
437
435
above it and prepares the graph for running. The fork created is of
438
 
type QUE_FORK_MYSQL_INTERFACE. */
439
 
UNIV_INTERN
 
436
type QUE_FORK_DRIZZLE_INTERFACE. */
 
437
 
440
438
que_thr_t*
441
439
pars_complete_graph_for_exec(
442
440
/*=========================*/
448
446
 
449
447
/********************************************************************
450
448
Create parser info struct.*/
451
 
UNIV_INTERN
 
449
 
452
450
pars_info_t*
453
451
pars_info_create(void);
454
452
/*==================*/
456
454
 
457
455
/********************************************************************
458
456
Free info struct and everything it contains.*/
459
 
UNIV_INTERN
 
457
 
460
458
void
461
459
pars_info_free(
462
460
/*===========*/
464
462
 
465
463
/********************************************************************
466
464
Add bound literal. */
467
 
UNIV_INTERN
 
465
 
468
466
void
469
467
pars_info_add_literal(
470
468
/*==================*/
479
477
/********************************************************************
480
478
Equivalent to pars_info_add_literal(info, name, str, strlen(str),
481
479
DATA_VARCHAR, DATA_ENGLISH). */
482
 
UNIV_INTERN
 
480
 
483
481
void
484
482
pars_info_add_str_literal(
485
483
/*======================*/
496
494
 
497
495
except that the buffer is dynamically allocated from the info struct's
498
496
heap. */
499
 
UNIV_INTERN
 
497
 
500
498
void
501
499
pars_info_add_int4_literal(
502
500
/*=======================*/
513
511
 
514
512
except that the buffer is dynamically allocated from the info struct's
515
513
heap. */
516
 
UNIV_INTERN
 
514
 
517
515
void
518
516
pars_info_add_dulint_literal(
519
517
/*=========================*/
522
520
        dulint          val);           /* in: value */
523
521
/********************************************************************
524
522
Add user function. */
525
 
UNIV_INTERN
 
523
 
526
524
void
527
525
pars_info_add_function(
528
526
/*===================*/
533
531
 
534
532
/********************************************************************
535
533
Add bound id. */
536
 
UNIV_INTERN
 
534
 
537
535
void
538
536
pars_info_add_id(
539
537
/*=============*/
543
541
 
544
542
/********************************************************************
545
543
Get user function with the given name.*/
546
 
UNIV_INTERN
 
544
 
547
545
pars_user_func_t*
548
546
pars_info_get_user_func(
549
547
/*====================*/
554
552
 
555
553
/********************************************************************
556
554
Get bound literal with the given name.*/
557
 
UNIV_INTERN
 
555
 
558
556
pars_bound_lit_t*
559
557
pars_info_get_bound_lit(
560
558
/*====================*/
565
563
 
566
564
/********************************************************************
567
565
Get bound id with the given name.*/
568
 
UNIV_INTERN
 
566
 
569
567
pars_bound_id_t*
570
568
pars_info_get_bound_id(
571
569
/*===================*/
623
621
struct func_node_struct{
624
622
        que_common_t    common; /* type: QUE_NODE_FUNC */
625
623
        int             func;   /* token code of the function name */
626
 
        ulint           class;  /* class of the function */
 
624
        ulint           klass;  /* class of the function */
627
625
        que_node_t*     args;   /* argument(s) of the function */
628
626
        UT_LIST_NODE_T(func_node_t) cond_list;
629
627
                                /* list of comparison conditions; defined