-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
sql_yacc.yy
15521 lines (14124 loc) · 457 KB
/
sql_yacc.yy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* sql_yacc.yy */
/**
@defgroup Parser Parser
@{
*/
%{
/*
Note: YYTHD is passed as an argument to yyparse(), and subsequently to yylex().
*/
#define YYLIP (& YYTHD->m_parser_state->m_lip)
#define YYPS (& YYTHD->m_parser_state->m_yacc)
#define YYCSCL (YYLIP->query_charset)
#define YYINITDEPTH 100
#define YYMAXDEPTH 3200 /* Because of 64K stack */
#define Lex (YYTHD->lex)
#define Select Lex->current_select()
#include "sql_parse.h" /* comp_*_creator */
#include "sql_table.h" /* primary_key_name */
#include "partition_info.h" /* partition_info */
#include "sql_partition.h" /* mem_alloc_error */
#include "auth_common.h" /* *_ACL */
#include "password.h" /* my_make_scrambled_password_323, my_make_scrambled_password */
#include "sql_class.h" /* Key_part_spec, enum_filetype */
#include "rpl_slave.h"
#include "rpl_msr.h" /* multisource replication */
#include "rpl_filter.h"
#include "log_event.h"
#include "lex_symbol.h"
#include "item_create.h"
#include "sp_head.h"
#include "sp_instr.h"
#include "sp_pcontext.h"
#include "sp_rcontext.h"
#include "sp.h"
#include "sql_alter.h" // Sql_cmd_alter_table*
#include "sql_truncate.h" // Sql_cmd_truncate_table
#include "sql_admin.h" // Sql_cmd_analyze/Check..._table
#include "sql_partition_admin.h" // Sql_cmd_alter_table_*_part.
#include "sql_handler.h" // Sql_cmd_handler_*
#include "sql_signal.h"
#include "sql_get_diagnostics.h" // Sql_cmd_get_diagnostics
#include "sql_servers.h"
#include "event_parse_data.h"
#include <myisam.h>
#include <myisammrg.h>
#include "keycaches.h"
#include "set_var.h"
#include "opt_explain_traditional.h"
#include "opt_explain_json.h"
#include "rpl_slave.h" // Sql_cmd_change_repl_filter
#include "sql_show_status.h" // build_show_session_status, ...
#include "parse_location.h"
#include "parse_tree_helpers.h"
#include "lex_token.h"
#include "item_cmpfunc.h"
#include "item_geofunc.h"
#include "item_json_func.h"
#include "sql_plugin.h" // plugin_is_ready
#include "parse_tree_hints.h"
/* this is to get the bison compilation windows warnings out */
#ifdef _MSC_VER
/* warning C4065: switch statement contains 'default' but no 'case' labels */
#pragma warning (disable : 4065)
#endif
using std::min;
using std::max;
int yylex(void *yylval, void *yythd);
#define yyoverflow(A,B,C,D,E,F,G,H) \
{ \
ulong val= *(H); \
if (my_yyoverflow((B), (D), (F), &val)) \
{ \
yyerror(NULL, YYTHD, (char*) (A)); \
return 2; \
} \
else \
{ \
*(H)= (YYSIZE_T)val; \
} \
}
#define MYSQL_YYABORT \
do \
{ \
LEX::cleanup_lex_after_parse_error(YYTHD);\
YYABORT; \
} while (0)
#define MYSQL_YYABORT_UNLESS(A) \
if (!(A)) \
{ \
my_syntax_error(ER(ER_SYNTAX_ERROR));\
MYSQL_YYABORT; \
}
#define NEW_PTN new(YYTHD->mem_root)
/**
Parse_tree_node::contextualize_() function call wrapper
*/
#define TMP_CONTEXTUALIZE(x) \
do \
{ \
Parse_context pc(YYTHD, Select);\
if ((x)->contextualize_(&pc)) \
MYSQL_YYABORT; \
} while(0)
/**
Parse_tree_node::contextualize() function call wrapper
*/
#define CONTEXTUALIZE(x) \
do \
{ \
Parse_context pc(YYTHD, Select); \
if (YYTHD->is_error() || (x)->contextualize(&pc)) \
MYSQL_YYABORT; \
} while(0)
/**
Item::itemize() function call wrapper
*/
#define ITEMIZE(x, y) \
do \
{ \
Parse_context pc(YYTHD, Select); \
if (YYTHD->is_error() || (x)->itemize(&pc, (y))) \
MYSQL_YYABORT; \
} while(0)
/**
PT_statement::make_cmd() wrapper to raise postponed error message on OOM
@note x may be NULL because of OOM error.
*/
#define MAKE_CMD(x) \
do \
{ \
if (YYTHD->is_error()) \
MYSQL_YYABORT; \
Lex->m_sql_cmd= (x)->make_cmd(YYTHD); \
} while(0)
#ifndef DBUG_OFF
#define YYDEBUG 1
#else
#define YYDEBUG 0
#endif
/**
@brief Bison callback to report a syntax/OOM error
This function is invoked by the bison-generated parser
when a syntax error, a parse error or an out-of-memory
condition occurs. This function is not invoked when the
parser is requested to abort by semantic action code
by means of YYABORT or YYACCEPT macros. This is why these
macros should not be used (use MYSQL_YYABORT/MYSQL_YYACCEPT
instead).
The parser will abort immediately after invoking this callback.
This function is not for use in semantic actions and is internal to
the parser, as it performs some pre-return cleanup.
In semantic actions, please use my_syntax_error or my_error to
push an error into the error stack and MYSQL_YYABORT
to abort from the parser.
*/
void MYSQLerror(YYLTYPE *, THD *thd, const char *s)
{
/*
Restore the original LEX if it was replaced when parsing
a stored procedure. We must ensure that a parsing error
does not leave any side effects in the THD.
*/
LEX::cleanup_lex_after_parse_error(thd);
/* "parse error" changed into "syntax error" between bison 1.75 and 1.875 */
if (strcmp(s,"parse error") == 0 || strcmp(s,"syntax error") == 0)
s= ER(ER_SYNTAX_ERROR);
my_syntax_error(s);
}
#ifndef DBUG_OFF
void turn_parser_debug_on()
{
/*
MYSQLdebug is in sql/sql_yacc.cc, in bison generated code.
Turning this option on is **VERY** verbose, and should be
used when investigating a syntax error problem only.
The syntax to run with bison traces is as follows :
- Starting a server manually :
mysqld --debug="d,parser_debug" ...
- Running a test :
mysql-test-run.pl --mysqld="--debug=d,parser_debug" ...
The result will be in the process stderr (var/log/master.err)
*/
extern int yydebug;
yydebug= 1;
}
#endif
static bool is_native_function(THD *thd, const LEX_STRING *name)
{
if (find_native_function_builder(thd, *name))
return true;
if (is_lex_native_function(name))
return true;
return false;
}
/**
Helper action for a case statement (entering the CASE).
This helper is used for both 'simple' and 'searched' cases.
This helper, with the other case_stmt_action_..., is executed when
the following SQL code is parsed:
<pre>
CREATE PROCEDURE proc_19194_simple(i int)
BEGIN
DECLARE str CHAR(10);
CASE i
WHEN 1 THEN SET str="1";
WHEN 2 THEN SET str="2";
WHEN 3 THEN SET str="3";
ELSE SET str="unknown";
END CASE;
SELECT str;
END
</pre>
The actions are used to generate the following code:
<pre>
SHOW PROCEDURE CODE proc_19194_simple;
Pos Instruction
0 set str@1 NULL
1 set_case_expr (12) 0 i@0
2 jump_if_not 5(12) (case_expr@0 = 1)
3 set str@1 _latin1'1'
4 jump 12
5 jump_if_not 8(12) (case_expr@0 = 2)
6 set str@1 _latin1'2'
7 jump 12
8 jump_if_not 11(12) (case_expr@0 = 3)
9 set str@1 _latin1'3'
10 jump 12
11 set str@1 _latin1'unknown'
12 stmt 0 "SELECT str"
</pre>
@param thd thread handler
*/
void case_stmt_action_case(THD *thd)
{
LEX *lex= thd->lex;
sp_head *sp= lex->sphead;
sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
sp->m_parser_data.new_cont_backpatch();
/*
BACKPATCH: Creating target label for the jump to
"case_stmt_action_end_case"
(Instruction 12 in the example)
*/
pctx->push_label(thd, EMPTY_STR, sp->instructions());
}
/**
Helper action for a case then statements.
This helper is used for both 'simple' and 'searched' cases.
@param lex the parser lex context
*/
bool case_stmt_action_then(THD *thd, LEX *lex)
{
sp_head *sp= lex->sphead;
sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
sp_instr_jump *i =
new (thd->mem_root) sp_instr_jump(sp->instructions(), pctx);
if (!i || sp->add_instr(thd, i))
return true;
/*
BACKPATCH: Resolving forward jump from
"case_stmt_action_when" to "case_stmt_action_then"
(jump_if_not from instruction 2 to 5, 5 to 8 ... in the example)
*/
sp->m_parser_data.do_backpatch(pctx->pop_label(), sp->instructions());
/*
BACKPATCH: Registering forward jump from
"case_stmt_action_then" to "case_stmt_action_end_case"
(jump from instruction 4 to 12, 7 to 12 ... in the example)
*/
return sp->m_parser_data.add_backpatch_entry(i, pctx->last_label());
}
/**
Helper action for an end case.
This helper is used for both 'simple' and 'searched' cases.
@param lex the parser lex context
@param simple true for simple cases, false for searched cases
*/
void case_stmt_action_end_case(LEX *lex, bool simple)
{
sp_head *sp= lex->sphead;
sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
/*
BACKPATCH: Resolving forward jump from
"case_stmt_action_then" to "case_stmt_action_end_case"
(jump from instruction 4 to 12, 7 to 12 ... in the example)
*/
sp->m_parser_data.do_backpatch(pctx->pop_label(), sp->instructions());
if (simple)
pctx->pop_case_expr_id();
sp->m_parser_data.do_cont_backpatch(sp->instructions());
}
static bool add_create_index_prepare (LEX *lex, Table_ident *table)
{
lex->sql_command= SQLCOM_CREATE_INDEX;
if (!lex->current_select()->add_table_to_list(lex->thd, table, NULL,
TL_OPTION_UPDATING,
TL_READ_NO_INSERT,
MDL_SHARED_UPGRADABLE))
return TRUE;
lex->alter_info.reset();
lex->alter_info.flags= Alter_info::ALTER_ADD_INDEX;
lex->col_list.empty();
lex->change= NullS;
return FALSE;
}
static bool add_create_index (LEX *lex, keytype type,
const LEX_STRING &name,
KEY_CREATE_INFO *info= NULL, bool generated= 0)
{
Key *key;
key= new Key(type, name, info ? info : &lex->key_create_info, generated,
lex->col_list);
if (key == NULL)
return TRUE;
lex->alter_info.key_list.push_back(key);
lex->col_list.empty();
return FALSE;
}
/**
Compare a LEX_USER against the current user as defined by the exact user and
host used during authentication.
@param user A pointer to a user which needs to be matched against the
current.
@see SET PASSWORD rules
@retval true The specified user is the authorized user
@retval false The user doesn't match
*/
bool match_authorized_user(Security_context *ctx, LEX_USER *user)
{
if(user->user.str && my_strcasecmp(system_charset_info,
ctx->priv_user().str,
user->user.str) == 0)
{
/*
users match; let's compare hosts.
1. first compare with the host we actually authorized,
2. then see if we match the host mask of the priv_host
*/
if (user->host.str && my_strcasecmp(system_charset_info,
user->host.str,
ctx->priv_host().str) == 0)
{
/* specified user exactly match the authorized user */
return true;
}
}
return false;
}
static void init_index_hints(List<Index_hint> *hints, index_hint_type type,
index_clause_map clause)
{
List_iterator<Index_hint> it(*hints);
Index_hint *hint;
while ((hint= it++))
{
hint->type= type;
hint->clause= clause;
}
}
bool my_yyoverflow(short **a, YYSTYPE **b, YYLTYPE **c, ulong *yystacksize);
#include "parse_tree_nodes.h"
#include "parse_tree_items.h"
%}
%yacc
%parse-param { class THD *YYTHD }
%lex-param { class THD *YYTHD }
%pure-parser /* We have threads */
/*
Currently there are 159 shift/reduce conflicts.
We should not introduce new conflicts any more.
*/
%expect 155
/*
Comments for TOKENS.
For each token, please include in the same line a comment that contains
the following tags:
SQL-2015-R : Reserved keyword as per SQL-2015 draft
SQL-2003-R : Reserved keyword as per SQL-2003
SQL-2003-N : Non Reserved keyword as per SQL-2003
SQL-1999-R : Reserved keyword as per SQL-1999
SQL-1999-N : Non Reserved keyword as per SQL-1999
MYSQL : MySQL extention (unspecified)
MYSQL-FUNC : MySQL extention, function
INTERNAL : Not a real token, lex optimization
OPERATOR : SQL operator
FUTURE-USE : Reserved for futur use
This makes the code grep-able, and helps maintenance.
*/
%token ABORT_SYM /* INTERNAL (used in lex) */
%token ACCESSIBLE_SYM
%token ACCOUNT_SYM
%token ACTION /* SQL-2003-N */
%token ADD /* SQL-2003-R */
%token ADDDATE_SYM /* MYSQL-FUNC */
%token AFTER_SYM /* SQL-2003-N */
%token AGAINST
%token AGGREGATE_SYM
%token ALGORITHM_SYM
%token ALL /* SQL-2003-R */
%token ALTER /* SQL-2003-R */
%token ALWAYS_SYM
%token ANALYSE_SYM
%token ANALYZE_SYM
%token AND_AND_SYM /* OPERATOR */
%token AND_SYM /* SQL-2003-R */
%token ANY_SYM /* SQL-2003-R */
%token AS /* SQL-2003-R */
%token ASC /* SQL-2003-N */
%token ASCII_SYM /* MYSQL-FUNC */
%token ASENSITIVE_SYM /* FUTURE-USE */
%token AT_SYM /* SQL-2003-R */
%token AUTOEXTEND_SIZE_SYM
%token AUTO_INC
%token AVG_ROW_LENGTH
%token AVG_SYM /* SQL-2003-N */
%token BACKUP_SYM
%token BEFORE_SYM /* SQL-2003-N */
%token BEGIN_SYM /* SQL-2003-R */
%token BETWEEN_SYM /* SQL-2003-R */
%token BIGINT /* SQL-2003-R */
%token BINARY /* SQL-2003-R */
%token BINLOG_SYM
%token BIN_NUM
%token BIT_AND /* MYSQL-FUNC */
%token BIT_OR /* MYSQL-FUNC */
%token BIT_SYM /* MYSQL-FUNC */
%token BIT_XOR /* MYSQL-FUNC */
%token BLOB_SYM /* SQL-2003-R */
%token BLOCK_SYM
%token BOOLEAN_SYM /* SQL-2003-R */
%token BOOL_SYM
%token BOTH /* SQL-2003-R */
%token BTREE_SYM
%token BY /* SQL-2003-R */
%token BYTE_SYM
%token CACHE_SYM
%token CALL_SYM /* SQL-2003-R */
%token CASCADE /* SQL-2003-N */
%token CASCADED /* SQL-2003-R */
%token CASE_SYM /* SQL-2003-R */
%token CAST_SYM /* SQL-2003-R */
%token CATALOG_NAME_SYM /* SQL-2003-N */
%token CHAIN_SYM /* SQL-2003-N */
%token CHANGE
%token CHANGED
%token CHANNEL_SYM
%token CHARSET
%token CHAR_SYM /* SQL-2003-R */
%token CHECKSUM_SYM
%token CHECK_SYM /* SQL-2003-R */
%token CIPHER_SYM
%token CLASS_ORIGIN_SYM /* SQL-2003-N */
%token CLIENT_SYM
%token CLOSE_SYM /* SQL-2003-R */
%token COALESCE /* SQL-2003-N */
%token CODE_SYM
%token COLLATE_SYM /* SQL-2003-R */
%token COLLATION_SYM /* SQL-2003-N */
%token COLUMNS
%token COLUMN_SYM /* SQL-2003-R */
%token COLUMN_FORMAT_SYM
%token COLUMN_NAME_SYM /* SQL-2003-N */
%token COMMENT_SYM
%token COMMITTED_SYM /* SQL-2003-N */
%token COMMIT_SYM /* SQL-2003-R */
%token COMPACT_SYM
%token COMPLETION_SYM
%token COMPRESSED_SYM
%token COMPRESSION_SYM
%token ENCRYPTION_SYM
%token CONCURRENT
%token CONDITION_SYM /* SQL-2003-R, SQL-2008-R */
%token CONNECTION_SYM
%token CONSISTENT_SYM
%token CONSTRAINT /* SQL-2003-R */
%token CONSTRAINT_CATALOG_SYM /* SQL-2003-N */
%token CONSTRAINT_NAME_SYM /* SQL-2003-N */
%token CONSTRAINT_SCHEMA_SYM /* SQL-2003-N */
%token CONTAINS_SYM /* SQL-2003-N */
%token CONTEXT_SYM
%token CONTINUE_SYM /* SQL-2003-R */
%token CONVERT_SYM /* SQL-2003-N */
%token COUNT_SYM /* SQL-2003-N */
%token CPU_SYM
%token CREATE /* SQL-2003-R */
%token CROSS /* SQL-2003-R */
%token CUBE_SYM /* SQL-2003-R */
%token CURDATE /* MYSQL-FUNC */
%token CURRENT_SYM /* SQL-2003-R */
%token CURRENT_USER /* SQL-2003-R */
%token CURSOR_SYM /* SQL-2003-R */
%token CURSOR_NAME_SYM /* SQL-2003-N */
%token CURTIME /* MYSQL-FUNC */
%token DATABASE
%token DATABASES
%token DATAFILE_SYM
%token DATA_SYM /* SQL-2003-N */
%token DATETIME
%token DATE_ADD_INTERVAL /* MYSQL-FUNC */
%token DATE_SUB_INTERVAL /* MYSQL-FUNC */
%token DATE_SYM /* SQL-2003-R */
%token DAY_HOUR_SYM
%token DAY_MICROSECOND_SYM
%token DAY_MINUTE_SYM
%token DAY_SECOND_SYM
%token DAY_SYM /* SQL-2003-R */
%token DEALLOCATE_SYM /* SQL-2003-R */
%token DECIMAL_NUM
%token DECIMAL_SYM /* SQL-2003-R */
%token DECLARE_SYM /* SQL-2003-R */
%token DEFAULT /* SQL-2003-R */
%token DEFAULT_AUTH_SYM /* INTERNAL */
%token DEFINER_SYM
%token DELAYED_SYM
%token DELAY_KEY_WRITE_SYM
%token DELETE_SYM /* SQL-2003-R */
%token DESC /* SQL-2003-N */
%token DESCRIBE /* SQL-2003-R */
%token DES_KEY_FILE
%token DETERMINISTIC_SYM /* SQL-2003-R */
%token DIAGNOSTICS_SYM /* SQL-2003-N */
%token DIRECTORY_SYM
%token DISABLE_SYM
%token DISCARD
%token DISK_SYM
%token DISTINCT /* SQL-2003-R */
%token DIV_SYM
%token DOUBLE_SYM /* SQL-2003-R */
%token DO_SYM
%token DROP /* SQL-2003-R */
%token DUAL_SYM
%token DUMPFILE
%token DUPLICATE_SYM
%token DYNAMIC_SYM /* SQL-2003-R */
%token EACH_SYM /* SQL-2003-R */
%token ELSE /* SQL-2003-R */
%token ELSEIF_SYM
%token ENABLE_SYM
%token ENCLOSED
%token END /* SQL-2003-R */
%token ENDS_SYM
%token END_OF_INPUT /* INTERNAL */
%token ENGINES_SYM
%token ENGINE_SYM
%token ENUM
%token EQ /* OPERATOR */
%token EQUAL_SYM /* OPERATOR */
%token ERROR_SYM
%token ERRORS
%token ESCAPED
%token ESCAPE_SYM /* SQL-2003-R */
%token EVENTS_SYM
%token EVENT_SYM
%token EVERY_SYM /* SQL-2003-N */
%token EXCHANGE_SYM
%token EXECUTE_SYM /* SQL-2003-R */
%token EXISTS /* SQL-2003-R */
%token EXIT_SYM
%token EXPANSION_SYM
%token EXPIRE_SYM
%token EXPORT_SYM
%token EXTENDED_SYM
%token EXTENT_SIZE_SYM
%token EXTRACT_SYM /* SQL-2003-N */
%token FALSE_SYM /* SQL-2003-R */
%token FAST_SYM
%token FAULTS_SYM
%token FETCH_SYM /* SQL-2003-R */
%token FILE_SYM
%token FILE_BLOCK_SIZE_SYM
%token FILTER_SYM
%token FIRST_SYM /* SQL-2003-N */
%token FIXED_SYM
%token FLOAT_NUM
%token FLOAT_SYM /* SQL-2003-R */
%token FLUSH_SYM
%token FOLLOWS_SYM /* MYSQL */
%token FORCE_SYM
%token FOREIGN /* SQL-2003-R */
%token FOR_SYM /* SQL-2003-R */
%token FORMAT_SYM
%token FOUND_SYM /* SQL-2003-R */
%token FROM
%token FULL /* SQL-2003-R */
%token FULLTEXT_SYM
%token FUNCTION_SYM /* SQL-2003-R */
%token GE
%token GENERAL
%token GENERATED
%token GROUP_REPLICATION
%token GEOMETRYCOLLECTION
%token GEOMETRY_SYM
%token GET_FORMAT /* MYSQL-FUNC */
%token GET_SYM /* SQL-2003-R */
%token GLOBAL_SYM /* SQL-2003-R */
%token GRANT /* SQL-2003-R */
%token GRANTS
%token GROUP_SYM /* SQL-2003-R */
%token GROUP_CONCAT_SYM
%token GT_SYM /* OPERATOR */
%token HANDLER_SYM
%token HASH_SYM
%token HAVING /* SQL-2003-R */
%token HELP_SYM
%token HEX_NUM
%token HIGH_PRIORITY
%token HOST_SYM
%token HOSTS_SYM
%token HOUR_MICROSECOND_SYM
%token HOUR_MINUTE_SYM
%token HOUR_SECOND_SYM
%token HOUR_SYM /* SQL-2003-R */
%token IDENT
%token IDENTIFIED_SYM
%token IDENT_QUOTED
%token IF
%token IGNORE_SYM
%token IGNORE_SERVER_IDS_SYM
%token IMPORT
%token INDEXES
%token INDEX_SYM
%token INFILE
%token INITIAL_SIZE_SYM
%token INNER_SYM /* SQL-2003-R */
%token INOUT_SYM /* SQL-2003-R */
%token INSENSITIVE_SYM /* SQL-2003-R */
%token INSERT /* SQL-2003-R */
%token INSERT_METHOD
%token INSTANCE_SYM
%token INSTALL_SYM
%token INTERVAL_SYM /* SQL-2003-R */
%token INTO /* SQL-2003-R */
%token INT_SYM /* SQL-2003-R */
%token INVOKER_SYM
%token IN_SYM /* SQL-2003-R */
%token IO_AFTER_GTIDS /* MYSQL, FUTURE-USE */
%token IO_BEFORE_GTIDS /* MYSQL, FUTURE-USE */
%token IO_SYM
%token IPC_SYM
%token IS /* SQL-2003-R */
%token ISOLATION /* SQL-2003-R */
%token ISSUER_SYM
%token ITERATE_SYM
%token JOIN_SYM /* SQL-2003-R */
%token JSON_SEPARATOR_SYM /* MYSQL */
%token JSON_UNQUOTED_SEPARATOR_SYM /* MYSQL */
%token JSON_SYM /* MYSQL */
%token KEYS
%token KEY_BLOCK_SIZE
%token KEY_SYM /* SQL-2003-N */
%token KILL_SYM
%token LANGUAGE_SYM /* SQL-2003-R */
%token LAST_SYM /* SQL-2003-N */
%token LE /* OPERATOR */
%token LEADING /* SQL-2003-R */
%token LEAVES
%token LEAVE_SYM
%token LEFT /* SQL-2003-R */
%token LESS_SYM
%token LEVEL_SYM
%token LEX_HOSTNAME
%token LIKE /* SQL-2003-R */
%token LIMIT
%token LINEAR_SYM
%token LINES
%token LINESTRING
%token LIST_SYM
%token LOAD
%token LOCAL_SYM /* SQL-2003-R */
%token LOCATOR_SYM /* SQL-2003-N */
%token LOCKS_SYM
%token LOCK_SYM
%token LOGFILE_SYM
%token LOGS_SYM
%token LONGBLOB
%token LONGTEXT
%token LONG_NUM
%token LONG_SYM
%token LOOP_SYM
%token LOW_PRIORITY
%token LT /* OPERATOR */
%token MASTER_AUTO_POSITION_SYM
%token MASTER_BIND_SYM
%token MASTER_CONNECT_RETRY_SYM
%token MASTER_DELAY_SYM
%token MASTER_HOST_SYM
%token MASTER_LOG_FILE_SYM
%token MASTER_LOG_POS_SYM
%token MASTER_PASSWORD_SYM
%token MASTER_PORT_SYM
%token MASTER_RETRY_COUNT_SYM
%token MASTER_SERVER_ID_SYM
%token MASTER_SSL_CAPATH_SYM
%token MASTER_TLS_VERSION_SYM
%token MASTER_SSL_CA_SYM
%token MASTER_SSL_CERT_SYM
%token MASTER_SSL_CIPHER_SYM
%token MASTER_SSL_CRL_SYM
%token MASTER_SSL_CRLPATH_SYM
%token MASTER_SSL_KEY_SYM
%token MASTER_SSL_SYM
%token MASTER_SSL_VERIFY_SERVER_CERT_SYM
%token MASTER_SYM
%token MASTER_USER_SYM
%token MASTER_HEARTBEAT_PERIOD_SYM
%token MATCH /* SQL-2003-R */
%token MAX_CONNECTIONS_PER_HOUR
%token MAX_QUERIES_PER_HOUR
%token MAX_ROWS
%token MAX_SIZE_SYM
%token MAX_SYM /* SQL-2003-N */
%token MAX_UPDATES_PER_HOUR
%token MAX_USER_CONNECTIONS_SYM
%token MAX_VALUE_SYM /* SQL-2003-N */
%token MEDIUMBLOB
%token MEDIUMINT
%token MEDIUMTEXT
%token MEDIUM_SYM
%token MEMORY_SYM
%token MERGE_SYM /* SQL-2003-R */
%token MESSAGE_TEXT_SYM /* SQL-2003-N */
%token MICROSECOND_SYM /* MYSQL-FUNC */
%token MIGRATE_SYM
%token MINUTE_MICROSECOND_SYM
%token MINUTE_SECOND_SYM
%token MINUTE_SYM /* SQL-2003-R */
%token MIN_ROWS
%token MIN_SYM /* SQL-2003-N */
%token MODE_SYM
%token MODIFIES_SYM /* SQL-2003-R */
%token MODIFY_SYM
%token MOD_SYM /* SQL-2003-N */
%token MONTH_SYM /* SQL-2003-R */
%token MULTILINESTRING
%token MULTIPOINT
%token MULTIPOLYGON
%token MUTEX_SYM
%token MYSQL_ERRNO_SYM
%token NAMES_SYM /* SQL-2003-N */
%token NAME_SYM /* SQL-2003-N */
%token NATIONAL_SYM /* SQL-2003-R */
%token NATURAL /* SQL-2003-R */
%token NCHAR_STRING
%token NCHAR_SYM /* SQL-2003-R */
%token NDBCLUSTER_SYM
%token NE /* OPERATOR */
%token NEG
%token NEVER_SYM
%token NEW_SYM /* SQL-2003-R */
%token NEXT_SYM /* SQL-2003-N */
%token NODEGROUP_SYM
%token NONE_SYM /* SQL-2003-R */
%token NOT2_SYM
%token NOT_SYM /* SQL-2003-R */
%token NOW_SYM
%token NO_SYM /* SQL-2003-R */
%token NO_WAIT_SYM
%token NO_WRITE_TO_BINLOG
%token NULL_SYM /* SQL-2003-R */
%token NUM
%token NUMBER_SYM /* SQL-2003-N */
%token NUMERIC_SYM /* SQL-2003-R */
%token NVARCHAR_SYM
%token OFFSET_SYM
%token ON /* SQL-2003-R */
%token ONE_SYM
%token ONLY_SYM /* SQL-2003-R */
%token OPEN_SYM /* SQL-2003-R */
%token OPTIMIZE
%token OPTIMIZER_COSTS_SYM
%token OPTIONS_SYM
%token OPTION /* SQL-2003-N */
%token OPTIONALLY
%token OR2_SYM
%token ORDER_SYM /* SQL-2003-R */
%token OR_OR_SYM /* OPERATOR */
%token OR_SYM /* SQL-2003-R */
%token OUTER
%token OUTFILE
%token OUT_SYM /* SQL-2003-R */
%token OWNER_SYM
%token PACK_KEYS_SYM
%token PAGE_SYM
%token PARAM_MARKER
%token PARSER_SYM
%token PARSE_GCOL_EXPR_SYM
%token PARTIAL /* SQL-2003-N */
%token PARTITION_SYM /* SQL-2003-R */
%token PARTITIONS_SYM
%token PARTITIONING_SYM
%token PASSWORD
%token PHASE_SYM
%token PLUGIN_DIR_SYM /* INTERNAL */
%token PLUGIN_SYM
%token PLUGINS_SYM
%token POINT_SYM
%token POLYGON
%token PORT_SYM
%token POSITION_SYM /* SQL-2003-N */
%token PRECEDES_SYM /* MYSQL */
%token PRECISION /* SQL-2003-R */
%token PREPARE_SYM /* SQL-2003-R */
%token PRESERVE_SYM
%token PREV_SYM
%token PRIMARY_SYM /* SQL-2003-R */
%token PRIVILEGES /* SQL-2003-N */
%token PROCEDURE_SYM /* SQL-2003-R */
%token PROCESS
%token PROCESSLIST_SYM
%token PROFILE_SYM
%token PROFILES_SYM
%token PROXY_SYM
%token PURGE
%token QUARTER_SYM
%token QUERY_SYM
%token QUICK
%token RANGE_SYM /* SQL-2003-R */
%token READS_SYM /* SQL-2003-R */
%token READ_ONLY_SYM
%token READ_SYM /* SQL-2003-N */
%token READ_WRITE_SYM
%token REAL /* SQL-2003-R */
%token REBUILD_SYM
%token RECOVER_SYM
%token REDOFILE_SYM
%token REDO_BUFFER_SIZE_SYM
%token REDUNDANT_SYM
%token REFERENCES /* SQL-2003-R */
%token REGEXP
%token RELAY
%token RELAYLOG_SYM
%token RELAY_LOG_FILE_SYM
%token RELAY_LOG_POS_SYM
%token RELAY_THREAD
%token RELEASE_SYM /* SQL-2003-R */
%token RELOAD
%token REMOVE_SYM
%token RENAME
%token REORGANIZE_SYM
%token REPAIR
%token REPEATABLE_SYM /* SQL-2003-N */
%token REPEAT_SYM /* MYSQL-FUNC */
%token REPLACE /* MYSQL-FUNC */
%token REPLICATION
%token REPLICATE_DO_DB
%token REPLICATE_IGNORE_DB
%token REPLICATE_DO_TABLE
%token REPLICATE_IGNORE_TABLE
%token REPLICATE_WILD_DO_TABLE
%token REPLICATE_WILD_IGNORE_TABLE
%token REPLICATE_REWRITE_DB
%token REQUIRE_SYM
%token RESET_SYM
%token RESIGNAL_SYM /* SQL-2003-R */
%token RESOURCES
%token RESTORE_SYM
%token RESTRICT
%token RESUME_SYM
%token RETURNED_SQLSTATE_SYM /* SQL-2003-N */
%token RETURNS_SYM /* SQL-2003-R */
%token RETURN_SYM /* SQL-2003-R */
%token REVERSE_SYM
%token REVOKE /* SQL-2003-R */
%token RIGHT /* SQL-2003-R */
%token ROLLBACK_SYM /* SQL-2003-R */
%token ROLLUP_SYM /* SQL-2003-R */
%token ROTATE_SYM
%token ROUTINE_SYM /* SQL-2003-N */
%token ROWS_SYM /* SQL-2003-R */
%token ROW_FORMAT_SYM
%token ROW_SYM /* SQL-2003-R */
%token ROW_COUNT_SYM /* SQL-2003-N */
%token RTREE_SYM
%token SAVEPOINT_SYM /* SQL-2003-R */
%token SCHEDULE_SYM
%token SCHEMA_NAME_SYM /* SQL-2003-N */
%token SECOND_MICROSECOND_SYM
%token SECOND_SYM /* SQL-2003-R */
%token SECURITY_SYM /* SQL-2003-N */
%token SELECT_SYM /* SQL-2003-R */
%token SENSITIVE_SYM /* FUTURE-USE */
%token SEPARATOR_SYM
%token SERIALIZABLE_SYM /* SQL-2003-N */
%token SERIAL_SYM
%token SESSION_SYM /* SQL-2003-N */
%token SERVER_SYM
%token SERVER_OPTIONS
%token SET /* SQL-2003-R */
%token SET_VAR
%token SHARE_SYM
%token SHIFT_LEFT /* OPERATOR */
%token SHIFT_RIGHT /* OPERATOR */
%token SHOW
%token SHUTDOWN
%token SIGNAL_SYM /* SQL-2003-R */
%token SIGNED_SYM
%token SIMPLE_SYM /* SQL-2003-N */
%token SLAVE
%token SLOW
%token SMALLINT /* SQL-2003-R */
%token SNAPSHOT_SYM
%token SOCKET_SYM
%token SONAME_SYM
%token SOUNDS_SYM
%token SOURCE_SYM
%token SPATIAL_SYM
%token SPECIFIC_SYM /* SQL-2003-R */
%token SQLEXCEPTION_SYM /* SQL-2003-R */
%token SQLSTATE_SYM /* SQL-2003-R */