Commit Graph

266 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
97e61aea57 [parser] parser: add auto_random table option support (#823)
* add auto_random table option support

* .

* .
2021-10-09 14:53:23 +08:00
29c3fc2591 [parser] parser: add order by clause in group_concat (#813) 2021-10-09 14:53:23 +08:00
928eb78a0e [parser] add func: mvcc_get_by_hex (#805)
Signed-off-by: Qiannan Lyu <lvqiannan@gmail.com>

Co-authored-by: Lingyu Song <songlingyu@pingcap.com>
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
096d4fad21 [parser] opcode,ast: fix invalid restore of '4 DIV 2' (became '4DIV2') (#792) 2021-10-09 14:53:23 +08:00
c6b2ea9598 [parser] parser: add syntax ADMIN RELOAD BINDINGS (#787) 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
d7b93edc66 [parser] parser: recognize BACKUP SNAPSHOT = TSO in additional to 'TIMESTAMP' (#782) 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
b255e058e5 [parser] *: set charset and collate for string literals correctly (#761)
* done

* address comment

* fix

* revert
2021-10-09 14:53:23 +08:00
2f1915d785 [parser] parser: set UnionStmt and ShowStmt as readonly (#755)
* add UnionStmt and ShowStmt as readonly

* fix UnionStmt
2021-10-09 14:53:23 +08:00
1f323f3aa7 [parser] *: Add format_bytes and format_nano_time function (#754)
* add Performance Schema Functions format_bytes and format_nano_time

Signed-off-by: gauss <gauss1314@gmail.com>

* remove a test case

Signed-off-by: gauss <gauss1314@gmail.com>

Co-authored-by: kennytm <kennytm@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
46600d4798 [parser] parser, ast: add SetCollatorExpr (#749)
This ExprNode is equivalent to the `Item_func_set_collation` in MySQL,
it is used to specify the collation for the result of another
expression.

Co-authored-by: tangenta <tangenta@126.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
644e72eba2 [parser] add show table $table_name next_row_id syntax (#738)
* add `show table $table_name next_row_id` syntax

Signed-off-by: zhang555 <4598181@qq.com>

add show table next row id

Signed-off-by: zhang555 <4598181@qq.com>

add show table next row id

Signed-off-by: zhang555 <4598181@qq.com>

add show table next row id

Signed-off-by: zhang555 <4598181@qq.com>

add show table next row id

Signed-off-by: zhang555 <4598181@qq.com>

add show table next row id

Signed-off-by: zhang555 <4598181@qq.com>

add `show table  next_row_id`  syntax

Signed-off-by: zhang555 <4598181@qq.com>

add `show table $table_name next_row_id` syntax

Signed-off-by: zhang555 <4598181@qq.com>

add `show table  next_row_id` syntax

Signed-off-by: zhang555 <4598181@qq.com>

add `show table $table_name next_row_id` syntax

Signed-off-by: zhang555 <4598181@qq.com>

add `show table  next_row_id` syntax

Signed-off-by: zhang555 <4598181@qq.com>

* add `show table $table_name next_row_id` syntax

Signed-off-by: zhang555 <4598181@qq.com>

* add `show table $table_name next_row_id` syntax

Signed-off-by: zhang555 <4598181@qq.com>

* add  syntax

Signed-off-by: zhang555 <4598181@qq.com>

* Merge branch 'master' into mytidb1

Signed-off-by: zhang555 <4598181@qq.com>

# Conflicts:
#	parser.go
2021-10-09 14:53:23 +08:00
acf6cb52c0 [parser] *: remove until timestamp syntax in flashback since we not support this (#733) 2021-10-09 14:53:23 +08:00
6eb2909901 [parser] change all dot import, according to staticcheck (#730)
* change all dot import, according to staticcheck

* make staticcheck happy
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
cd9ed92d53 [parser] distinguish 'convert to' keyword in table option of charset (#706) 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
403a889033 [parser] parser : support drop sequence syntax. (#680) 2021-10-09 14:53:23 +08:00
b9268c63bc [parser] remove dependency on TiDB (#679) 2021-10-09 14:53:23 +08:00
6721fea8cf [parser] add show create sequence (#681) 2021-10-09 14:53:23 +08:00
c6a316f63f [parser] support require clauses in grant stmt (#666) 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
de4291013c [parser] ddl: add expression index support (#664)
* done

* update comment

* address comment and add error code

* address comment

* rename

* address comment

* fmt

*  address comment

* address comment
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
ef3cc1fe1c [parser] ast: support explain format hint (#654) 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
570f2f00a6 [parser] fix alter table convert to charset default syntax (#566) 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
097954ab2d [parser] parser: support drop specific plan binding (#620) 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
9b11c3d2ad [parser] revert pr 587 failed to parse WHERE / GROUP BY clauses in a SELECT statement without a FROM table (#597) 2021-10-09 14:53:23 +08:00
26b362d28c [parser] parser: rename 'timestampliteral' to avoid misuse of 'select timestampliteral()' (#591)
When the input is select timestamp '2019-10-29 16:14:42', it's parsed to something like

> 'select timestampliteral()'

`timestampliteral` is a valid function name in TiDB, used to implement the timestamp literal.

However, if the input is 'select timestampliteral()', we should reject this query.
This PR renames `timestampliteral` to avoid conflict.
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