Commit Graph

1209 Commits

Author SHA1 Message Date
486bd152dc [parser] model: add invisible option for IndexInfo (#771)
* model: add invisible option for IndexInfo

* fmt

Co-authored-by: kennytm <kennytm@gmail.com>
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
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
b01eedeba1 [parser] mysql: clean up unused TiDB errcode (#764) 2021-10-09 14:53:23 +08:00
8c1da586c4 [parser] README.md, docs: add an introduction to parser (#758)
refactor and make it more formal

* README.md: fix typo

* README.md: move acknowledgments to the end and add license

Co-authored-by: Zhang Jian <zjsariel@gmail.com>
2021-10-09 14:53:23 +08:00
12683245ad [parser] parser: remove useless IndexToProto,ColumnToProto,ColumnsToProto function (#762) 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
126233c2b1 [parser] model: do not rewrite collation id as default for tipb. (#752) 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
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
a9dc625514 [parser] README.md: add a user list (#750) 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
9a0826d097 [parser] model: add partition replica available info to support partition table in tiflash (#742)
Signed-off-by: crazycs <crazycs520@gmail.com>
2021-10-09 14:53:23 +08:00
b1500ed8d3 [parser] support alter instance reload tls (#740) 2021-10-09 14:53:23 +08:00
36dbd526d0 [parser] mysql/errname.go: update error message of ErrCantGetValidID (#741) 2021-10-09 14:53:23 +08:00
bb8631cca6 [parser] add errcode and errname of unsupported sequence default value for column type (#739) 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
1e9165920b [parser] mysql: sort the error code (#737) 2021-10-09 14:53:23 +08:00
214dd44fab [parser] support register new terror (#734) 2021-10-09 14:53:23 +08:00
f62926609d [parser] add .editorconfig (#732) 2021-10-09 14:53:23 +08:00
2549fe5ce1 [parser] parser: support expression restored string in default value. (#731) 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
6b1494c6a0 [parser] add json_objetagg's unsupported second argument type errorcode (#727) 2021-10-09 14:53:23 +08:00
e0c2eeb2c1 [parser] add json_objectagg's null key errcode (#726) 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
1c949fd936 [parser] parser : add invalid auto increment and offset error (#707) 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
b3ae107597 [parser] fix json field name in #571 (#702) 2021-10-09 14:53:23 +08:00
ba3ed9535b [parser] add yacc file formatter (#701) 2021-10-09 14:53:23 +08:00
e57636c295 [parser] Remove abandon command in Makefile (#703) 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
9de1af2c4e [parser] add GlobalDBVisible to represent global privilege which can see all database (#697)
* add const GlobalDBVisible

* allowed grant priv to see all database
2021-10-09 14:53:23 +08:00
00ada7f542 [parser] terror: replace sirupsen/logrus by pingcap/log (#693)
* terror: replace sirupsen/logrus by pingcap/log

also fixed test failure on Windows

* circle.yml: restrict test parallelism in integration tests

also, stop verifying parser.go and code format in the integration tests...
those steps are redundant.

* codecov: add codecov.yml, based on pingcap/tidb#9618

Co-authored-by: tiancaiamao <tiancaiamao@gmail.com>
2021-10-09 14:53:23 +08:00
e59bd5b94f [parser] add auto_random error definitions (#696) 2021-10-09 14:53:23 +08:00
b5701d9165 [parser] parser : Add model & errcode & errname for supporting sequence. (#691) 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
f799e5c41a [parser] remove digit seperator (#683) 2021-10-09 14:53:23 +08:00