Commit Graph

218 Commits

Author SHA1 Message Date
6c03d809f2 [parser] Update BACKUP/RESTORE syntax to match the RFC; Added IMPORT statement (#824)
* *: remove the s3/gcs-specific options

* *: replace the INCREMENTAL UNTIL syntax with LAST_BACKUP = ...

* *: use SHOW BACKUPS rather than SHOW BACKUP

* *: added IMPORT statements and options
2021-10-09 14:53:23 +08:00
96e2a03403 [parser] parser: rename auto rand table option (#828) 2021-10-09 14:53:23 +08:00
22fc63f328 [parser] parser: add autoid cache option (#765) 2021-10-09 14:53:23 +08:00
511776d406 [parser] parser: remove sequence order option support (#796) 2021-10-09 14:53:23 +08:00
6cd14a0c30 [parser] lexer: replace version comments with feature-ids mechanism (#777)
* lexer: replace version comments with feature-ids mechanism

* tests: retain the original version digit test

* fix scanVersionDigits

* add SpecialCommentsController to decide what comments can be parsed

* only ignore comments with unsupported feature-id

* remove debug log
2021-10-09 14:53:23 +08:00
3b3575a14e [parser] Change hint "enable_plan_cache(bool)" to "ignore_plan_cache()" (#785) 2021-10-09 14:53:23 +08:00
ea8d816ea7 [parser] rename sm_join to merge_join, letter case correction (#775)
Co-authored-by: kennytm <kennytm@gmail.com>
2021-10-09 14:53:23 +08:00
af3a3c6266 [parser] parser: support set config ... and show config ... syntaxes (#770)
* support 'set config ...' and 'show config ...' syntaxes

* address comments

* address comment

* address comment
2021-10-09 14:53:23 +08:00
58f9e70de7 [parser] *: support parsing BACKUP and RESTORE statements (#746)
* *: support parsing BACKUP and RESTORE statements

* parser: add SNAPSHOT = 'str' option to BACKUP statement
2021-10-09 14:53:23 +08:00
1471d3cc89 [parser] parser: add USE_CASCADES hint syntax (#769)
Signed-off-by: gauss <gauss1314@gmail.com>
2021-10-09 14:53:23 +08:00
e437ae67a8 [parser] parser, ast: accept syntax about chain, release when commit or rollback (#751)
* add CompletionType in CommitStmt and RollbackStmt

* refine CompletionType in ast

* fix typo in parser.y

* add parser test for ROLLBACK

Co-authored-by: kennytm <kennytm@gmail.com>
2021-10-09 14:53:23 +08:00
fcace6539d [parser] misc: correct TiDB-style executable comment version for auto_random (#748)
Co-authored-by: kennytm <kennytm@gmail.com>
2021-10-09 14:53:23 +08:00
cfc2e0273f [parser] refine table optimizer hint and make it more generic (#747)
* refine table optimizer hint and make it more generic

Signed-off-by: Lonng <heng@lonng.org>

* implement the restore

Signed-off-by: Lonng <heng@lonng.org>

* address comment

Signed-off-by: Lonng <heng@lonng.org>

* address comment

Signed-off-by: Lonng <heng@lonng.org>

* fix typo

Signed-off-by: Lonng <heng@lonng.org>
2021-10-09 14:53:23 +08:00
1539b1f3fe [parser] parser: support the SELECT ... INTO OUTFILE syntax (#745)
* SELECT OUTFILE

* fix CI

* update

* add more tests
2021-10-09 14:53:23 +08:00
9fe4e83705 [parser] parser: add WEIGHT_STRING() function (#743) 2021-10-09 14:53:23 +08:00
b1500ed8d3 [parser] support alter instance reload tls (#740) 2021-10-09 14:53:23 +08:00
313a0d13e4 [parser] parser: support sequence function & next value for (#713) 2021-10-09 14:53:23 +08:00
048bd7d569 [parser] add definition of json_objectagg (#378) 2021-10-09 14:53:23 +08:00
f41adcde4c [parser] parser: add Reload and File privileges (#708) 2021-10-09 14:53:23 +08:00
5cfb690491 [parser] Rewrite special comment parser (#711)
* lexer: added a function to scan version digits

* lexer: removed special comment scanner

Instead, simply strip off '/*!' and the pairing '*/'.

Temporarily disabled handling of /*+ ... */

* lexer: support collecting the entire /*+ ... */ as a single token

This new token has type `hintComment`. The actual hint will be parsed
lazily.

* lexer,yy_parser: move lastErrorAsWarn() from Parser into Scanner

* goyacc: do not allow conflict, support changing parser type name

change the "DO NOT EDIT" line to fit the Go standard

* parser,hintparser: created a new parser just for parsing optimizer hints

deleted all optimizer hint rules from parser.go

refactor the Makefile to support building both parsers (also deleted some
outdated fixup of *parser.go)

* lexer: fix comment parser

* codecov: don't wait for integration test before showing the coverage

* lexer: fix comment parsing again

* hintparser: TiDB still expects `HASH_JOIN(@qb1 foo@qb2)` to be valid :(

* parser,hintparser: provide the true line/column offset in the warnings

cache the hintparser in the main parser to avoid repeated allocation

* lexer: delete unused sqlOffsetInComment()
2021-10-09 14:53:23 +08:00
7af8905dbd [parser] parser: add log types for flush statements (#687) 2021-10-09 14:53:23 +08:00
385d05ce3e [parser] parser: support syntax for AUTO_RANDOM (#571) 2021-10-09 14:53:23 +08:00
07751a60e2 [parser] parser: support index advisor (#667) 2021-10-09 14:53:23 +08:00
f7f50a28a7 [parser] DDL : add create sequence support & compatible with mariaDB except OrReplace. (#658)
* add create sequence support

* fix conflict

* be compatible with mariaDB

* add SignedNum and reformat indent

* add sequence test

* .

* address comment

* not support orreplace by now

* add sequence ddl

* add ddl restore test

* add : no cycle/no cache/no order

* .

* fix ident
2021-10-09 14:53:23 +08:00
f523233fff [parser] *: add flashback table syntax (#611) 2021-10-09 14:53:23 +08:00
8907945611 [parser] remove unnecessary variable (#655) 2021-10-09 14:53:23 +08:00
194335f65f [parser] model: add hidden to ColumnInfo (#621)
* add hidden

* make codecov happy

* support extended

* clean code

* address comment

* tweak

* address comment
2021-10-09 14:53:23 +08:00
cfabf36c6d [parser] add hint for (no_)swap_join_inputs (#652) 2021-10-09 14:53:23 +08:00
4760408a32 [parser] parser: support syntax for manage bindings (#646) 2021-10-09 14:53:23 +08:00
99d1a794b6 [parser] Add Cloud Spanner style read only transaction (#610)
* Add Cloud Spanner style read only transaction

* Put non keywords to the right place

Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
2021-10-09 14:53:23 +08:00
c13460aad7 [parser] support hint for indexMergeJoin and indexHashJoin (#619) 2021-10-09 14:53:23 +08:00
cc817e1324 [parser] *: Support full-text search (#592)
add MATCH(col1,col2,...) AGAINST(expr [search_modifier]) syntax support
2021-10-09 14:53:23 +08:00
3fe6ed4c13 [parser] parser: support FLUSH LOGS | HOSTS syntax (#589) 2021-10-09 14:53:23 +08:00
f26c3e85f4 [parser] parser: add support for SHUTDOWN syntax (#580)
* add support for SHUTDOWN syntax

* add SHUTDOWN privilege syntax
2021-10-09 14:53:23 +08:00
24a0caa4af [parser] *: suport alter table set flash replica syntax (#564) 2021-10-09 14:53:23 +08:00
9d0dae0e58 [parser] parser: add nowait keyword, add for update no wait grammar, and related error… (#582) 2021-10-09 14:53:23 +08:00
190f905a91 [parser] *: refine split region syntax add split partition table region syntax. (#561) 2021-10-09 14:53:23 +08:00
d3b76259b1 [parser] add support for SHOW BUILTINS syntax. (#570) 2021-10-09 14:53:23 +08:00
26d10784e4 [parser] add IGNORE_INDEX hint (#550) 2021-10-09 14:53:23 +08:00
cf56856f63 [parser] parser: fix *TEXT BYTE | ASCII | UNICODE syntax (#536) 2021-10-09 14:53:23 +08:00
5b27268b74 [parser] parser: fix CREATE INDEX .. TYPE syntax (#533) 2021-10-09 14:53:23 +08:00
592dc0fc6e [parser] Parser: support WITH PARSER (#524) 2021-10-09 14:53:23 +08:00
741cae3cfc [parser] Fix CREATE INDEX .. VISIBLE/INVISIBLE syntax (#518) 2021-10-09 14:53:23 +08:00
ece045c976 [parser] add a table hint to access table from a specific type of storage. (#446) 2021-10-09 14:53:23 +08:00
aa86dbe09c [parser] parser: add agg_to_cop hint (#517) 2021-10-09 14:53:23 +08:00
a344829761 [parser] parser: fix VARCHARACTER, VARYING syntax (#515) 2021-10-09 14:53:23 +08:00
e1690e7912 [parser] parser: support query block in hint (#491) 2021-10-09 14:53:23 +08:00
e0db8ceee7 [parser] Support keyword SERIAL (#481)
* Support keyword `SERIAL`

* Fix fmt

* make fmt happy

* execute gofmt after `make parser`

* revert modification on Makefile
2021-10-09 14:53:23 +08:00
34ef8f0215 [parser] parser: support secondary_load and secondary_unload (#496) 2021-10-09 14:53:23 +08:00
a351d5b33e [parser] parser: fix STATS_AUTO_RECALC syntax (#483) 2021-10-09 14:53:23 +08:00