forked from pingcap/parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.y
12078 lines (11496 loc) · 272 KB
/
parser.y
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 2013 The ql Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSES/QL-LICENSE file.
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
// Initial yacc source generated by ebnf2y[1]
// at 2013-10-04 23:10:47.861401015 +0200 CEST
//
// $ ebnf2y -o ql.y -oe ql.ebnf -start StatementList -pkg ql -p _
//
// [1]: http://github.com/cznic/ebnf2y
package parser
import (
"strings"
"github.com/pingcap/parser/mysql"
"github.com/pingcap/parser/ast"
"github.com/pingcap/parser/model"
"github.com/pingcap/parser/opcode"
"github.com/pingcap/parser/auth"
"github.com/pingcap/parser/charset"
"github.com/pingcap/parser/types"
)
%}
%union {
offset int // offset
item interface{}
ident string
expr ast.ExprNode
statement ast.StmtNode
}
%token <ident>
/*yy:token "%c" */
identifier "identifier"
/*yy:token "_%c" */
underscoreCS "UNDERSCORE_CHARSET"
/*yy:token "\"%c\"" */
stringLit "string literal"
singleAtIdentifier "identifier with single leading at"
doubleAtIdentifier "identifier with double leading at"
invalid "a special token never used by parser, used by lexer to indicate error"
hintComment "an optimizer hint"
andand "&&"
pipes "||"
/* The following tokens belong to ODBCDateTimeType. */
odbcDateType "d"
odbcTimeType "t"
odbcTimestampType "ts"
/* The following tokens belong to ReservedKeyword. Notice: make sure these tokens are contained in ReservedKeyword. */
add "ADD"
all "ALL"
alter "ALTER"
analyze "ANALYZE"
and "AND"
as "AS"
asc "ASC"
between "BETWEEN"
bigIntType "BIGINT"
binaryType "BINARY"
blobType "BLOB"
both "BOTH"
by "BY"
cascade "CASCADE"
caseKwd "CASE"
change "CHANGE"
character "CHARACTER"
charType "CHAR"
check "CHECK"
collate "COLLATE"
column "COLUMN"
constraint "CONSTRAINT"
convert "CONVERT"
create "CREATE"
cross "CROSS"
cumeDist "CUME_DIST"
currentDate "CURRENT_DATE"
currentTime "CURRENT_TIME"
currentTs "CURRENT_TIMESTAMP"
currentUser "CURRENT_USER"
currentRole "CURRENT_ROLE"
database "DATABASE"
databases "DATABASES"
dayHour "DAY_HOUR"
dayMicrosecond "DAY_MICROSECOND"
dayMinute "DAY_MINUTE"
daySecond "DAY_SECOND"
decimalType "DECIMAL"
defaultKwd "DEFAULT"
delayed "DELAYED"
deleteKwd "DELETE"
denseRank "DENSE_RANK"
desc "DESC"
describe "DESCRIBE"
distinct "DISTINCT"
distinctRow "DISTINCTROW"
div "DIV"
doubleType "DOUBLE"
drop "DROP"
dual "DUAL"
elseKwd "ELSE"
enclosed "ENCLOSED"
escaped "ESCAPED"
exists "EXISTS"
explain "EXPLAIN"
except "EXCEPT"
falseKwd "FALSE"
fetch "FETCH"
firstValue "FIRST_VALUE"
floatType "FLOAT"
forKwd "FOR"
force "FORCE"
foreign "FOREIGN"
from "FROM"
fulltext "FULLTEXT"
generated "GENERATED"
grant "GRANT"
group "GROUP"
groups "GROUPS"
having "HAVING"
highPriority "HIGH_PRIORITY"
hourMicrosecond "HOUR_MICROSECOND"
hourMinute "HOUR_MINUTE"
hourSecond "HOUR_SECOND"
ifKwd "IF"
ignore "IGNORE"
in "IN"
index "INDEX"
infile "INFILE"
inner "INNER"
integerType "INTEGER"
intersect "INTERSECT"
interval "INTERVAL"
into "INTO"
outfile "OUTFILE"
is "IS"
insert "INSERT"
intType "INT"
int1Type "INT1"
int2Type "INT2"
int3Type "INT3"
int4Type "INT4"
int8Type "INT8"
join "JOIN"
key "KEY"
keys "KEYS"
kill "KILL"
lag "LAG"
lastValue "LAST_VALUE"
lead "LEAD"
leading "LEADING"
left "LEFT"
like "LIKE"
limit "LIMIT"
lines "LINES"
linear "LINEAR"
load "LOAD"
localTime "LOCALTIME"
localTs "LOCALTIMESTAMP"
lock "LOCK"
longblobType "LONGBLOB"
longtextType "LONGTEXT"
lowPriority "LOW_PRIORITY"
match "MATCH"
maxValue "MAXVALUE"
mediumblobType "MEDIUMBLOB"
mediumIntType "MEDIUMINT"
mediumtextType "MEDIUMTEXT"
minuteMicrosecond "MINUTE_MICROSECOND"
minuteSecond "MINUTE_SECOND"
mod "MOD"
not "NOT"
noWriteToBinLog "NO_WRITE_TO_BINLOG"
nthValue "NTH_VALUE"
ntile "NTILE"
null "NULL"
numericType "NUMERIC"
on "ON"
optimize "OPTIMIZE"
option "OPTION"
optionally "OPTIONALLY"
or "OR"
order "ORDER"
outer "OUTER"
over "OVER"
partition "PARTITION"
percentRank "PERCENT_RANK"
placement "PLACEMENT"
precisionType "PRECISION"
primary "PRIMARY"
procedure "PROCEDURE"
rangeKwd "RANGE"
rank "RANK"
read "READ"
realType "REAL"
references "REFERENCES"
regexpKwd "REGEXP"
release "RELEASE"
rename "RENAME"
repeat "REPEAT"
replace "REPLACE"
require "REQUIRE"
restrict "RESTRICT"
revoke "REVOKE"
right "RIGHT"
rlike "RLIKE"
row "ROW"
rows "ROWS"
rowNumber "ROW_NUMBER"
secondMicrosecond "SECOND_MICROSECOND"
selectKwd "SELECT"
set "SET"
show "SHOW"
smallIntType "SMALLINT"
spatial "SPATIAL"
sql "SQL"
sqlBigResult "SQL_BIG_RESULT"
sqlCalcFoundRows "SQL_CALC_FOUND_ROWS"
sqlSmallResult "SQL_SMALL_RESULT"
ssl "SSL"
starting "STARTING"
straightJoin "STRAIGHT_JOIN"
tableKwd "TABLE"
stored "STORED"
terminated "TERMINATED"
then "THEN"
tinyblobType "TINYBLOB"
tinyIntType "TINYINT"
tinytextType "TINYTEXT"
to "TO"
trailing "TRAILING"
trigger "TRIGGER"
trueKwd "TRUE"
unique "UNIQUE"
union "UNION"
unlock "UNLOCK"
unsigned "UNSIGNED"
update "UPDATE"
usage "USAGE"
use "USE"
using "USING"
utcDate "UTC_DATE"
utcTimestamp "UTC_TIMESTAMP"
utcTime "UTC_TIME"
values "VALUES"
long "LONG"
varcharType "VARCHAR"
varcharacter "VARCHARACTER"
varbinaryType "VARBINARY"
varying "VARYING"
virtual "VIRTUAL"
when "WHEN"
where "WHERE"
write "WRITE"
window "WINDOW"
with "WITH"
xor "XOR"
yearMonth "YEAR_MONTH"
zerofill "ZEROFILL"
natural "NATURAL"
/* The following tokens belong to UnReservedKeyword. Notice: make sure these tokens are contained in UnReservedKeyword. */
account "ACCOUNT"
action "ACTION"
advise "ADVISE"
after "AFTER"
against "AGAINST"
ago "AGO"
algorithm "ALGORITHM"
always "ALWAYS"
any "ANY"
ascii "ASCII"
autoIdCache "AUTO_ID_CACHE"
autoIncrement "AUTO_INCREMENT"
autoRandom "AUTO_RANDOM"
autoRandomBase "AUTO_RANDOM_BASE"
avg "AVG"
avgRowLength "AVG_ROW_LENGTH"
backend "BACKEND"
backup "BACKUP"
backups "BACKUPS"
begin "BEGIN"
binding "BINDING"
bindings "BINDINGS"
binlog "BINLOG"
bitType "BIT"
block "BLOCK"
booleanType "BOOLEAN"
boolType "BOOL"
btree "BTREE"
byteType "BYTE"
cache "CACHE"
capture "CAPTURE"
cascaded "CASCADED"
chain "CHAIN"
charsetKwd "CHARSET"
checkpoint "CHECKPOINT"
checksum "CHECKSUM"
cipher "CIPHER"
cleanup "CLEANUP"
client "CLIENT"
coalesce "COALESCE"
collation "COLLATION"
columnFormat "COLUMN_FORMAT"
columns "COLUMNS"
config "CONFIG"
comment "COMMENT"
commit "COMMIT"
committed "COMMITTED"
compact "COMPACT"
compressed "COMPRESSED"
compression "COMPRESSION"
concurrency "CONCURRENCY"
connection "CONNECTION"
consistent "CONSISTENT"
constraints "CONSTRAINTS"
context "CONTEXT"
cpu "CPU"
csvBackslashEscape "CSV_BACKSLASH_ESCAPE"
csvDelimiter "CSV_DELIMITER"
csvHeader "CSV_HEADER"
csvNotNull "CSV_NOT_NULL"
csvNull "CSV_NULL"
csvSeparator "CSV_SEPARATOR"
csvTrimLastSeparators "CSV_TRIM_LAST_SEPARATORS"
current "CURRENT"
cycle "CYCLE"
data "DATA"
datetimeType "DATETIME"
dateType "DATE"
day "DAY"
deallocate "DEALLOCATE"
definer "DEFINER"
delayKeyWrite "DELAY_KEY_WRITE"
directory "DIRECTORY"
disable "DISABLE"
discard "DISCARD"
disk "DISK"
do "DO"
duplicate "DUPLICATE"
dynamic "DYNAMIC"
enable "ENABLE"
encryption "ENCRYPTION"
end "END"
enforced "ENFORCED"
engine "ENGINE"
engines "ENGINES"
enum "ENUM"
errorKwd "ERROR"
escape "ESCAPE"
event "EVENT"
events "EVENTS"
evolve "EVOLVE"
exchange "EXCHANGE"
exclusive "EXCLUSIVE"
execute "EXECUTE"
expansion "EXPANSION"
expire "EXPIRE"
extended "EXTENDED"
faultsSym "FAULTS"
fields "FIELDS"
file "FILE"
first "FIRST"
fixed "FIXED"
flush "FLUSH"
following "FOLLOWING"
format "FORMAT"
full "FULL"
function "FUNCTION"
general "GENERAL"
global "GLOBAL"
grants "GRANTS"
hash "HASH"
histogram "HISTOGRAM"
history "HISTORY"
hosts "HOSTS"
hour "HOUR"
identified "IDENTIFIED"
identSQLErrors "ERRORS"
importKwd "IMPORT"
imports "IMPORTS"
increment "INCREMENT"
incremental "INCREMENTAL"
indexes "INDEXES"
insertMethod "INSERT_METHOD"
instance "INSTANCE"
invisible "INVISIBLE"
invoker "INVOKER"
io "IO"
ipc "IPC"
isolation "ISOLATION"
issuer "ISSUER"
jsonType "JSON"
keyBlockSize "KEY_BLOCK_SIZE"
labels "LABELS"
language "LANGUAGE"
last "LAST"
lastBackup "LAST_BACKUP"
lastval "LASTVAL"
less "LESS"
level "LEVEL"
list "LIST"
local "LOCAL"
location "LOCATION"
logs "LOGS"
master "MASTER"
max_idxnum "MAX_IDXNUM"
max_minutes "MAX_MINUTES"
maxConnectionsPerHour "MAX_CONNECTIONS_PER_HOUR"
maxQueriesPerHour "MAX_QUERIES_PER_HOUR"
maxRows "MAX_ROWS"
maxUpdatesPerHour "MAX_UPDATES_PER_HOUR"
maxUserConnections "MAX_USER_CONNECTIONS"
mb "MB"
memory "MEMORY"
merge "MERGE"
microsecond "MICROSECOND"
minRows "MIN_ROWS"
minute "MINUTE"
minValue "MINVALUE"
mode "MODE"
modify "MODIFY"
month "MONTH"
names "NAMES"
national "NATIONAL"
ncharType "NCHAR"
never "NEVER"
next "NEXT"
nextval "NEXTVAL"
no "NO"
nocache "NOCACHE"
nocycle "NOCYCLE"
nodegroup "NODEGROUP"
nomaxvalue "NOMAXVALUE"
nominvalue "NOMINVALUE"
none "NONE"
nowait "NOWAIT"
nvarcharType "NVARCHAR"
nulls "NULLS"
offset "OFFSET"
onDuplicate "ON_DUPLICATE"
online "ONLINE"
only "ONLY"
open "OPEN"
packKeys "PACK_KEYS"
pageSym "PAGE"
parser "PARSER"
partial "PARTIAL"
partitioning "PARTITIONING"
partitions "PARTITIONS"
password "PASSWORD"
per_db "PER_DB"
per_table "PER_TABLE"
pipesAsOr
plugins "PLUGINS"
policy "POLICY"
preSplitRegions "PRE_SPLIT_REGIONS"
preceding "PRECEDING"
prepare "PREPARE"
privileges "PRIVILEGES"
process "PROCESS"
processlist "PROCESSLIST"
profile "PROFILE"
profiles "PROFILES"
quarter "QUARTER"
queries "QUERIES"
query "QUERY"
quick "QUICK"
rateLimit "RATE_LIMIT"
rebuild "REBUILD"
recover "RECOVER"
redundant "REDUNDANT"
reload "RELOAD"
remove "REMOVE"
reorganize "REORGANIZE"
repair "REPAIR"
repeatable "REPEATABLE"
replica "REPLICA"
replicas "REPLICAS"
replication "REPLICATION"
respect "RESPECT"
restore "RESTORE"
restores "RESTORES"
reverse "REVERSE"
role "ROLE"
rollback "ROLLBACK"
routine "ROUTINE"
rowCount "ROW_COUNT"
rowFormat "ROW_FORMAT"
rtree "RTREE"
san "SAN"
second "SECOND"
secondaryEngine "SECONDARY_ENGINE"
secondaryLoad "SECONDARY_LOAD"
secondaryUnload "SECONDARY_UNLOAD"
security "SECURITY"
sendCredentialsToTiKV "SEND_CREDENTIALS_TO_TIKV"
separator "SEPARATOR"
sequence "SEQUENCE"
serial "SERIAL"
serializable "SERIALIZABLE"
session "SESSION"
setval "SETVAL"
shardRowIDBits "SHARD_ROW_ID_BITS"
share "SHARE"
shared "SHARED"
shutdown "SHUTDOWN"
signed "SIGNED"
simple "SIMPLE"
skipSchemaFiles "SKIP_SCHEMA_FILES"
slave "SLAVE"
slow "SLOW"
snapshot "SNAPSHOT"
some "SOME"
source "SOURCE"
sqlBufferResult "SQL_BUFFER_RESULT"
sqlCache "SQL_CACHE"
sqlNoCache "SQL_NO_CACHE"
sqlTsiDay "SQL_TSI_DAY"
sqlTsiHour "SQL_TSI_HOUR"
sqlTsiMinute "SQL_TSI_MINUTE"
sqlTsiMonth "SQL_TSI_MONTH"
sqlTsiQuarter "SQL_TSI_QUARTER"
sqlTsiSecond "SQL_TSI_SECOND"
sqlTsiWeek "SQL_TSI_WEEK"
sqlTsiYear "SQL_TSI_YEAR"
start "START"
statsAutoRecalc "STATS_AUTO_RECALC"
statsPersistent "STATS_PERSISTENT"
statsSamplePages "STATS_SAMPLE_PAGES"
status "STATUS"
storage "STORAGE"
strictFormat "STRICT_FORMAT"
subject "SUBJECT"
subpartition "SUBPARTITION"
subpartitions "SUBPARTITIONS"
super "SUPER"
swaps "SWAPS"
switchesSym "SWITCHES"
systemTime "SYSTEM_TIME"
tableChecksum "TABLE_CHECKSUM"
tables "TABLES"
tablespace "TABLESPACE"
temporary "TEMPORARY"
temptable "TEMPTABLE"
textType "TEXT"
than "THAN"
tikvImporter "TIKV_IMPORTER"
timestampType "TIMESTAMP"
timeType "TIME"
tp "TYPE"
trace "TRACE"
traditional "TRADITIONAL"
transaction "TRANSACTION"
triggers "TRIGGERS"
truncate "TRUNCATE"
unbounded "UNBOUNDED"
uncommitted "UNCOMMITTED"
undefined "UNDEFINED"
unicodeSym "UNICODE"
unknown "UNKNOWN"
user "USER"
validation "VALIDATION"
value "VALUE"
variables "VARIABLES"
view "VIEW"
visible "VISIBLE"
warnings "WARNINGS"
week "WEEK"
weightString "WEIGHT_STRING"
without "WITHOUT"
x509 "X509"
yearType "YEAR"
wait "WAIT"
/* The following tokens belong to NotKeywordToken. Notice: make sure these tokens are contained in NotKeywordToken. */
addDate "ADDDATE"
approxCountDistinct "APPROX_COUNT_DISTINCT"
approxPercentile "APPROX_PERCENTILE"
bitAnd "BIT_AND"
bitOr "BIT_OR"
bitXor "BIT_XOR"
bound "BOUND"
cast "CAST"
copyKwd "COPY"
curTime "CURTIME"
dateAdd "DATE_ADD"
dateSub "DATE_SUB"
exact "EXACT"
extract "EXTRACT"
flashback "FLASHBACK"
getFormat "GET_FORMAT"
groupConcat "GROUP_CONCAT"
next_row_id "NEXT_ROW_ID"
inplace "INPLACE"
instant "INSTANT"
internal "INTERNAL"
min "MIN"
max "MAX"
now "NOW"
position "POSITION"
recent "RECENT"
staleness "STALENESS"
std "STD"
stddev "STDDEV"
stddevPop "STDDEV_POP"
stddevSamp "STDDEV_SAMP"
strong "STRONG"
subDate "SUBDATE"
sum "SUM"
substring "SUBSTRING"
timestampAdd "TIMESTAMPADD"
timestampDiff "TIMESTAMPDIFF"
tokudbDefault "TOKUDB_DEFAULT"
tokudbFast "TOKUDB_FAST"
tokudbLzma "TOKUDB_LZMA"
tokudbQuickLZ "TOKUDB_QUICKLZ"
tokudbSnappy "TOKUDB_SNAPPY"
tokudbSmall "TOKUDB_SMALL"
tokudbUncompressed "TOKUDB_UNCOMPRESSED"
tokudbZlib "TOKUDB_ZLIB"
top "TOP"
trim "TRIM"
variance "VARIANCE"
varPop "VAR_POP"
varSamp "VAR_SAMP"
exprPushdownBlacklist "EXPR_PUSHDOWN_BLACKLIST"
optRuleBlacklist "OPT_RULE_BLACKLIST"
jsonArrayagg "JSON_ARRAYAGG"
jsonObjectAgg "JSON_OBJECTAGG"
tls "TLS"
follower "FOLLOWER"
leader "LEADER"
learner "LEARNER"
voter "VOTER"
/* The following tokens belong to TiDBKeyword. Notice: make sure these tokens are contained in TiDBKeyword. */
admin "ADMIN"
buckets "BUCKETS"
builtins "BUILTINS"
cancel "CANCEL"
cardinality "CARDINALITY"
cmSketch "CMSKETCH"
correlation "CORRELATION"
ddl "DDL"
dependency "DEPENDENCY"
depth "DEPTH"
drainer "DRAINER"
jobs "JOBS"
job "JOB"
nodeID "NODE_ID"
nodeState "NODE_STATE"
optimistic "OPTIMISTIC"
pessimistic "PESSIMISTIC"
pump "PUMP"
samples "SAMPLES"
statistics "STATISTICS"
stats "STATS"
statsMeta "STATS_META"
statsHistograms "STATS_HISTOGRAMS"
statsBuckets "STATS_BUCKETS"
statsHealthy "STATS_HEALTHY"
telemetry "TELEMETRY"
telemetryID "TELEMETRY_ID"
tidb "TIDB"
tiFlash "TIFLASH"
topn "TOPN"
split "SPLIT"
width "WIDTH"
reset "RESET"
regions "REGIONS"
region "REGION"
builtinAddDate
builtinBitAnd
builtinBitOr
builtinBitXor
builtinCast
builtinCount
builtinApproxCountDistinct
builtinApproxPercentile
builtinCurDate
builtinCurTime
builtinDateAdd
builtinDateSub
builtinExtract
builtinGroupConcat
builtinMax
builtinMin
builtinNow
builtinPosition
builtinSubDate
builtinSubstring
builtinSum
builtinSysDate
builtinStddevPop
builtinStddevSamp
builtinTrim
builtinUser
builtinVarPop
builtinVarSamp
%token <item>
/*yy:token "1.%d" */
floatLit "floating-point literal"
/*yy:token "1.%d" */
decLit "decimal literal"
/*yy:token "%d" */
intLit "integer literal"
/*yy:token "%x" */
hexLit "hexadecimal literal"
/*yy:token "%b" */
bitLit "bit literal"
andnot "&^"
assignmentEq ":="
eq "="
ge ">="
le "<="
jss "->"
juss "->>"
lsh "<<"
neq "!="
neqSynonym "<>"
nulleq "<=>"
paramMarker "?"
rsh ">>"
%token not2
%type <expr>
Expression "expression"
MaxValueOrExpression "maxvalue or expression"
BoolPri "boolean primary expression"
ExprOrDefault "expression or default"
PredicateExpr "Predicate expression factor"
SetExpr "Set variable statement value's expression"
BitExpr "bit expression"
SimpleExpr "simple expression"
SimpleIdent "Simple Identifier expression"
SumExpr "aggregate functions"
FunctionCallGeneric "Function call with Identifier"
FunctionCallKeyword "Function call with keyword as function name"
FunctionCallNonKeyword "Function call with nonkeyword as function name"
Literal "literal value"
Variable "User or system variable"
SystemVariable "System defined variable name"
UserVariable "User defined variable name"
SubSelect "Sub Select"
SubSelect2 "Sub Select2"
StringLiteral "text literal"
ExpressionOpt "Optional expression"
SignedLiteral "Literal or NumLiteral with sign"
DefaultValueExpr "DefaultValueExpr(Now or Signed Literal)"
NowSymOptionFraction "NowSym with optional fraction part"
CharsetNameOrDefault "Character set name or default"
NextValueForSequence "Default nextval expression"
FunctionNameSequence "Function with sequence function call"
WindowFuncCall "WINDOW function call"
%type <statement>
AdminStmt "Check table statement or show ddl statement"
AlterDatabaseStmt "Alter database statement"
AlterTableStmt "Alter table statement"
AlterUserStmt "Alter user statement"
AlterInstanceStmt "Alter instance statement"
AnalyzeTableStmt "Analyze table statement"
BeginTransactionStmt "BEGIN TRANSACTION statement"
BinlogStmt "Binlog base64 statement"
BRIEStmt "BACKUP or RESTORE statement"
CommitStmt "COMMIT statement"
CreateTableStmt "CREATE TABLE statement"
CreateViewStmt "CREATE VIEW statement"
CreateUserStmt "CREATE User statement"
CreateRoleStmt "CREATE Role statement"
CreateDatabaseStmt "Create Database Statement"
CreateIndexStmt "CREATE INDEX statement"
CreateBindingStmt "CREATE BINDING statement"
CreateSequenceStmt "CREATE SEQUENCE statement"
CreateStatisticsStmt "CREATE STATISTICS statement"
DoStmt "Do statement"
DropDatabaseStmt "DROP DATABASE statement"
DropIndexStmt "DROP INDEX statement"
DropStatisticsStmt "DROP STATISTICS statement"
DropStatsStmt "DROP STATS statement"
DropTableStmt "DROP TABLE statement"
DropSequenceStmt "DROP SEQUENCE statement"
DropUserStmt "DROP USER"
DropRoleStmt "DROP ROLE"
DropViewStmt "DROP VIEW statement"
DropBindingStmt "DROP BINDING statement"
DeallocateStmt "Deallocate prepared statement"
DeleteFromStmt "DELETE FROM statement"
EmptyStmt "empty statement"
ExecuteStmt "Execute statement"
ExplainStmt "EXPLAIN statement"
ExplainableStmt "explainable statement"
FlushStmt "Flush statement"
FlashbackTableStmt "Flashback table statement"
GrantStmt "Grant statement"
GrantRoleStmt "Grant role statement"
InsertIntoStmt "INSERT INTO statement"
IndexAdviseStmt "INDEX ADVISE statement"
KillStmt "Kill statement"
LoadDataStmt "Load data statement"
LoadStatsStmt "Load statistic statement"
LockTablesStmt "Lock tables statement"
PreparedStmt "PreparedStmt"
SelectStmt "SELECT statement"
RenameTableStmt "rename table statement"
ReplaceIntoStmt "REPLACE INTO statement"
RecoverTableStmt "recover table statement"
RevokeStmt "Revoke statement"
RevokeRoleStmt "Revoke role statement"
RollbackStmt "ROLLBACK statement"
SplitRegionStmt "Split index region statement"
SetStmt "Set variable statement"
ChangeStmt "Change statement"
SetRoleStmt "Set active role statement"
SetDefaultRoleStmt "Set default statement for some user"
ShowStmt "Show engines/databases/tables/user/columns/warnings/status statement"
Statement "statement"
TraceStmt "TRACE statement"
TraceableStmt "traceable statement"
TruncateTableStmt "TRUNCATE TABLE statement"
UnlockTablesStmt "Unlock tables statement"
UpdateStmt "UPDATE statement"
SetOprStmt "Union/Except/Intersect select statement"
SetOprStmt1 "Union/Except/Intersect select statement1"
SetOprStmt2 "Union/Except/Intersect select statement2"
UseStmt "USE statement"
ShutdownStmt "SHUTDOWN statement"
CreateViewSelectOpt "Select/Union/Except/Intersect statement in CREATE VIEW ... AS SELECT"
%type <item>
AdminShowSlow "Admin Show Slow statement"
AllOrPartitionNameList "All or partition name list"
AlgorithmClause "Alter table algorithm"
AlterTablePartitionOpt "Alter table partition option"
AlterTableSpec "Alter table specification"
AlterTableSpecList "Alter table specification list"
AlterTableSpecListOpt "Alter table specification list optional"
AnalyzeOption "Analyze option"
AnalyzeOptionList "Analyze option list"
AnalyzeOptionListOpt "Optional analyze option list"
AnyOrAll "Any or All for subquery"
Assignment "assignment"
AssignmentList "assignment list"
AssignmentListOpt "assignment list opt"
AuthOption "User auth option"
Boolean "Boolean (0, 1, false, true)"
OptionalBraces "optional braces"
CastType "Cast function target type"
ClearPasswordExpireOptions "Clear password expire options"
ColumnDef "table column definition"
ColumnDefList "table column definition list"
ColumnName "column name"
ColumnNameOrUserVariable "column name or user variable"
ColumnNameList "column name list"
ColumnNameOrUserVariableList "column name or user variable list"
ColumnList "column list"
ColumnNameListOpt "column name list opt"
ColumnNameOrUserVarListOpt "column name or user vairiabe list opt"
ColumnNameOrUserVarListOptWithBrackets "column name or user variable list opt with brackets"
ColumnSetValue "insert statement set value by column name"
ColumnSetValueList "insert statement set value by column name list"
CompareOp "Compare opcode"
ColumnOption "column definition option"
ColumnOptionList "column definition option list"
VirtualOrStored "indicate generated column is stored or not"
ColumnOptionListOpt "optional column definition option list"
CompletionTypeWithinTransaction "overwrite system variable completion_type within current transaction"
ConnectionOption "single connection options"
ConnectionOptionList "connection options for CREATE USER statement"
ConnectionOptions "optional connection options for CREATE USER statement"
Constraint "table constraint"
ConstraintElem "table constraint element"
ConstraintKeywordOpt "Constraint Keyword or empty"
CreateSequenceOptionListOpt "create sequence list opt"
CreateTableOptionListOpt "create table option list opt"
CreateTableSelectOpt "Select/Union statement in CREATE TABLE ... SELECT"
DatabaseOption "CREATE Database specification"
DatabaseOptionList "CREATE Database specification list"
DatabaseOptionListOpt "CREATE Database specification list opt"
DistinctOpt "Explicit distinct option"
DefaultFalseDistinctOpt "Distinct option which defaults to false"
DefaultTrueDistinctOpt "Distinct option which defaults to true"
BuggyDefaultFalseDistinctOpt "Distinct option which accepts DISTINCT ALL and defaults to false"
RequireClause "Encrypted connections options"
RequireClauseOpt "optional Encrypted connections options"
EqOpt "= or empty"
EscapedTableRef "escaped table reference"
ExpressionList "expression list"
MaxValueOrExpressionList "maxvalue or expression list"
ExpressionListOpt "expression list opt"
FetchFirstOpt "Fetch First/Next Option"
FuncDatetimePrecListOpt "Function datetime precision list opt"
FuncDatetimePrecList "Function datetime precision list"
Field "field expression"
Fields "Fields clause"
FieldList "field expression list"
FlushOption "Flush option"
InstanceOption "Instance option"
FulltextSearchModifierOpt "Fulltext modifier"
PluginNameList "Plugin Name List"
TableRefsClause "Table references clause"
FieldItem "Field item for load data clause"
FieldItemList "Field items for load data clause"
FuncDatetimePrec "Function datetime precision"
GetFormatSelector "{DATE|DATETIME|TIME|TIMESTAMP}"
GlobalScope "The scope of variable"
GroupByClause "GROUP BY clause"
HavingClause "HAVING clause"
HandleRange "handle range"
HandleRangeList "handle range list"
IfExists "If Exists"
IfNotExists "If Not Exists"
IgnoreOptional "IGNORE or empty"
IndexHint "index hint"
IndexHintList "index hint list"
IndexHintListOpt "index hint list opt"
IndexHintScope "index hint scope"
IndexHintType "index hint type"
IndexInvisible "index visible/invisible"
IndexKeyTypeOpt "index key type"
IndexLockAndAlgorithmOpt "index lock and algorithm"
IndexNameAndTypeOpt "index name and index type"
IndexNameList "index name list"
IndexOption "Index Option"
IndexOptionList "Index Option List or empty"
IndexType "index type"
IndexTypeName "index type name"
IndexTypeOpt "optional index type"
IndexPartSpecification "Index column name or expression"
IndexPartSpecificationList "List of index column name or expression"
IndexPartSpecificationListOpt "Optional list of index column name or expression"
InsertValues "Rest part of INSERT/REPLACE INTO statement"
JoinTable "join table"
JoinType "join type"
KillOrKillTiDB "Kill or Kill TiDB"
LocationLabelList "location label name list"
LikeTableWithOrWithoutParen "LIKE table_name or ( LIKE table_name )"
LimitClause "LIMIT clause"
LimitOption "Limit option could be integer or parameter marker."
Lines "Lines clause"
LoadDataSetSpecOpt "Optional load data specification"
LoadDataSetList "Load data specifications"
LoadDataSetItem "Single load data specification"
LocalOpt "Local opt"
LockClause "Alter table lock clause"
LogTypeOpt "Optional log type used in FLUSH statements"
NumLiteral "Num/Int/Float/Decimal Literal"
NoWriteToBinLogAliasOpt "NO_WRITE_TO_BINLOG alias LOCAL or empty"
ObjectType "Grant statement object type"
OnDuplicateKeyUpdate "ON DUPLICATE KEY UPDATE value list"
DuplicateOpt "[IGNORE|REPLACE] in CREATE TABLE ... SELECT statement or LOAD DATA statement"
OptFull "Full or empty"
OptTemporary "TEMPORARY or empty"
Order "ORDER BY clause optional collation specification"
OrderBy "ORDER BY clause"
OrReplace "or replace"
ByItem "BY item"
OrderByOptional "Optional ORDER BY clause optional"
ByList "BY list"
AlterOrderItem "Alter Order item"
AlterOrderList "Alter Order list"
QuickOptional "QUICK or empty"
PartitionDefinition "Partition definition"
PartitionDefinitionList "Partition definition list"
PartitionDefinitionListOpt "Partition definition list option"
PartitionKeyAlgorithmOpt "ALGORITHM = n option for KEY partition"
PartitionMethod "Partition method"
PartitionOpt "Partition option"
PartitionNameList "Partition name list"
PartitionNameListOpt "table partition names list optional"
PartitionNumOpt "PARTITION NUM option"