Commit Graph

46 Commits

Author SHA1 Message Date
13d0deb7fe parser: respect TiDB comment when DROP INDEX IF EXISTS (#30173) 2021-11-30 19:35:53 +08:00
dbea9892c4 *: Remove old syntax ALTER TABLE ... ADD/REMOVE/ALTER PLACEMENT POLICY ... (#29603) 2021-11-10 01:19:06 +08:00
11b61738f3 parser: migrate test-infra to testify (#29191) 2021-10-28 12:30:49 +08:00
xhe
94e30df8e2 parser: fix compiling, add unit tests (#28700) 2021-10-11 23:15:25 +08:00
0036788fc0 [parser] add special comments support for index constraints (#1296) 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
ef95ffa348 [parser] parser, ast: replace TIDB_STATS with STATS_EXTENDED (#1159) 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
67c73b4af9 [parser] restore: make restore sql contains charset information even default charset (#1012) 2021-10-09 14:53:23 +08:00
eb188bac29 [parser] ddl: support multiple table rename (#1021) 2021-10-09 14:53:23 +08:00
c20039dd15 [parser] ast: Don't write comma when restore TableOption of ALTER TABLE (#1061) 2021-10-09 14:53:23 +08:00
7ad133a444 [parser] fix: use OptCharsetWithOptBinary for ENUM & SET (#976)
See also: https://github.com/mysql/mysql-server/blob/8.0/sql/sql_yacc.yy#L6617

Signed-off-by: Wang Ruichao <wangruichao2014@xiaochuankeji.cn>

Co-authored-by: tangenta <tangenta@126.com>
2021-10-09 14:53:23 +08:00
9c327e0427 [parser] fix: add hex & bit for text_string (#975)
See also: https://github.com/mysql/mysql-server/blob/8.0/sql/sql_yacc.yy#L13936

Signed-off-by: Wang Ruichao <wangruichao2014@xiaochuankeji.cn>

Co-authored-by: Arenatlx <ailinsilence4@gmail.com>
Co-authored-by: kennytm <kennytm@gmail.com>
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
511776d406 [parser] parser: remove sequence order option support (#796) 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
403a889033 [parser] parser : support drop sequence syntax. (#680) 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
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
ef25c58596 [parser] parser : support admin repair table syntax (#547)
* support admin repair table

* fix comment

* add ddl test

* fix depency
2021-10-09 14:53:23 +08:00
95b921f113 [parser] parser: add support for STORAGE DEFAULT/DISK/MEMORY in column attributes (#563)
* add support for STORAGE DEFAULT/DISK/MEMORY in column attributes

* ident lines with tab
2021-10-09 14:53:23 +08:00
a9ac52b528 [parser] fix CONSTRAINT syntax (#548) 2021-10-09 14:53:23 +08:00
97941448f4 [parser] issues 280: Support ON UPDATE ddl statements (#331)
* issues 280: Support ON UPDATE ddl statements

* issue 280: add generated file
2021-10-09 14:53:23 +08:00
fe06061d94 [parser] Issue 332 support "DROP TEMPORARY table" (#333)
* issue 332: add support for 'drop temporary table'

* issue 332: add generated file
2021-10-09 14:53:23 +08:00
c3f5479d6b [parser] Fix handling of FLOAT(p), FLOAT(m,d) and DECIMAL(m,0) types esp. w.r.t. Restore() (#311)
* parser: fix handling of FLOAT(p) and FLOAT(m,d) types

* FLOAT(50,4) should not automatically become a DOUBLE, it is just a FLOAT
  shown with 50 digits.
* FLOAT(0) and FLOAT(24) are the alias of the same type FLOAT. There is no
  need to record the Flen.

* types: fix Restore of DECIMAL(m,0) types

* tests: add test cases
2021-10-09 14:53:23 +08:00
78d1b7f21b [parser] parser: add support for ALTER DATABASE syntax (#318) 2021-10-09 14:53:23 +08:00
1fa4d04572 [parser] *: fix upper-cased charset and collation name (#301) 2021-10-09 14:53:23 +08:00
b5a1ee3a2f [parser] parser, ast: add ColumnOptionCollate for all column types (#260) 2021-10-09 14:53:23 +08:00
7c13429c34 [parser] *: Support ENGINE TokuDB and it's ROW_FORMAT (#222) 2021-10-09 14:53:23 +08:00
cb0ee3bb8d [parser] parser: fix stored option in generated column restore (#221)
* parser: fix stored option in generated column restore

* parser: replace pkg/errors with pingcap/errors

* parser: address comment
2021-10-09 14:53:23 +08:00
38bca7abec [parser] parser: implement Restore for CreateViewStmt (#139) 2021-10-09 14:53:23 +08:00
7abc99d6e3 [parser] parser: implement Restore for CreateTableStmt (#170) 2021-10-09 14:53:23 +08:00
c70ba5e716 [parser] parser: implement Restore for CreateIndexStmt (#150)
* add empty test case

* CreateIndexStmt restore implement

* remove useless function TestCreateIndexStmtRestore

* CreateIndexStmt error add index info

* combine trivial code of CreateIndexStmt.Restore

* add unique index case for CreateIndexStmt.Restore

* merge code from master
2021-10-09 14:53:23 +08:00
b47d6e9f4c [parser] parser: implement Restore for AlterTableStmt and AlterTableSpec (#154)
* implement AlterTableStmt#Restore.

* implement TableOption#Restore

* implement AlterTableSpec#Restore.
add test cases.

* resolved conversation

* resolved conversation: WritePlainf -> WriteString

* resolved: ctx.Annotate -> ctx.Annotatef

* resolved: merge ctx,WriteKeyWord

* resolved: merge if used else.

* implement PartitionDefinition#restore.

* change error message.
2021-10-09 14:53:23 +08:00
d057e9ebaf [parser] parser: implement Restore for ColumnOption, FieldType and ColumnDef (#160) 2021-10-09 14:53:23 +08:00
7287ea54b8 [parser] parser: implement Restore for Constraint (#127) 2021-10-09 14:53:23 +08:00
8c816f7587 [parser] parser: implement Restore for ColumnPosition (#110) 2021-10-09 14:53:23 +08:00
31ac5d0e24 [parser] parser: implement Restore for TableToTable (#109) 2021-10-09 14:53:23 +08:00
0d99bd9732 [parser] implement Restore for ReferenceDef (#123) 2021-10-09 14:53:23 +08:00
a1ce7e5973 [parser] parser: implement Restore for TruncateTableStmt (#122) 2021-10-09 14:53:23 +08:00
92ae1a8d62 [parser] parser: implement Restore for IndexColName (#91) 2021-10-09 14:53:23 +08:00
0828b98973 [parser] parser: implement Restore for OnDeleteOpt And OnUpdateOpt (#98) 2021-10-09 14:53:23 +08:00
33ebd359b8 [parser] ci: update ci script for checking code format (#103) 2021-10-09 14:53:23 +08:00
631f5c92e4 [parser] parser: implement Restore for IndexOption (#88) 2021-10-09 14:53:23 +08:00
c270f55405 [parser] *: move github.com/pingcap/tidb/parser here (#1) 2021-10-09 14:53:23 +08:00