Commit Graph

858 Commits

Author SHA1 Message Date
359debdae6 [parser] Remove unnecessary .(string) casting and $$ = $1 from parser.y (#825)
* parser: use <ident> rather than <item> for string-only rules

This get rid of many .(string) casts.

* parser: get rid of unnecessary $$ = $1.
2021-10-09 14:53:23 +08:00
3a347a826b [parser] parser: introduce a new privilege for the set config statement (#835) 2021-10-09 14:53:23 +08:00
e228ea6519 [parser] parser: change CONFIG to an unreserved keyword 2021-10-09 14:53:23 +08:00
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
34c18a6ee0 [parser] add some tests for ignore_plan_cache, and correct a bug in parser.y (#822) 2021-10-09 14:53:23 +08:00
7f7e9bf8df [parser] parser: support using dash('-') in config item names (#821) 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
f1d610f394 [parser] fix type conversion panic from NUM to int64 (#809)
* fix conversion panic from NUM to int64

* catch teardown error

* polish int64num description

Co-authored-by: kennytm <kennytm@gmail.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
8598cb86e9 [parser] parser: remove with/without validation unsupported warning in parser (#795) 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
2a7d4fa913 [parser] parser: sequence order option parse warning (#791) 2021-10-09 14:53:23 +08:00
6d587c8837 [parser] support 'binary' collation in table option (#789)
Co-authored-by: Arenatlx <ailinsilence4@gmail.com>
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
d7b93edc66 [parser] parser: recognize BACKUP SNAPSHOT = TSO in additional to 'TIMESTAMP' (#782) 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
37c036ca8b [parser] parser: support group_concat as window function in parser (#766)
* windown function add

* fix

* make test

* window function support for group_concat

* back mod fiel
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
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
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
313a0d13e4 [parser] parser: support sequence function & next value for (#713) 2021-10-09 14:53:23 +08:00
e633cd8221 [parser] Parser: Database and Table encryption (#599 #600) (#717)
* add junit test of database encrption

* *: Add warn when database encrypting

* *: add warn of database encryption

* Parser:Database encryption

* Parser: Database encryption ignores case

* *:add unit test of database encryption

* *: Fallback to master version

* parse:More universal implementation

* parser: support table Encryption

* parser:avoid several type conversion
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
cd9ed92d53 [parser] distinguish 'convert to' keyword in table option of charset (#706) 2021-10-09 14:53:23 +08:00
54c8b68819 [parser] fix rename column rule (#705) 2021-10-09 14:53:23 +08:00
ba3ed9535b [parser] add yacc file formatter (#701) 2021-10-09 14:53:23 +08:00
1785397d6d [parser] Add parsing of window function for aggregate function varpop (#700) 2021-10-09 14:53:23 +08:00
9e2eb9d931 [parser] parser: fix panic when MEMORY_QUOTA overflows int64 (#694) 2021-10-09 14:53:23 +08:00
935055c937 [parser] make 'language' as unreserved keyword (#699) 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
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
526e7683ef [parser] change sequence unreserved keyword (#673) 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
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