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: skip JSON in ColumnDisallowSetCharset (#5564)
rebelicefe355886a1db
diff --git a/backend/plugin/advisor/mysql/advisor_column_disallow_set_charset.go b/backend/plugin/advisor/mysql/advisor_column_disallow_set_charset.goindex 27feb41908..be2b907f48 100644--- a/backend/plugin/advisor/mysql/advisor_column_disallow_set_charset.go+++ b/backend/plugin/advisor/mysql/advisor_column_disallow_set_charset.go@@ -74,7 +74,7 @@ func (checker *columnDisallowSetCharsetChecker) Enter(in ast.Node) (ast.Node, bocase *ast.CreateTableStmt:for _, column := range node.Cols {charset := getColumnCharset(column)- if charset != "" {+ if !checkCharset(charset) {code = advisor.SetColumnCharsetbreak}@@ -85,13 +85,13 @@ func (checker *columnDisallowSetCharsetChecker) Enter(in ast.Node) (ast.Node, bocase ast.AlterTableAddColumns:for _, column := range spec.NewColumns {charset := getColumnCharset(column)- if charset != "" {+ if !checkCharset(charset) {code = advisor.SetColumnCharset}}case ast.AlterTableChangeColumn, ast.AlterTableModifyColumn:charset := getColumnCharset(spec.NewColumns[0])- if charset != "" {+ if !checkCharset(charset) {code = advisor.SetColumnCharset}}@@ -118,3 +118,13 @@ func (checker *columnDisallowSetCharsetChecker) Enter(in ast.Node) (ast.Node, bofunc (*columnDisallowSetCharsetChecker) Leave(in ast.Node) (ast.Node, bool) {return in, true}++func checkCharset(charset string) bool {+ switch charset {+ // empty charset or binary for JSON.+ case "", "binary":+ return true+ default:+ return false+ }+}diff --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 d2a3a3798f..e6b9f972e2 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@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(a int auto_increment) auto_increment = 20want:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(a int auto_increment) auto_increment = 2want:- status: WARN@@ -19,3 +21,4 @@title: column.auto-increment-initial-valuecontent: The initial auto-increment value in table `t` is 2, which doesn't equal 20line: 1+ details: ""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 daaf4696ad..3685dbf6db 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@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(a varchar(255) AUTO_INCREMENT)want:- status: WARN@@ -12,6 +13,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typeline: 1+ details: ""- statement: |-CREATE TABLE t(b int);ALTER TABLE t ADD COLUMN a varchar(255) AUTO_INCREMENT@@ -21,6 +23,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typeline: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t MODIFY COLUMN a varchar(255) AUTO_INCREMENT@@ -30,6 +33,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typeline: 2+ details: ""- statement: |-CREATE TABLE t(b int);ALTER TABLE t CHANGE COLUMN b a varchar(255) AUTO_INCREMENT@@ -39,3 +43,4 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typeline: 2+ details: ""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 3a46434ced..07fa3166a1 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@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(a INT AUTO_INCREMENT)want:- status: WARN@@ -12,6 +13,7 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typeline: 1+ details: ""- statement: |-CREATE TABLE t(b int);ALTER TABLE t ADD COLUMN a INT AUTO_INCREMENT@@ -21,6 +23,7 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typeline: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t MODIFY COLUMN a INT AUTO_INCREMENT@@ -30,6 +33,7 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typeline: 2+ details: ""- statement: |-CREATE TABLE t(b int);ALTER TABLE t CHANGE COLUMN b a INT AUTO_INCREMENT@@ -39,3 +43,4 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typeline: 2+ details: ""diff --git a/backend/plugin/advisor/mysql/test/column_comment.yaml b/backend/plugin/advisor/mysql/test/column_comment.yamlindex eb82551753..0bacb51ad3 100644--- a/backend/plugin/advisor/mysql/test/column_comment.yaml+++ b/backend/plugin/advisor/mysql/test/column_comment.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int COMMENT 'some comments',@@ -16,16 +17,19 @@title: column.commentcontent: The length of column `t`.`a` comment should be within 10 charactersline: 2+ details: ""- status: WARNcode: 408title: column.commentcontent: Column `t`.`b` requires commentsline: 3+ details: ""- status: WARNcode: 408title: column.commentcontent: Column `t`.`c` requires commentsline: 4+ details: ""- statement: |-CREATE TABLE t(a int COMMENT 'comment');ALTER TABLE t ADD COLUMN b int@@ -35,6 +39,7 @@title: column.commentcontent: Column `t`.`b` requires commentsline: 2+ details: ""- statement: |-CREATE TABLE t(a int COMMENT 'this is comment');ALTER TABLE t CHANGE COLUMN a b int@@ -44,11 +49,13 @@title: column.commentcontent: The length of column `t`.`a` comment should be within 10 charactersline: 1+ details: ""- status: WARNcode: 408title: column.commentcontent: Column `t`.`b` requires commentsline: 2+ details: ""- statement: |-CREATE TABLE t(b int COMMENT 'It is comment');ALTER TABLE t MODIFY COLUMN b int@@ -58,11 +65,13 @@title: column.commentcontent: The length of column `t`.`b` comment should be within 10 charactersline: 1+ details: ""- status: WARNcode: 408title: column.commentcontent: Column `t`.`b` requires commentsline: 2+ details: ""- statement: |-CREATE TABLE t(b int COMMENT 'It is COMMENT');ALTER TABLE t MODIFY COLUMN b int COMMENT 'abcdefghiakljhakljdsfalugelkhnabsdguelkadf'@@ -72,8 +81,10 @@title: column.commentcontent: The length of column `t`.`b` comment should be within 10 charactersline: 1+ details: ""- status: WARNcode: 409title: column.commentcontent: The length of column `t`.`b` comment should be within 10 charactersline: 2+ details: ""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 1d31c96f8f..08b3c5ded7 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@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a timestamp default now(),@@ -17,6 +18,7 @@title: column.current-time-count-limitcontent: Table `t` has 3 DEFAULT CURRENT_TIMESTAMP() columns. The count greater than 2.line: 5+ details: ""- statement: |-CREATE TABLE t(a timestamp default now() on update localtime,@@ -28,6 +30,7 @@title: column.current-time-count-limitcontent: Table `t` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.line: 4+ details: ""- statement: |-ALTER TABLE tech_book ADD COLUMN a timestamp default now() on update localtime;ALTER TABLE tech_book ADD COLUMN b timestamp default current_timestamp() on update localtimestamp();@@ -37,3 +40,4 @@title: column.current-time-count-limitcontent: Table `tech_book` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.line: 2+ details: ""diff --git a/backend/plugin/advisor/mysql/test/column_disallow_change.yaml b/backend/plugin/advisor/mysql/test/column_disallow_change.yamlindex e3f11e3953..0cac3ff8d6 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_change.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_change.yaml@@ -7,6 +7,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(b int);ALTER TABLE t CHANGE COLUMN b a int@@ -16,3 +17,4 @@title: column.disallow-changecontent: '"ALTER TABLE t CHANGE COLUMN b a int" contains CHANGE COLUMN statement'line: 2+ details: ""diff --git a/backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml b/backend/plugin/advisor/mysql/test/column_disallow_change_type.yamlindex f8f8b61239..d2e7fa820d 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml@@ -5,6 +5,7 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book MODIFY id INTEGER UNSIGNED" changes column type'line: 1+ details: ""- statement: ALTER TABLE tech_book MODIFY id intwant:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: ALTER TABLE tech_book MODIFY id bigintwant:- status: WARN@@ -19,6 +21,7 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book MODIFY id bigint" changes column type'line: 1+ details: ""- statement: ALTER TABLE tech_book CHANGE name uname varchar(20)want:- status: WARN@@ -26,3 +29,4 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book CHANGE name uname varchar(20)" changes column type'line: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml b/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yamlindex f7ec6d05f9..fe5c5f252f 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml@@ -7,6 +7,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t MODIFY COLUMN a int FIRST@@ -16,6 +17,7 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t MODIFY COLUMN a int FIRST" changes column order'line: 2+ details: ""- statement: |-CREATE TABLE t(b int, a1 int);ALTER TABLE t CHANGE COLUMN a1 a int FIRST@@ -25,6 +27,7 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t CHANGE COLUMN a1 a int FIRST" changes column order'line: 2+ details: ""- statement: |-CREATE TABLE t(a int, b int);ALTER TABLE t MODIFY COLUMN a int AFTER b@@ -34,6 +37,7 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t MODIFY COLUMN a int AFTER b" changes column order'line: 2+ details: ""- statement: |-CREATE TABLE t(a1 int, b int);ALTER TABLE t CHANGE COLUMN a1 a int AFTER b@@ -43,3 +47,4 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t CHANGE COLUMN a1 a int AFTER b" changes column order'line: 2+ details: ""diff --git a/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml b/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yamlindex a09814a422..781d8e6431 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml@@ -1,3 +1,13 @@+- statement: |-+ CREATE TABLE dt_relation_temp(objto int);+ ALTER TABLE dt_relation_temp ADD COLUMN infos json null comment'关系信息点'AFTER`objto`;+ want:+ - status: SUCCESS+ code: 0+ title: OK+ content: ""+ line: 0+ details: ""- statement: CREATE TABLE t(a varchar(20))want:- status: SUCCESS@@ -5,6 +15,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(a varchar(20) CHARSET ascii)want:- status: WARN@@ -12,6 +23,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "CREATE TABLE t(a varchar(20) CHARSET ascii)" doesline: 1+ details: ""- statement: ALTER TABLE tech_book ADD COLUMN a varchar(20) CHARSET asciiwant:- status: WARN@@ -19,6 +31,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book ADD COLUMN a varchar(20) CHARSET ascii" doesline: 1+ details: ""- statement: ALTER TABLE tech_book MODIFY COLUMN id varchar(20) CHARSET asciiwant:- status: WARN@@ -26,6 +39,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book MODIFY COLUMN id varchar(20) CHARSET ascii" doesline: 1+ details: ""- statement: ALTER TABLE tech_book CHANGE COLUMN name name varchar(20) CHARSET asciiwant:- status: WARN@@ -33,3 +47,4 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book CHANGE COLUMN name name varchar(20) CHARSET ascii" doesline: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml b/backend/plugin/advisor/mysql/test/column_maximum_character_length.yamlindex ba36c9f8f4..7aa1b02db1 100644--- a/backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml+++ b/backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(name varchar(225));want:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(name char(225));want:- status: WARN@@ -19,6 +21,7 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `name` is bigger than 20, please use VARCHAR insteadline: 1+ details: ""- statement: ALTER TABLE tech_book ADD COLUMN name_2 char(225)want:- status: WARN@@ -26,6 +29,7 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `name_2` is bigger than 20, please use VARCHAR insteadline: 1+ details: ""- statement: ALTER TABLE tech_book CHANGE COLUMN name name char(225)want:- status: WARN@@ -33,6 +37,7 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `name` is bigger than 20, please use VARCHAR insteadline: 1+ details: ""- statement: ALTER TABLE tech_book MODIFY COLUMN name char(225)want:- status: WARN@@ -40,3 +45,4 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `name` is bigger than 20, please use VARCHAR insteadline: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/column_no_null.yaml b/backend/plugin/advisor/mysql/test/column_no_null.yamlindex 1ab9977242..38e3dd70f4 100644--- a/backend/plugin/advisor/mysql/test/column_no_null.yaml+++ b/backend/plugin/advisor/mysql/test/column_no_null.yaml@@ -8,11 +8,13 @@title: column.no-nullcontent: '`book`.`id` cannot have NULL value'line: 2+ details: ""- status: WARNcode: 402title: column.no-nullcontent: '`book`.`name` cannot have NULL value'line: 3+ details: ""- statement: CREATE TABLE book(id int PRIMARY KEY, name varchar(255))want:- status: WARN@@ -20,6 +22,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'line: 1+ details: ""- statement: CREATE TABLE book(id int NOT NULL, name varchar(255))want:- status: WARN@@ -27,6 +30,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'line: 1+ details: ""- statement: CREATE TABLE book(id int PRIMARY KEY, name varchar(255) NOT NULL)want:- status: SUCCESS@@ -34,6 +38,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(a int NOT NULL);ALTER TABLE book ADD COLUMN (id int, name varchar(255) NOT NULL);@@ -43,6 +48,7 @@title: column.no-nullcontent: '`book`.`id` cannot have NULL value'line: 2+ details: ""- statement: |-CREATE TABLE book(a int NOT NULL);ALTER TABLE book ADD COLUMN (id int PRIMARY KEY, name varchar(255) NOT NULL);@@ -52,6 +58,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int NOT NULL);ALTER TABLE book CHANGE COLUMN id name varchar(255);@@ -61,6 +68,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'line: 2+ details: ""- statement: |-CREATE TABLE book(id int NOT NULL);ALTER TABLE book CHANGE COLUMN id name varchar(255) NOT NULL;@@ -70,3 +78,4 @@title: OKcontent: ""line: 0+ details: ""diff --git a/backend/plugin/advisor/mysql/test/column_require_default.yaml b/backend/plugin/advisor/mysql/test/column_require_default.yamlindex 3e02ab3101..342755ca06 100644--- a/backend/plugin/advisor/mysql/test/column_require_default.yaml+++ b/backend/plugin/advisor/mysql/test/column_require_default.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int,@@ -16,6 +17,7 @@title: column.require-defaultcontent: Column `t`.`a` doesn't have DEFAULT.line: 2+ details: ""- statement: |-ALTER TABLE tech_book ADD COLUMN a BLOB;ALTER TABLE tech_book ADD COLUMN b timestamp;@@ -26,8 +28,10 @@title: column.require-defaultcontent: Column `tech_book`.`b` doesn't have DEFAULT.line: 2+ details: ""- status: WARNcode: 420title: column.require-defaultcontent: Column `tech_book`.`a` doesn't have DEFAULT.line: 3+ details: ""diff --git a/backend/plugin/advisor/mysql/test/column_required.yaml b/backend/plugin/advisor/mysql/test/column_required.yamlindex b860fb4a44..09ae6cf94d 100644--- a/backend/plugin/advisor/mysql/test/column_required.yaml+++ b/backend/plugin/advisor/mysql/test/column_required.yaml@@ -5,6 +5,7 @@title: column.requiredcontent: 'Table `book` requires columns: created_ts, creator_id, updated_ts, updater_id'line: 1+ details: ""- statement: |-CREATE TABLE book(id int,@@ -18,6 +19,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int,@@ -32,6 +34,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'line: 7+ details: ""- statement: |-CREATE TABLE book(id int,@@ -46,6 +49,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int,@@ -60,6 +64,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'line: 7+ details: ""- statement: |-CREATE TABLE book(id int,@@ -74,6 +79,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int,@@ -88,6 +94,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'line: 7+ details: ""- statement: |-CREATE TABLE book(id int,@@ -103,6 +110,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int,@@ -116,6 +124,7 @@title: column.requiredcontent: 'Table `book` requires columns: updater_id'line: 5+ details: ""- statement: |-CREATE TABLE book(id int,@@ -130,6 +139,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int,@@ -146,11 +156,13 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'line: 5+ details: ""- status: WARNcode: 401title: column.requiredcontent: 'Table `student` requires columns: creator_id, updater_id'line: 9+ details: ""- statement: |-CREATE TABLE book(id int,@@ -165,3 +177,4 @@title: OKcontent: ""line: 0+ details: ""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 29af326aec..3a4b70ffd8 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@@ -8,6 +8,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int PRIMARY KEY@@ -18,6 +19,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int NOT NULL@@ -28,6 +30,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTline: 2+ details: ""- statement: |-CREATE TABLE book(id int,@@ -39,6 +42,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTline: 2+ details: ""- statement: |-CREATE TABLE book(a int);ALTER TABLE book ADD COLUMN id int PRIMARY KEY@@ -48,6 +52,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(a int);ALTER TABLE book ADD COLUMN id int NOT NULL@@ -57,6 +62,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTline: 2+ details: ""- statement: |-CREATE TABLE book(id int);ALTER TABLE book MODIFY COLUMN id int NOT NULL@@ -66,6 +72,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTline: 2+ details: ""- statement: |-CREATE TABLE book(id int);ALTER TABLE book MODIFY COLUMN id int PRIMARY KEY@@ -75,6 +82,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(uid int);ALTER TABLE book CHANGE COLUMN uid id int PRIMARY KEY@@ -84,6 +92,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(uid int);ALTER TABLE book CHANGE COLUMN uid id int NOT NULL@@ -93,6 +102,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTline: 2+ details: ""- 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:- status: SUCCESS@@ -100,3 +110,4 @@title: OKcontent: ""line: 0+ details: ""diff --git a/backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml b/backend/plugin/advisor/mysql/test/column_type_disallow_list.yamlindex 1f90918f1c..2f6fb9e6d6 100644--- a/backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml+++ b/backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(a JSON, b BLOB, c TEXT)want:- status: WARN@@ -12,6 +13,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` isline: 1+ details: ""- statement: |-CREATE TABLE t(d int);ALTER TABLE t add COLUMN (a JSON, b BLOB, c TEXT)@@ -21,6 +23,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` isline: 2+ details: ""- statement: |-CREATE TABLE t(c int, b int);ALTER TABLE t CHANGE COLUMN c a JSON, MODIFY b BLOB@@ -30,3 +33,4 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` isline: 2+ details: ""diff --git a/backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml b/backend/plugin/advisor/mysql/test/database_drop_empty_database.yamlindex 7baaf278d4..ddaa830fbb 100644--- a/backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml+++ b/backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml@@ -5,3 +5,4 @@title: database.drop-empty-databasecontent: Database `test` is not allowed to drop if not emptyline: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml b/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yamlindex 93e84e11ef..94eba64411 100644--- a/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml+++ b/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE book(id int)want:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE book(id int) ENGINE = CSVwant:- status: WARN@@ -19,6 +21,7 @@title: engine.mysql.use-innodbcontent: '"CREATE TABLE book(id int) ENGINE = CSV" doesn''t use InnoDB engine'line: 1+ details: ""- statement: ALTER TABLE tech_book ENGINE = INNODBwant:- status: SUCCESS@@ -26,6 +29,7 @@title: OKcontent: ""line: 0+ details: ""- statement: ALTER TABLE tech_book ENGINE = CSVwant:- status: WARN@@ -33,6 +37,7 @@title: engine.mysql.use-innodbcontent: '"ALTER TABLE tech_book ENGINE = CSV" doesn''t use InnoDB engine'line: 1+ details: ""- statement: SET default_storage_engine=INNODBwant:- status: SUCCESS@@ -40,6 +45,7 @@title: OKcontent: ""line: 0+ details: ""- statement: SET default_storage_engine=CSVwant:- status: WARN@@ -47,3 +53,4 @@title: engine.mysql.use-innodbcontent: '"SET default_storage_engine=CSV" doesn''t use InnoDB engine'line: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/index_key_number_limit.yaml b/backend/plugin/advisor/mysql/test/index_key_number_limit.yamlindex 1cd22615c2..fed362f8a2 100644--- a/backend/plugin/advisor/mysql/test/index_key_number_limit.yaml+++ b/backend/plugin/advisor/mysql/test/index_key_number_limit.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int,@@ -16,6 +17,7 @@title: index.key-number-limitcontent: The number of index `pk` in table `t` should be not greater than 5line: 4+ details: ""- statement: |-CREATE TABLE t(a int, b int, c int, d int, e int, f int, g int);CREATE INDEX idx ON t(a, b, c, d, e, f, g)@@ -25,6 +27,7 @@title: index.key-number-limitcontent: The number of index `idx` in table `t` should be not greater than 5line: 2+ details: ""- statement: |-CREATE TABLE t(a int, b int, c int, d int, e int, f int, g int);ALTER TABLE t ADD UNIQUE KEY uk (a, b, c, d, e, f, g)@@ -34,6 +37,7 @@title: index.key-number-limitcontent: The number of index `uk` in table `t` should be not greater than 5line: 2+ details: ""- statement: |-CREATE TABLE t(a int, b int, c int, d int, e int, f int, g int);ALTER TABLE t ADD FOREIGN KEY uk (a, b, c, d, e, f, g) REFERENCES t1(a, b, c, d, e, f, g)@@ -43,3 +47,4 @@title: index.key-number-limitcontent: The number of index `uk` in table `t` should be not greater than 5line: 2+ details: ""diff --git a/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml b/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yamlindex 62045e5c5d..8daa2383fe 100644--- a/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml+++ b/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t (a int,@@ -15,6 +16,7 @@title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`line: 3+ details: ""- statement: |-CREATE TABLE t(a int);CREATE INDEX idx_a on t(a, a)@@ -24,6 +26,7 @@title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD INDEX idx_a (a, a)@@ -33,6 +36,7 @@title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD PRIMARY KEY pk_a (a, a)@@ -42,6 +46,7 @@title: index.no-duplicate-columncontent: PRIMARY KEY `pk_a` has duplicate column `t`.`a`line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD UNIQUE KEY uk_a (a, a)@@ -51,6 +56,7 @@title: index.no-duplicate-columncontent: UNIQUE KEY `uk_a` has duplicate column `t`.`a`line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD FOREIGN KEY fk_a (a, a) REFERENCES t1(a, b)@@ -60,3 +66,4 @@title: index.no-duplicate-columncontent: FOREIGN KEY `fk_a` has duplicate column `t`.`a`line: 2+ details: ""diff --git a/backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml b/backend/plugin/advisor/mysql/test/index_pk_type_limit.yamlindex 2817902c47..24627976e5 100644--- a/backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml+++ b/backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml@@ -5,6 +5,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)line: 1+ details: ""- statement: CREATE TABLE t(id INT PRIMARY KEY)want:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(id VARCHAR(5), PRIMARY KEY(id))want:- status: WARN@@ -19,6 +21,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)line: 1+ details: ""- statement: CREATE TABLE t(id INT, id2 VARCHAR(5), id3 VARCHAR(5), PRIMARY KEY(id, id2, id3))want:- status: WARN@@ -26,11 +29,13 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)line: 1+ details: ""- status: WARNcode: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)line: 1+ details: ""- statement: CREATE TABLE t(id INT, id2 BIGINT, PRIMARY KEY(id, id2))want:- status: SUCCESS@@ -38,6 +43,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(id INT, PRIMARY KEY(id))want:- status: SUCCESS@@ -45,6 +51,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id VARCHAR(5) PRIMARY KEY@@ -54,6 +61,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id INT PRIMARY KEY@@ -63,6 +71,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id VARCHAR(5), ADD PRIMARY KEY (id)@@ -72,6 +81,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id INT, ADD COLUMN id2 VARCHAR(5), ADD COLUMN id3 VARCHAR(5), ADD PRIMARY KEY (id, id2, id3)@@ -81,11 +91,13 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)line: 2+ details: ""- status: WARNcode: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id INT, ADD COLUMN id2 BIGINT, ADD PRIMARY KEY (id, id2)@@ -95,6 +107,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id BIGINT, ADD PRIMARY KEY (id)@@ -104,6 +117,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id VARCHAR(5));ALTER TABLE t ADD PRIMARY KEY(id);@@ -113,6 +127,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)line: 2+ details: ""- statement: |-CREATE TABLE t(id INT, id2 VARCHAR(5), id3 VARCHAR(5));ALTER TABLE t ADD PRIMARY KEY(id, id2, id3);@@ -122,11 +137,13 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)line: 2+ details: ""- status: WARNcode: 803title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)line: 2+ details: ""- statement: |-CREATE TABLE t(id INT, id2 BIGINT);ALTER TABLE t ADD PRIMARY KEY(id, id2);@@ -136,6 +153,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id BIGINT);ALTER TABLE t ADD PRIMARY KEY(id);@@ -145,6 +163,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id int);ALTER TABLE t MODIFY COLUMN id VARCHAR(5) PRIMARY KEY;@@ -154,6 +173,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)line: 2+ details: ""- statement: |-CREATE TABLE t(id int);ALTER TABLE t MODIFY COLUMN id INT(5) PRIMARY KEY;@@ -163,6 +183,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id int);ALTER TABLE t CHANGE COLUMN id id2 VARCHAR(5) PRIMARY KEY@@ -172,6 +193,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)line: 2+ details: ""- statement: |-CREATE TABLE t(id int);ALTER TABLE t CHANGE COLUMN id id2 INT(5) PRIMARY KEY@@ -181,3 +203,4 @@title: OKcontent: ""line: 0+ details: ""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 94806560dd..f146fb554a 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@@ -5,6 +5,7 @@title: index.primary-key-type-allowlistcontent: The column `id` in table `t` is one of the primary key, but its type "varchar" is not in allowlistline: 1+ details: ""- statement: CREATE TABLE t(id INT PRIMARY KEY)want:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(id VARCHAR(5), PRIMARY KEY(id))want:- status: WARN@@ -19,6 +21,7 @@title: index.primary-key-type-allowlistcontent: The column `id` in table `t` is one of the primary key, but its type "varchar" is not in allowlistline: 1+ details: ""- statement: CREATE TABLE t(id INT, id2 VARCHAR(5), id3 VARCHAR(5), PRIMARY KEY(id, id2, id3))want:- status: WARN@@ -26,11 +29,13 @@title: index.primary-key-type-allowlistcontent: The column `id2` in table `t` is one of the primary key, but its type "varchar" is not in allowlistline: 1+ details: ""- 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 allowlistline: 1+ details: ""- statement: CREATE TABLE t(id INT, id2 BIGINT, PRIMARY KEY(id, id2))want:- status: SUCCESS@@ -38,6 +43,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(id INT, PRIMARY KEY(id))want:- status: SUCCESS@@ -45,6 +51,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id VARCHAR(5) PRIMARY KEY@@ -54,6 +61,7 @@title: index.primary-key-type-allowlistcontent: The column `id` in table `t` is one of the primary key, but its type "varchar" is not in allowlistline: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id INT PRIMARY KEY@@ -63,6 +71,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id VARCHAR(5), ADD PRIMARY KEY (id)@@ -72,6 +81,7 @@title: index.primary-key-type-allowlistcontent: The column `id` in table `t` is one of the primary key, but its type "varchar" is not in allowlistline: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id INT, ADD COLUMN id2 VARCHAR(5), ADD COLUMN id3 VARCHAR(5), ADD PRIMARY KEY (id, id2, id3)@@ -81,11 +91,13 @@title: index.primary-key-type-allowlistcontent: The column `id2` in table `t` is one of the primary key, but its type "varchar" is not in allowlistline: 2+ details: ""- 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 allowlistline: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id INT, ADD COLUMN id2 BIGINT, ADD PRIMARY KEY (id, id2)@@ -95,6 +107,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN id BIGINT, ADD PRIMARY KEY (id)@@ -104,6 +117,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id VARCHAR(5));ALTER TABLE t ADD PRIMARY KEY(id);@@ -113,6 +127,7 @@title: index.primary-key-type-allowlistcontent: The column `id` in table `t` is one of the primary key, but its type "varchar" is not in allowlistline: 2+ details: ""- statement: |-CREATE TABLE t(id INT, id2 VARCHAR(5), id3 VARCHAR(5));ALTER TABLE t ADD PRIMARY KEY(id, id2, id3);@@ -122,11 +137,13 @@title: index.primary-key-type-allowlistcontent: The column `id2` in table `t` is one of the primary key, but its type "varchar" is not in allowlistline: 2+ details: ""- 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 allowlistline: 2+ details: ""- statement: |-CREATE TABLE t(id INT, id2 BIGINT);ALTER TABLE t ADD PRIMARY KEY(id, id2);@@ -136,6 +153,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id BIGINT);ALTER TABLE t ADD PRIMARY KEY(id);@@ -145,6 +163,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id int);ALTER TABLE t MODIFY COLUMN id VARCHAR(5) PRIMARY KEY;@@ -154,6 +173,7 @@title: index.primary-key-type-allowlistcontent: The column `id` in table `t` is one of the primary key, but its type "varchar" is not in allowlistline: 2+ details: ""- statement: |-CREATE TABLE t(id int);ALTER TABLE t MODIFY COLUMN id INT(5) PRIMARY KEY;@@ -163,6 +183,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id int);ALTER TABLE t CHANGE COLUMN id id2 VARCHAR(5) PRIMARY KEY@@ -172,6 +193,7 @@title: index.primary-key-type-allowlistcontent: The column `id2` in table `t` is one of the primary key, but its type "varchar" is not in allowlistline: 2+ details: ""- statement: |-CREATE TABLE t(id int);ALTER TABLE t CHANGE COLUMN id id2 INT(5) PRIMARY KEY@@ -181,3 +203,4 @@title: OKcontent: ""line: 0+ details: ""diff --git a/backend/plugin/advisor/mysql/test/index_total_number_limit.yaml b/backend/plugin/advisor/mysql/test/index_total_number_limit.yamlindex 45edd91c35..ddb832a98c 100644--- a/backend/plugin/advisor/mysql/test/index_total_number_limit.yaml+++ b/backend/plugin/advisor/mysql/test/index_total_number_limit.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE INDEX idx_id_name on tech_book(id, name)want:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE INDEX idx_id_name_1 on tech_book(id, name);CREATE INDEX idx_id_name_2 on tech_book(id, name);@@ -24,6 +26,7 @@title: index.total-number-limitcontent: The count of index in table `tech_book` should be no more than 5, but found 8line: 5+ details: ""- statement: |-CREATE TABLE t(a int PRIMARY KEY, b int, c int);CREATE INDEX idx_a_b_1 on t(a, b);@@ -37,6 +40,7 @@title: index.total-number-limitcontent: The count of index in table `t` should be no more than 5, but found 6line: 6+ details: ""- statement: |-CREATE TABLE t(a int PRIMARY KEY,@@ -53,3 +57,4 @@title: index.total-number-limitcontent: The count of index in table `t` should be no more than 5, but found 6line: 9+ details: ""diff --git a/backend/plugin/advisor/mysql/test/index_type_no_blob.yaml b/backend/plugin/advisor/mysql/test/index_type_no_blob.yamlindex dc2d342e28..0442d9a067 100644--- a/backend/plugin/advisor/mysql/test/index_type_no_blob.yaml+++ b/backend/plugin/advisor/mysql/test/index_type_no_blob.yaml@@ -5,6 +5,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobline: 1+ details: ""- statement: CREATE TABLE t(b BLOB, mb MEDIUMBLOB, lb LONGBLOB, id INT, PRIMARY KEY(b(1), mb(2), lb(3), id))want:- status: WARN@@ -12,16 +13,19 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobline: 1+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobline: 1+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobline: 1+ details: ""- statement: CREATE TABLE t(b BLOB, mb MEDIUMBLOB, lb LONGBLOB, id INT, UNIQUE INDEX(b(1), mb(2), lb(3), id))want:- status: WARN@@ -29,16 +33,19 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobline: 1+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobline: 1+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobline: 1+ details: ""- statement: CREATE TABLE t(b BLOB, mb MEDIUMBLOB, lb LONGBLOB, id iNT, INDEX(b(1), mb(2), lb(3), id))want:- status: WARN@@ -46,16 +53,19 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobline: 1+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobline: 1+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobline: 1+ details: ""- statement: CREATE TABLE t(id INT, PRIMARY KEY(id))want:- status: SUCCESS@@ -63,6 +73,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN id INT, ADD PRIMARY KEY(b(1), id)@@ -72,6 +83,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobline: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN mb MEDIUMBLOB, ADD COLUMN lb LONGBLOB, ADD COLUMN id INT, ADD UNIQUE INDEX(b(1), mb(2), lb(3), id)@@ -81,16 +93,19 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobline: 2+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobline: 2+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobline: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN mb MEDIUMBLOB, ADD COLUMN lb LONGBLOB, ADD COLUMN id INT, ADD INDEX(b(1), mb(2), lb(3), id)@@ -100,16 +115,19 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobline: 2+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobline: 2+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobline: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t ADD COLUMN b BLOB, ADD COLUMN mb MEDIUMBLOB, ADD COLUMN lb LONGBLOB, ADD COLUMN id INT, ADD INDEX(id)@@ -119,6 +137,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(b blob, mb mediumblob, lb longblob, id int);CREATE INDEX idx_b ON t(b(5));@@ -131,16 +150,19 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobline: 2+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobline: 3+ details: ""- status: WARNcode: 804title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobline: 4+ details: ""- statement: |-CREATE TABLE t(b blob, mb mediumblob, lb longblob, id int);CREATE INDEX idx_id ON t(id);@@ -150,3 +172,4 @@title: OKcontent: ""line: 0+ details: ""diff --git a/backend/plugin/advisor/mysql/test/naming_column.yaml b/backend/plugin/advisor/mysql/test/naming_column.yamlindex 20f1405c65..1ce2ecf64c 100644--- a/backend/plugin/advisor/mysql/test/naming_column.yaml+++ b/backend/plugin/advisor/mysql/test/naming_column.yaml@@ -5,6 +5,7 @@title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 1+ details: ""- statement: CREATE TABLE book(id int, gbhzmtchhsjzyrhdroxmyouwloxqezowdvhcbqalqcgqhfbjnvmhwrbggezmzeusx int)want:- status: WARN@@ -12,6 +13,7 @@title: naming.columncontent: '`book`.`gbhzmtchhsjzyrhdroxmyouwloxqezowdvhcbqalqcgqhfbjnvmhwrbggezmzeusx` mismatches column naming convention, its length should be within 64 characters'line: 1+ details: ""- statement: CREATE TABLE book(id int, creator_id int)want:- status: SUCCESS@@ -19,6 +21,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int, creator_id int);ALTER TABLE book RENAME COLUMN creator_id TO creatorId@@ -28,6 +31,7 @@title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 2+ details: ""- statement: ALTER TABLE tech_book RENAME COLUMN id TO creator_id;want:- status: SUCCESS@@ -35,6 +39,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int,@@ -49,6 +54,7 @@title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 7+ details: ""- statement: ALTER TABLE tech_book CHANGE COLUMN id creator_id int;want:- status: SUCCESS@@ -56,6 +62,7 @@title: OKcontent: ""line: 0+ details: ""- statement: ALTER TABLE tech_book DROP COLUMN id;want:- status: SUCCESS@@ -63,6 +70,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE book(id int,@@ -76,6 +84,7 @@title: naming.columncontent: '`book`.`contentString` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 6+ details: ""- statement: |-CREATE TABLE book(id int,@@ -92,18 +101,22 @@title: naming.columncontent: '`book`.`createdTs` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 3+ details: ""- status: WARNcode: 302title: naming.columncontent: '`book`.`updaterId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 4+ details: ""- status: WARNcode: 302title: naming.columncontent: '`student`.`createdTs` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 8+ details: ""- status: WARNcode: 302title: naming.columncontent: '`student`.`updatedTs` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 9+ details: ""diff --git a/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml b/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yamlindex 3ea6409ab5..3201a6a383 100644--- a/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml+++ b/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE book(a int AUTO_INCREMENT)want:- status: WARN@@ -12,6 +13,7 @@title: naming.column.auto-incrementcontent: '`book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'line: 1+ details: ""- statement: ALTER TABLE tech_book ADD COLUMN a int AUTO_INCREMENTwant:- status: WARN@@ -19,6 +21,7 @@title: naming.column.auto-incrementcontent: '`tech_book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'line: 1+ details: ""- statement: ALTER TABLE tech_book CHANGE COLUMN id a int AUTO_INCREMENTwant:- status: WARN@@ -26,6 +29,7 @@title: naming.column.auto-incrementcontent: '`tech_book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'line: 1+ details: ""- statement: ALTER TABLE tech_book MODIFY COLUMN name int AUTO_INCREMENTwant:- status: WARN@@ -33,3 +37,4 @@title: naming.column.auto-incrementcontent: '`tech_book`.`name` mismatches auto_increment column naming convention, naming format should be "^id$"'line: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/naming_index_fk.yaml b/backend/plugin/advisor/mysql/test/naming_index_fk.yamlindex 74643398e4..112616d4c5 100644--- a/backend/plugin/advisor/mysql/test/naming_index_fk.yaml+++ b/backend/plugin/advisor/mysql/test/naming_index_fk.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: ALTER TABLE tech_book ADD CONSTRAINT fk_author_id FOREIGN KEY (author_id) REFERENCES author (id)want:- status: WARN@@ -12,6 +13,7 @@title: 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+ details: ""- statement: ALTER TABLE tech_book ADD CONSTRAINT rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk FOREIGN KEY (author_id) REFERENCES author (id)want:- status: WARN@@ -19,11 +21,13 @@title: 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+ details: ""- status: WARNcode: 305title: naming.index.fkcontent: Foreign key `rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk` in table `tech_book` mismatches the naming convention, its length should be within 64 charactersline: 1+ details: ""- statement: CREATE TABLE book(id INT, author_id INT, FOREIGN KEY fk_book_author_id_author_id (author_id) REFERENCES author (id))want:- status: SUCCESS@@ -31,6 +35,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE book(id INT, author_id INT, FOREIGN KEY (author_id) REFERENCES author (id))want:- status: SUCCESS@@ -38,6 +43,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE book(id INT, author_id INT, FOREIGN KEY fk_book_author_id (author_id) REFERENCES author (id))want:- status: WARN@@ -45,3 +51,4 @@title: naming.index.fkcontent: Foreign key in table `book` mismatches the naming convention, expect "^$|^fk_book_author_id_author_id$" but found `fk_book_author_id`line: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/naming_index_idx.yaml b/backend/plugin/advisor/mysql/test/naming_index_idx.yamlindex 4461459a28..79a89fa586 100644--- a/backend/plugin/advisor/mysql/test/naming_index_idx.yaml+++ b/backend/plugin/advisor/mysql/test/naming_index_idx.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE INDEX tech_book_id_name ON tech_book(id, name)want:- status: WARN@@ -12,6 +13,7 @@title: 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+ details: ""- statement: CREATE INDEX afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw ON tech_book(id, name)want:- status: WARN@@ -19,11 +21,13 @@title: naming.index.idxcontent: Index in table `tech_book` mismatches the naming convention, expect "^$|^idx_tech_book_id_name$" but found `afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw`line: 1+ details: ""- status: WARNcode: 303title: naming.index.idxcontent: Index `afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw` in table `tech_book` mismatches the naming convention, its length should be within 64 charactersline: 1+ details: ""- statement: ALTER TABLE tech_book RENAME INDEX old_index TO idx_tech_book_id_namewant:- status: SUCCESS@@ -31,6 +35,7 @@title: OKcontent: ""line: 0+ details: ""- statement: ALTER TABLE tech_book RENAME INDEX old_index TO idx_tech_bookwant:- status: WARN@@ -38,6 +43,7 @@title: 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+ details: ""- statement: ALTER TABLE tech_book ADD INDEX idx_tech_book_id_name (id, name)want:- status: SUCCESS@@ -45,6 +51,7 @@title: OKcontent: ""line: 0+ details: ""- statement: ALTER TABLE tech_book ADD INDEX tech_book_id_name (id, name)want:- status: WARN@@ -52,6 +59,7 @@title: 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+ details: ""- statement: CREATE TABLE tech_book_copy(id INT PRIMARY KEY, name VARCHAR(20), INDEX idx_tech_book_copy_name (name))want:- status: SUCCESS@@ -59,6 +67,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE tech_book_copy(id INT PRIMARY KEY, name VARCHAR(20), INDEX (name))want:- status: SUCCESS@@ -66,3 +75,4 @@title: OKcontent: ""line: 0+ details: ""diff --git a/backend/plugin/advisor/mysql/test/naming_index_uk.yaml b/backend/plugin/advisor/mysql/test/naming_index_uk.yamlindex d3efefd84f..bb03ac33e9 100644--- a/backend/plugin/advisor/mysql/test/naming_index_uk.yaml+++ b/backend/plugin/advisor/mysql/test/naming_index_uk.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE UNIQUE INDEX tech_book_id_name ON tech_book(id, name)want:- status: WARN@@ -12,6 +13,7 @@title: 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+ details: ""- statement: CREATE UNIQUE INDEX qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy ON tech_book(id, name)want:- status: WARN@@ -19,11 +21,13 @@title: naming.index.ukcontent: Unique key in table `tech_book` mismatches the naming convention, expect "^$|^uk_tech_book_id_name$" but found `qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy`line: 1+ details: ""- status: WARNcode: 304title: naming.index.ukcontent: Unique key `qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy` in table `tech_book` mismatches the naming convention, its length should be within 64 charactersline: 1+ details: ""- statement: ALTER TABLE tech_book ADD UNIQUE uk_tech_book_id_name (id, name)want:- status: SUCCESS@@ -31,6 +35,7 @@title: OKcontent: ""line: 0+ details: ""- statement: ALTER TABLE tech_book ADD UNIQUE tech_book_id_name (id, name)want:- status: WARN@@ -38,6 +43,7 @@title: 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+ details: ""- statement: ALTER TABLE tech_book RENAME INDEX old_uk TO uk_tech_book_id_namewant:- status: SUCCESS@@ -45,6 +51,7 @@title: OKcontent: ""line: 0+ details: ""- statement: ALTER TABLE tech_book RENAME INDEX old_uk TO uk_tech_bookwant:- status: WARN@@ -52,6 +59,7 @@title: 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+ details: ""- statement: CREATE TABLE book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE INDEX uk_book_name (name))want:- status: SUCCESS@@ -59,6 +67,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE KEY (name))want:- status: SUCCESS@@ -66,6 +75,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE INDEX (name))want:- status: SUCCESS@@ -73,3 +83,4 @@title: OKcontent: ""line: 0+ details: ""diff --git a/backend/plugin/advisor/mysql/test/naming_table.yaml b/backend/plugin/advisor/mysql/test/naming_table.yamlindex 4a7a95da34..a7e411fef3 100644--- a/backend/plugin/advisor/mysql/test/naming_table.yaml+++ b/backend/plugin/advisor/mysql/test/naming_table.yaml@@ -5,6 +5,7 @@title: naming.tablecontent: '`techBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 1+ details: ""- statement: CREATE TABLE tech_book_copy(id int, name varchar(255))want:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE cjnubexocfhqoogdmihudyahmmghviqkzvpixnwvxtxumvuannpwdcbtsgwrvzpde(id int, name varchar(255))want:- status: WARN@@ -19,6 +21,7 @@title: naming.tablecontent: '`cjnubexocfhqoogdmihudyahmmghviqkzvpixnwvxtxumvuannpwdcbtsgwrvzpde` mismatches table naming convention, its length should be within 64 characters'line: 1+ details: ""- statement: ALTER TABLE tech_book RENAME TO TechBookwant:- status: WARN@@ -26,6 +29,7 @@title: naming.tablecontent: '`TechBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 1+ details: ""- statement: ALTER TABLE tech_book RENAME TO tech_book_copywant:- status: SUCCESS@@ -33,6 +37,7 @@title: OKcontent: ""line: 0+ details: ""- statement: RENAME TABLE tech_book TO tech_book_copy, tech_book_copy TO LiteraryBookwant:- status: WARN@@ -40,6 +45,7 @@title: naming.tablecontent: '`LiteraryBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 1+ details: ""- statement: CREATE TABLE literary_book(a int);RENAME TABLE tech_book TO TechBook, literary_book TO LiteraryBookwant:- status: WARN@@ -47,11 +53,13 @@title: naming.tablecontent: '`TechBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 1+ details: ""- status: WARNcode: 301title: naming.tablecontent: '`LiteraryBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'line: 1+ details: ""- statement: CREATE TABLE literary_book(a int);RENAME TABLE tech_book TO tech_book_copy, literary_book TO literary_book_copywant:- status: SUCCESS@@ -59,3 +67,4 @@title: OKcontent: ""line: 0+ details: ""diff --git a/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml b/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yamlindex 5ed20c9ff5..c75a85a891 100644--- a/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml+++ b/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml@@ -5,6 +5,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book CHANGE name f2 TEXT" may cause incompatibility with the existing data and code'line: 1+ details: ""- statement: ALTER TABLE tech_book MODIFY name TEXTwant:- status: WARN@@ -12,6 +13,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT" may cause incompatibility with the existing data and code'line: 1+ details: ""- statement: ALTER TABLE tech_book MODIFY name TEXT NULLwant:- status: WARN@@ -19,6 +21,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT NULL" may cause incompatibility with the existing data and code'line: 1+ details: ""- statement: ALTER TABLE tech_book MODIFY name TEXT NOT NULLwant:- status: WARN@@ -26,6 +29,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT NOT NULL" may cause incompatibility with the existing data and code'line: 1+ details: ""- statement: ALTER TABLE tech_book MODIFY name TEXT COMMENT 'bla'want:- status: WARN@@ -33,3 +37,4 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT COMMENT ''bla''" may cause incompatibility with the existing data and code'line: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_affected_row_limit.yaml b/backend/plugin/advisor/mysql/test/statement_affected_row_limit.yamlindex a23ef20e45..58391995e6 100644--- a/backend/plugin/advisor/mysql/test/statement_affected_row_limit.yaml+++ b/backend/plugin/advisor/mysql/test/statement_affected_row_limit.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: UPDATE tech_book SET id = 1want:- status: SUCCESS@@ -12,3 +13,4 @@title: OKcontent: ""line: 0+ details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_commit.yamlindex 0293cbec31..fcf79a651d 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml@@ -8,6 +8,7 @@title: statement.disallow-commitcontent: 'Commit is not allowed, related statement: "COMMIT;"'line: 3+ details: ""- statement: |-START TRANSACTION;CREATE TABLE techBook(id int, name varchar(255));@@ -22,8 +23,10 @@title: statement.disallow-commitcontent: 'Commit is not allowed, related statement: "COMMIT;"'line: 3+ details: ""- status: WARNcode: 206title: statement.disallow-commitcontent: 'Commit is not allowed, related statement: "COMMIT;"'line: 7+ details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_limit.yamlindex a1832b402c..d136ed57ac 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: INSERT INTO tech_book SELECT * FROM tech_book LIMIT 1want:- status: WARN@@ -12,6 +13,7 @@title: statement.disallow-limitcontent: LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "INSERT INTO tech_book SELECT * FROM tech_book LIMIT 1" usesline: 1+ details: ""- statement: INSERT INTO tech_book SELECT * FROM tech_book UNION SELECT * FROM tech_book LIMIT 1want:- status: WARN@@ -19,6 +21,7 @@title: statement.disallow-limitcontent: 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" usesline: 1+ details: ""- statement: UPDATE tech_book SET name = 'my name' LIMIT 10want:- status: WARN@@ -26,6 +29,7 @@title: statement.disallow-limitcontent: LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "UPDATE tech_book SET name = 'my name' LIMIT 10" usesline: 1+ details: ""- statement: DELETE FROM tech_book LIMIT 10want:- status: WARN@@ -33,3 +37,4 @@title: statement.disallow-limitcontent: LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "DELETE FROM tech_book LIMIT 10" usesline: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yamlindex c0cdd5020a..e9f45b9e6a 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: UPDATE tech_book SET name = 'my name' ORDER BY idwant:- status: WARN@@ -12,6 +13,7 @@title: statement.disallow-order-bycontent: ORDER BY clause is forbidden in DELETE and UPDATE statements, but "UPDATE tech_book SET name = 'my name' ORDER BY id" usesline: 1+ details: ""- statement: DELETE FROM tech_book ORDER BY idwant:- status: WARN@@ -19,3 +21,4 @@title: statement.disallow-order-bycontent: ORDER BY clause is forbidden in DELETE and UPDATE statements, but "DELETE FROM tech_book ORDER BY id" usesline: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_dml_dry_run.yaml b/backend/plugin/advisor/mysql/test/statement_dml_dry_run.yamlindex df16988259..c9f492fe7a 100644--- a/backend/plugin/advisor/mysql/test/statement_dml_dry_run.yaml+++ b/backend/plugin/advisor/mysql/test/statement_dml_dry_run.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: DELETE FROM tech_bookwant:- status: SUCCESS@@ -12,3 +13,4 @@title: OKcontent: ""line: 0+ details: ""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 9b5896577a..79a825f657 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@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: INSERT INTO tech_book SELECT * FROM tech_book ORDER BY rand()want:- status: WARN@@ -12,3 +13,4 @@title: statement.insert.disallow-order-by-randcontent: '"INSERT INTO tech_book SELECT * FROM tech_book ORDER BY rand()" uses ORDER BY RAND in the INSERT statement'line: 1+ details: ""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 bcf13aec8f..ed3beaefcf 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@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: INSERT INTO tech_book VALUES (1, '1')want:- status: WARN@@ -12,3 +13,4 @@title: statement.insert.must-specify-columncontent: The INSERT statement must specify columns but "INSERT INTO tech_book VALUES (1, '1')" does notline: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml b/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yamlindex a143330655..eadd625df6 100644--- a/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml+++ b/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: INSERT INTO tech_book values(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')want:- status: WARN@@ -12,6 +13,7 @@title: statement.insert.row-limitcontent: '"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+ details: ""- statement: INSERT INTO tech_book SELECT * FROM tech_bookwant:- status: SUCCESS@@ -19,3 +21,4 @@title: OKcontent: ""line: 0+ details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml b/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yamlindex d33f1bfc34..bd31e8960c 100644--- a/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml+++ b/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-ALTER TABLE tech_book ADD COLUMN a int;ALTER TABLE tech_book ADD COLUMN b int;@@ -14,6 +15,7 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE tech_book ADD COLUMN a int;@@ -25,11 +27,13 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `t`line: 3+ details: ""- status: WARNcode: 207title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`line: 4+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE tech_book ADD COLUMN a int;@@ -41,8 +45,10 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`line: 3+ details: ""- status: WARNcode: 207title: statement.merge-alter-tablecontent: There are 2 statements to modify table `t`line: 4+ details: ""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 7e2c6f4a63..4f12df0613 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@@ -5,6 +5,7 @@title: statement.select.no-select-allcontent: '"SELECT * FROM t" uses SELECT all'line: 1+ details: ""- statement: SELECT a, b FROM twant:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: SELECT a, b FROM (SELECT * from t1 JOIN t2) twant:- status: WARN@@ -19,3 +21,4 @@title: statement.select.no-select-allcontent: '"SELECT a, b FROM (SELECT * from t1 JOIN t2) t" uses SELECT all'line: 1+ details: ""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 f4e3424b48..0765d6e4d9 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@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: SELECT * FROM t WHERE a LIKE '%abc'want:- status: WARN@@ -12,6 +13,7 @@title: statement.where.no-leading-wildcard-likecontent: '"SELECT * FROM t WHERE a LIKE ''%abc''" uses leading wildcard LIKE'line: 1+ details: ""- statement: SELECT * FROM t WHERE a LIKE 'abc' OR a LIKE '%abc'want:- status: WARN@@ -19,6 +21,7 @@title: statement.where.no-leading-wildcard-likecontent: '"SELECT * FROM t WHERE a LIKE ''abc'' OR a LIKE ''%abc''" uses leading wildcard LIKE'line: 1+ details: ""- statement: SELECT * FROM t WHERE a LIKE '%acc' OR a LIKE '%abc'want:- status: WARN@@ -26,6 +29,7 @@title: statement.where.no-leading-wildcard-likecontent: '"SELECT * FROM t WHERE a LIKE ''%acc'' OR a LIKE ''%abc''" uses leading wildcard LIKE'line: 1+ details: ""- statement: SELECT * FROM (SELECT * FROM t WHERE a LIKE '%acc' OR a LIKE '%abc') t1want:- status: WARN@@ -33,3 +37,4 @@title: statement.where.no-leading-wildcard-likecontent: '"SELECT * FROM (SELECT * FROM t WHERE a LIKE ''%acc'' OR a LIKE ''%abc'') t1" uses leading wildcard LIKE'line: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/statement_where_require.yaml b/backend/plugin/advisor/mysql/test/statement_where_require.yamlindex e4348c306c..af4064bd2c 100644--- a/backend/plugin/advisor/mysql/test/statement_where_require.yaml+++ b/backend/plugin/advisor/mysql/test/statement_where_require.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: DELETE FROM tech_bookwant:- status: WARN@@ -12,6 +13,7 @@title: statement.where.requirecontent: '"DELETE FROM tech_book" requires WHERE clause'line: 1+ details: ""- statement: UPDATE tech_book SET id = 1want:- status: WARN@@ -19,6 +21,7 @@title: statement.where.requirecontent: '"UPDATE tech_book SET id = 1" requires WHERE clause'line: 1+ details: ""- statement: DELETE FROM tech_book WHERE id > 0want:- status: SUCCESS@@ -26,6 +29,7 @@title: OKcontent: ""line: 0+ details: ""- statement: UPDATE tech_book SET id = 1 WHERE id > 10want:- status: SUCCESS@@ -33,6 +37,7 @@title: OKcontent: ""line: 0+ details: ""- statement: SELECT id FROM tech_bookwant:- status: WARN@@ -40,6 +45,7 @@title: statement.where.requirecontent: '"SELECT id FROM tech_book" requires WHERE clause'line: 1+ details: ""- statement: SELECT id FROM tech_book WHERE id > 0want:- status: SUCCESS@@ -47,6 +53,7 @@title: OKcontent: ""line: 0+ details: ""- statement: SELECT id FROM tech_book WHERE id > (SELECT max(id) FROM tech_book)want:- status: WARN@@ -54,3 +61,4 @@title: statement.where.requirecontent: '"SELECT id FROM tech_book WHERE id > (SELECT max(id) FROM tech_book)" requires WHERE clause'line: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml b/backend/plugin/advisor/mysql/test/system_charset_allowlist.yamlindex ef9e429aae..a2569b3553 100644--- a/backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml+++ b/backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(a varchar(255))want:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(a int) CHARSET asciiwant:- status: WARN@@ -19,6 +21,7 @@title: system.charset.allowlistcontent: '"CREATE TABLE t(a int) CHARSET ascii" used disabled charset ''ascii'''line: 1+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t CHARSET ascii@@ -28,6 +31,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t CHARSET ascii" used disabled charset ''ascii'''line: 2+ details: ""- statement: ALTER DATABASE test CHARSET asciiwant:- status: WARN@@ -35,6 +39,7 @@title: system.charset.allowlistcontent: '"ALTER DATABASE test CHARSET ascii" used disabled charset ''ascii'''line: 1+ details: ""- statement: CREATE TABLE t(a varchar(255) CHARSET ascii)want:- status: WARN@@ -42,6 +47,7 @@title: system.charset.allowlistcontent: '"CREATE TABLE t(a varchar(255) CHARSET ascii)" used disabled charset ''ascii'''line: 1+ details: ""- statement: |-CREATE TABLE t(b int);ALTER TABLE t ADD COLUMN a varchar(255) CHARSET ascii@@ -51,6 +57,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t ADD COLUMN a varchar(255) CHARSET ascii" used disabled charset ''ascii'''line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t MODIFY COLUMN a varchar(255) CHARSET ascii@@ -60,6 +67,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t MODIFY COLUMN a varchar(255) CHARSET ascii" used disabled charset ''ascii'''line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARSET ascii@@ -69,6 +77,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARSET ascii" used disabled charset ''ascii'''line: 2+ details: ""- statement: /* this is a comment */want:- status: SUCCESS@@ -76,3 +85,4 @@title: OKcontent: ""line: 0+ details: ""diff --git a/backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml b/backend/plugin/advisor/mysql/test/system_collation_allowlist.yamlindex ce69200e64..bdc6be1159 100644--- a/backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml+++ b/backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml@@ -5,6 +5,7 @@title: system.collation.allowlistcontent: '"CREATE TABLE t(a int) COLLATE utf8mb4_polish_ci" used disabled collation ''utf8mb4_polish_ci'''line: 1+ details: ""- statement: CREATE TABLE t(a varchar(255))want:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(a int) COLLATE latin1_binwant:- status: WARN@@ -19,6 +21,7 @@title: system.collation.allowlistcontent: '"CREATE TABLE t(a int) COLLATE latin1_bin" used disabled collation ''latin1_bin'''line: 1+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t COLLATE latin1_bin@@ -28,6 +31,7 @@title: system.collation.allowlistcontent: '"ALTER TABLE t COLLATE latin1_bin" used disabled collation ''latin1_bin'''line: 2+ details: ""- statement: ALTER DATABASE test COLLATE latin1_binwant:- status: WARN@@ -35,6 +39,7 @@title: system.collation.allowlistcontent: '"ALTER DATABASE test COLLATE latin1_bin" used disabled collation ''latin1_bin'''line: 1+ details: ""- statement: CREATE TABLE t(a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin)want:- status: WARN@@ -42,6 +47,7 @@title: system.collation.allowlistcontent: '"CREATE TABLE t(a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin)" used disabled collation ''latin1_bin'''line: 1+ details: ""- statement: |-CREATE TABLE t(b int);ALTER TABLE t ADD COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin@@ -51,6 +57,7 @@title: system.collation.allowlistcontent: '"ALTER TABLE t ADD COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin" used disabled collation ''latin1_bin'''line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t MODIFY COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin@@ -60,6 +67,7 @@title: system.collation.allowlistcontent: '"ALTER TABLE t MODIFY COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin" used disabled collation ''latin1_bin'''line: 2+ details: ""- statement: |-CREATE TABLE t(a int);ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin@@ -69,3 +77,4 @@title: system.collation.allowlistcontent: '"ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin" used disabled collation ''latin1_bin'''line: 2+ details: ""diff --git a/backend/plugin/advisor/mysql/test/table_comment.yaml b/backend/plugin/advisor/mysql/test/table_comment.yamlindex 89aae589c4..e9f1263ebd 100644--- a/backend/plugin/advisor/mysql/test/table_comment.yaml+++ b/backend/plugin/advisor/mysql/test/table_comment.yaml@@ -5,6 +5,7 @@title: table.commentcontent: The length of table `t` comment should be within 10 charactersline: 1+ details: ""- statement: CREATE TABLE t(a int)want:- status: WARN@@ -12,6 +13,7 @@title: table.commentcontent: Table `t` requires commentsline: 1+ details: ""- statement: CREATE TABLE t(a int) COMMENT 'sdlfkjalkseblkjduafelbnlsdfkljayue'want:- status: WARN@@ -19,3 +21,4 @@title: table.commentcontent: The length of table `t` comment should be within 10 charactersline: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/table_disallow_partition.yaml b/backend/plugin/advisor/mysql/test/table_disallow_partition.yamlindex 6f3b7c019d..58fe721c39 100644--- a/backend/plugin/advisor/mysql/test/table_disallow_partition.yaml+++ b/backend/plugin/advisor/mysql/test/table_disallow_partition.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(a int) PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (6),@@ -20,6 +21,7 @@PARTITION p1 VALUES LESS THAN (11))" createsline: 4+ details: ""- statement: |-ALTER TABLE tech_book PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (6),@@ -35,3 +37,4 @@PARTITION p1 VALUES LESS THAN (11))" createsline: 4+ details: ""diff --git a/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml b/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yamlindex 7143a405ab..a54ba29f54 100644--- a/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml+++ b/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: DROP TABLE IF EXISTS foowant:- status: WARN@@ -12,6 +13,7 @@title: table.drop-naming-conventioncontent: '`foo` mismatches drop table naming convention, naming format should be "_delete$"'line: 1+ details: ""- statement: DROP TABLE IF EXISTS foo_delete, barwant:- status: WARN@@ -19,3 +21,4 @@title: table.drop-naming-conventioncontent: '`bar` mismatches drop table naming convention, naming format should be "_delete$"'line: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml b/backend/plugin/advisor/mysql/test/table_no_foreign_key.yamlindex 188ce1b7ce..a612f5c79d 100644--- a/backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml+++ b/backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml@@ -5,6 +5,7 @@title: table.no-foreign-keycontent: Foreign key is not allowed in the table `tech_book`line: 1+ details: ""- statement: CREATE TABLE book(id INT, author_id INT, FOREIGN KEY fk_book_author_id_author_id (author_id) REFERENCES author (id))want:- status: WARN@@ -12,3 +13,4 @@title: table.no-foreign-keycontent: Foreign key is not allowed in the table `book`line: 1+ details: ""diff --git a/backend/plugin/advisor/mysql/test/table_require_pk.yaml b/backend/plugin/advisor/mysql/test/table_require_pk.yamlindex 991ea6b016..edcd895663 100644--- a/backend/plugin/advisor/mysql/test/table_require_pk.yaml+++ b/backend/plugin/advisor/mysql/test/table_require_pk.yaml@@ -5,6 +5,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(id INT, PRIMARY KEY (id))want:- status: SUCCESS@@ -12,6 +13,7 @@title: OKcontent: ""line: 0+ details: ""- statement: CREATE TABLE t(id INT)want:- status: WARN@@ -19,6 +21,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYline: 1+ details: ""- statement: |-CREATE TABLE t(id INT);DROP TABLE t@@ -28,6 +31,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id INT);ALTER TABLE t ADD CONSTRAINT PRIMARY KEY (id)@@ -37,6 +41,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id INT PRIMARY KEY);ALTER TABLE t DROP PRIMARY KEY@@ -46,6 +51,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYline: 2+ details: ""- statement: |-CREATE TABLE t(id INT PRIMARY KEY);ALTER TABLE t DROP INDEX `PRIMARY`@@ -55,6 +61,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYline: 2+ details: ""- statement: |-CREATE TABLE t(id INT);ALTER TABLE t ADD COLUMN name varchar(30) PRIMARY KEY@@ -64,6 +71,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id INT);ALTER TABLE t CHANGE COLUMN id id INT PRIMARY KEY@@ -73,6 +81,7 @@title: OKcontent: ""line: 0+ details: ""- statement: ALTER TABLE tech_book CHANGE COLUMN id uid INTwant:- status: SUCCESS@@ -80,6 +89,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id INT);ALTER TABLE t MODIFY COLUMN id INT PRIMARY KEY@@ -89,6 +99,7 @@title: OKcontent: ""line: 0+ details: ""- statement: ALTER TABLE tech_book MODIFY COLUMN id INTwant:- status: SUCCESS@@ -96,6 +107,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id INT, name varchar(30), PRIMARY KEY(id, name));ALTER TABLE t DROP COLUMN id@@ -105,6 +117,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-CREATE TABLE t(id INT, name varchar(30), comment varchar(255), PRIMARY KEY(id, name));ALTER TABLE t DROP COLUMN id, DROP COLUMN name@@ -114,6 +127,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYline: 2+ details: ""- statement: ALTER TABLE tech_book ADD COLUMN a int, DROP COLUMN id, DROP COLUMN namewant:- status: WARN@@ -121,6 +135,7 @@title: table.require-pkcontent: Table `tech_book` requires PRIMARY KEYline: 1+ details: ""- statement: ALTER TABLE tech_book DROP COLUMN namewant:- status: SUCCESS@@ -128,6 +143,7 @@title: OKcontent: ""line: 0+ details: ""- statement: |-ALTER TABLE tech_book CHANGE COLUMN id uid int;ALTER TABLE tech_book ADD COLUMN a int, DROP COLUMN uid, DROP COLUMN name@@ -137,3 +153,4 @@title: table.require-pkcontent: Table `tech_book` requires PRIMARY KEYline: 2+ details: ""