Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix(mysql-parser): force parsing until EOF (#6583)
rebelice632a5b690526
diff --git a/backend/plugin/advisor/catalog/test/mysql_walk_through.yaml b/backend/plugin/advisor/catalog/test/mysql_walk_through.yamlindex 8530f8cac2..14be99235c 100644--- a/backend/plugin/advisor/catalog/test/mysql_walk_through.yaml+++ b/backend/plugin/advisor/catalog/test/mysql_walk_through.yaml@@ -12,7 +12,7 @@err:type: 407content: BLOB, TEXT, GEOMETRY or JSON column `a` can't have a default value- line: 2+ line: 3payload: null- statement: ' CREATE TABLE t(a TEXT DEFAULT ''1'')'want: null@@ -28,7 +28,7 @@err:type: 406content: Invalid default value for column `a`- line: 2+ line: 3payload: null- statement: ' CREATE TABLE t(a INT NOT NULL DEFAULT NULL)'want: null@@ -49,63 +49,65 @@err:type: 404content: There can be only one auto column for table `t`- line: 1+ line: 2payload: null- statement: ' CREATE TABLE t as select * from t1;'want: nullerr:type: 303- content: Disallow the CREATE TABLE AS statement but "CREATE TABLE t as select * from t1;" uses- line: 1+ content: |-+ Disallow the CREATE TABLE AS statement but "CREATE TABLE t as select * from t1+ ;" uses+ line: 2payload: null- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tCREATE INDEX idx_c on t(c);\n\t\t\t"want: nullerr:type: 402content: Column `c` does not exist in table `t`- line: 3+ line: 4payload: null- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t MODIFY COLUMN c int;\n\t\t\t"want: nullerr:type: 402content: Column `c` does not exist in table `t`- line: 3+ line: 4payload: null- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t CHANGE COLUMN c aa int;\n\t\t\t"want: nullerr:type: 402content: Column `c` does not exist in table `t`- line: 3+ line: 4payload: null- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t DROP COLUMN c;\n\t\t\t"want: nullerr:type: 402content: Column `c` does not exist in table `t`- line: 3+ line: 4payload: null- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t RENAME COLUMN c TO cc;\n\t\t\t"want: nullerr:type: 402content: Column `c` does not exist in table `t`- line: 3+ line: 4payload: null- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t RENAME COLUMN c TO cc;\n\t\t\t"want: nullerr:type: 402content: Column `c` does not exist in table `t`- line: 3+ line: 4payload: null- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t ALTER COLUMN c DROP DEFAULT;\n\t\t\t"want: nullerr:type: 402content: Column `c` does not exist in table `t`- line: 3+ line: 4payload: null- statement: |-ALTER DATABASE CHARACTER SET = utf8mb4;@@ -120,6 +122,7 @@characterset: utf8mb4collation: utf8mb4_polish_ciextensions: []+ datashare: falseerr: null- statement: |-CREATE TABLE t(@@ -337,6 +340,7 @@characterset: ""collation: ""extensions: []+ datashare: falseerr: null- statement: |-CREATE TABLE t(@@ -456,6 +460,7 @@characterset: ""collation: ""extensions: []+ datashare: falseerr: null- statement: |-CREATE TABLE t(@@ -510,6 +515,7 @@characterset: ""collation: ""extensions: []+ datashare: falseerr: null- statement: |-CREATE TABLE t1(a int, b int, c int);@@ -525,13 +531,14 @@characterset: ""collation: ""extensions: []+ datashare: falseerr: null- statement: ' DROP TABLE t1, t2'want: nullerr:type: 302content: Table `t1` does not exist- line: 1+ line: 2payload: null- statement: |-CREATE TABLE t(a int);@@ -546,6 +553,7 @@characterset: ""collation: ""extensions: []+ datashare: falseerr: null- statement: |-CREATE TABLE t(a int);@@ -580,6 +588,7 @@characterset: ""collation: ""extensions: []+ datashare: falseerr: null- statement: |--- this is comment@@ -589,7 +598,7 @@err:type: 202content: Database `test` is deleted- line: 3+ line: 4payload: null- statement: |-CREATE TABLE t(@@ -721,6 +730,7 @@characterset: ""collation: ""extensions: []+ datashare: falseerr: null- statement: |-CREATE TABLE t(@@ -840,6 +850,7 @@characterset: ""collation: ""extensions: []+ datashare: falseerr: null- statement: |-CREATE TABLE t(@@ -894,4 +905,5 @@characterset: ""collation: ""extensions: []+ datashare: falseerr: nulldiff --git a/backend/plugin/advisor/mysql/test/column_auto_increment_initial_value.yaml b/backend/plugin/advisor/mysql/test/column_auto_increment_initial_value.yamlindex e6b9f972e2..c84eb6f231 100644--- a/backend/plugin/advisor/mysql/test/column_auto_increment_initial_value.yaml+++ b/backend/plugin/advisor/mysql/test/column_auto_increment_initial_value.yaml@@ -20,5 +20,5 @@code: 416title: column.auto-increment-initial-valuecontent: The initial auto-increment value in table `t` is 2, which doesn't equal 20- line: 1+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/column_auto_increment_must_integer.yaml b/backend/plugin/advisor/mysql/test/column_auto_increment_must_integer.yamlindex 3685dbf6db..d23d0b34d5 100644--- a/backend/plugin/advisor/mysql/test/column_auto_increment_must_integer.yaml+++ b/backend/plugin/advisor/mysql/test/column_auto_increment_must_integer.yaml@@ -12,7 +12,7 @@code: 410title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer type- line: 1+ line: 2details: ""- statement: |-CREATE TABLE t(b int);@@ -22,7 +22,7 @@code: 410title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer type- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -32,7 +32,7 @@code: 410title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer type- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(b int);@@ -42,5 +42,5 @@code: 410title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer type- line: 2+ line: 3details: ""diff --git a/backend/plugin/advisor/mysql/test/column_auto_increment_must_unsigned.yaml b/backend/plugin/advisor/mysql/test/column_auto_increment_must_unsigned.yamlindex 07fa3166a1..7c72ff8355 100644--- a/backend/plugin/advisor/mysql/test/column_auto_increment_must_unsigned.yaml+++ b/backend/plugin/advisor/mysql/test/column_auto_increment_must_unsigned.yaml@@ -12,7 +12,7 @@code: 417title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED type- line: 1+ line: 2details: ""- statement: |-CREATE TABLE t(b int);@@ -22,7 +22,7 @@code: 417title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED type- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -32,7 +32,7 @@code: 417title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED type- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(b int);@@ -42,5 +42,5 @@code: 417title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED type- line: 2+ line: 3details: ""diff --git a/backend/plugin/advisor/mysql/test/column_comment.yaml b/backend/plugin/advisor/mysql/test/column_comment.yamlindex 0bacb51ad3..1e764ba49f 100644--- a/backend/plugin/advisor/mysql/test/column_comment.yaml+++ b/backend/plugin/advisor/mysql/test/column_comment.yaml@@ -38,7 +38,7 @@code: 408title: column.commentcontent: Column `t`.`b` requires comments- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int COMMENT 'this is comment');@@ -54,7 +54,7 @@code: 408title: column.commentcontent: Column `t`.`b` requires comments- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(b int COMMENT 'It is comment');@@ -70,7 +70,7 @@code: 408title: column.commentcontent: Column `t`.`b` requires comments- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(b int COMMENT 'It is COMMENT');@@ -86,5 +86,5 @@code: 409title: column.commentcontent: The length of column `t`.`b` comment should be within 10 characters- line: 2+ line: 3details: ""diff --git a/backend/plugin/advisor/mysql/test/column_current_time_count_limit.yaml b/backend/plugin/advisor/mysql/test/column_current_time_count_limit.yamlindex 08b3c5ded7..f5b200b722 100644--- a/backend/plugin/advisor/mysql/test/column_current_time_count_limit.yaml+++ b/backend/plugin/advisor/mysql/test/column_current_time_count_limit.yaml@@ -17,7 +17,7 @@code: 418title: column.current-time-count-limitcontent: Table `t` has 3 DEFAULT CURRENT_TIMESTAMP() columns. The count greater than 2.- line: 5+ line: 6details: ""- statement: |-CREATE TABLE t(@@ -29,7 +29,7 @@code: 419title: column.current-time-count-limitcontent: Table `t` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.- line: 4+ line: 5details: ""- statement: |-ALTER TABLE tech_book ADD COLUMN a timestamp default now() on update localtime;@@ -39,5 +39,5 @@code: 419title: column.current-time-count-limitcontent: Table `tech_book` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.- line: 2+ line: 3details: ""diff --git a/backend/plugin/advisor/mysql/test/column_disallow_change.yaml b/backend/plugin/advisor/mysql/test/column_disallow_change.yamlindex 0cac3ff8d6..b25f8ce70a 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_change.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_change.yaml@@ -15,6 +15,8 @@- status: WARNcode: 406title: column.disallow-change- content: '"ALTER TABLE t CHANGE COLUMN b a int" contains CHANGE COLUMN statement'- line: 2+ content: |-+ "ALTER TABLE t CHANGE COLUMN b a int+ ;" contains CHANGE COLUMN statement+ line: 3details: ""diff --git a/backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml b/backend/plugin/advisor/mysql/test/column_disallow_change_type.yamlindex d2e7fa820d..54ccb860b1 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml@@ -3,8 +3,10 @@- status: WARNcode: 403title: column.disallow-change-type- content: '"ALTER TABLE tech_book MODIFY id INTEGER UNSIGNED" changes column type'- line: 1+ content: |-+ "ALTER TABLE tech_book MODIFY id INTEGER UNSIGNED+ ;" changes column type+ line: 2details: ""- statement: ALTER TABLE tech_book MODIFY id intwant:@@ -19,14 +21,18 @@- status: WARNcode: 403title: column.disallow-change-type- content: '"ALTER TABLE tech_book MODIFY id bigint" changes column type'- line: 1+ content: |-+ "ALTER TABLE tech_book MODIFY id bigint+ ;" changes column type+ line: 2details: ""- statement: ALTER TABLE tech_book CHANGE name uname varchar(20)want:- status: WARNcode: 403title: column.disallow-change-type- content: '"ALTER TABLE tech_book CHANGE name uname varchar(20)" changes column type'- line: 1+ content: |-+ "ALTER TABLE tech_book CHANGE name uname varchar(20)+ ;" changes column type+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml b/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yamlindex fe5c5f252f..8d7fd61c6e 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml@@ -15,8 +15,10 @@- status: WARNcode: 407title: column.disallow-changing-order- content: '"ALTER TABLE t MODIFY COLUMN a int FIRST" changes column order'- line: 2+ content: |-+ "ALTER TABLE t MODIFY COLUMN a int FIRST+ ;" changes column order+ line: 3details: ""- statement: |-CREATE TABLE t(b int, a1 int);@@ -25,8 +27,10 @@- status: WARNcode: 407title: column.disallow-changing-order- content: '"ALTER TABLE t CHANGE COLUMN a1 a int FIRST" changes column order'- line: 2+ content: |-+ "ALTER TABLE t CHANGE COLUMN a1 a int FIRST+ ;" changes column order+ line: 3details: ""- statement: |-CREATE TABLE t(a int, b int);@@ -35,8 +39,10 @@- status: WARNcode: 407title: column.disallow-changing-order- content: '"ALTER TABLE t MODIFY COLUMN a int AFTER b" changes column order'- line: 2+ content: |-+ "ALTER TABLE t MODIFY COLUMN a int AFTER b+ ;" changes column order+ line: 3details: ""- statement: |-CREATE TABLE t(a1 int, b int);@@ -45,6 +51,8 @@- status: WARNcode: 407title: column.disallow-changing-order- content: '"ALTER TABLE t CHANGE COLUMN a1 a int AFTER b" changes column order'- line: 2+ content: |-+ "ALTER TABLE t CHANGE COLUMN a1 a int AFTER b+ ;" changes column order+ line: 3details: ""diff --git a/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml b/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yamlindex 781d8e6431..7125519720 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml@@ -21,30 +21,38 @@- status: WARNcode: 414title: column.disallow-set-charset- content: Disallow set column charset but "CREATE TABLE t(a varchar(20) CHARSET ascii)" does- line: 1+ content: |-+ Disallow set column charset but "CREATE TABLE t(a varchar(20) CHARSET ascii)+ ;" does+ line: 2details: ""- statement: ALTER TABLE tech_book ADD COLUMN a varchar(20) CHARSET asciiwant:- status: WARNcode: 414title: column.disallow-set-charset- content: Disallow set column charset but "ALTER TABLE tech_book ADD COLUMN a varchar(20) CHARSET ascii" does- line: 1+ content: |-+ Disallow set column charset but "ALTER TABLE tech_book ADD COLUMN a varchar(20) CHARSET ascii+ ;" does+ line: 2details: ""- statement: ALTER TABLE tech_book MODIFY COLUMN id varchar(20) CHARSET asciiwant:- status: WARNcode: 414title: column.disallow-set-charset- content: Disallow set column charset but "ALTER TABLE tech_book MODIFY COLUMN id varchar(20) CHARSET ascii" does- line: 1+ content: |-+ Disallow set column charset but "ALTER TABLE tech_book MODIFY COLUMN id varchar(20) CHARSET ascii+ ;" does+ line: 2details: ""- statement: ALTER TABLE tech_book CHANGE COLUMN name name varchar(20) CHARSET asciiwant:- status: WARNcode: 414title: column.disallow-set-charset- content: Disallow set column charset but "ALTER TABLE tech_book CHANGE COLUMN name name varchar(20) CHARSET ascii" does- line: 1+ content: |-+ Disallow set column charset but "ALTER TABLE tech_book CHANGE COLUMN name name varchar(20) CHARSET ascii+ ;" does+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml b/backend/plugin/advisor/mysql/test/column_maximum_character_length.yamlindex 7aa1b02db1..a826b65ac6 100644--- a/backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml+++ b/backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml@@ -28,7 +28,7 @@code: 415title: column.maximum-character-lengthcontent: The length of the CHAR column `name_2` is bigger than 20, please use VARCHAR instead- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book CHANGE COLUMN name name char(225)want:@@ -36,7 +36,7 @@code: 415title: column.maximum-character-lengthcontent: The length of the CHAR column `name` is bigger than 20, please use VARCHAR instead- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book MODIFY COLUMN name char(225)want:@@ -44,5 +44,5 @@code: 415title: column.maximum-character-lengthcontent: The length of the CHAR column `name` is bigger than 20, please use VARCHAR instead- line: 1+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/column_no_null.yaml b/backend/plugin/advisor/mysql/test/column_no_null.yamlindex 38e3dd70f4..c91a3aa86d 100644--- a/backend/plugin/advisor/mysql/test/column_no_null.yaml+++ b/backend/plugin/advisor/mysql/test/column_no_null.yaml@@ -47,7 +47,7 @@code: 402title: column.no-nullcontent: '`book`.`id` cannot have NULL value'- line: 2+ line: 3details: ""- statement: |-CREATE TABLE book(a int NOT NULL);@@ -67,7 +67,7 @@code: 402title: column.no-nullcontent: '`book`.`name` cannot have NULL value'- line: 2+ line: 3details: ""- statement: |-CREATE TABLE book(id int NOT NULL);diff --git a/backend/plugin/advisor/mysql/test/column_require_default.yaml b/backend/plugin/advisor/mysql/test/column_require_default.yamlindex 342755ca06..ed80fca205 100644--- a/backend/plugin/advisor/mysql/test/column_require_default.yaml+++ b/backend/plugin/advisor/mysql/test/column_require_default.yaml@@ -33,5 +33,5 @@code: 420title: column.require-defaultcontent: Column `tech_book`.`a` doesn't have DEFAULT.- line: 3+ line: 4details: ""diff --git a/backend/plugin/advisor/mysql/test/column_required.yaml b/backend/plugin/advisor/mysql/test/column_required.yamlindex 09ae6cf94d..fe2b0c2998 100644--- a/backend/plugin/advisor/mysql/test/column_required.yaml+++ b/backend/plugin/advisor/mysql/test/column_required.yaml@@ -4,7 +4,7 @@code: 401title: column.requiredcontent: 'Table `book` requires columns: created_ts, creator_id, updated_ts, updater_id'- line: 1+ line: 2details: ""- statement: |-CREATE TABLE book(@@ -33,7 +33,7 @@code: 401title: column.requiredcontent: 'Table `book` requires columns: creator_id'- line: 7+ line: 8details: ""- statement: |-CREATE TABLE book(@@ -63,7 +63,7 @@code: 401title: column.requiredcontent: 'Table `book` requires columns: creator_id'- line: 7+ line: 8details: ""- statement: |-CREATE TABLE book(@@ -93,7 +93,7 @@code: 401title: column.requiredcontent: 'Table `book` requires columns: creator_id'- line: 7+ line: 8details: ""- statement: |-CREATE TABLE book(@@ -161,7 +161,7 @@code: 401title: column.requiredcontent: 'Table `student` requires columns: creator_id, updater_id'- line: 9+ line: 10details: ""- statement: |-CREATE TABLE book(diff --git a/backend/plugin/advisor/mysql/test/column_set_default_for_not_null.yaml b/backend/plugin/advisor/mysql/test/column_set_default_for_not_null.yamlindex 3a4b70ffd8..169e70d0fc 100644--- a/backend/plugin/advisor/mysql/test/column_set_default_for_not_null.yaml+++ b/backend/plugin/advisor/mysql/test/column_set_default_for_not_null.yaml@@ -61,7 +61,7 @@code: 404title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULT- line: 2+ line: 3details: ""- statement: |-CREATE TABLE book(id int);@@ -71,7 +71,7 @@code: 404title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULT- line: 2+ line: 3details: ""- statement: |-CREATE TABLE book(id int);@@ -101,7 +101,7 @@code: 404title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULT- line: 2+ line: 3details: ""- statement: "\n\t\t\t\tCREATE TABLE book(uid int, id int);\n\t\t\t\tALTER TABLE book \n\t\t\t\t\tCHANGE COLUMN uid uid int NOT NULL DEFAULT 0,\n\t\t\t\t\tMODIFY COLUMN id int PRIMARY KEY DEFAULT 0,\n\t\t\t\t\tADD COLUMN name varchar(20) NOT NULL DEFAULT ''\n\t\t\t\t"want:diff --git a/backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml b/backend/plugin/advisor/mysql/test/column_type_disallow_list.yamlindex 2f6fb9e6d6..aa3d6dc244 100644--- a/backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml+++ b/backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml@@ -22,7 +22,7 @@code: 411title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` is- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(c int, b int);@@ -32,5 +32,5 @@code: 411title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` is- line: 2+ line: 3details: ""diff --git a/backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml b/backend/plugin/advisor/mysql/test/database_drop_empty_database.yamlindex ddaa830fbb..c5b2d15f6a 100644--- a/backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml+++ b/backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml@@ -4,5 +4,5 @@code: 701title: database.drop-empty-databasecontent: Database `test` is not allowed to drop if not empty- line: 1+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml b/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yamlindex 94eba64411..70190f0dda 100644--- a/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml+++ b/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml@@ -19,8 +19,10 @@- status: WARNcode: 501title: engine.mysql.use-innodb- content: '"CREATE TABLE book(id int) ENGINE = CSV" doesn''t use InnoDB engine'- line: 1+ content: |-+ "CREATE TABLE book(id int) ENGINE = CSV+ ;" doesn't use InnoDB engine+ line: 2details: ""- statement: ALTER TABLE tech_book ENGINE = INNODBwant:@@ -35,8 +37,10 @@- status: WARNcode: 501title: engine.mysql.use-innodb- content: '"ALTER TABLE tech_book ENGINE = CSV" doesn''t use InnoDB engine'- line: 1+ content: |-+ "ALTER TABLE tech_book ENGINE = CSV+ ;" doesn't use InnoDB engine+ line: 2details: ""- statement: SET default_storage_engine=INNODBwant:@@ -51,6 +55,8 @@- status: WARNcode: 501title: engine.mysql.use-innodb- content: '"SET default_storage_engine=CSV" doesn''t use InnoDB engine'- line: 1+ content: |-+ "SET default_storage_engine=CSV+ ;" doesn't use InnoDB engine+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/index_key_number_limit.yaml b/backend/plugin/advisor/mysql/test/index_key_number_limit.yamlindex fed362f8a2..bab83ee30a 100644--- a/backend/plugin/advisor/mysql/test/index_key_number_limit.yaml+++ b/backend/plugin/advisor/mysql/test/index_key_number_limit.yaml@@ -26,7 +26,7 @@code: 802title: index.key-number-limitcontent: The number of index `idx` in table `t` should be not greater than 5- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int, b int, c int, d int, e int, f int, g int);@@ -36,7 +36,7 @@code: 802title: index.key-number-limitcontent: The number of index `uk` in table `t` should be not greater than 5- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int, b int, c int, d int, e int, f int, g int);@@ -46,5 +46,5 @@code: 802title: index.key-number-limitcontent: The number of index `uk` in table `t` should be not greater than 5- line: 2+ line: 3details: ""diff --git a/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml b/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yamlindex 8daa2383fe..c16e93b8f3 100644--- a/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml+++ b/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml@@ -25,7 +25,7 @@code: 812title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -35,7 +35,7 @@code: 812title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -45,7 +45,7 @@code: 812title: index.no-duplicate-columncontent: PRIMARY KEY `pk_a` has duplicate column `t`.`a`- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -55,7 +55,7 @@code: 812title: index.no-duplicate-columncontent: UNIQUE KEY `uk_a` has duplicate column `t`.`a`- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -65,5 +65,5 @@code: 812title: index.no-duplicate-columncontent: FOREIGN KEY `fk_a` has duplicate column `t`.`a`- line: 2+ line: 3details: ""diff --git a/backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml b/backend/plugin/advisor/mysql/test/index_pk_type_limit.yamlindex 24627976e5..96e9f4f70c 100644--- a/backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml+++ b/backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml@@ -60,7 +60,7 @@code: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -80,7 +80,7 @@code: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -90,13 +90,13 @@code: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)- line: 2+ line: 3details: ""- status: WARNcode: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -126,7 +126,7 @@code: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(id INT, id2 VARCHAR(5), id3 VARCHAR(5));@@ -136,13 +136,13 @@code: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)- line: 2+ line: 3details: ""- status: WARNcode: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(id INT, id2 BIGINT);@@ -172,7 +172,7 @@code: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(id int);@@ -192,7 +192,7 @@code: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(id int);diff --git a/backend/plugin/advisor/mysql/test/index_primary_key_type_allowlist.yaml b/backend/plugin/advisor/mysql/test/index_primary_key_type_allowlist.yamlindex f146fb554a..6b7fc068ea 100644--- a/backend/plugin/advisor/mysql/test/index_primary_key_type_allowlist.yaml+++ b/backend/plugin/advisor/mysql/test/index_primary_key_type_allowlist.yaml@@ -60,7 +60,7 @@code: 803title: index.primary-key-type-allowlistcontent: The column `id` in table `t` is one of the primary key, but its type "varchar" is not in allowlist- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -80,7 +80,7 @@code: 803title: index.primary-key-type-allowlistcontent: The column `id` in table `t` is one of the primary key, but its type "varchar" is not in allowlist- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -90,13 +90,13 @@code: 803title: index.primary-key-type-allowlistcontent: The column `id2` in table `t` is one of the primary key, but its type "varchar" is not in allowlist- line: 2+ line: 3details: ""- status: WARNcode: 803title: index.primary-key-type-allowlistcontent: The column `id3` in table `t` is one of the primary key, but its type "varchar" is not in allowlist- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -126,7 +126,7 @@code: 803title: index.primary-key-type-allowlistcontent: The column `id` in table `t` is one of the primary key, but its type "varchar" is not in allowlist- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(id INT, id2 VARCHAR(5), id3 VARCHAR(5));@@ -136,13 +136,13 @@code: 803title: index.primary-key-type-allowlistcontent: The column `id2` in table `t` is one of the primary key, but its type "varchar" is not in allowlist- line: 2+ line: 3details: ""- status: WARNcode: 803title: index.primary-key-type-allowlistcontent: The column `id3` in table `t` is one of the primary key, but its type "varchar" is not in allowlist- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(id INT, id2 BIGINT);@@ -172,7 +172,7 @@code: 803title: index.primary-key-type-allowlistcontent: The column `id` in table `t` is one of the primary key, but its type "varchar" is not in allowlist- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(id int);@@ -192,7 +192,7 @@code: 803title: index.primary-key-type-allowlistcontent: The column `id2` in table `t` is one of the primary key, but its type "varchar" is not in allowlist- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(id int);diff --git a/backend/plugin/advisor/mysql/test/index_total_number_limit.yaml b/backend/plugin/advisor/mysql/test/index_total_number_limit.yamlindex ddb832a98c..70ba0fc71d 100644--- a/backend/plugin/advisor/mysql/test/index_total_number_limit.yaml+++ b/backend/plugin/advisor/mysql/test/index_total_number_limit.yaml@@ -25,7 +25,7 @@code: 813title: index.total-number-limitcontent: The count of index in table `tech_book` should be no more than 5, but found 8- line: 5+ line: 6details: ""- statement: |-CREATE TABLE t(a int PRIMARY KEY, b int, c int);@@ -39,7 +39,7 @@code: 813title: index.total-number-limitcontent: The count of index in table `t` should be no more than 5, but found 6- line: 6+ line: 7details: ""- statement: |-CREATE TABLE t(@@ -56,5 +56,5 @@code: 813title: index.total-number-limitcontent: The count of index in table `t` should be no more than 5, but found 6- line: 9+ line: 10details: ""diff --git a/backend/plugin/advisor/mysql/test/index_type_no_blob.yaml b/backend/plugin/advisor/mysql/test/index_type_no_blob.yamlindex 0442d9a067..184a472765 100644--- a/backend/plugin/advisor/mysql/test/index_type_no_blob.yaml+++ b/backend/plugin/advisor/mysql/test/index_type_no_blob.yaml@@ -82,7 +82,7 @@code: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blob- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -92,19 +92,19 @@code: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blob- line: 2+ line: 3details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblob- line: 2+ line: 3details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblob- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -114,19 +114,19 @@code: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blob- line: 2+ line: 3details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblob- line: 2+ line: 3details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblob- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);diff --git a/backend/plugin/advisor/mysql/test/naming_column.yaml b/backend/plugin/advisor/mysql/test/naming_column.yamlindex 1ce2ecf64c..97e0bc8a28 100644--- a/backend/plugin/advisor/mysql/test/naming_column.yaml+++ b/backend/plugin/advisor/mysql/test/naming_column.yaml@@ -30,7 +30,7 @@code: 302title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'- line: 2+ line: 3details: ""- statement: ALTER TABLE tech_book RENAME COLUMN id TO creator_id;want:@@ -53,7 +53,7 @@code: 302title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'- line: 7+ line: 8details: ""- statement: ALTER TABLE tech_book CHANGE COLUMN id creator_id int;want:@@ -83,7 +83,7 @@code: 302title: naming.columncontent: '`book`.`contentString` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'- line: 6+ line: 7details: ""- statement: |-CREATE TABLE book(diff --git a/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml b/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yamlindex 3201a6a383..29e0a0dc10 100644--- a/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml+++ b/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml@@ -20,7 +20,7 @@code: 307title: naming.column.auto-incrementcontent: '`tech_book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book CHANGE COLUMN id a int AUTO_INCREMENTwant:@@ -28,7 +28,7 @@code: 307title: naming.column.auto-incrementcontent: '`tech_book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book MODIFY COLUMN name int AUTO_INCREMENTwant:@@ -36,5 +36,5 @@code: 307title: naming.column.auto-incrementcontent: '`tech_book`.`name` mismatches auto_increment column naming convention, naming format should be "^id$"'- line: 1+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/naming_index_fk.yaml b/backend/plugin/advisor/mysql/test/naming_index_fk.yamlindex 112616d4c5..10a69d82d3 100644--- a/backend/plugin/advisor/mysql/test/naming_index_fk.yaml+++ b/backend/plugin/advisor/mysql/test/naming_index_fk.yaml@@ -12,7 +12,7 @@code: 305title: naming.index.fkcontent: Foreign key in table `tech_book` mismatches the naming convention, expect "^$|^fk_tech_book_author_id_author_id$" but found `fk_author_id`- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book ADD CONSTRAINT rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk FOREIGN KEY (author_id) REFERENCES author (id)want:@@ -20,13 +20,13 @@code: 305title: naming.index.fkcontent: Foreign key in table `tech_book` mismatches the naming convention, expect "^$|^fk_tech_book_author_id_author_id$" but found `rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk`- line: 1+ line: 2details: ""- status: WARNcode: 305title: naming.index.fkcontent: Foreign key `rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk` in table `tech_book` mismatches the naming convention, its length should be within 64 characters- line: 1+ line: 2details: ""- statement: CREATE TABLE book(id INT, author_id INT, FOREIGN KEY fk_book_author_id_author_id (author_id) REFERENCES author (id))want:diff --git a/backend/plugin/advisor/mysql/test/naming_index_idx.yaml b/backend/plugin/advisor/mysql/test/naming_index_idx.yamlindex 79a89fa586..378d44a3b5 100644--- a/backend/plugin/advisor/mysql/test/naming_index_idx.yaml+++ b/backend/plugin/advisor/mysql/test/naming_index_idx.yaml@@ -12,7 +12,7 @@code: 303title: naming.index.idxcontent: Index in table `tech_book` mismatches the naming convention, expect "^$|^idx_tech_book_id_name$" but found `tech_book_id_name`- line: 1+ line: 2details: ""- statement: CREATE INDEX afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw ON tech_book(id, name)want:@@ -20,13 +20,13 @@code: 303title: naming.index.idxcontent: Index in table `tech_book` mismatches the naming convention, expect "^$|^idx_tech_book_id_name$" but found `afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw`- line: 1+ line: 2details: ""- status: WARNcode: 303title: naming.index.idxcontent: Index `afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw` in table `tech_book` mismatches the naming convention, its length should be within 64 characters- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book RENAME INDEX old_index TO idx_tech_book_id_namewant:@@ -42,7 +42,7 @@code: 303title: naming.index.idxcontent: Index in table `tech_book` mismatches the naming convention, expect "^$|^idx_tech_book_id_name$" but found `idx_tech_book`- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book ADD INDEX idx_tech_book_id_name (id, name)want:@@ -58,7 +58,7 @@code: 303title: naming.index.idxcontent: Index in table `tech_book` mismatches the naming convention, expect "^$|^idx_tech_book_id_name$" but found `tech_book_id_name`- line: 1+ line: 2details: ""- statement: CREATE TABLE tech_book_copy(id INT PRIMARY KEY, name VARCHAR(20), INDEX idx_tech_book_copy_name (name))want:diff --git a/backend/plugin/advisor/mysql/test/naming_index_uk.yaml b/backend/plugin/advisor/mysql/test/naming_index_uk.yamlindex bb03ac33e9..9c02353147 100644--- a/backend/plugin/advisor/mysql/test/naming_index_uk.yaml+++ b/backend/plugin/advisor/mysql/test/naming_index_uk.yaml@@ -12,7 +12,7 @@code: 304title: naming.index.ukcontent: Unique key in table `tech_book` mismatches the naming convention, expect "^$|^uk_tech_book_id_name$" but found `tech_book_id_name`- line: 1+ line: 2details: ""- statement: CREATE UNIQUE INDEX qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy ON tech_book(id, name)want:@@ -20,13 +20,13 @@code: 304title: naming.index.ukcontent: Unique key in table `tech_book` mismatches the naming convention, expect "^$|^uk_tech_book_id_name$" but found `qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy`- line: 1+ line: 2details: ""- status: WARNcode: 304title: naming.index.ukcontent: Unique key `qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy` in table `tech_book` mismatches the naming convention, its length should be within 64 characters- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book ADD UNIQUE uk_tech_book_id_name (id, name)want:@@ -42,7 +42,7 @@code: 304title: naming.index.ukcontent: Unique key in table `tech_book` mismatches the naming convention, expect "^$|^uk_tech_book_id_name$" but found `tech_book_id_name`- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book RENAME INDEX old_uk TO uk_tech_book_id_namewant:@@ -58,7 +58,7 @@code: 304title: naming.index.ukcontent: Unique key in table `tech_book` mismatches the naming convention, expect "^$|^uk_tech_book_id_name$" but found `uk_tech_book`- line: 1+ line: 2details: ""- statement: CREATE TABLE book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE INDEX uk_book_name (name))want:diff --git a/backend/plugin/advisor/mysql/test/naming_table.yaml b/backend/plugin/advisor/mysql/test/naming_table.yamlindex a7e411fef3..d7678b4175 100644--- a/backend/plugin/advisor/mysql/test/naming_table.yaml+++ b/backend/plugin/advisor/mysql/test/naming_table.yaml@@ -4,7 +4,7 @@code: 301title: naming.tablecontent: '`techBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'- line: 1+ line: 2details: ""- statement: CREATE TABLE tech_book_copy(id int, name varchar(255))want:@@ -20,7 +20,7 @@code: 301title: naming.tablecontent: '`cjnubexocfhqoogdmihudyahmmghviqkzvpixnwvxtxumvuannpwdcbtsgwrvzpde` mismatches table naming convention, its length should be within 64 characters'- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book RENAME TO TechBookwant:@@ -28,7 +28,7 @@code: 301title: naming.tablecontent: '`TechBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book RENAME TO tech_book_copywant:@@ -44,7 +44,7 @@code: 301title: naming.tablecontent: '`LiteraryBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'- line: 1+ line: 2details: ""- statement: CREATE TABLE literary_book(a int);RENAME TABLE tech_book TO TechBook, literary_book TO LiteraryBookwant:@@ -52,13 +52,13 @@code: 301title: naming.tablecontent: '`TechBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'- line: 1+ line: 2details: ""- status: WARNcode: 301title: naming.tablecontent: '`LiteraryBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'- line: 1+ line: 2details: ""- statement: CREATE TABLE literary_book(a int);RENAME TABLE tech_book TO tech_book_copy, literary_book TO literary_book_copywant:diff --git a/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml b/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yamlindex c75a85a891..4513d1535f 100644--- a/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml+++ b/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml@@ -3,38 +3,48 @@- status: WARNcode: 111title: schema.backward-compatibility- content: '"ALTER TABLE tech_book CHANGE name f2 TEXT" may cause incompatibility with the existing data and code'- line: 1+ content: |-+ "ALTER TABLE tech_book CHANGE name f2 TEXT+ ;" may cause incompatibility with the existing data and code+ line: 2details: ""- statement: ALTER TABLE tech_book MODIFY name TEXTwant:- status: WARNcode: 111title: schema.backward-compatibility- content: '"ALTER TABLE tech_book MODIFY name TEXT" may cause incompatibility with the existing data and code'- line: 1+ content: |-+ "ALTER TABLE tech_book MODIFY name TEXT+ ;" may cause incompatibility with the existing data and code+ line: 2details: ""- statement: ALTER TABLE tech_book MODIFY name TEXT NULLwant:- status: WARNcode: 111title: schema.backward-compatibility- content: '"ALTER TABLE tech_book MODIFY name TEXT NULL" may cause incompatibility with the existing data and code'- line: 1+ content: |-+ "ALTER TABLE tech_book MODIFY name TEXT NULL+ ;" may cause incompatibility with the existing data and code+ line: 2details: ""- statement: ALTER TABLE tech_book MODIFY name TEXT NOT NULLwant:- status: WARNcode: 111title: schema.backward-compatibility- content: '"ALTER TABLE tech_book MODIFY name TEXT NOT NULL" may cause incompatibility with the existing data and code'- line: 1+ content: |-+ "ALTER TABLE tech_book MODIFY name TEXT NOT NULL+ ;" may cause incompatibility with the existing data and code+ line: 2details: ""- statement: ALTER TABLE tech_book MODIFY name TEXT COMMENT 'bla'want:- status: WARNcode: 111title: schema.backward-compatibility- content: '"ALTER TABLE tech_book MODIFY name TEXT COMMENT ''bla''" may cause incompatibility with the existing data and code'- line: 1+ content: |-+ "ALTER TABLE tech_book MODIFY name TEXT COMMENT 'bla'+ ;" may cause incompatibility with the existing data and code+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_commit.yamlindex fcf79a651d..07b523e8d7 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml@@ -6,8 +6,10 @@- status: WARNcode: 206title: statement.disallow-commit- content: 'Commit is not allowed, related statement: "COMMIT;"'- line: 3+ content: |-+ Commit is not allowed, related statement: "COMMIT+ ;"+ line: 4details: ""- statement: |-START TRANSACTION;@@ -27,6 +29,8 @@- status: WARNcode: 206title: statement.disallow-commit- content: 'Commit is not allowed, related statement: "COMMIT;"'- line: 7+ content: |-+ Commit is not allowed, related statement: "COMMIT+ ;"+ line: 8details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_limit.yamlindex d136ed57ac..71b6916a92 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml@@ -11,30 +11,38 @@- status: WARNcode: 1103title: statement.disallow-limit- content: LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "INSERT INTO tech_book SELECT * FROM tech_book LIMIT 1" uses- line: 1+ content: |-+ LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "INSERT INTO tech_book SELECT * FROM tech_book LIMIT 1+ ;" uses+ line: 2details: ""- statement: INSERT INTO tech_book SELECT * FROM tech_book UNION SELECT * FROM tech_book LIMIT 1want:- status: WARNcode: 1103title: statement.disallow-limit- content: LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "INSERT INTO tech_book SELECT * FROM tech_book UNION SELECT * FROM tech_book LIMIT 1" uses- line: 1+ content: |-+ LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "INSERT INTO tech_book SELECT * FROM tech_book UNION SELECT * FROM tech_book LIMIT 1+ ;" uses+ line: 2details: ""- statement: UPDATE tech_book SET name = 'my name' LIMIT 10want:- status: WARNcode: 1102title: statement.disallow-limit- content: LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "UPDATE tech_book SET name = 'my name' LIMIT 10" uses- line: 1+ content: |-+ LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "UPDATE tech_book SET name = 'my name' LIMIT 10+ ;" uses+ line: 2details: ""- statement: DELETE FROM tech_book LIMIT 10want:- status: WARNcode: 1106title: statement.disallow-limit- content: LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "DELETE FROM tech_book LIMIT 10" uses- line: 1+ content: |-+ LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "DELETE FROM tech_book LIMIT 10+ ;" uses+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yamlindex e9f45b9e6a..06853d65b6 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml@@ -11,14 +11,18 @@- status: WARNcode: 1104title: statement.disallow-order-by- content: ORDER BY clause is forbidden in DELETE and UPDATE statements, but "UPDATE tech_book SET name = 'my name' ORDER BY id" uses- line: 1+ content: |-+ ORDER BY clause is forbidden in DELETE and UPDATE statements, but "UPDATE tech_book SET name = 'my name' ORDER BY id+ ;" uses+ line: 2details: ""- statement: DELETE FROM tech_book ORDER BY idwant:- status: WARNcode: 1105title: statement.disallow-order-by- content: ORDER BY clause is forbidden in DELETE and UPDATE statements, but "DELETE FROM tech_book ORDER BY id" uses- line: 1+ content: |-+ ORDER BY clause is forbidden in DELETE and UPDATE statements, but "DELETE FROM tech_book ORDER BY id+ ;" uses+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_insert_disallow_order_by_rand.yaml b/backend/plugin/advisor/mysql/test/statement_insert_disallow_order_by_rand.yamlindex 79a825f657..2180032bc7 100644--- a/backend/plugin/advisor/mysql/test/statement_insert_disallow_order_by_rand.yaml+++ b/backend/plugin/advisor/mysql/test/statement_insert_disallow_order_by_rand.yaml@@ -11,6 +11,8 @@- status: WARNcode: 1108title: statement.insert.disallow-order-by-rand- content: '"INSERT INTO tech_book SELECT * FROM tech_book ORDER BY rand()" uses ORDER BY RAND in the INSERT statement'- line: 1+ content: |-+ "INSERT INTO tech_book SELECT * FROM tech_book ORDER BY rand()+ ;" uses ORDER BY RAND in the INSERT statement+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_insert_must_specify_column.yaml b/backend/plugin/advisor/mysql/test/statement_insert_must_specify_column.yamlindex ed3beaefcf..c6a5a25d87 100644--- a/backend/plugin/advisor/mysql/test/statement_insert_must_specify_column.yaml+++ b/backend/plugin/advisor/mysql/test/statement_insert_must_specify_column.yaml@@ -11,6 +11,8 @@- status: WARNcode: 1107title: statement.insert.must-specify-column- content: The INSERT statement must specify columns but "INSERT INTO tech_book VALUES (1, '1')" does not- line: 1+ content: |-+ The INSERT statement must specify columns but "INSERT INTO tech_book VALUES (1, '1')+ ;" does not+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml b/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yamlindex eadd625df6..82dc610691 100644--- a/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml+++ b/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml@@ -11,8 +11,10 @@- status: WARNcode: 1101title: statement.insert.row-limit- content: '"INSERT INTO tech_book values(1, ''a''), (2, ''b''), (3, ''c''), (4, ''d''), (5, ''e''), (6, ''f'')" inserts 6 rows. The count exceeds 5.'- line: 1+ content: |-+ "INSERT INTO tech_book values(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')+ ;" inserts 6 rows. The count exceeds 5.+ line: 2details: ""- statement: INSERT INTO tech_book SELECT * FROM tech_bookwant:diff --git a/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml b/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yamlindex bd31e8960c..5f32202d5d 100644--- a/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml+++ b/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml@@ -14,7 +14,7 @@code: 207title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -32,7 +32,7 @@code: 207title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`- line: 4+ line: 5details: ""- statement: |-CREATE TABLE t(a int);@@ -50,5 +50,5 @@code: 207title: statement.merge-alter-tablecontent: There are 2 statements to modify table `t`- line: 4+ line: 5details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_select_no_select_all.yaml b/backend/plugin/advisor/mysql/test/statement_select_no_select_all.yamlindex 4f12df0613..79fd5cf005 100644--- a/backend/plugin/advisor/mysql/test/statement_select_no_select_all.yaml+++ b/backend/plugin/advisor/mysql/test/statement_select_no_select_all.yaml@@ -3,8 +3,10 @@- status: WARNcode: 203title: statement.select.no-select-all- content: '"SELECT * FROM t" uses SELECT all'- line: 1+ content: |-+ "SELECT * FROM t+ ;" uses SELECT all+ line: 2details: ""- statement: SELECT a, b FROM twant:@@ -19,6 +21,8 @@- status: WARNcode: 203title: statement.select.no-select-all- content: '"SELECT a, b FROM (SELECT * from t1 JOIN t2) t" uses SELECT all'- line: 1+ content: |-+ "SELECT a, b FROM (SELECT * from t1 JOIN t2) t+ ;" uses SELECT all+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_where_no_leading_wildcard_like.yaml b/backend/plugin/advisor/mysql/test/statement_where_no_leading_wildcard_like.yamlindex 0765d6e4d9..9827bafcfa 100644--- a/backend/plugin/advisor/mysql/test/statement_where_no_leading_wildcard_like.yaml+++ b/backend/plugin/advisor/mysql/test/statement_where_no_leading_wildcard_like.yaml@@ -11,30 +11,38 @@- status: WARNcode: 204title: statement.where.no-leading-wildcard-like- content: '"SELECT * FROM t WHERE a LIKE ''%abc''" uses leading wildcard LIKE'- line: 1+ content: |-+ "SELECT * FROM t WHERE a LIKE '%abc'+ ;" uses leading wildcard LIKE+ line: 2details: ""- statement: SELECT * FROM t WHERE a LIKE 'abc' OR a LIKE '%abc'want:- status: WARNcode: 204title: statement.where.no-leading-wildcard-like- content: '"SELECT * FROM t WHERE a LIKE ''abc'' OR a LIKE ''%abc''" uses leading wildcard LIKE'- line: 1+ content: |-+ "SELECT * FROM t WHERE a LIKE 'abc' OR a LIKE '%abc'+ ;" uses leading wildcard LIKE+ line: 2details: ""- statement: SELECT * FROM t WHERE a LIKE '%acc' OR a LIKE '%abc'want:- status: WARNcode: 204title: statement.where.no-leading-wildcard-like- content: '"SELECT * FROM t WHERE a LIKE ''%acc'' OR a LIKE ''%abc''" uses leading wildcard LIKE'- line: 1+ content: |-+ "SELECT * FROM t WHERE a LIKE '%acc' OR a LIKE '%abc'+ ;" uses leading wildcard LIKE+ line: 2details: ""- statement: SELECT * FROM (SELECT * FROM t WHERE a LIKE '%acc' OR a LIKE '%abc') t1want:- status: WARNcode: 204title: statement.where.no-leading-wildcard-like- content: '"SELECT * FROM (SELECT * FROM t WHERE a LIKE ''%acc'' OR a LIKE ''%abc'') t1" uses leading wildcard LIKE'- line: 1+ content: |-+ "SELECT * FROM (SELECT * FROM t WHERE a LIKE '%acc' OR a LIKE '%abc') t1+ ;" uses leading wildcard LIKE+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_where_require.yaml b/backend/plugin/advisor/mysql/test/statement_where_require.yamlindex af4064bd2c..71011e6780 100644--- a/backend/plugin/advisor/mysql/test/statement_where_require.yaml+++ b/backend/plugin/advisor/mysql/test/statement_where_require.yaml@@ -11,16 +11,20 @@- status: WARNcode: 202title: statement.where.require- content: '"DELETE FROM tech_book" requires WHERE clause'- line: 1+ content: |-+ "DELETE FROM tech_book+ ;" requires WHERE clause+ line: 2details: ""- statement: UPDATE tech_book SET id = 1want:- status: WARNcode: 202title: statement.where.require- content: '"UPDATE tech_book SET id = 1" requires WHERE clause'- line: 1+ content: |-+ "UPDATE tech_book SET id = 1+ ;" requires WHERE clause+ line: 2details: ""- statement: DELETE FROM tech_book WHERE id > 0want:@@ -43,8 +47,10 @@- status: WARNcode: 202title: statement.where.require- content: '"SELECT id FROM tech_book" requires WHERE clause'- line: 1+ content: |-+ "SELECT id FROM tech_book+ ;" requires WHERE clause+ line: 2details: ""- statement: SELECT id FROM tech_book WHERE id > 0want:@@ -59,6 +65,8 @@- status: WARNcode: 202title: statement.where.require- content: '"SELECT id FROM tech_book WHERE id > (SELECT max(id) FROM tech_book)" requires WHERE clause'- line: 1+ content: |-+ "SELECT id FROM tech_book WHERE id > (SELECT max(id) FROM tech_book)+ ;" requires WHERE clause+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml b/backend/plugin/advisor/mysql/test/system_charset_allowlist.yamlindex a2569b3553..4576406ec7 100644--- a/backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml+++ b/backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml@@ -19,8 +19,10 @@- status: WARNcode: 1001title: system.charset.allowlist- content: '"CREATE TABLE t(a int) CHARSET ascii" used disabled charset ''ascii'''- line: 1+ content: |-+ "CREATE TABLE t(a int) CHARSET ascii+ ;" used disabled charset 'ascii'+ line: 2details: ""- statement: |-CREATE TABLE t(a int);@@ -29,23 +31,29 @@- status: WARNcode: 1001title: system.charset.allowlist- content: '"ALTER TABLE t CHARSET ascii" used disabled charset ''ascii'''- line: 2+ content: |-+ "ALTER TABLE t CHARSET ascii+ ;" used disabled charset 'ascii'+ line: 3details: ""- statement: ALTER DATABASE test CHARSET asciiwant:- status: WARNcode: 1001title: system.charset.allowlist- content: '"ALTER DATABASE test CHARSET ascii" used disabled charset ''ascii'''- line: 1+ content: |-+ "ALTER DATABASE test CHARSET ascii+ ;" used disabled charset 'ascii'+ line: 2details: ""- statement: CREATE TABLE t(a varchar(255) CHARSET ascii)want:- status: WARNcode: 1001title: system.charset.allowlist- content: '"CREATE TABLE t(a varchar(255) CHARSET ascii)" used disabled charset ''ascii'''+ content: |-+ "CREATE TABLE t(a varchar(255) CHARSET ascii)+ ;" used disabled charset 'ascii'line: 1details: ""- statement: |-@@ -55,8 +63,10 @@- status: WARNcode: 1001title: system.charset.allowlist- content: '"ALTER TABLE t ADD COLUMN a varchar(255) CHARSET ascii" used disabled charset ''ascii'''- line: 2+ content: |-+ "ALTER TABLE t ADD COLUMN a varchar(255) CHARSET ascii+ ;" used disabled charset 'ascii'+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -65,8 +75,10 @@- status: WARNcode: 1001title: system.charset.allowlist- content: '"ALTER TABLE t MODIFY COLUMN a varchar(255) CHARSET ascii" used disabled charset ''ascii'''- line: 2+ content: |-+ "ALTER TABLE t MODIFY COLUMN a varchar(255) CHARSET ascii+ ;" used disabled charset 'ascii'+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -75,8 +87,10 @@- status: WARNcode: 1001title: system.charset.allowlist- content: '"ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARSET ascii" used disabled charset ''ascii'''- line: 2+ content: |-+ "ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARSET ascii+ ;" used disabled charset 'ascii'+ line: 3details: ""- statement: /* this is a comment */want:diff --git a/backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml b/backend/plugin/advisor/mysql/test/system_collation_allowlist.yamlindex bdc6be1159..54e92ad233 100644--- a/backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml+++ b/backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml@@ -3,8 +3,10 @@- status: WARNcode: 1201title: system.collation.allowlist- content: '"CREATE TABLE t(a int) COLLATE utf8mb4_polish_ci" used disabled collation ''utf8mb4_polish_ci'''- line: 1+ content: |-+ "CREATE TABLE t(a int) COLLATE utf8mb4_polish_ci+ ;" used disabled collation 'utf8mb4_polish_ci'+ line: 2details: ""- statement: CREATE TABLE t(a varchar(255))want:@@ -19,8 +21,10 @@- status: WARNcode: 1201title: system.collation.allowlist- content: '"CREATE TABLE t(a int) COLLATE latin1_bin" used disabled collation ''latin1_bin'''- line: 1+ content: |-+ "CREATE TABLE t(a int) COLLATE latin1_bin+ ;" used disabled collation 'latin1_bin'+ line: 2details: ""- statement: |-CREATE TABLE t(a int);@@ -29,23 +33,29 @@- status: WARNcode: 1201title: system.collation.allowlist- content: '"ALTER TABLE t COLLATE latin1_bin" used disabled collation ''latin1_bin'''- line: 2+ content: |-+ "ALTER TABLE t COLLATE latin1_bin+ ;" used disabled collation 'latin1_bin'+ line: 3details: ""- statement: ALTER DATABASE test COLLATE latin1_binwant:- status: WARNcode: 1201title: system.collation.allowlist- content: '"ALTER DATABASE test COLLATE latin1_bin" used disabled collation ''latin1_bin'''- line: 1+ content: |-+ "ALTER DATABASE test COLLATE latin1_bin+ ;" used disabled collation 'latin1_bin'+ line: 2details: ""- statement: CREATE TABLE t(a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin)want:- status: WARNcode: 1201title: system.collation.allowlist- content: '"CREATE TABLE t(a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin)" used disabled collation ''latin1_bin'''+ content: |-+ "CREATE TABLE t(a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin)+ ;" used disabled collation 'latin1_bin'line: 1details: ""- statement: |-@@ -55,8 +65,10 @@- status: WARNcode: 1201title: system.collation.allowlist- content: '"ALTER TABLE t ADD COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin" used disabled collation ''latin1_bin'''- line: 2+ content: |-+ "ALTER TABLE t ADD COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin+ ;" used disabled collation 'latin1_bin'+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -65,8 +77,10 @@- status: WARNcode: 1201title: system.collation.allowlist- content: '"ALTER TABLE t MODIFY COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin" used disabled collation ''latin1_bin'''- line: 2+ content: |-+ "ALTER TABLE t MODIFY COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin+ ;" used disabled collation 'latin1_bin'+ line: 3details: ""- statement: |-CREATE TABLE t(a int);@@ -75,6 +89,8 @@- status: WARNcode: 1201title: system.collation.allowlist- content: '"ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin" used disabled collation ''latin1_bin'''- line: 2+ content: |-+ "ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin+ ;" used disabled collation 'latin1_bin'+ line: 3details: ""diff --git a/backend/plugin/advisor/mysql/test/table_comment.yaml b/backend/plugin/advisor/mysql/test/table_comment.yamlindex e9f1263ebd..6a2833b108 100644--- a/backend/plugin/advisor/mysql/test/table_comment.yaml+++ b/backend/plugin/advisor/mysql/test/table_comment.yaml@@ -4,7 +4,7 @@code: 606title: table.commentcontent: The length of table `t` comment should be within 10 characters- line: 1+ line: 2details: ""- statement: CREATE TABLE t(a int)want:@@ -12,7 +12,7 @@code: 605title: table.commentcontent: Table `t` requires comments- line: 1+ line: 2details: ""- statement: CREATE TABLE t(a int) COMMENT 'sdlfkjalkseblkjduafelbnlsdfkljayue'want:@@ -20,5 +20,5 @@code: 606title: table.commentcontent: The length of table `t` comment should be within 10 characters- line: 1+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/table_disallow_partition.yaml b/backend/plugin/advisor/mysql/test/table_disallow_partition.yamlindex 58fe721c39..0d5307a0ae 100644--- a/backend/plugin/advisor/mysql/test/table_disallow_partition.yaml+++ b/backend/plugin/advisor/mysql/test/table_disallow_partition.yaml@@ -19,8 +19,9 @@Table partition is forbidden, but "CREATE TABLE t(a int) PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (6),PARTITION p1 VALUES LESS THAN (11)- )" creates- line: 4+ )+ ;" creates+ line: 5details: ""- statement: |-ALTER TABLE tech_book PARTITION BY RANGE (a) (@@ -35,6 +36,7 @@Table partition is forbidden, but "ALTER TABLE tech_book PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (6),PARTITION p1 VALUES LESS THAN (11)- )" creates- line: 4+ )+ ;" creates+ line: 5details: ""diff --git a/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml b/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yamlindex a54ba29f54..0394c75b06 100644--- a/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml+++ b/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml@@ -12,7 +12,7 @@code: 603title: table.drop-naming-conventioncontent: '`foo` mismatches drop table naming convention, naming format should be "_delete$"'- line: 1+ line: 2details: ""- statement: DROP TABLE IF EXISTS foo_delete, barwant:@@ -20,5 +20,5 @@code: 603title: table.drop-naming-conventioncontent: '`bar` mismatches drop table naming convention, naming format should be "_delete$"'- line: 1+ line: 2details: ""diff --git a/backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml b/backend/plugin/advisor/mysql/test/table_no_foreign_key.yamlindex a612f5c79d..2657588ef9 100644--- a/backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml+++ b/backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml@@ -4,7 +4,7 @@code: 602title: table.no-foreign-keycontent: Foreign key is not allowed in the table `tech_book`- line: 1+ line: 2details: ""- statement: CREATE TABLE book(id INT, author_id INT, FOREIGN KEY fk_book_author_id_author_id (author_id) REFERENCES author (id))want:diff --git a/backend/plugin/advisor/mysql/test/table_require_pk.yaml b/backend/plugin/advisor/mysql/test/table_require_pk.yamlindex edcd895663..26a04ea666 100644--- a/backend/plugin/advisor/mysql/test/table_require_pk.yaml+++ b/backend/plugin/advisor/mysql/test/table_require_pk.yaml@@ -20,7 +20,7 @@code: 601title: table.require-pkcontent: Table `t` requires PRIMARY KEY- line: 1+ line: 2details: ""- statement: |-CREATE TABLE t(id INT);@@ -50,7 +50,7 @@code: 601title: table.require-pkcontent: Table `t` requires PRIMARY KEY- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(id INT PRIMARY KEY);@@ -60,7 +60,7 @@code: 601title: table.require-pkcontent: Table `t` requires PRIMARY KEY- line: 2+ line: 3details: ""- statement: |-CREATE TABLE t(id INT);@@ -126,7 +126,7 @@code: 601title: table.require-pkcontent: Table `t` requires PRIMARY KEY- line: 2+ line: 3details: ""- statement: ALTER TABLE tech_book ADD COLUMN a int, DROP COLUMN id, DROP COLUMN namewant:@@ -134,7 +134,7 @@code: 601title: table.require-pkcontent: Table `tech_book` requires PRIMARY KEY- line: 1+ line: 2details: ""- statement: ALTER TABLE tech_book DROP COLUMN namewant:@@ -152,5 +152,5 @@code: 601title: table.require-pkcontent: Table `tech_book` requires PRIMARY KEY- line: 2+ line: 3details: ""diff --git a/backend/plugin/advisor/oracle/test/column_required.yaml b/backend/plugin/advisor/oracle/test/column_required.yamlindex d1570ab96b..bca7ad4708 100644--- a/backend/plugin/advisor/oracle/test/column_required.yaml+++ b/backend/plugin/advisor/oracle/test/column_required.yaml@@ -4,7 +4,7 @@code: 401title: column.requiredcontent: 'Table "BOOK" requires columns: "created_ts", "creator_id", "updated_ts", "updater_id"'- line: 1+ line: 2details: ""- statement: |-CREATE TABLE book(@@ -28,7 +28,7 @@code: 401title: column.requiredcontent: 'Table "TECH_BOOK" requires columns: "creator_id"'- line: 2+ line: 3details: ""- statement: |-ALTER TABLE tech_book ADD "creator_id" int;@@ -38,5 +38,5 @@code: 401title: column.requiredcontent: 'Table "TECH_BOOK" requires columns: "creator_id"'- line: 2+ line: 3details: ""diff --git a/backend/plugin/advisor/oracle/test/table_require_pk.yaml b/backend/plugin/advisor/oracle/test/table_require_pk.yamlindex 6e4560e81f..86477bb71c 100644--- a/backend/plugin/advisor/oracle/test/table_require_pk.yaml+++ b/backend/plugin/advisor/oracle/test/table_require_pk.yaml@@ -20,7 +20,7 @@code: 601title: table.require-pkcontent: Table "SYS"."T" requires PRIMARY KEY.- line: 1+ line: 2details: ""- statement: |-CREATE TABLE t(id INT);diff --git a/backend/plugin/db/mysql/mysql_test.go b/backend/plugin/db/mysql/mysql_test.goindex c07d060132..2e199ac638 100644--- a/backend/plugin/db/mysql/mysql_test.go+++ b/backend/plugin/db/mysql/mysql_test.go@@ -14,7 +14,7 @@ func TestTransformDelimiter(t *testing.T) {}{{statement: "CREATE TABLE t1(id INT PRIMARY KEY);",- want: "CREATE TABLE t1(id INT PRIMARY KEY);",+ want: "CREATE TABLE t1(id INT PRIMARY KEY)\n;",},{statement: `@@ -103,5 +103,6 @@ func TestTransformDelimiter_Truncate(t *testing.T) {}require.Equal(t, 12, len(got))// Make sure all trunks add up.- require.Equal(t, total, len(statements))+ // 12 trunks + 1 delimiter+ require.Equal(t, total, len(statements)+1)}diff --git a/backend/plugin/parser/sql/differ/mysql/utils_test.go b/backend/plugin/parser/sql/differ/mysql/utils_test.goindex afce46725d..02ad128b72 100644--- a/backend/plugin/parser/sql/differ/mysql/utils_test.go+++ b/backend/plugin/parser/sql/differ/mysql/utils_test.go@@ -13,7 +13,7 @@ func TestTrigger(t *testing.T) {"CREATE DEFINER=`root`@`%` TRIGGER `ins_sum` BEFORE INSERT ON account FOR EACH ROW SET @sum = sum + NEW.amount * NEW.price;",want: "ALTER TABLE `account` ADD COLUMN `price` INT AFTER `amount`;\n\n" +"DROP TRIGGER IF EXISTS `ins_sum`;\n\n" +- "CREATE DEFINER=`root`@`%` TRIGGER `ins_sum` BEFORE INSERT ON account FOR EACH ROW SET @sum = sum + NEW.amount * NEW.price;\n\n",+ "CREATE DEFINER=`root`@`%` TRIGGER `ins_sum` BEFORE INSERT ON account FOR EACH ROW SET @sum = sum + NEW.amount * NEW.price\n;\n\n",},}testDiffWithoutDisableForeignKeyCheck(t, tests)@@ -28,7 +28,7 @@ func TestFunction(t *testing.T) {"BEGIN DECLARE a INT; SET a = v; SET a = a * 1 + 1; RETURN a; END ;\n",want: "DROP FUNCTION IF EXISTS `AddOne`;\n\n" +"CREATE DEFINER=`root`@`%` FUNCTION `AddOne`(v INT) RETURNS int\n" +- "BEGIN DECLARE a INT; SET a = v; SET a = a * 1 + 1; RETURN a; END ;\n\n",+ "BEGIN DECLARE a INT; SET a = v; SET a = a * 1 + 1; RETURN a; END\n;\n\n",},}testDiffWithoutDisableForeignKeyCheck(t, tests)@@ -52,7 +52,7 @@ func TestProcedure(t *testing.T) {"SQL SECURITY INVOKER\n" +"BEGIN\n" +"SELECT 'Number of accounts:', (COUNT(*)-1) FROM mysql.user;\n" +- "END ;\n\n",+ "END\n;\n\n",},}testDiffWithoutDisableForeignKeyCheck(t, tests)@@ -74,7 +74,8 @@ func TestEvent(t *testing.T) {`CREATE EVENT purge_old_usersON SCHEDULE EVERY 1 DAY STARTS '2023-07-01 00:00:00'DO- DELETE FROM users WHERE age > 110;+ DELETE FROM users WHERE age > 110+;`,},diff --git a/backend/plugin/parser/sql/mysql.go b/backend/plugin/parser/sql/mysql.goindex ab0d2e27cb..2078d9c642 100644--- a/backend/plugin/parser/sql/mysql.go+++ b/backend/plugin/parser/sql/mysql.go@@ -15,6 +15,7 @@ import (// ParseMySQL parses the given SQL statement and returns the AST.func ParseMySQL(statement string) (antlr.Tree, *antlr.CommonTokenStream, error) {// deal with delimiter if needed+ statement = strings.TrimRight(statement, " \r\n\t\f;") + "\n;"has, list, err := hasDelimiter(statement)if err != nil {return nil, nil, errdiff --git a/backend/plugin/parser/sql/mysql_test.go b/backend/plugin/parser/sql/mysql_test.goindex f87e94ebc3..7bf48b8261 100644--- a/backend/plugin/parser/sql/mysql_test.go+++ b/backend/plugin/parser/sql/mysql_test.go@@ -11,6 +11,13 @@ func TestMySQLParser(t *testing.T) {statement stringerrorMessage string}{+ {+ statement: "aaa",+ errorMessage: "line 1:0 extraneous input 'aaa' expecting {<EOF>, ALTER_SYMBOL, ANALYZE_SYMBOL, BEGIN_SYMBOL, BINLOG_SYMBOL, CACHE_SYMBOL, CALL_SYMBOL, CHANGE_SYMBOL, CHECKSUM_SYMBOL, CHECK_SYMBOL, COMMIT_SYMBOL, CREATE_SYMBOL, DEALLOCATE_SYMBOL, DELETE_SYMBOL, DESC_SYMBOL, DESCRIBE_SYMBOL, DO_SYMBOL, DROP_SYMBOL, EXECUTE_SYMBOL, EXPLAIN_SYMBOL, FLUSH_SYMBOL, FOR_SYMBOL, GET_SYMBOL, GRANT_SYMBOL, HANDLER_SYMBOL, HELP_SYMBOL, IMPORT_SYMBOL, INSERT_SYMBOL, INSTALL_SYMBOL, KILL_SYMBOL, LOAD_SYMBOL, LOCK_SYMBOL, OPTIMIZE_SYMBOL, PREPARE_SYMBOL, PURGE_SYMBOL, RELEASE_SYMBOL, RENAME_SYMBOL, REPAIR_SYMBOL, REPLACE_SYMBOL, RESET_SYMBOL, RESIGNAL_SYMBOL, REVOKE_SYMBOL, ROLLBACK_SYMBOL, SAVEPOINT_SYMBOL, SELECT_SYMBOL, SET_SYMBOL, SHOW_SYMBOL, SHUTDOWN_SYMBOL, SIGNAL_SYMBOL, START_SYMBOL, STOP_SYMBOL, TABLE_SYMBOL, TRUNCATE_SYMBOL, UNINSTALL_SYMBOL, UNLOCK_SYMBOL, UPDATE_SYMBOL, USE_SYMBOL, VALUES_SYMBOL, WITH_SYMBOL, XA_SYMBOL, CLONE_SYMBOL, RESTART_SYMBOL, ';', '('}",+ },+ {+ statement: "select * from t;\n -- comments",+ },{statement: "SELECT count(t.a) as TID from t1 as t;",},diff --git a/backend/plugin/parser/sql/plsql.go b/backend/plugin/parser/sql/plsql.goindex f1d764ad19..b0eaed080f 100644--- a/backend/plugin/parser/sql/plsql.go+++ b/backend/plugin/parser/sql/plsql.go@@ -411,7 +411,7 @@ func (*ParseErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa// ParsePLSQL parses the given PLSQL.func ParsePLSQL(sql string) (antlr.Tree, error) {// The antlr parser requires a semicolon at the end of the SQL.- sql = strings.TrimRight(sql, " \t\n\r\f;") + ";"+ sql = strings.TrimRight(sql, " \t\n\r\f;") + "\n;"lexer := parser.NewPlSqlLexer(antlr.NewInputStream(sql))steam := antlr.NewCommonTokenStream(lexer, 0)p := parser.NewPlSqlParser(steam)diff --git a/backend/plugin/parser/sql/split_multi_sql_test.go b/backend/plugin/parser/sql/split_multi_sql_test.goindex 08d611bfef..fdceaaae41 100644--- a/backend/plugin/parser/sql/split_multi_sql_test.go+++ b/backend/plugin/parser/sql/split_multi_sql_test.go@@ -343,8 +343,8 @@ func TestMySQLSplitMultiSQL(t *testing.T) {LastLine: 1,},{- Text: `select * from t;`,- LastLine: 3,+ Text: "select * from t\n;",+ LastLine: 4,},},},@@ -380,8 +380,9 @@ func TestMySQLSplitMultiSQL(t *testing.T) {RETURN income;- END ;`,- LastLine: 14,+ END+;`,+ LastLine: 15,},},},@@ -391,8 +392,8 @@ func TestMySQLSplitMultiSQL(t *testing.T) {want: resData{res: []SingleSQL{{- Text: bigSQL,- LastLine: 1,+ Text: bigSQL + "\n;",+ LastLine: 2,},},},@@ -406,8 +407,8 @@ func TestMySQLSplitMultiSQL(t *testing.T) {LastLine: 1,},{- Text: "CREATE TABLE t1(a int)",- LastLine: 1,+ Text: "CREATE TABLE t1(a int)\n;",+ LastLine: 2,},},},@@ -422,8 +423,8 @@ func TestMySQLSplitMultiSQL(t *testing.T) {LastLine: 1,},{- Text: "INSERT INTO `tech_Book` VALUES (0, 'abce_ksdf'), (1, 'lks''kjsafa\\'jdfl;\"ka');",- LastLine: 2,+ Text: "INSERT INTO `tech_Book` VALUES (0, 'abce_ksdf'), (1, 'lks''kjsafa\\'jdfl;\"ka')\n;",+ LastLine: 3,},},},@@ -447,8 +448,9 @@ func TestMySQLSplitMultiSQL(t *testing.T) {LastLine: 5,},{- Text: `INSERT INTO tech_Book VALUES (0, 'abce_ksdf'), (1, 'lks''kjsafa\'jdfl;"ka');`,- LastLine: 7,+ Text: `INSERT INTO tech_Book VALUES (0, 'abce_ksdf'), (1, 'lks''kjsafa\'jdfl;"ka')+;`,+ LastLine: 8,},},},@@ -480,8 +482,9 @@ func TestMySQLSplitMultiSQL(t *testing.T) {LastLine: 8,},{- Text: `SELECT @x;`,- LastLine: 9,+ Text: `SELECT @x+;`,+ LastLine: 10,},},},@@ -515,8 +518,8 @@ func TestMySQLSplitMultiSQL(t *testing.T) {LastLine: 9,},{- Text: `SELECT @x;`,- LastLine: 10,+ Text: "SELECT @x\n;",+ LastLine: 11,},},},@@ -531,8 +534,8 @@ func TestMySQLSplitMultiSQL(t *testing.T) {LastLine: 2,},{- Text: "CREATE TABLE t1(b int);",- LastLine: 3,+ Text: "CREATE TABLE t1(b int)\n;",+ LastLine: 4,},},},@@ -619,8 +622,9 @@ func TestMySQLSplitMultiSQLAndNormalize(t *testing.T) {Text: `CREATE PROCEDURE p2()BEGINSELECT count(*) from t;- END;`,- LastLine: 14,+ END+;`,+ LastLine: 15,},},},diff --git a/backend/plugin/parser/sql/transform/mysql/transform_test.go b/backend/plugin/parser/sql/transform/mysql/transform_test.goindex 41f30c5090..67c7d2f2af 100644--- a/backend/plugin/parser/sql/transform/mysql/transform_test.go+++ b/backend/plugin/parser/sql/transform/mysql/transform_test.go@@ -59,7 +59,7 @@ func TestTransform(t *testing.T) {"CREATE PROCEDURE p1()" + "\n" +" BEGIN" + "\n" +" SELECT * FROM t;" + "\n" +- " END;" + "\n" ++ " END\n;" + "\n" +"\n"a := require.New(t)diff --git a/backend/plugin/parser/sql/utils_test.go b/backend/plugin/parser/sql/utils_test.goindex cf17e3ad19..1ee5ed64d0 100644--- a/backend/plugin/parser/sql/utils_test.go+++ b/backend/plugin/parser/sql/utils_test.go@@ -29,7 +29,8 @@ func TestExtractTiDBUnsupportStmts(t *testing.T) {BEGININSERT INTO orders_audit(order_id, order_date, customer_id, order_amount)VALUES (NEW.order_id, NEW.order_date, NEW.customer_id, NEW.order_amount);- END;`,+ END+;`,},wantSupport: "CREATE TABLE t1(id INT);\n",wantErr: false,diff --git a/backend/runner/taskcheck/statement_type_executor_test.go b/backend/runner/taskcheck/statement_type_executor_test.goindex 0fe74ffd90..02702597d6 100644--- a/backend/runner/taskcheck/statement_type_executor_test.go+++ b/backend/runner/taskcheck/statement_type_executor_test.go@@ -23,7 +23,7 @@ type testData struct {func TestStatementTypeCheck(t *testing.T) {tests := []testData{{- stmt: "CREATE DATABASE db",+ stmt: "CREATE DATABASE db\n;",taskType: api.TaskDatabaseSchemaUpdate,want: []api.TaskCheckResult{{@@ -31,13 +31,13 @@ func TestStatementTypeCheck(t *testing.T) {Namespace: api.BBNamespace,Code: common.TaskTypeCreateDatabase.Int(),Title: "Cannot create database",- Content: "The statement \"CREATE DATABASE db\" creates database",+ Content: "The statement \"CREATE DATABASE db\n;\" creates database",},},},{- stmt: "DROP DATABASE db",+ stmt: "DROP DATABASE db\n;",taskType: api.TaskDatabaseSchemaUpdate,want: []api.TaskCheckResult{{@@ -45,12 +45,12 @@ func TestStatementTypeCheck(t *testing.T) {Namespace: api.BBNamespace,Code: common.TaskTypeDropDatabase.Int(),Title: "Cannot drop database",- Content: "The statement \"DROP DATABASE db\" drops database",+ Content: "The statement \"DROP DATABASE db\n;\" drops database",},},},{- stmt: "CREATE DATABASE db",+ stmt: "CREATE DATABASE db\n;",taskType: api.TaskDatabaseDataUpdate,want: []api.TaskCheckResult{{@@ -58,19 +58,19 @@ func TestStatementTypeCheck(t *testing.T) {Namespace: api.BBNamespace,Code: common.TaskTypeCreateDatabase.Int(),Title: "Cannot create database",- Content: "The statement \"CREATE DATABASE db\" creates database",+ Content: "The statement \"CREATE DATABASE db\n;\" creates database",},{Status: api.TaskCheckStatusWarn,Namespace: api.BBNamespace,Code: common.TaskTypeNotDML.Int(),Title: "Data change can only run DML",- Content: "\"CREATE DATABASE db\" is not DML",+ Content: "\"CREATE DATABASE db\n;\" is not DML",},},},{- stmt: "DROP DATABASE db",+ stmt: "DROP DATABASE db\n;",taskType: api.TaskDatabaseDataUpdate,want: []api.TaskCheckResult{{@@ -78,19 +78,19 @@ func TestStatementTypeCheck(t *testing.T) {Namespace: api.BBNamespace,Code: common.TaskTypeDropDatabase.Int(),Title: "Cannot drop database",- Content: "The statement \"DROP DATABASE db\" drops database",+ Content: "The statement \"DROP DATABASE db\n;\" drops database",},{Status: api.TaskCheckStatusWarn,Namespace: api.BBNamespace,Code: common.TaskTypeNotDML.Int(),Title: "Data change can only run DML",- Content: "\"DROP DATABASE db\" is not DML",+ Content: "\"DROP DATABASE db\n;\" is not DML",},},},{- stmt: "CREATE TABLE t(a int, b int)",+ stmt: "CREATE TABLE t(a int, b int)\n;",taskType: api.TaskDatabaseDataUpdate,want: []api.TaskCheckResult{{@@ -98,12 +98,12 @@ func TestStatementTypeCheck(t *testing.T) {Namespace: api.BBNamespace,Code: common.TaskTypeNotDML.Int(),Title: "Data change can only run DML",- Content: "\"CREATE TABLE t(a int, b int)\" is not DML",+ Content: "\"CREATE TABLE t(a int, b int)\n;\" is not DML",},},},{- stmt: "ALTER TABLE t ADD COLUMN a int",+ stmt: "ALTER TABLE t ADD COLUMN a int\n;",taskType: api.TaskDatabaseDataUpdate,want: []api.TaskCheckResult{{@@ -111,12 +111,12 @@ func TestStatementTypeCheck(t *testing.T) {Namespace: api.BBNamespace,Code: common.TaskTypeNotDML.Int(),Title: "Data change can only run DML",- Content: "\"ALTER TABLE t ADD COLUMN a int\" is not DML",+ Content: "\"ALTER TABLE t ADD COLUMN a int\n;\" is not DML",},},},{- stmt: "INSERT INTO t values(1, 2, 3)",+ stmt: "INSERT INTO t values(1, 2, 3)\n;",taskType: api.TaskDatabaseDataUpdate,want: []api.TaskCheckResult(nil),},@@ -131,17 +131,17 @@ func TestStatementTypeCheck(t *testing.T) {want: []api.TaskCheckResult(nil),},{- stmt: "CREATE TABLE t(a int, b int)",+ stmt: "CREATE TABLE t(a int, b int)\n;",taskType: api.TaskDatabaseSchemaUpdate,want: []api.TaskCheckResult(nil),},{- stmt: "ALTER TABLE t ADD COLUMN a int",+ stmt: "ALTER TABLE t ADD COLUMN a int\n;",taskType: api.TaskDatabaseSchemaUpdate,want: []api.TaskCheckResult(nil),},{- stmt: "INSERT INTO t values(1, 2, 3)",+ stmt: "INSERT INTO t values(1, 2, 3)\n;",taskType: api.TaskDatabaseSchemaUpdate,want: []api.TaskCheckResult{{@@ -149,7 +149,7 @@ func TestStatementTypeCheck(t *testing.T) {Namespace: api.BBNamespace,Code: common.TaskTypeNotDDL.Int(),Title: "Alter schema can only run DDL",- Content: "\"INSERT INTO t values(1, 2, 3)\" is not DDL",+ Content: "\"INSERT INTO t values(1, 2, 3)\n;\" is not DDL",},},},@@ -160,12 +160,12 @@ func TestStatementTypeCheck(t *testing.T) {},}- for _, test := range tests {+ for i, test := range tests {res, err := mysqlStatementTypeCheck(test.stmt, "", "", test.taskType)require.NoError(t, err)require.Equal(t, test.want, res)res, err = postgresqlStatementTypeCheck(test.stmt, test.taskType)require.NoError(t, err)- require.Equal(t, test.want, res)+ require.Equal(t, test.want, res, i)}}diff --git a/backend/tests/test-data/sql_review_mysql.yaml b/backend/tests/test-data/sql_review_mysql.yamlindex 0f994ba301..f92e4c5ee0 100644--- a/backend/tests/test-data/sql_review_mysql.yaml+++ b/backend/tests/test-data/sql_review_mysql.yaml@@ -6,6 +6,7 @@title: OKcontent: ""line: 0+ details: ""run: false- statement: CREATE TABLE user(id);result:@@ -13,8 +14,9 @@code: 201status: ERRORtitle: Syntax error- content: "line 1:20 mismatched input ')' expecting {BIGINT_SYMBOL, BINARY_SYMBOL, BIT_SYMBOL, BLOB_SYMBOL, BOOLEAN_SYMBOL, BOOL_SYMBOL, CHAR_SYMBOL, DATETIME_SYMBOL, DATE_SYMBOL, DECIMAL_SYMBOL, DOUBLE_SYMBOL, ENUM_SYMBOL, FIXED_SYMBOL, FLOAT_SYMBOL, GEOMETRYCOLLECTION_SYMBOL, GEOMETRY_SYMBOL, INT_SYMBOL, JSON_SYMBOL, LINESTRING_SYMBOL, LONGBLOB_SYMBOL, LONGTEXT_SYMBOL, LONG_SYMBOL, MEDIUMBLOB_SYMBOL, MEDIUMINT_SYMBOL, MEDIUMTEXT_SYMBOL, MULTILINESTRING_SYMBOL, MULTIPOINT_SYMBOL, MULTIPOLYGON_SYMBOL, NATIONAL_SYMBOL, NCHAR_SYMBOL, NUMERIC_SYMBOL, NVARCHAR_SYMBOL, POINT_SYMBOL, POLYGON_SYMBOL, REAL_SYMBOL, SERIAL_SYMBOL, SET_SYMBOL, SMALLINT_SYMBOL, TEXT_SYMBOL, TIMESTAMP_SYMBOL, TIME_SYMBOL, TINYBLOB_SYMBOL, TINYINT_SYMBOL, TINYTEXT_SYMBOL, VARBINARY_SYMBOL, VARCHAR_SYMBOL, YEAR_SYMBOL}"+ content: line 1:20 mismatched input ')' expecting {BIGINT_SYMBOL, BINARY_SYMBOL, BIT_SYMBOL, BLOB_SYMBOL, BOOLEAN_SYMBOL, BOOL_SYMBOL, CHAR_SYMBOL, DATETIME_SYMBOL, DATE_SYMBOL, DECIMAL_SYMBOL, DOUBLE_SYMBOL, ENUM_SYMBOL, FIXED_SYMBOL, FLOAT_SYMBOL, GEOMETRYCOLLECTION_SYMBOL, GEOMETRY_SYMBOL, INT_SYMBOL, JSON_SYMBOL, LINESTRING_SYMBOL, LONGBLOB_SYMBOL, LONGTEXT_SYMBOL, LONG_SYMBOL, MEDIUMBLOB_SYMBOL, MEDIUMINT_SYMBOL, MEDIUMTEXT_SYMBOL, MULTILINESTRING_SYMBOL, MULTIPOINT_SYMBOL, MULTIPOLYGON_SYMBOL, NATIONAL_SYMBOL, NCHAR_SYMBOL, NUMERIC_SYMBOL, NVARCHAR_SYMBOL, POINT_SYMBOL, POLYGON_SYMBOL, REAL_SYMBOL, SERIAL_SYMBOL, SET_SYMBOL, SMALLINT_SYMBOL, TEXT_SYMBOL, TIMESTAMP_SYMBOL, TIME_SYMBOL, TINYBLOB_SYMBOL, TINYINT_SYMBOL, TINYTEXT_SYMBOL, VARBINARY_SYMBOL, VARCHAR_SYMBOL, YEAR_SYMBOL}line: 0+ details: ""run: false- statement: CREATE TABLE userTable(id INT NOT NULL,name VARCHAR(255) CHARSET ascii,roomId INT,time_created TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',time_updated TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',content BLOB NOT NULL COMMENT 'comment',json_content JSON NOT NULL COMMENT 'comment',INDEX idx1(name),UNIQUE KEY uk1(id, name),FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_binresult:@@ -22,152 +24,185 @@code: 501status: ERRORtitle: engine.mysql.use-innodb- content: '"CREATE TABLE userTable(id INT NOT NULL,name VARCHAR(255) CHARSET ascii,roomId INT,time_created TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT ''comment'',time_updated TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT ''comment'',content BLOB NOT NULL COMMENT ''comment'',json_content JSON NOT NULL COMMENT ''comment'',INDEX idx1(name),UNIQUE KEY uk1(id, name),FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_bin" doesn''t use InnoDB engine'- line: 1+ content: |-+ "CREATE TABLE userTable(id INT NOT NULL,name VARCHAR(255) CHARSET ascii,roomId INT,time_created TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',time_updated TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',content BLOB NOT NULL COMMENT 'comment',json_content JSON NOT NULL COMMENT 'comment',INDEX idx1(name),UNIQUE KEY uk1(id, name),FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_bin+ ;" doesn't use InnoDB engine+ line: 2+ details: ""- namespace: bb.advisorcode: 601status: ERRORtitle: table.require-pkcontent: Table `userTable` requires PRIMARY KEY- line: 1+ line: 2+ details: ""- namespace: bb.advisorcode: 602status: ERRORtitle: table.no-foreign-keycontent: Foreign key is not allowed in the table `userTable`line: 1+ details: ""- namespace: bb.advisorcode: 411status: ERRORtitle: column.type-disallow-listcontent: Disallow column type JSON but column `userTable`.`json_content` isline: 1+ details: ""- namespace: bb.advisorcode: 301status: WARNtitle: naming.tablecontent: '`userTable` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'- line: 1+ line: 2+ details: ""- namespace: bb.advisorcode: 302status: WARNtitle: naming.columncontent: '`userTable`.`roomId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 1+ details: ""- namespace: bb.advisorcode: 303status: WARNtitle: naming.index.idxcontent: Index in table `userTable` mismatches the naming convention, expect "^$|^idx_userTable_name$" but found `idx1`line: 1+ details: ""- namespace: bb.advisorcode: 304status: WARNtitle: naming.index.ukcontent: Unique key in table `userTable` mismatches the naming convention, expect "^$|^uk_userTable_id_name$" but found `uk1`line: 1+ details: ""- namespace: bb.advisorcode: 305status: WARNtitle: naming.index.fkcontent: Foreign key in table `userTable` mismatches the naming convention, expect "^$|^fk_userTable_roomId_room_id$" but found `fk1`line: 1+ details: ""- namespace: bb.advisorcode: 605status: WARNtitle: table.commentcontent: Table `userTable` requires comments- line: 1+ line: 2+ details: ""- namespace: bb.advisorcode: 401status: WARNtitle: column.required- content: "Table `userTable` requires columns: created_ts, creator_id, updated_ts, updater_id"- line: 1+ content: 'Table `userTable` requires columns: created_ts, creator_id, updated_ts, updater_id'+ line: 2+ details: ""- namespace: bb.advisorcode: 402status: WARNtitle: column.no-null- content: "`userTable`.`name` cannot have NULL value"+ content: '`userTable`.`name` cannot have NULL value'line: 1+ details: ""- namespace: bb.advisorcode: 402status: WARNtitle: column.no-null- content: "`userTable`.`roomId` cannot have NULL value"+ content: '`userTable`.`roomId` cannot have NULL value'line: 1+ details: ""- namespace: bb.advisorcode: 404status: WARNtitle: column.set-default-for-not-nullcontent: Column `userTable`.`id` is NOT NULL but doesn't have DEFAULTline: 1+ details: ""- namespace: bb.advisorcode: 408status: WARNtitle: column.commentcontent: Column `userTable`.`id` requires commentsline: 1+ details: ""- namespace: bb.advisorcode: 408status: WARNtitle: column.commentcontent: Column `userTable`.`name` requires commentsline: 1+ details: ""- namespace: bb.advisorcode: 408status: WARNtitle: column.commentcontent: Column `userTable`.`roomId` requires commentsline: 1+ details: ""- namespace: bb.advisorcode: 414status: WARNtitle: column.disallow-set-charset- content: Disallow set column charset but "CREATE TABLE userTable(id INT NOT NULL,name VARCHAR(255) CHARSET ascii,roomId INT,time_created TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',time_updated TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',content BLOB NOT NULL COMMENT 'comment',json_content JSON NOT NULL COMMENT 'comment',INDEX idx1(name),UNIQUE KEY uk1(id, name),FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_bin" does- line: 1+ content: |-+ Disallow set column charset but "CREATE TABLE userTable(id INT NOT NULL,name VARCHAR(255) CHARSET ascii,roomId INT,time_created TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',time_updated TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',content BLOB NOT NULL COMMENT 'comment',json_content JSON NOT NULL COMMENT 'comment',INDEX idx1(name),UNIQUE KEY uk1(id, name),FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_bin+ ;" does+ line: 2+ details: ""- namespace: bb.advisorcode: 419status: WARNtitle: column.current-time-count-limitcontent: Table `userTable` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.- line: 1+ line: 2+ details: ""- namespace: bb.advisorcode: 420status: WARNtitle: column.require-defaultcontent: Column `userTable`.`id` doesn't have DEFAULT.line: 1+ details: ""- namespace: bb.advisorcode: 420status: WARNtitle: column.require-defaultcontent: Column `userTable`.`name` doesn't have DEFAULT.line: 1+ details: ""- namespace: bb.advisorcode: 420status: WARNtitle: column.require-defaultcontent: Column `userTable`.`roomId` doesn't have DEFAULT.line: 1+ details: ""- namespace: bb.advisorcode: 804status: WARNtitle: index.type-no-blobcontent: Columns in index must not be BLOB but `userTable`.`content` is blobline: 1+ details: ""- namespace: bb.advisorcode: 1001status: WARNtitle: system.charset.allowlist- content: '"CREATE TABLE userTable(id INT NOT NULL,name VARCHAR(255) CHARSET ascii,roomId INT,time_created TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT ''comment'',time_updated TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT ''comment'',content BLOB NOT NULL COMMENT ''comment'',json_content JSON NOT NULL COMMENT ''comment'',INDEX idx1(name),UNIQUE KEY uk1(id, name),FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_bin" used disabled charset ''ascii'''+ content: |-+ "CREATE TABLE userTable(id INT NOT NULL,name VARCHAR(255) CHARSET ascii,roomId INT,time_created TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',time_updated TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',content BLOB NOT NULL COMMENT 'comment',json_content JSON NOT NULL COMMENT 'comment',INDEX idx1(name),UNIQUE KEY uk1(id, name),FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_bin+ ;" used disabled charset 'ascii'line: 1+ details: ""- namespace: bb.advisorcode: 1201status: WARNtitle: system.collation.allowlist- content: '"CREATE TABLE userTable(id INT NOT NULL,name VARCHAR(255) CHARSET ascii,roomId INT,time_created TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT ''comment'',time_updated TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT ''comment'',content BLOB NOT NULL COMMENT ''comment'',json_content JSON NOT NULL COMMENT ''comment'',INDEX idx1(name),UNIQUE KEY uk1(id, name),FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_bin" used disabled collation ''latin1_bin'''- line: 1+ content: |-+ "CREATE TABLE userTable(id INT NOT NULL,name VARCHAR(255) CHARSET ascii,roomId INT,time_created TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',time_updated TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',content BLOB NOT NULL COMMENT 'comment',json_content JSON NOT NULL COMMENT 'comment',INDEX idx1(name),UNIQUE KEY uk1(id, name),FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_bin+ ;" used disabled collation 'latin1_bin'+ line: 2+ details: ""run: false- statement: CREATE TABLE t_auto(auto_id varchar(20) AUTO_INCREMENT PRIMARY KEY COMMENT 'COMMENT') auto_increment = 2 COMMENT 'comment'result:@@ -176,58 +211,73 @@status: ERRORtitle: column.auto-increment-must-integercontent: Auto-increment column `t_auto`.`auto_id` requires integer type- line: 1+ line: 2+ details: ""- namespace: bb.advisorcode: 307status: WARNtitle: naming.column.auto-incrementcontent: '`t_auto`.`auto_id` mismatches auto_increment column naming convention, naming format should be "^id$"'line: 1+ details: ""- namespace: bb.advisorcode: 401status: WARNtitle: column.required- content: "Table `t_auto` requires columns: created_ts, creator_id, id, updated_ts, updater_id"- line: 1+ content: 'Table `t_auto` requires columns: created_ts, creator_id, id, updated_ts, updater_id'+ line: 2+ details: ""- namespace: bb.advisorcode: 416status: WARNtitle: column.auto-increment-initial-valuecontent: The initial auto-increment value in table `t_auto` is 2, which doesn't equal 20- line: 1+ line: 2+ details: ""- namespace: bb.advisorcode: 417status: WARNtitle: column.auto-increment-must-unsignedcontent: Auto-increment column `t_auto`.`auto_id` is not UNSIGNED type- line: 1+ line: 2+ details: ""- namespace: bb.advisorcode: 803status: WARNtitle: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t_auto`.`auto_id` is varchar(20)line: 1+ details: ""run: false-- statement: " DELETE FROM tech_book"+- statement: ' DELETE FROM tech_book'result:- namespace: bb.advisorcode: 202status: ERRORtitle: statement.where.require- content: '"DELETE FROM tech_book" requires WHERE clause'- line: 1+ content: |-+ "DELETE FROM tech_book+ ;" requires WHERE clause+ line: 2+ details: ""- namespace: bb.advisorcode: 208status: ERRORtitle: statement.dml-dry-run- content: '"DELETE FROM tech_book" dry runs failed: Error 1146 (42S02): Table ''testsqlreview.tech_book'' doesn''t exist'- line: 1+ content: |-+ "DELETE FROM tech_book+ ;" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.tech_book' doesn't exist+ line: 2+ details: ""- namespace: bb.advisorcode: 209status: WARNtitle: statement.affected-row-limit- content: '"DELETE FROM tech_book" dry runs failed: Error 1146 (42S02): Table ''testsqlreview.tech_book'' doesn''t exist'- line: 1+ content: |-+ "DELETE FROM tech_book+ ;" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.tech_book' doesn't exist+ line: 2+ details: ""run: false- statement: DELETE FROM tech_book WHERE name like `%abc`result:@@ -235,68 +285,98 @@code: 204status: ERRORtitle: statement.where.no-leading-wildcard-like- content: '"DELETE FROM tech_book WHERE name like `%abc`" uses leading wildcard LIKE'- line: 1+ content: |-+ "DELETE FROM tech_book WHERE name like `%abc`+ ;" uses leading wildcard LIKE+ line: 2+ details: ""- namespace: bb.advisorcode: 208status: ERRORtitle: statement.dml-dry-run- content: '"DELETE FROM tech_book WHERE name like `%abc`" dry runs failed: Error 1146 (42S02): Table ''testsqlreview.tech_book'' doesn''t exist'- line: 1+ content: |-+ "DELETE FROM tech_book WHERE name like `%abc`+ ;" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.tech_book' doesn't exist+ line: 2+ details: ""- namespace: bb.advisorcode: 209status: WARNtitle: statement.affected-row-limit- content: '"DELETE FROM tech_book WHERE name like `%abc`" dry runs failed: Error 1146 (42S02): Table ''testsqlreview.tech_book'' doesn''t exist'- line: 1+ content: |-+ "DELETE FROM tech_book WHERE name like `%abc`+ ;" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.tech_book' doesn't exist+ line: 2+ details: ""run: false-- statement: " INSERT INTO t_copy SELECT * FROM t"+- statement: ' INSERT INTO t_copy SELECT * FROM t'result:- namespace: bb.advisorcode: 203status: ERRORtitle: statement.select.no-select-all- content: '"INSERT INTO t_copy SELECT * FROM t" uses SELECT all'- line: 1+ content: |-+ "INSERT INTO t_copy SELECT * FROM t+ ;" uses SELECT all+ line: 2+ details: ""- namespace: bb.advisorcode: 202status: ERRORtitle: statement.where.require- content: '"INSERT INTO t_copy SELECT * FROM t" requires WHERE clause'- line: 1+ content: |-+ "INSERT INTO t_copy SELECT * FROM t+ ;" requires WHERE clause+ line: 2+ details: ""- namespace: bb.advisorcode: 208status: ERRORtitle: statement.dml-dry-run- content: '"INSERT INTO t_copy SELECT * FROM t" dry runs failed: Error 1146 (42S02): Table ''testsqlreview.t_copy'' doesn''t exist'- line: 1+ content: |-+ "INSERT INTO t_copy SELECT * FROM t+ ;" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.t_copy' doesn't exist+ line: 2+ details: ""- namespace: bb.advisorcode: 1101status: WARNtitle: statement.insert.row-limit- content: '"INSERT INTO t_copy SELECT * FROM t" dry runs failed: Error 1146 (42S02): Table ''testsqlreview.t_copy'' doesn''t exist'- line: 1+ content: |-+ "INSERT INTO t_copy SELECT * FROM t+ ;" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.t_copy' doesn't exist+ line: 2+ details: ""- namespace: bb.advisorcode: 1107status: WARNtitle: statement.insert.must-specify-column- content: The INSERT statement must specify columns but "INSERT INTO t_copy SELECT * FROM t" does not- line: 1+ content: |-+ The INSERT statement must specify columns but "INSERT INTO t_copy SELECT * FROM t+ ;" does not+ line: 2+ details: ""run: false-- statement: " INSERT INTO t VALUES (1, 1, now(), 1, now())"+- statement: ' INSERT INTO t VALUES (1, 1, now(), 1, now())'result:- namespace: bb.advisorcode: 208status: ERRORtitle: statement.dml-dry-run- content: '"INSERT INTO t VALUES (1, 1, now(), 1, now())" dry runs failed: Error 1146 (42S02): Table ''testsqlreview.t'' doesn''t exist'- line: 1+ content: |-+ "INSERT INTO t VALUES (1, 1, now(), 1, now())+ ;" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.t' doesn't exist+ line: 2+ details: ""- namespace: bb.advisorcode: 1107status: WARNtitle: statement.insert.must-specify-column- content: The INSERT statement must specify columns but "INSERT INTO t VALUES (1, 1, now(), 1, now())" does not- line: 1+ content: |-+ The INSERT statement must specify columns but "INSERT INTO t VALUES (1, 1, now(), 1, now())+ ;" does not+ line: 2+ details: ""run: false- statement: DELETE FROM tech_book WHERE id = (SELECT max(id) FROM tech_book WHERE name = 'bytebase')result:@@ -304,14 +384,20 @@code: 208status: ERRORtitle: statement.dml-dry-run- content: '"DELETE FROM tech_book WHERE id = (SELECT max(id) FROM tech_book WHERE name = ''bytebase'')" dry runs failed: Error 1146 (42S02): Table ''testsqlreview.tech_book'' doesn''t exist'- line: 1+ content: |-+ "DELETE FROM tech_book WHERE id = (SELECT max(id) FROM tech_book WHERE name = 'bytebase')+ ;" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.tech_book' doesn't exist+ line: 2+ details: ""- namespace: bb.advisorcode: 209status: WARNtitle: statement.affected-row-limit- content: '"DELETE FROM tech_book WHERE id = (SELECT max(id) FROM tech_book WHERE name = ''bytebase'')" dry runs failed: Error 1146 (42S02): Table ''testsqlreview.tech_book'' doesn''t exist'- line: 1+ content: |-+ "DELETE FROM tech_book WHERE id = (SELECT max(id) FROM tech_book WHERE name = 'bytebase')+ ;" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.tech_book' doesn't exist+ line: 2+ details: ""run: false- statement: COMMIT;result:@@ -319,8 +405,11 @@code: 206status: ERRORtitle: statement.disallow-commit- content: 'Commit is not allowed, related statement: "COMMIT;"'- line: 1+ content: |-+ Commit is not allowed, related statement: "COMMIT+ ;"+ line: 2+ details: ""run: false- statement: CREATE TABLE user(id INT PRIMARY KEY COMMENT 'comment',name VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'comment',room_id INT NOT NULL DEFAULT 0 COMMENT 'comment',creator_id INT NOT NULL DEFAULT 0 COMMENT 'comment',created_ts TIMESTAMP NOT NULL DEFAULT NOW() COMMENT 'comment',updater_id INT NOT NULL DEFAULT 0 COMMENT 'comment',updated_ts TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW() COMMENT 'comment',INDEX idx_user_name(name),UNIQUE KEY uk_user_id_name(id, name)) ENGINE = INNODB COMMENT 'comment'result:@@ -330,6 +419,7 @@title: OKcontent: ""line: 0+ details: ""run: true- statement: INSERT INTO user(id, name) values (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')result:@@ -339,6 +429,7 @@title: OKcontent: ""line: 0+ details: ""run: true- statement: DELETE FROM user WHERE id < 10result:@@ -348,6 +439,7 @@title: OKcontent: ""line: 0+ details: ""run: false- statement: INSERT INTO user(id, name) values (6, 'f'), (7, 'g'), (8, 'h'), (9, 'i'), (10, 'j')result:@@ -357,6 +449,7 @@title: OKcontent: ""line: 0+ details: ""run: true- statement: DELETE FROM user WHERE id <= 10result:@@ -364,8 +457,11 @@code: 209status: WARNtitle: statement.affected-row-limit- content: '"DELETE FROM user WHERE id <= 10" affected 10 rows. The count exceeds 5.'- line: 1+ content: |-+ "DELETE FROM user WHERE id <= 10+ ;" affected 10 rows. The count exceeds 5.+ line: 2+ details: ""run: false- statement: |-INSERT INTO user(id, name) SELECT id, name FROM (SELECT 1 AS id, 'a' AS name WHERE 1=1 UNION ALL@@ -393,8 +489,10 @@SELECT 7 AS id, 'g' AS name WHERE 1=1 UNION ALLSELECT 8 AS id, 'h' AS name WHERE 1=1 UNION ALLSELECT 9 AS id, 'i' AS name WHERE 1=1 UNION ALL- SELECT 10 AS id, 'j' AS name WHERE 1=1) value_table WHERE 1=1" inserts 10 rows. The count exceeds 5.- line: 10+ SELECT 10 AS id, 'j' AS name WHERE 1=1) value_table WHERE 1=1+ ;" inserts 10 rows. The count exceeds 5.+ line: 11+ details: ""run: false- statement: INSERT INTO user(id, name) SELECT id, name FROM user WHERE id=1 LIMIT 1result:@@ -402,65 +500,80 @@code: 1103status: WARNtitle: statement.disallow-limit- content: LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "INSERT INTO user(id, name) SELECT id, name FROM user WHERE id=1 LIMIT 1" uses- line: 1+ content: |-+ LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "INSERT INTO user(id, name) SELECT id, name FROM user WHERE id=1 LIMIT 1+ ;" uses+ line: 2+ details: ""run: false-- statement: " ALTER TABLE user PARTITION BY HASH(id) PARTITIONS 8;"+- statement: ' ALTER TABLE user PARTITION BY HASH(id) PARTITIONS 8;'result:- namespace: bb.advisorcode: 608status: WARNtitle: table.disallow-partition- content: Table partition is forbidden, but "ALTER TABLE user PARTITION BY HASH(id) PARTITIONS 8;" creates- line: 1+ content: |-+ Table partition is forbidden, but "ALTER TABLE user PARTITION BY HASH(id) PARTITIONS 8+ ;" creates+ line: 2+ details: ""run: false- statement: |4-- ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '' COMMENT 'COMMENT' FIRST;- ALTER TABLE user ADD COLUMN c_column int NOT NULL DEFAULT 0 COMMENT 'comment';+ ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '' COMMENT 'COMMENT' FIRST;+ ALTER TABLE user ADD COLUMN c_column int NOT NULL DEFAULT 0 COMMENT 'comment';result:- namespace: bb.advisorcode: 207status: WARNtitle: statement.merge-alter-tablecontent: There are 2 statements to modify table `user`- line: 2+ line: 3+ details: ""- namespace: bb.advisorcode: 403status: WARNtitle: column.disallow-change-typecontent: '"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '''' COMMENT ''COMMENT'' FIRST;" changes column type'line: 1+ details: ""- namespace: bb.advisorcode: 406status: WARNtitle: column.disallow-changecontent: '"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '''' COMMENT ''COMMENT'' FIRST;" contains CHANGE COLUMN statement'line: 1+ details: ""- namespace: bb.advisorcode: 407status: WARNtitle: column.disallow-changing-ordercontent: '"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '''' COMMENT ''COMMENT'' FIRST;" changes column order'line: 1+ details: ""- namespace: bb.advisorcode: 111status: WARNtitle: schema.backward-compatibilitycontent: '"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '''' COMMENT ''COMMENT'' FIRST;" may cause incompatibility with the existing data and code'line: 1+ details: ""run: false-- statement: " DROP TABLE user;"+- statement: ' DROP TABLE user;'result:- namespace: bb.advisorcode: 603status: ERRORtitle: table.drop-naming-conventioncontent: '`user` mismatches drop table naming convention, naming format should be "_delete$"'- line: 1+ line: 2+ details: ""- namespace: bb.advisorcode: 103status: WARNtitle: schema.backward-compatibility- content: '"DROP TABLE user;" may cause incompatibility with the existing data and code'- line: 1+ content: |-+ "DROP TABLE user+ ;" may cause incompatibility with the existing data and code+ line: 2+ details: ""run: falsediff --git a/go.mod b/go.modindex f0876af57e..ecdb0b6fd8 100644--- a/go.mod+++ b/go.mod@@ -12,8 +12,8 @@ require (github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.60github.com/aws/aws-sdk-go-v2/service/s3 v1.31.1github.com/blang/semver/v4 v4.0.0- github.com/bytebase/mysql-parser v0.0.0-20230608081517-18ca6de4af0d- github.com/bytebase/plsql-parser v0.0.0-20230605065610-558b30eea9da+ github.com/bytebase/mysql-parser v0.0.0-20230612050356-4592d9ba30da+ github.com/bytebase/plsql-parser v0.0.0-20230612081829-80675dfad134github.com/bytebase/snowsql-parser v0.0.0-20230609063735-32997ba8276cgithub.com/casbin/casbin/v2 v2.66.2github.com/cenkalti/backoff/v4 v4.2.0diff --git a/go.sum b/go.sumindex 2a6f253ceb..cf5a1dc7de 100644--- a/go.sum+++ b/go.sum@@ -137,12 +137,12 @@ github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao=github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y=github.com/bytebase/gh-ost v1.1.3-0.20220728080340-11d9c9027651 h1:NpoTuRY6Ckj37zTlEax/UTfvHCOdanI5/5dVCarOD18=github.com/bytebase/gh-ost v1.1.3-0.20220728080340-11d9c9027651/go.mod h1:/HsnX0+34LXVz3MxtZoW15GiwEOXz/PrEhutjb3icfE=-github.com/bytebase/mysql-parser v0.0.0-20230608081517-18ca6de4af0d h1:G5SX1AuJgWoe1lksSFeZaJFfAYyWqHnhm13cbabgkng=-github.com/bytebase/mysql-parser v0.0.0-20230608081517-18ca6de4af0d/go.mod h1:n22yoTeLcphIYQlV6nbufQbHMxNceOjeGDOrpaRIhiY=+github.com/bytebase/mysql-parser v0.0.0-20230612050356-4592d9ba30da h1:DlK8ipp+tzhEPNBmOLG0wBhM+cYX3leGTh+8lomML2U=+github.com/bytebase/mysql-parser v0.0.0-20230612050356-4592d9ba30da/go.mod h1:n22yoTeLcphIYQlV6nbufQbHMxNceOjeGDOrpaRIhiY=github.com/bytebase/pg_query_go/v2 v2.0.0-20221123093650-17425d1d18b7 h1:RDN6UnjTq4HR4LKrN8Yav4XfwUoGRjTocvWmzGr6Usc=github.com/bytebase/pg_query_go/v2 v2.0.0-20221123093650-17425d1d18b7/go.mod h1:XAxmVqz1tEGqizcQ3YSdN90vCOHBWjJi8URL1er5+cA=-github.com/bytebase/plsql-parser v0.0.0-20230605065610-558b30eea9da h1:xZB0WhAyVS5aQKPoNkutxcSGE9AUnTatJkgcKvW+S3k=-github.com/bytebase/plsql-parser v0.0.0-20230605065610-558b30eea9da/go.mod h1:kL1Tk89SNE7wPnUzkVMJ9v012an5z8as7OUmkapJQGs=+github.com/bytebase/plsql-parser v0.0.0-20230612081829-80675dfad134 h1:4NWP76NVYstvWPtZu4JwRmKDHK+1PudmODEdCQLfU8g=+github.com/bytebase/plsql-parser v0.0.0-20230612081829-80675dfad134/go.mod h1:kL1Tk89SNE7wPnUzkVMJ9v012an5z8as7OUmkapJQGs=github.com/bytebase/snowsql-parser v0.0.0-20230609063735-32997ba8276c h1:jZVqlqqBt5obROzTJ848jfzXhKcX9bLyn8f88xbGkak=github.com/bytebase/snowsql-parser v0.0.0-20230609063735-32997ba8276c/go.mod h1:gJ1aclz1e9xLArQTbCpDjL+A79Jt3Ro9+/QEw8A6vMM=github.com/bytebase/tidb v0.0.0-20230329095902-fe196d3c77d0 h1:h0LzCFbiCKWy/TbnE5amjDf+/j+06chImQwEhe+TbHc=