Commit Graph

275 Commits

Author SHA1 Message Date
2a5e48011c parser: fix function as identifier in TiDB is not compatible with Mysql (#31803)
close pingcap/tidb#30556
2022-01-28 13:03:13 +08:00
7647c2b9b0 parser: parse gbk encoding SQL token by token instead of the whole SQL (#31039)
close pingcap/tidb#30765
2021-12-28 22:07:49 +08:00
dd95dd6e4c parser: support admin flush plan_cache (#30747) 2021-12-17 17:34:36 +08:00
aa002f28a2 *: show cmd to check if all needed histograms are loaded (#29672) 2021-12-10 13:45:57 +08:00
23af09d8bf *: support trace plan target='estimation' statement (#30491) 2021-12-10 11:43:57 +08:00
a3f3924388 parser: support analyze/stats options when create/alter table (#29056) 2021-10-27 14:54:49 +08:00
b332a085a3 parser: add new analyze option SAMPLERATE (#28961) 2021-10-25 16:04:48 +08:00
412dd4f763 parser: refactor Parse() interface to make it extensible (#28975) 2021-10-21 10:56:45 +08:00
fce1a03e40 parser: analyze predicate/user-specified columns and show column_stats_usage (#28846) 2021-10-18 16:52:43 +08:00
cc96f59bdb *: rename RECREATOR to REPLAYER (#28826) 2021-10-15 16:23:27 +08:00
ba105bbd10 [parser] support parsing SQL with encodings other than utf8 (#1312) 2021-10-09 14:53:23 +08:00
xhe
0c458aca02 [parser] *: support new placement rules syntax (#1299) 2021-10-09 14:53:23 +08:00
b266e09b30 [parser] charset: clean up some code about charset (#1306) 2021-10-09 14:53:23 +08:00
3ed80be1c4 [parser] restore: support restoring SQL wrapping with TiDB special comments (#1287) 2021-10-09 14:53:23 +08:00
386287d9b4 [parser] Support add/drop attributes for table or partition (#1271) 2021-10-09 14:53:23 +08:00
742f960ce7 [parser] parser: add plan recreator statement (#1278) 2021-10-09 14:53:23 +08:00
217cd12248 [parser] parser: support Oracle translate function (#1283) 2021-10-09 14:53:23 +08:00
a8fd323ac6 [parser] parser: fix the compatiblity of explain_format (#1262) 2021-10-09 14:53:23 +08:00
c0fd7427f1 [parser] Add 'HELP' statement support (#1250) 2021-10-09 14:53:23 +08:00
fd730ec231 [parser] parser: support the 'create global temporary table' syntax (#1211) 2021-10-09 14:53:23 +08:00
b6c5ada1d5 [parser] *: add as of clause for SET and SELECT (#1206)
* *: add as of clause

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

* resolve shift-reduce conflict

* *: fix and try to add test

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

* *: add timestamp

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

* make as of to token

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

* address comments

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

* add test

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

* make of as Reserved(from mysql 8.0)

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

* add set test case

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

* address comment

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

Co-authored-by: tangenta <tangenta@126.com>
2021-10-09 14:53:23 +08:00
ccf996259d [parser] support CTE clause (#1207) 2021-10-09 14:53:23 +08:00
f09db3e3ce [parser] feat: force_index hint (#1205) 2021-10-09 14:53:23 +08:00
xhe
bc860cdd5e [parser] *: fix static check report (#1195)
* ast: base.go

Signed-off-by: xhe <xw897002528@gmail.com>

* ast: expressions.go

Signed-off-by: xhe <xw897002528@gmail.com>

* ast: misc_test.go

Signed-off-by: xhe <xw897002528@gmail.com>

* *: digester.go

Signed-off-by: xhe <xw897002528@gmail.com>

* goyacc: format_yacc.go

Signed-off-by: xhe <xw897002528@gmail.com>

* *: lexer_test.go

Signed-off-by: xhe <xw897002528@gmail.com>

* *: misc.go

Signed-off-by: xhe <xw897002528@gmail.com>

* model: model.go

Signed-off-by: xhe <xw897002528@gmail.com>

* model: model_test.go

Signed-off-by: xhe <xw897002528@gmail.com>

* *: parser_test.go

Signed-off-by: xhe <xw897002528@gmail.com>

* test_driver: test_driver_datum.go

Signed-off-by: xhe <xw897002528@gmail.com>

* test_driver: test_driver_mydecimal.go

Signed-off-by: xhe <xw897002528@gmail.com>

* ast: ddl.go, bugfix

Signed-off-by: xhe <xw897002528@gmail.com>

* mysql: errcode.go

charset/charset.go is passing errcode to NewStd, which requires int. But
here codes are uint16. To get rid of the error, uint16 is removed.

Signed-off-by: xhe <xw897002528@gmail.com>

* model: better test

Signed-off-by: xhe <xw897002528@gmail.com>

* *: fix timezone

Signed-off-by: xhe <xw897002528@gmail.com>

Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
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
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
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
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
d0d67ddb9e [parser] *: support GRANT PROXY (#1142) 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
42ac1b81d6 [parser] parser: add RESUME and BRIEOptionLevel for IMPORT (#1100) 2021-10-09 14:53:23 +08:00
8a2041474b [parser] parser: add PURGE IMPORT (#1102) 2021-10-09 14:53:23 +08:00
b76254849a [parser] support SELECT FROM TABLESAMPLE syntax (#1071)
* support SELECT FROM TABLESAMPLE syntax

* refine naming

* make table sample clause as a part of TableFactor

* address comment
2021-10-09 14:53:23 +08:00
cb5af255be [parser] support call statement (#1077)
* support call statement

* support call statement (review fixes)

* support call statement (review fixes)

Co-authored-by: tiancaiamao <tiancaiamao@gmail.com>
2021-10-09 14:53:23 +08:00
caa3a88377 [parser] parser: support alter sequence (#1046) 2021-10-09 14:53:23 +08:00
1ffb873bba [parser] executor: add builtin aggregate function json_arrayagg (#1020) 2021-10-09 14:53:23 +08:00
00712da525 [parser] parser: rename topn_to_cop hint to limit_to_cop hint. (#1028)
Co-authored-by: Yuanjia Zhang <zhangyuanjia@pingcap.com>
2021-10-09 14:53:23 +08:00
4a04e063a6 [parser] support select for update wait seconds grammar (#997) 2021-10-09 14:53:23 +08:00
d215bbeaf1 [parser] Support APPROX_PERCENTILE function (#1002)
* support approx_percentile function

* update

Co-authored-by: kennytm <kennytm@gmail.com>
2021-10-09 14:53:23 +08:00
f42586fcd3 [parser] feat: add "HISTOGRAM" option in "ALTER TABLE... UPDATE/DROP..." (#925) 2021-10-09 14:53:23 +08:00
57acffbb54 [parser] parser: add FETCH FIRST syntax support (#985) 2021-10-09 14:53:23 +08:00
b77fec8b53 [parser] parser: add topn_to_cop hint (#981) 2021-10-09 14:53:23 +08:00
49b6c5e4b4 [parser] parser: support CREATE STATISTICS / DROP STATISTICS / ADMIN RELOAD STATISTICS (#913) 2021-10-09 14:53:23 +08:00
xhe
88e2440084 [parser] parser: more meaningful words for placement rules (#931)
follow
https://github.com/pingcap/tidb/issues/18030#issuecomment-654943694.
However, "constraints" is used for "label". Because it is not
necessarily related to region/locality.
2021-10-09 14:53:23 +08:00
8f8575ddf5 [parser] parser: support set operator EXCEPT and INTERSECT (#916) 2021-10-09 14:53:23 +08:00
xhe
c307c0dab5 [parser] parser: support ALTER PARTITION clause (#921) 2021-10-09 14:53:23 +08:00