Commit Graph

1424 Commits

Author SHA1 Message Date
568cdcc4bd [parser] downgrade mysql driver version (#1193)
* downgrade mysql driver version

* use v1.4.1

* use v1.3.0
2021-10-09 14:53:23 +08:00
5020689f09 [parser] parser: Add truncate all support (#1179)
* remove warning
* make parser
2021-10-09 14:53:23 +08:00
8cd0659690 [parser] set right not null flag when newing extra PK (#1189)
* set right not null flag when newing extra PK

* add test

* fmt

Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2021-10-09 14:53:23 +08:00
4bc38d9c99 [parser] privileges: show create view privilege should in AllTablePrivs (#1182)
Co-authored-by: jwxiong <xiongjiwei1996@outlook.com>
2021-10-09 14:53:23 +08:00
7515d165a3 [parser] parser: regard NULL as literal when normalizing query (#1166)
* parser: regard NULL as literal when normalizing queries

Currently, Normalize() converts "SELECT NULL" to "select null", while NULL is
regarded as a literal in MySQL, as described in the documentation.
https://dev.mysql.com/doc/refman/8.0/en/literals.html
It seems natural that Normalize() would convert "SELECT NULL" to "select ?"
from the consistency viewpoint.

* Handle case of 'select `null`'

* Fix quotation

Co-authored-by: Arenatlx <ailinsilence4@gmail.com>
Co-authored-by: kennytm <kennytm@gmail.com>
2021-10-09 14:53:23 +08:00
bb256c7e19 [parser] format: add RestoreStringWithoutCharset flag (#1184)
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2021-10-09 14:53:23 +08:00
0ab86feca6 [parser] add ActionType: ActionDropIndexes (#1186) 2021-10-09 14:53:23 +08:00
a27471d6df [parser] statistics: introduce a new kind of syntax to drop global-stats #1181 2021-10-09 14:53:23 +08:00
cead7b3c5d [parser] parser: support show stats_extended syntax (#1178) 2021-10-09 14:53:23 +08:00
747a99dd53 [parser] add the new stmt: drop stats partition (#1177) 2021-10-09 14:53:23 +08:00
10b601cc69 [parser] restore: fix the bug about restore join table generate syntax error SQL (#1173) 2021-10-09 14:53:23 +08:00
b3efddbbec [parser] digest: add missed backquote when getting digest (#1176)
* fix test

* add test
2021-10-09 14:53:23 +08:00
9c4959a061 [parser] lexer: quote identifier when get sql digest (#1151)
* fix

* fix

* Update digester.go

Co-authored-by: kennytm <kennytm@gmail.com>

Co-authored-by: kennytm <kennytm@gmail.com>
2021-10-09 14:53:23 +08:00
51f162cf17 [parser] model: add a version for the clustered index (#1172) 2021-10-09 14:53:23 +08:00
1f210fe678 [parser] model: add a new TableInfoVersion for separating id allocators (#1170) 2021-10-09 14:53:23 +08:00
bed9d55584 [parser] parser: update the broken link for Contribution Guide in README.md (#1167) 2021-10-09 14:53:23 +08:00
7aa3bf1b2f [parser] Add "START TRANSACTION WITH CAUSAL CONSISTENCY ONLY" (#1162)
* add a start transaction without external consistency statement

Signed-off-by: ekexium <ekexium@gmail.com>

* change the grammar to 'with causal consistency'

Signed-off-by: ekexium <ekexium@gmail.com>

* rename WithoutExternalConsistency to CausalConsistency

Signed-off-by: ekexium <ekexium@gmail.com>

* change syntax to 'start transaction with causal consistency only'

Signed-off-by: ekexium <ekexium@gmail.com>

Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2021-10-09 14:53:23 +08:00
b700ada012 [parser] README: add more resources (#1163) 2021-10-09 14:53:23 +08:00
f2bcba6779 [parser] ast: support explain format = 'test' syntax (#1164) 2021-10-09 14:53:23 +08:00
85c41d1017 [parser] parser: support builtin function SOUNDEX (#1161)
* add soundex

* add unit test
2021-10-09 14:53:23 +08:00
ef95ffa348 [parser] parser, ast: replace TIDB_STATS with STATS_EXTENDED (#1159) 2021-10-09 14:53:23 +08:00
5e94208b8b [parser] ast, misc, parser: add FLUSH CLIENT_ERRORS_SUMMARY (#1154) 2021-10-09 14:53:23 +08:00
e944f5cfcb [parser] *: add CREATE IMPORT and other control statement (#1147) 2021-10-09 14:53:23 +08:00
6a18e2f063 [parser] *: support CLUSTERED and NONCLUSTERED syntax (#1153) 2021-10-09 14:53:23 +08:00
a0c6fa67ae [parser] remove proxy from reserved keyword (#1150)
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
2021-10-09 14:53:23 +08:00
df2a55a4cc [parser] parser: compatible with select...for share statement (#946)
* parser: compatible with `select...for share` statement

* parser: parse `LOCK IN SHARE MODE` into `FOR SHARE` and support `NOWAIT` & `SKIP LOCKED`

* merge master

* SelectLockType.String() returns string only

* update parser_test.go

* resolve conflicts
2021-10-09 14:53:23 +08:00
a3519e86f4 [parser] *: create / drop extended stats by ALTER TABLE (#1138) 2021-10-09 14:53:23 +08:00
df89db3af2 [parser] parser: change the trace statement default format to row (#1107)
* parser: change trace statement default format to row

* fix CI

Co-authored-by: tangenta <tangenta@126.com>
2021-10-09 14:53:23 +08:00
8950ad0f44 [parser] *: support dynamic privileges and more extended privileges (#1144)
* *: support dynamic privileges and more extended privileges

* address comment

* address comment
2021-10-09 14:53:23 +08:00
ca82007543 [parser] Revert "make prepared readonly (#1139)" (#1145)
This reverts commit 72e9144ea37c26c219dc36afeb6a2e7689f12f27.
2021-10-09 14:53:23 +08:00
d0d67ddb9e [parser] *: support GRANT PROXY (#1142) 2021-10-09 14:53:23 +08:00
593668b982 [parser] parser: Compatible with mysql8 fix select 1 where 1=1 (#1131) 2021-10-09 14:53:23 +08:00
4c87213312 [parser] make prepared readonly (#1139) 2021-10-09 14:53:23 +08:00
21bcae2c9c [parser] parser: remove invalid syntax (#1134)
* remove

* Merge remote-tracking branch 'upstream/master' into remove-dot

# Conflicts:
#	parser.go

* add test

* add test

* Merge remote-tracking branch 'upstream/master' into remove-dot

# Conflicts:
#	parser.go
2021-10-09 14:53:23 +08:00
22aef2341f [parser] ast, parser: add FUNCTION and PROCEDURE for GRANT object_type (#1136) 2021-10-09 14:53:23 +08:00
634199be7f [parser] lexer: reset identifierDot to false in QuotedIdent (#1135) 2021-10-09 14:53:23 +08:00
207955cf69 [parser] *: change privilege type to uint64 and support REPLICATION CLIENT, etc (#1121) 2021-10-09 14:53:23 +08:00
5e0bbb8eb8 [parser] lexer: treat dot differently in different context (#1132)
* fix lexer

* fix lexer

* fix lexer

* fix lexer

* fix lexer

* update test

Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2021-10-09 14:53:23 +08:00
78d16b53a2 [parser] ast, parser: fix parse join (#1129) 2021-10-09 14:53:23 +08:00
5d55a9dd61 [parser] digester: keep the singleAtIdentifier in normalize (#1128) 2021-10-09 14:53:23 +08:00
c3ac91c0ac [parser] ast: fix restore panic for TRIM() when arguments contain column name (#1124) 2021-10-09 14:53:23 +08:00
5d600ee3b0 [parser] *: support multiple select options (#1122)
* done

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>

* done

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>

* clean

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>

* fix

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>

* fix

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>

* clean

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>

* address comment

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
2021-10-09 14:53:23 +08:00
9fb295fcc8 [parser] parser.y: populate the Fields field for TABLE and VALUES statements (#1118) 2021-10-09 14:53:23 +08:00
79fbb96097 [parser] mysql: add consts for auth switch request (#1088) 2021-10-09 14:53:23 +08:00
d2352cfd0d [parser] fix create binding for update with hint (#1117) 2021-10-09 14:53:23 +08:00
bba8f9579c [parser] model: Add StateGlobalTxnWriteOnly (#1104) 2021-10-09 14:53:23 +08:00
61d4863dab [parser] model: add functionality to check if a base table (#1080) 2021-10-09 14:53:23 +08:00
0529fa31aa [parser] parser: add grammar show stats_topn (#1109) 2021-10-09 14:53:23 +08:00
d61bcedfa7 [parser] Adding vitess_hash function to ast (#1089)
Co-authored-by: Arenatlx <ailinsilence4@gmail.com>
2021-10-09 14:53:23 +08:00
b777f86c22 [parser] done (#1108)
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
2021-10-09 14:53:23 +08:00