Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: standardize Position to use 1-based line and column numbering (#17770)
Danny Xu520be4e3f8c3
diff --git a/backend/common/position.go b/backend/common/position.goindex 51e486608f..881e13d4fd 100644--- a/backend/common/position.go+++ b/backend/common/position.go@@ -52,9 +52,11 @@ func ConvertANTLRPositionToPosition(a *ANTLRPosition, text string) *storepb.Posi}func ConvertANTLRLineToPosition(line int) *storepb.Position {- positionLine := line - 1- if line == 0 {- positionLine = 0+ // ANTLR line numbers are 1-based, and Position uses 1-based line numbering.+ // Just pass through the value, handling the 0 case for safety.+ positionLine := line+ if line < 1 {+ positionLine = 1}return &storepb.Position{Line: int32(positionLine),diff --git a/backend/generated-go/store/common.pb.go b/backend/generated-go/store/common.pb.goindex 87e6d3daf6..dc13609c4d 100644--- a/backend/generated-go/store/common.pb.go+++ b/backend/generated-go/store/common.pb.go@@ -524,25 +524,24 @@ func (x *PageToken) GetOffset() int32 {return 0}-// Position in a text.-// Line is 0-based, Column is 1-based.-//-// Why this mixed numbering?-// - Line is 0-based to match LSP (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)-// and common programming practice (arrays/lists are 0-indexed)-// - Column is 1-based to match user expectations (text editors show "column 1" for the first character)+// Position in a text expressed as one-based line and one-based column.+// We use 1-based numbering to match the majority of industry standards:+// - Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)+// - GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)+// - Most text editors display 1-based positions to users+// Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),+// but we follow the canonical user-facing standards.//// Handling unknown positions:// - If the entire position is unknown, leave this field as nil/undefined// - If only line is known, set line and leave column as 0 (e.g., line=5, column=0)// - If only column is known (rare), set column and leave line as 0// Frontends should check for nil/undefined/zero values and handle them appropriately.-//-// When displaying to users, convert to 1-based: display "line X" as "line X+1".type Position struct {state protoimpl.MessageState `protogen:"open.v1"`- // Line position in a text (zero-based).- // First line of the text is line 0, second line is line 1, etc.+ // Line position in a text (one-based).+ // First line of the text is line 1.+ // A value of 0 indicates the line information is unknown.Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`// Column position in a text (one-based).// Column is measured in Unicode code points (characters/runes), not bytes or grapheme clusters.diff --git a/backend/generated-go/v1/common.pb.go b/backend/generated-go/v1/common.pb.goindex c456d17e42..f864a9a50b 100644--- a/backend/generated-go/v1/common.pb.go+++ b/backend/generated-go/v1/common.pb.go@@ -505,25 +505,24 @@ func (RiskLevel) EnumDescriptor() ([]byte, []int) {return file_v1_common_proto_rawDescGZIP(), []int{6}}-// Position in a text.-// Line is 0-based, Column is 1-based.-//-// Why this mixed numbering?-// - Line is 0-based to match LSP (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)-// and common programming practice (arrays/lists are 0-indexed)-// - Column is 1-based to match user expectations (text editors show "column 1" for the first character)+// Position in a text expressed as one-based line and one-based column.+// We use 1-based numbering to match the majority of industry standards:+// - Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)+// - GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)+// - Most text editors display 1-based positions to users+// Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),+// but we follow the canonical user-facing standards.//// Handling unknown positions:// - If the entire position is unknown, leave this field as nil/undefined// - If only line is known, set line and leave column as 0 (e.g., line=5, column=0)// - If only column is known (rare), set column and leave line as 0// Frontends should check for nil/undefined/zero values and handle them appropriately.-//-// When displaying to users, convert to 1-based: display "line X" as "line X+1".type Position struct {state protoimpl.MessageState `protogen:"open.v1"`- // Line position in a text (zero-based).- // First line of the text is line 0, second line is line 1, etc.+ // Line position in a text (one-based).+ // First line of the text is line 1.+ // A value of 0 indicates the line information is unknown.Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`// Column position in a text (one-based).// Column is measured in Unicode code points (characters/runes), not bytes or grapheme clusters.diff --git a/backend/plugin/advisor/mssql/test/column_maximum_varchar_length.yaml b/backend/plugin/advisor/mssql/test/column_maximum_varchar_length.yamlindex 87d0a1ec2d..a21ff23b87 100644--- a/backend/plugin/advisor/mssql/test/column_maximum_varchar_length.yaml+++ b/backend/plugin/advisor/mssql/test/column_maximum_varchar_length.yaml@@ -8,7 +8,7 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE MyTable ALTER COLUMN a VARCHAR(MAX);@@ -19,7 +19,7 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE MyTable ALTER COLUMN a NVARCHAR(MAX);@@ -30,6 +30,6 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/column_no_null.yaml b/backend/plugin/advisor/mssql/test/column_no_null.yamlindex 034ee9c733..5a201f8838 100644--- a/backend/plugin/advisor/mssql/test/column_no_null.yaml+++ b/backend/plugin/advisor/mssql/test/column_no_null.yaml@@ -12,7 +12,7 @@title: column.no-nullcontent: Column [age] is nullable, which is not allowed.startposition:- line: 3+ line: 4column: 0endposition: null- status: 2@@ -20,7 +20,7 @@title: column.no-nullcontent: Column [address] is nullable, which is not allowed.startposition:- line: 4+ line: 5column: 0endposition: null- statement: |-@@ -38,7 +38,7 @@title: column.no-nullcontent: Column [address] is nullable, which is not allowed.startposition:- line: 4+ line: 5column: 0endposition: null- statement: ALTER TABLE MyTable ALTER COLUMN Name VARCHAR(100) NULL;@@ -49,7 +49,7 @@title: column.no-nullcontent: Column [name] is nullable, which is not allowed.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE MyTable ALTER COLUMN Name VARCHAR(100) NOT NULL;@@ -62,7 +62,7 @@title: column.no-nullcontent: Column [age] is nullable, which is not allowed.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE MyTable ADD Age INT NULL;@@ -73,7 +73,7 @@title: column.no-nullcontent: Column [age] is nullable, which is not allowed.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE MyTable ADD Age INT NOT NULL;diff --git a/backend/plugin/advisor/mssql/test/column_required.yaml b/backend/plugin/advisor/mssql/test/column_required.yamlindex 93236a97e0..b28664eb69 100644--- a/backend/plugin/advisor/mssql/test/column_required.yaml+++ b/backend/plugin/advisor/mssql/test/column_required.yaml@@ -19,7 +19,7 @@title: column.requiredcontent: Table t missing required column "created_ts"startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -27,7 +27,7 @@title: column.requiredcontent: Table t missing required column "creator_id"startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -35,7 +35,7 @@title: column.requiredcontent: Table t missing required column "id"startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -43,7 +43,7 @@title: column.requiredcontent: Table t missing required column "updated_ts"startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -51,7 +51,7 @@title: column.requiredcontent: Table t missing required column "updater_id"startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -68,7 +68,7 @@title: column.requiredcontent: Table t missing required column "updated_ts"startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE t DROP COLUMN created_ts;@@ -79,7 +79,7 @@title: column.requiredcontent: Table t missing required column "created_ts"startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE t DROP COLUMN creator_id;@@ -90,6 +90,6 @@title: column.requiredcontent: Table t missing required column "creator_id"startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/column_type_disallow_list.yaml b/backend/plugin/advisor/mssql/test/column_type_disallow_list.yamlindex 55870ca444..0e4762b2cb 100644--- a/backend/plugin/advisor/mssql/test/column_type_disallow_list.yaml+++ b/backend/plugin/advisor/mssql/test/column_type_disallow_list.yaml@@ -11,6 +11,6 @@title: column.type-disallow-listcontent: Column type JSON is disallowedstartposition:- line: 3+ line: 4column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/index_not_redundant.yaml b/backend/plugin/advisor/mssql/test/index_not_redundant.yamlindex a06d5c1e83..68a13ca18c 100644--- a/backend/plugin/advisor/mssql/test/index_not_redundant.yaml+++ b/backend/plugin/advisor/mssql/test/index_not_redundant.yaml@@ -6,7 +6,7 @@title: index.not-redundantcontent: Redundant indexes with the same prefix ('idx_0' and 'test_index') in 'dbo.pokes' is not allowedstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE INDEX test_index ON dbo.pokes (c100, c200);@@ -19,6 +19,6 @@title: index.not-redundantcontent: Redundant indexes with the same prefix ('idx_0' and 'test_index') in 'dbo.pokes' is not allowedstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/naming_identifier_no_keyword.yaml b/backend/plugin/advisor/mssql/test/naming_identifier_no_keyword.yamlindex 3e035cacdd..0f55729cd2 100644--- a/backend/plugin/advisor/mssql/test/naming_identifier_no_keyword.yaml+++ b/backend/plugin/advisor/mssql/test/naming_identifier_no_keyword.yaml@@ -8,7 +8,7 @@title: naming.identifier.no-keywordcontent: Identifier [exec] is a keyword identifier and should be avoided.startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -16,7 +16,7 @@title: naming.identifier.no-keywordcontent: Identifier [fillfactor] is a keyword identifier and should be avoided.startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -24,7 +24,7 @@title: naming.identifier.no-keywordcontent: Identifier [add] is a keyword identifier and should be avoided.startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -32,6 +32,6 @@title: naming.identifier.no-keywordcontent: Identifier [fillfactor] is a keyword identifier and should be avoided.startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/naming_table.yaml b/backend/plugin/advisor/mssql/test/naming_table.yamlindex a8f31e3ece..e5f86ad672 100644--- a/backend/plugin/advisor/mssql/test/naming_table.yaml+++ b/backend/plugin/advisor/mssql/test/naming_table.yaml@@ -8,7 +8,7 @@title: naming.tablecontent: '[\\] mismatches table naming convention, naming format should be "^[A-Z]([_A-Za-z])*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE all_lowercase(ID INT);@@ -19,7 +19,7 @@title: naming.tablecontent: all_lowercase mismatches table naming convention, naming format should be "^[A-Z]([_A-Za-z])*$"startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE PascalCase(ID INT);@@ -34,6 +34,6 @@title: naming.tablecontent: salesTerr mismatches table naming convention, naming format should be "^[A-Z]([_A-Za-z])*$"startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/naming_table_no_keyword.yaml b/backend/plugin/advisor/mssql/test/naming_table_no_keyword.yamlindex d1666b0291..d7234c09dd 100644--- a/backend/plugin/advisor/mssql/test/naming_table_no_keyword.yaml+++ b/backend/plugin/advisor/mssql/test/naming_table_no_keyword.yaml@@ -6,7 +6,7 @@title: naming.table.no-keywordcontent: Table name [fillfactor] is a reserved keyword and should be avoided.startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE MyDB.MySchema.[fillfactor] (id INT);@@ -17,7 +17,7 @@title: naming.table.no-keywordcontent: Table name [fillfactor] is a reserved keyword and should be avoided.startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE Person(id INT);diff --git a/backend/plugin/advisor/mssql/test/schema_backward_compatibility.yaml b/backend/plugin/advisor/mssql/test/schema_backward_compatibility.yamlindex eb35273418..e825f15abf 100644--- a/backend/plugin/advisor/mssql/test/schema_backward_compatibility.yaml+++ b/backend/plugin/advisor/mssql/test/schema_backward_compatibility.yaml@@ -6,7 +6,7 @@title: schema.backward-compatibilitycontent: sp_rename may cause incompatibility with the existing data and code, and break scripts and stored procedures.startposition:- line: 0+ line: 1column: 0endposition: null- statement: DROP TABLE MyTable;@@ -17,7 +17,7 @@title: schema.backward-compatibilitycontent: Drop table master.dbo.MyTable may cause incompatibility with the existing data and codestartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -32,7 +32,7 @@title: schema.backward-compatibilitycontent: Drop schema master.myschema may cause incompatibility with the existing data and codestartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -47,7 +47,7 @@title: schema.backward-compatibilitycontent: Drop database mydb may cause incompatibility with the existing data and codestartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -71,7 +71,7 @@title: schema.backward-compatibilitycontent: Drop column mycolumnone, mycolumntwo may cause incompatibility with the existing data and codestartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -79,7 +79,7 @@title: schema.backward-compatibilitycontent: Alter COLUMN mycolumnone may cause incompatibility with the existing data and codestartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -87,7 +87,7 @@title: schema.backward-compatibilitycontent: Add PRIMARY KEY may cause incompatibility with the existing data and codestartposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -95,7 +95,7 @@title: schema.backward-compatibilitycontent: Add UNIQUE KEY may cause incompatibility with the existing data and codestartposition:- line: 3+ line: 4column: 0endposition: null- status: 2@@ -103,7 +103,7 @@title: schema.backward-compatibilitycontent: Add CHECK may cause incompatibility with the existing data and codestartposition:- line: 4+ line: 5column: 0endposition: null- status: 2@@ -111,7 +111,7 @@title: schema.backward-compatibilitycontent: Add CHECK WITH NO CHECK may cause incompatibility with the existing data and codestartposition:- line: 5+ line: 6column: 0endposition: null- status: 2@@ -119,7 +119,7 @@title: schema.backward-compatibilitycontent: Add FOREIGN KEY WITH NO CHECK may cause incompatibility with the existing data and codestartposition:- line: 7+ line: 8column: 0endposition: null- statement: EXEC sp_rename 'Sales.SalesTerritory', 'SalesTerr';@@ -130,7 +130,7 @@title: schema.backward-compatibilitycontent: sp_rename may cause incompatibility with the existing data and code, and break scripts and stored procedures.startposition:- line: 0+ line: 1column: 0endposition: null- statement: EXEC sp_rename 'dbo.ErrorLog.ErrorTime', 'ErrorDateTime', 'COLUMN';@@ -141,6 +141,6 @@title: schema.backward-compatibilitycontent: sp_rename may cause incompatibility with the existing data and code, and break scripts and stored procedures.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/statement_disallow_cross_db_queries.yaml b/backend/plugin/advisor/mssql/test/statement_disallow_cross_db_queries.yamlindex 2cb2eb330d..73418c0efe 100644--- a/backend/plugin/advisor/mssql/test/statement_disallow_cross_db_queries.yaml+++ b/backend/plugin/advisor/mssql/test/statement_disallow_cross_db_queries.yaml@@ -11,7 +11,7 @@title: statement.disallow-cross-db-queriescontent: 'Cross database queries (target databse: ''master2'', current database: ''master'') are prohibited'startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -24,6 +24,6 @@title: statement.disallow-cross-db-queriescontent: 'Cross database queries (target databse: ''master'', current database: ''master2'') are prohibited'startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/statement_disallow_mix_in_ddl.yaml b/backend/plugin/advisor/mssql/test/statement_disallow_mix_in_ddl.yamlindex 26a7315af8..1faca79076 100644--- a/backend/plugin/advisor/mssql/test/statement_disallow_mix_in_ddl.yaml+++ b/backend/plugin/advisor/mssql/test/statement_disallow_mix_in_ddl.yaml@@ -6,7 +6,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDLstartposition:- line: 0+ line: 1column: 0endposition: null- statement: UPDATE tech_book SET id = 1;@@ -17,7 +17,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDLstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD author TEXT; UPDATE tech_book SET id = 1;DELETE FROM tech_book WHERE a > 1;@@ -28,7 +28,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDLstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -36,6 +36,6 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDLstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/statement_disallow_mix_in_dml.yaml b/backend/plugin/advisor/mssql/test/statement_disallow_mix_in_dml.yamlindex 4e8c901134..f48c4bddf2 100644--- a/backend/plugin/advisor/mssql/test/statement_disallow_mix_in_dml.yaml+++ b/backend/plugin/advisor/mssql/test/statement_disallow_mix_in_dml.yaml@@ -10,6 +10,6 @@title: statement.disallow-mix-in-dmlcontent: Data change can only run DMLstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/statement_select_no_select_all.yaml b/backend/plugin/advisor/mssql/test/statement_select_no_select_all.yamlindex 82b924dd68..91130b858f 100644--- a/backend/plugin/advisor/mssql/test/statement_select_no_select_all.yaml+++ b/backend/plugin/advisor/mssql/test/statement_select_no_select_all.yaml@@ -6,7 +6,7 @@title: statement.select.no-select-allcontent: Avoid using SELECT *.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT a, b FROM t@@ -19,7 +19,7 @@title: statement.select.no-select-allcontent: Avoid using SELECT *.startposition:- line: 0+ line: 1column: 0endposition: null- statement: INSERT INTO t SELECT * FROM t1@@ -30,6 +30,6 @@title: statement.select.no-select-allcontent: Avoid using SELECT *.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/statement_where_disallow_functions_and_calculations.yaml b/backend/plugin/advisor/mssql/test/statement_where_disallow_functions_and_calculations.yamlindex b6a03b771c..b4ae973ec5 100644--- a/backend/plugin/advisor/mssql/test/statement_where_disallow_functions_and_calculations.yaml+++ b/backend/plugin/advisor/mssql/test/statement_where_disallow_functions_and_calculations.yaml@@ -10,7 +10,7 @@title: statement.where.disallow-functions-and-calculationscontent: Performing calculations in 'WHERE' clause is not allowedstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -18,7 +18,7 @@title: statement.where.disallow-functions-and-calculationscontent: Performing calculations in 'WHERE' clause is not allowedstartposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -31,7 +31,7 @@title: statement.where.disallow-functions-and-calculationscontent: Performing calculations in 'WHERE' clause is not allowedstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -39,7 +39,7 @@title: statement.where.disallow-functions-and-calculationscontent: Calling function 'AVG(bar)' in 'WHERE' clause is not allowedstartposition:- line: 1+ line: 2column: 0endposition: null- statement: SELECT bar FROM pokes WHERE bar > 1;@@ -58,6 +58,6 @@title: statement.where.disallow-functions-and-calculationscontent: Calling function 'AVG(a)' in 'WHERE' clause is not allowedstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/statement_where_require_select.yaml b/backend/plugin/advisor/mssql/test/statement_where_require_select.yamlindex 6544aad733..d66d2254ad 100644--- a/backend/plugin/advisor/mssql/test/statement_where_require_select.yaml+++ b/backend/plugin/advisor/mssql/test/statement_where_require_select.yaml@@ -6,7 +6,7 @@title: statement.where.require.selectcontent: WHERE clause is required for SELETE statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * FROM MyTable WHERE a = 1;@@ -22,7 +22,7 @@title: statement.where.require.selectcontent: WHERE clause is required for SELETE statement.startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -30,7 +30,7 @@title: statement.where.require.selectcontent: WHERE clause is required for SELETE statement.startposition:- line: 2+ line: 3column: 0endposition: null- statement: SELECT 1;diff --git a/backend/plugin/advisor/mssql/test/statement_where_require_update_delete.yaml b/backend/plugin/advisor/mssql/test/statement_where_require_update_delete.yamlindex 16493a590d..6546c8abbd 100644--- a/backend/plugin/advisor/mssql/test/statement_where_require_update_delete.yaml+++ b/backend/plugin/advisor/mssql/test/statement_where_require_update_delete.yaml@@ -6,7 +6,7 @@title: statement.where.require.update-deletecontent: WHERE clause is required for UPDATE statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: UPDATE MyTable SET a = 1 WHERE a = 1;@@ -19,7 +19,7 @@title: statement.where.require.update-deletecontent: WHERE clause is required for DELETE statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: DELETE FROM MyTable WHERE a = 1;diff --git a/backend/plugin/advisor/mssql/test/system_function_disallow_create.yaml b/backend/plugin/advisor/mssql/test/system_function_disallow_create.yamlindex f66a779881..b4e23edaf6 100644--- a/backend/plugin/advisor/mssql/test/system_function_disallow_create.yaml+++ b/backend/plugin/advisor/mssql/test/system_function_disallow_create.yaml@@ -20,6 +20,6 @@title: system.function.disallow-createcontent: Creating or altering functions is prohibitedstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/system_procedure_disallow_create.yaml b/backend/plugin/advisor/mssql/test/system_procedure_disallow_create.yamlindex 2cda3c4467..5795e30bf7 100644--- a/backend/plugin/advisor/mssql/test/system_procedure_disallow_create.yaml+++ b/backend/plugin/advisor/mssql/test/system_procedure_disallow_create.yaml@@ -24,6 +24,6 @@title: system.procedure.disallow-createcontent: Creating or altering procedures is prohibitedstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/table_disallow_ddl.yaml b/backend/plugin/advisor/mssql/test/table_disallow_ddl.yamlindex 87f702514a..8c2f521f3a 100644--- a/backend/plugin/advisor/mssql/test/table_disallow_ddl.yaml+++ b/backend/plugin/advisor/mssql/test/table_disallow_ddl.yaml@@ -14,6 +14,6 @@title: table.disallow-ddlcontent: DDL is disallowed on table MySchema.Identifier.startposition:- line: 4+ line: 5column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/table_disallow_dml.yaml b/backend/plugin/advisor/mssql/test/table_disallow_dml.yamlindex 0ebe5302cf..9533cf0a03 100644--- a/backend/plugin/advisor/mssql/test/table_disallow_dml.yaml+++ b/backend/plugin/advisor/mssql/test/table_disallow_dml.yaml@@ -9,7 +9,7 @@title: table.disallow-dmlcontent: DML is disallowed on table MySchema.Identifier.startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -22,7 +22,7 @@title: table.disallow-dmlcontent: DML is disallowed on table MySchema.Identifier.startposition:- line: 1+ line: 2column: 0endposition: null- statement: DELETE FROM MySchema.Identifier WHERE Id = 1;@@ -33,7 +33,7 @@title: table.disallow-dmlcontent: DML is disallowed on table MySchema.Identifier.startposition:- line: 0+ line: 1column: 0endposition: null- statement: UPDATE MySchema.Identifier SET Name = 'Bob' WHERE Id = 1;@@ -44,7 +44,7 @@title: table.disallow-dmlcontent: DML is disallowed on table MySchema.Identifier.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * INTO MySchema.Identifier FROM MySchema.MyTable;@@ -55,6 +55,6 @@title: table.disallow-dmlcontent: DML is disallowed on table MySchema.Identifier.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/table_drop_naming_convention.yaml b/backend/plugin/advisor/mssql/test/table_drop_naming_convention.yamlindex 59d3e35a52..ebe710aa5d 100644--- a/backend/plugin/advisor/mssql/test/table_drop_naming_convention.yaml+++ b/backend/plugin/advisor/mssql/test/table_drop_naming_convention.yaml@@ -8,7 +8,7 @@title: table.drop-naming-conventioncontent: '[foo] mismatches drop table naming convention, naming format should be "_delete$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: DROP TABLE [Foo], [Bar_delete];@@ -19,6 +19,6 @@title: table.drop-naming-conventioncontent: '[foo] mismatches drop table naming convention, naming format should be "_delete$"'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mssql/test/table_no_foreign_key.yaml b/backend/plugin/advisor/mssql/test/table_no_foreign_key.yamlindex 1da6a9db95..49ca2ac3a1 100644--- a/backend/plugin/advisor/mssql/test/table_no_foreign_key.yaml+++ b/backend/plugin/advisor/mssql/test/table_no_foreign_key.yaml@@ -12,7 +12,7 @@title: table.no-foreign-keycontent: FOREIGN KEY is not allowed in the table MyTable.startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -30,7 +30,7 @@title: table.no-foreign-keycontent: FOREIGN KEY is not allowed in the table Customer.startposition:- line: 5+ line: 6column: 0endposition: null- statement: |-@@ -48,7 +48,7 @@title: table.no-foreign-keycontent: FOREIGN KEY is not allowed in the table Customer.startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/mssql/test/table_require_pk.yaml b/backend/plugin/advisor/mssql/test/table_require_pk.yamlindex 016589d526..aec424a9ea 100644--- a/backend/plugin/advisor/mssql/test/table_require_pk.yaml+++ b/backend/plugin/advisor/mssql/test/table_require_pk.yaml@@ -10,7 +10,7 @@title: table.require-pkcontent: Table MySchema.MyTable requires PRIMARY KEY.startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-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 4bd33083ff..4d9267b9e0 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@@ -12,7 +12,7 @@title: column.auto-increment-initial-valuecontent: The initial auto-increment value in table `t2` is 2, which doesn't equal 20startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -27,6 +27,6 @@title: column.auto-increment-initial-valuecontent: The initial auto-increment value in table `t` is 100, which doesn't equal 20startposition:- line: 3+ line: 4column: 0endposition: nulldiff --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 240b57854f..a421ea7403 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@@ -20,7 +20,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t2`.`a` requires integer typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -33,7 +33,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -46,7 +46,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -59,7 +59,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -73,7 +73,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -86,6 +86,6 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typestartposition:- line: 1+ line: 2column: 0endposition: nulldiff --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 023ad9f298..424ea95906 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@@ -8,7 +8,7 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typestartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(a INT SIGNED AUTO_INCREMENT);@@ -19,7 +19,7 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typestartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(a INT ZEROFILL AUTO_INCREMENT);@@ -34,7 +34,7 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -48,7 +48,7 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -62,6 +62,6 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typestartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/column_comment.yaml b/backend/plugin/advisor/mysql/test/column_comment.yamlindex e9a5b51a8a..1b802658f0 100644--- a/backend/plugin/advisor/mysql/test/column_comment.yaml+++ b/backend/plugin/advisor/mysql/test/column_comment.yaml@@ -18,7 +18,7 @@title: column.commentcontent: Column `userTable`.`id` requires commentsstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -26,7 +26,7 @@title: column.commentcontent: Column `userTable`.`name` requires commentsstartposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -34,7 +34,7 @@title: column.commentcontent: Column `userTable`.`roomId` requires commentsstartposition:- line: 3+ line: 4column: 0endposition: null- statement: |@@ -65,7 +65,7 @@title: column.commentcontent: The length of column `t`.`a` comment should be within 10 charactersstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -73,7 +73,7 @@title: column.commentcontent: Column `t`.`b` requires commentsstartposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -81,7 +81,7 @@title: column.commentcontent: Column `t`.`c` requires commentsstartposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -94,7 +94,7 @@title: column.commentcontent: Column `t`.`b` requires commentsstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -107,7 +107,7 @@title: column.commentcontent: Column `t`.`b` requires commentsstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -115,7 +115,7 @@title: column.commentcontent: Column `t`.`c` requires commentsstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -128,7 +128,7 @@title: column.commentcontent: The length of column `t`.`a` comment should be within 10 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -136,7 +136,7 @@title: column.commentcontent: Column `t`.`b` requires commentsstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -149,7 +149,7 @@title: column.commentcontent: The length of column `t`.`b` comment should be within 10 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -157,7 +157,7 @@title: column.commentcontent: Column `t`.`b` requires commentsstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -170,7 +170,7 @@title: column.commentcontent: The length of column `t`.`b` comment should be within 10 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -178,6 +178,6 @@title: column.commentcontent: The length of column `t`.`b` comment should be within 10 charactersstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --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 035513c86c..49042a0288 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@@ -18,7 +18,7 @@title: column.current-time-count-limitcontent: Table `userTable` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.startposition:- line: 5+ line: 6column: 0endposition: null- statement: |@@ -49,7 +49,7 @@title: column.current-time-count-limitcontent: Table `t` has 3 DEFAULT CURRENT_TIMESTAMP() columns. The count greater than 2.startposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -64,7 +64,7 @@title: column.current-time-count-limitcontent: Table `t` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -77,6 +77,6 @@title: column.current-time-count-limitcontent: Table `tech_book` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/column_disallow_change.yaml b/backend/plugin/advisor/mysql/test/column_disallow_change.yamlindex e76a394a8c..c11bf3d939 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_change.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_change.yaml@@ -12,6 +12,6 @@title: column.disallow-changecontent: '"ALTER TABLE t CHANGE COLUMN b a int;" contains CHANGE COLUMN statement'startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml b/backend/plugin/advisor/mysql/test/column_disallow_change_type.yamlindex cd9fd66748..a0f5da374c 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml@@ -10,7 +10,7 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book MODIFY id INTEGER;" changes column type'startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -18,7 +18,7 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book MODIFY id INTEGER UNSIGNED;" changes column type'startposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -31,7 +31,7 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book MODIFY id int(4);" changes column type'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -44,7 +44,7 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book MODIFY id bigint;" changes column type'startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -52,7 +52,7 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book MODIFY id smallint;" changes column type'startposition:- line: 1+ line: 2column: 0endposition: null- statement: ALTER TABLE tech_book CHANGE name uname varchar(20);@@ -63,6 +63,6 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book CHANGE name uname varchar(20);" changes column type'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml b/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yamlindex ffdecc45fe..6285680961 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml@@ -12,7 +12,7 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t MODIFY COLUMN a int FIRST;" changes column order'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -25,7 +25,7 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t CHANGE COLUMN a1 a int FIRST;" changes column order'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -38,7 +38,7 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t MODIFY COLUMN a int AFTER b;" changes column order'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -51,6 +51,6 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t CHANGE COLUMN a1 a int AFTER b;" changes column order'startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/column_disallow_drop_in_index.yaml b/backend/plugin/advisor/mysql/test/column_disallow_drop_in_index.yamlindex aa8b366030..b1ea77d936 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_drop_in_index.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_drop_in_index.yaml@@ -39,7 +39,7 @@title: column.disallow-drop-in-indexcontent: '`t`.`b` cannot drop index column'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -52,7 +52,7 @@title: column.disallow-drop-in-indexcontent: '`t`.`c` cannot drop index column'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -71,7 +71,7 @@title: column.disallow-drop-in-indexcontent: '`t`.`a` cannot drop index column'startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -79,6 +79,6 @@title: column.disallow-drop-in-indexcontent: '`t`.`c` cannot drop index column'startposition:- line: 2+ line: 3column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml b/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yamlindex 6036724495..f93fcdb380 100644--- a/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml+++ b/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml@@ -14,7 +14,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "CREATE TABLE t1(a varchar(20) CHARSET ascii);" doesstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -22,7 +22,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "CREATE TABLE t2(a varchar(20) CHARSET ascii);" doesstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -35,7 +35,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book ADD COLUMN b varchar(20) CHARSET ascii;" doesstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -49,7 +49,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book ADD COLUMN (c varchar(20) CHARSET ascii, d varchar(20) CHARSET ascii);" doesstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -57,7 +57,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book ADD COLUMN (c varchar(20) CHARSET ascii, d varchar(20) CHARSET ascii);" doesstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -65,7 +65,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book ADD COLUMN e varchar(20) CHARSET ascii;" doesstartposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -78,7 +78,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book MODIFY COLUMN id varchar(20) CHARSET ascii;" doesstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -91,6 +91,6 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book CHANGE COLUMN name name varchar(20) CHARSET ascii;" doesstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml b/backend/plugin/advisor/mysql/test/column_maximum_character_length.yamlindex 2152a60f35..2b23ce35ba 100644--- a/backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml+++ b/backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml@@ -14,7 +14,7 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `t2.name` is bigger than 20, please use VARCHAR insteadstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -27,7 +27,7 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `tech_book.name_2` is bigger than 20, please use VARCHAR insteadstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -40,7 +40,7 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `tech_book.name` is bigger than 20, please use VARCHAR insteadstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -53,6 +53,6 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `tech_book.name` is bigger than 20, please use VARCHAR insteadstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/column_maximum_varchar_length.yaml b/backend/plugin/advisor/mysql/test/column_maximum_varchar_length.yamlindex 0853448e5a..09521a2f1f 100644--- a/backend/plugin/advisor/mysql/test/column_maximum_varchar_length.yaml+++ b/backend/plugin/advisor/mysql/test/column_maximum_varchar_length.yaml@@ -8,7 +8,7 @@title: column.maximum-varchar-lengthcontent: The length of the VARCHAR column `t1.name` is bigger than 2560startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -21,6 +21,6 @@title: column.maximum-varchar-lengthcontent: The length of the VARCHAR column `tech_book.name_2` is bigger than 2560startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/column_no_null.yaml b/backend/plugin/advisor/mysql/test/column_no_null.yamlindex e1b78fcea1..7c3eabc583 100644--- a/backend/plugin/advisor/mysql/test/column_no_null.yaml+++ b/backend/plugin/advisor/mysql/test/column_no_null.yaml@@ -10,7 +10,7 @@title: column.no-nullcontent: '`book`.`id` cannot have NULL value'startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -18,7 +18,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'startposition:- line: 2+ line: 3column: 0endposition: null- statement: CREATE TABLE book(id int PRIMARY KEY, name varchar(255));@@ -29,7 +29,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int NOT NULL, name varchar(255));@@ -40,7 +40,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int PRIMARY KEY, name varchar(255) NOT NULL);@@ -55,7 +55,7 @@title: column.no-nullcontent: '`book`.`id` cannot have NULL value'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -68,7 +68,7 @@title: column.no-nullcontent: '`book`.`id` cannot have NULL value'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -89,7 +89,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/mysql/test/column_require_default.yaml b/backend/plugin/advisor/mysql/test/column_require_default.yamlindex 428bdb6341..3675293869 100644--- a/backend/plugin/advisor/mysql/test/column_require_default.yaml+++ b/backend/plugin/advisor/mysql/test/column_require_default.yaml@@ -11,7 +11,7 @@title: column.require-defaultcontent: Column `t`.`b` doesn't have DEFAULT.startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -56,7 +56,7 @@title: column.require-defaultcontent: Column `t`.`a` doesn't have DEFAULT.startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -70,7 +70,7 @@title: column.require-defaultcontent: Column `tech_book`.`b` doesn't have DEFAULT.startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -78,7 +78,7 @@title: column.require-defaultcontent: Column `tech_book`.`a` doesn't have DEFAULT.startposition:- line: 2+ line: 3column: 0endposition: null- statement: ALTER TABLE tech_book ADD COLUMN (a BLOB, b timestamp);@@ -89,7 +89,7 @@title: column.require-defaultcontent: Column `tech_book`.`b` doesn't have DEFAULT.startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -103,7 +103,7 @@title: column.require-defaultcontent: Column `tech_book`.`b` doesn't have DEFAULT.startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/mysql/test/column_required.yaml b/backend/plugin/advisor/mysql/test/column_required.yamlindex 1d1f0ef1cb..86d01e58b2 100644--- a/backend/plugin/advisor/mysql/test/column_required.yaml+++ b/backend/plugin/advisor/mysql/test/column_required.yaml@@ -12,7 +12,7 @@title: column.requiredcontent: 'Table `t1` requires columns: created_ts, creator_id, id, updated_ts, updater_id'startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -20,7 +20,7 @@title: column.requiredcontent: 'Table `book` requires columns: created_ts, creator_id, updated_ts, updater_id'startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -28,7 +28,7 @@title: column.requiredcontent: 'Table `t2` requires columns: created_ts, updated_ts, updater_id'startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -36,7 +36,7 @@title: column.requiredcontent: 'Table `t3` requires columns: updated_ts, updater_id'startposition:- line: 3+ line: 4column: 0endposition: null- status: 2@@ -44,7 +44,7 @@title: column.requiredcontent: 'Table `t4` requires columns: updated_ts'startposition:- line: 4+ line: 5column: 0endposition: null- statement: |-@@ -72,7 +72,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'startposition:- line: 7+ line: 8column: 0endposition: null- statement: |-@@ -101,7 +101,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'startposition:- line: 7+ line: 8column: 0endposition: null- statement: |-@@ -130,7 +130,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'startposition:- line: 7+ line: 8column: 0endposition: null- statement: |-@@ -159,7 +159,7 @@title: column.requiredcontent: 'Table `book` requires columns: updater_id'startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -191,7 +191,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -199,7 +199,7 @@title: column.requiredcontent: 'Table `student` requires columns: creator_id, updater_id'startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-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 ad9506f053..ff8ea5d33b 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@@ -19,7 +19,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -42,7 +42,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -55,7 +55,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`b` is NOT NULL but doesn't have DEFAULTstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -63,7 +63,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`c` is NOT NULL but doesn't have DEFAULTstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -76,7 +76,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -97,7 +97,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml b/backend/plugin/advisor/mysql/test/column_type_disallow_list.yamlindex dbcc2b6da9..1e2228be24 100644--- a/backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml+++ b/backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml@@ -8,7 +8,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` isstartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -21,7 +21,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` isstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -34,7 +34,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` isstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -42,7 +42,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`b` isstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -55,7 +55,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` isstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -68,6 +68,6 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`c` isstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml b/backend/plugin/advisor/mysql/test/database_drop_empty_database.yamlindex 5ff015d406..ef87368005 100644--- a/backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml+++ b/backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml@@ -6,6 +6,6 @@title: database.drop-empty-databasecontent: Database `test` is not allowed to drop if not emptystartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml b/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yamlindex 2e2fd17dee..1e1ce7a471 100644--- a/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml+++ b/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml@@ -30,7 +30,7 @@FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_bin;" doesn't use InnoDB enginestartposition:- line: 11+ line: 12column: 0endposition: null- statement: |@@ -66,7 +66,7 @@price INT) ENGINE = CSV;" doesn't use InnoDB enginestartposition:- line: 3+ line: 4column: 0endposition: null- statement: |@@ -86,7 +86,7 @@price INT) ENGINE = CSV;" doesn't use InnoDB enginestartposition:- line: 4+ line: 5column: 0endposition: null- statement: ALTER TABLE tech_book ENGINE = INNODB;@@ -102,7 +102,7 @@title: engine.mysql.use-innodbcontent: '"ALTER TABLE tech_book ENGINE = CSV;" doesn''t use InnoDB engine'startposition:- line: 2+ line: 3column: 0endposition: null- statement: SET default_storage_engine=INNODB;@@ -117,7 +117,7 @@title: engine.mysql.use-innodbcontent: '"SET default_storage_engine=CSV;" doesn''t use InnoDB engine'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |diff --git a/backend/plugin/advisor/mysql/test/index_key_number_limit.yaml b/backend/plugin/advisor/mysql/test/index_key_number_limit.yamlindex 4aae661294..a352dc3f18 100644--- a/backend/plugin/advisor/mysql/test/index_key_number_limit.yaml+++ b/backend/plugin/advisor/mysql/test/index_key_number_limit.yaml@@ -15,7 +15,7 @@title: index.key-number-limitcontent: The number of index `pk` in table `t` should be not greater than 5startposition:- line: 3+ line: 4column: 0endposition: null- status: 2@@ -23,7 +23,7 @@title: index.key-number-limitcontent: The number of index `uk` in table `t` should be not greater than 5startposition:- line: 4+ line: 5column: 0endposition: null- status: 2@@ -31,7 +31,7 @@title: index.key-number-limitcontent: The number of index `fk` in table `t` should be not greater than 5startposition:- line: 5+ line: 6column: 0endposition: null- statement: |-@@ -45,7 +45,7 @@title: index.key-number-limitcontent: The number of index `idx` in table `t` should be not greater than 5startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -53,7 +53,7 @@title: index.key-number-limitcontent: The number of index `uk` in table `t` should be not greater than 5startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -67,7 +67,7 @@title: index.key-number-limitcontent: The number of index `pk` in table `t` should be not greater than 5startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -75,7 +75,7 @@title: index.key-number-limitcontent: The number of index `uk` in table `t` should be not greater than 5startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -88,7 +88,7 @@title: index.key-number-limitcontent: The number of index `uk` in table `t` should be not greater than 5startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml b/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yamlindex fb427013ae..8d486fb8b2 100644--- a/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml+++ b/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml@@ -12,7 +12,7 @@title: index.no-duplicate-columncontent: PRIMARY KEY `` has duplicate column `t`.`a`startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -35,7 +35,7 @@title: index.no-duplicate-columncontent: FOREIGN KEY `fk1` has duplicate column `t3`.`a`startposition:- line: 10+ line: 11column: 0endposition: null- statement: |-@@ -50,7 +50,7 @@title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -64,7 +64,7 @@title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -78,7 +78,7 @@title: index.no-duplicate-columncontent: UNIQUE INDEX `idx_a` has duplicate column `t`.`a`startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -92,7 +92,7 @@title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -105,7 +105,7 @@title: index.no-duplicate-columncontent: PRIMARY KEY `pk_a` has duplicate column `t`.`a`startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -123,7 +123,7 @@title: index.no-duplicate-columncontent: UNIQUE KEY `uk_a` has duplicate column `t`.`a`startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -137,6 +137,6 @@title: index.no-duplicate-columncontent: FOREIGN KEY `fk_a` has duplicate column `t`.`a`startposition:- line: 2+ line: 3column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml b/backend/plugin/advisor/mysql/test/index_pk_type_limit.yamlindex cd0126984f..dcfb1b92c4 100644--- a/backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml+++ b/backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml@@ -6,7 +6,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT PRIMARY KEY);@@ -19,7 +19,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT, id2 VARCHAR(5), id3 VARCHAR(5), PRIMARY KEY(id, id2, id3));@@ -30,7 +30,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -38,7 +38,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT, id2 BIGINT, PRIMARY KEY(id, id2));@@ -55,7 +55,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -72,7 +72,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -85,7 +85,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -93,7 +93,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -114,7 +114,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -127,7 +127,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -135,7 +135,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -156,7 +156,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -173,7 +173,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-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 73233d6bcf..fcec6b7aac 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@@ -6,7 +6,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 allowliststartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT PRIMARY KEY);@@ -19,7 +19,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 allowliststartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT, id2 VARCHAR(5), id3 VARCHAR(5), PRIMARY KEY(id, id2, id3));@@ -30,7 +30,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 allowliststartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -38,7 +38,7 @@title: index.primary-key-type-allowlistcontent: The column `id3` in table `t` is one of the primary key, but its type "varchar" is not in allowliststartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT, id2 BIGINT, PRIMARY KEY(id, id2));@@ -55,7 +55,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -72,7 +72,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -85,7 +85,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -93,7 +93,7 @@title: index.primary-key-type-allowlistcontent: The column `id3` in table `t` is one of the primary key, but its type "varchar" is not in allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -114,7 +114,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -127,7 +127,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -135,7 +135,7 @@title: index.primary-key-type-allowlistcontent: The column `id3` in table `t` is one of the primary key, but its type "varchar" is not in allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -156,7 +156,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -173,7 +173,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/mysql/test/index_total_number_limit.yaml b/backend/plugin/advisor/mysql/test/index_total_number_limit.yamlindex 3a50fcda48..6825fee445 100644--- a/backend/plugin/advisor/mysql/test/index_total_number_limit.yaml+++ b/backend/plugin/advisor/mysql/test/index_total_number_limit.yaml@@ -15,7 +15,7 @@title: index.total-number-limitcontent: The count of index in table `tech_book` should be no more than 5, but found 8startposition:- line: 4+ line: 5column: 0endposition: null- statement: |-@@ -32,7 +32,7 @@title: index.total-number-limitcontent: The count of index in table `t` should be no more than 5, but found 6startposition:- line: 5+ line: 6column: 0endposition: null- statement: |-@@ -52,7 +52,7 @@title: index.total-number-limitcontent: The count of index in table `t` should be no more than 5, but found 6startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -73,6 +73,6 @@title: index.total-number-limitcontent: The count of index in table `t` should be no more than 5, but found 6startposition:- line: 9+ line: 10column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/index_type_allow_list.yaml b/backend/plugin/advisor/mysql/test/index_type_allow_list.yamlindex ab0a68b7ab..4d6e9b0ec0 100644--- a/backend/plugin/advisor/mysql/test/index_type_allow_list.yaml+++ b/backend/plugin/advisor/mysql/test/index_type_allow_list.yaml@@ -27,7 +27,7 @@title: index.type-allow-listcontent: Index type `SPATIAL` is not allowedstartposition:- line: 4+ line: 5column: 0endposition: null- statement: |-@@ -43,6 +43,6 @@title: index.type-allow-listcontent: Index type `FULLTEXT` is not allowedstartposition:- line: 4+ line: 5column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/index_type_no_blob.yaml b/backend/plugin/advisor/mysql/test/index_type_no_blob.yamlindex 198e035b44..d252f8cfd8 100644--- a/backend/plugin/advisor/mysql/test/index_type_no_blob.yaml+++ b/backend/plugin/advisor/mysql/test/index_type_no_blob.yaml@@ -18,7 +18,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `userTable`.`content` is blobstartposition:- line: 11+ line: 12column: 0endposition: null- statement: |@@ -42,7 +42,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(b BLOB, mb MEDIUMBLOB, lb LONGBLOB, id INT, PRIMARY KEY(b(1), mb(2), lb(3), id));@@ -53,7 +53,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -61,7 +61,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -69,7 +69,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(b BLOB, mb MEDIUMBLOB, lb LONGBLOB, id INT, UNIQUE INDEX(b(1), mb(2), lb(3), id))@@ -80,7 +80,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -88,7 +88,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -96,7 +96,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(b BLOB, mb MEDIUMBLOB, lb LONGBLOB, id iNT, INDEX(b(1), mb(2), lb(3), id))@@ -107,7 +107,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -115,7 +115,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -123,7 +123,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT, PRIMARY KEY(id))@@ -138,7 +138,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -151,7 +151,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -159,7 +159,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -167,7 +167,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -180,7 +180,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -188,7 +188,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -196,7 +196,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -216,7 +216,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -224,7 +224,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -232,7 +232,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -250,7 +250,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -264,6 +264,6 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`d` is blobstartposition:- line: 2+ line: 3column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/naming_column.yaml b/backend/plugin/advisor/mysql/test/naming_column.yamlindex d012cc616f..86d56d9780 100644--- a/backend/plugin/advisor/mysql/test/naming_column.yaml+++ b/backend/plugin/advisor/mysql/test/naming_column.yaml@@ -6,7 +6,7 @@title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int, gbhzmtchhsjzyrhdroxmyouwloxqezowdvhcbqalqcgqhfbjnvmhwrbggezmzeusx int);@@ -17,7 +17,7 @@title: naming.columncontent: '`book`.`gbhzmtchhsjzyrhdroxmyouwloxqezowdvhcbqalqcgqhfbjnvmhwrbggezmzeusx` mismatches column naming convention, its length should be within 64 characters'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int, creator_id int);@@ -33,7 +33,7 @@title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -41,7 +41,7 @@title: naming.columncontent: '`book`.`gbhzmtchhsjzyrhdroxmyouwloxqezowdvhcbqalqcgqhfbjnvmhwrbggezmzeusx` mismatches column naming convention, its length should be within 64 characters'startposition:- line: 2+ line: 3column: 0endposition: null- statement: |@@ -54,7 +54,7 @@title: naming.columncontent: '`tech_book`.`gbhzmtchhsjzyrhdroxmyouwloxqezowdvhcbqalqcgqhfbjnvmhwrbggezmzeusx` mismatches column naming convention, its length should be within 64 characters'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -72,7 +72,7 @@title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-@@ -95,7 +95,7 @@title: naming.columncontent: '`book`.`contentString` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 5+ line: 6column: 0endposition: null- statement: |-@@ -112,7 +112,7 @@title: naming.columncontent: '`book`.`contentString` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 5+ line: 6column: 0endposition: null- status: 2@@ -120,7 +120,7 @@title: naming.columncontent: '`book`.`personAge` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 5+ line: 6column: 0endposition: null- statement: |-@@ -140,7 +140,7 @@title: naming.columncontent: '`book`.`createdTs` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -148,7 +148,7 @@title: naming.columncontent: '`book`.`updaterId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 3+ line: 4column: 0endposition: null- status: 2@@ -156,7 +156,7 @@title: naming.columncontent: '`student`.`createdTs` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 7+ line: 8column: 0endposition: null- status: 2@@ -164,6 +164,6 @@title: naming.columncontent: '`student`.`updatedTs` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 8+ line: 9column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml b/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yamlindex 7198964add..298adc1a5f 100644--- a/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml+++ b/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml@@ -8,7 +8,7 @@title: naming.column.auto-incrementcontent: '`book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD COLUMN a int AUTO_INCREMENT;@@ -19,7 +19,7 @@title: naming.column.auto-incrementcontent: '`tech_book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book CHANGE COLUMN id a int AUTO_INCREMENT;@@ -30,7 +30,7 @@title: naming.column.auto-incrementcontent: '`tech_book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY COLUMN name int AUTO_INCREMENT;@@ -41,7 +41,7 @@title: naming.column.auto-incrementcontent: '`tech_book`.`name` mismatches auto_increment column naming convention, naming format should be "^id$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: |diff --git a/backend/plugin/advisor/mysql/test/naming_identifier_no_keyword.yaml b/backend/plugin/advisor/mysql/test/naming_identifier_no_keyword.yamlindex 5257abdb8e..f07df1a297 100644--- a/backend/plugin/advisor/mysql/test/naming_identifier_no_keyword.yaml+++ b/backend/plugin/advisor/mysql/test/naming_identifier_no_keyword.yaml@@ -19,7 +19,7 @@title: naming.identifier.no-keywordcontent: Identifier "execute" is a keyword and should be avoidedstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE `execute`(id int)@@ -30,7 +30,7 @@title: naming.identifier.no-keywordcontent: Identifier "execute" is a keyword and should be avoidedstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE `interval`(id int);@@ -41,7 +41,7 @@title: naming.identifier.no-keywordcontent: Identifier "interval" is a keyword and should be avoidedstartposition:- line: 0+ line: 1column: 0endposition: null- statement: "CREATE TABLE t(\n id int, \n `current_timestamp` int\n);\n"@@ -52,7 +52,7 @@title: naming.identifier.no-keywordcontent: Identifier "current_timestamp" is a keyword and should be avoidedstartposition:- line: 2+ line: 3column: 0endposition: null- statement: CREATE TABLE `test`.`interval`(id int);@@ -63,6 +63,6 @@title: naming.identifier.no-keywordcontent: Identifier "interval" is a keyword and should be avoidedstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/naming_index_fk.yaml b/backend/plugin/advisor/mysql/test/naming_index_fk.yamlindex f8dbd2035f..dc1ca53d4c 100644--- a/backend/plugin/advisor/mysql/test/naming_index_fk.yaml+++ b/backend/plugin/advisor/mysql/test/naming_index_fk.yaml@@ -6,7 +6,7 @@title: naming.index.fkcontent: Foreign key in table `userTable` mismatches the naming convention, expect "^$|^fk_userTable_roomId_room_id$" but found `fk1`startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD CONSTRAINT fk_tech_book_author_id_author_id FOREIGN KEY (author_id) REFERENCES author (id);@@ -19,7 +19,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD CONSTRAINT rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk FOREIGN KEY (author_id) REFERENCES author (id);@@ -30,7 +30,7 @@title: naming.index.fkcontent: Foreign key `rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk` in table `tech_book` mismatches the naming convention, its length should be within 64 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -38,7 +38,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 `rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk`startposition:- line: 0+ line: 1column: 0endposition: null- statement: |@@ -68,6 +68,6 @@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`startposition:- line: 3+ line: 4column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/naming_index_idx.yaml b/backend/plugin/advisor/mysql/test/naming_index_idx.yamlindex a4e4a8e9c1..3784345830 100644--- a/backend/plugin/advisor/mysql/test/naming_index_idx.yaml+++ b/backend/plugin/advisor/mysql/test/naming_index_idx.yaml@@ -8,7 +8,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE INDEX afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw ON tech_book(id, name);@@ -19,7 +19,7 @@title: naming.index.idxcontent: Index `afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw` in table `tech_book` mismatches the naming convention, its length should be within 64 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -27,7 +27,7 @@title: naming.index.idxcontent: Index in table `tech_book` mismatches the naming convention, expect "^$|^idx_tech_book_id_name$" but found `afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw`startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book RENAME INDEX old_index TO idx_tech_book_id_name;@@ -40,7 +40,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD INDEX idx_tech_book_id_name (id, name);@@ -53,7 +53,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE tech_book_copy(id INT PRIMARY KEY, name VARCHAR(20), INDEX idx_tech_book_copy_name (name));diff --git a/backend/plugin/advisor/mysql/test/naming_index_uk.yaml b/backend/plugin/advisor/mysql/test/naming_index_uk.yamlindex 0a0e310658..4b9e9f4784 100644--- a/backend/plugin/advisor/mysql/test/naming_index_uk.yaml+++ b/backend/plugin/advisor/mysql/test/naming_index_uk.yaml@@ -10,7 +10,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`startposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -23,7 +23,7 @@title: naming.index.ukcontent: Unique key `qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy` in table `tech_book` mismatches the naming convention, its length should be within 64 charactersstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -31,7 +31,7 @@title: naming.index.ukcontent: Unique key in table `tech_book` mismatches the naming convention, expect "^$|^uk_tech_book_id_name$" but found `qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy`startposition:- line: 1+ line: 2column: 0endposition: null- statement: ALTER TABLE tech_book ADD UNIQUE uk_tech_book_id_name (id, name);@@ -46,7 +46,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`startposition:- line: 1+ line: 2column: 0endposition: null- statement: ALTER TABLE tech_book RENAME INDEX old_uk TO uk_tech_book_id_name;@@ -61,7 +61,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`startposition:- line: 1+ line: 2column: 0endposition: null- statement: CREATE TABLE book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE INDEX uk_book_name (name));diff --git a/backend/plugin/advisor/mysql/test/naming_table.yaml b/backend/plugin/advisor/mysql/test/naming_table.yamlindex a773e094f3..1f2df8cdcf 100644--- a/backend/plugin/advisor/mysql/test/naming_table.yaml+++ b/backend/plugin/advisor/mysql/test/naming_table.yaml@@ -6,7 +6,7 @@title: naming.tablecontent: '`techBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE tech_book_copy(id int, name varchar(255));@@ -19,7 +19,7 @@title: naming.tablecontent: '`cjnubexocfhqoogdmihudyahmmghviqkzvpixnwvxtxumvuannpwdcbtsgwrvzpde` mismatches table naming convention, its length should be within 64 characters'startposition:- line: 0+ line: 1column: 0endposition: null- statement: |@@ -32,7 +32,7 @@title: naming.tablecontent: '`TechBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -49,7 +49,7 @@title: naming.tablecontent: '`LiteraryBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -63,7 +63,7 @@title: naming.tablecontent: '`LiteraryBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -71,7 +71,7 @@title: naming.tablecontent: '`TechBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 2+ line: 3column: 0endposition: null- statement: |diff --git a/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml b/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yamlindex d549c9df14..113d38f01a 100644--- a/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml+++ b/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml@@ -6,7 +6,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book CHANGE name f2 TEXT;" may cause incompatibility with the existing data and code'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY name TEXT;@@ -17,7 +17,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT;" may cause incompatibility with the existing data and code'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY name TEXT NULL;@@ -28,7 +28,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT NULL;" may cause incompatibility with the existing data and code'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY name TEXT NOT NULL;@@ -39,7 +39,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT NOT NULL;" may cause incompatibility with the existing data and code'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY name TEXT COMMENT 'bla';@@ -50,6 +50,6 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT COMMENT ''bla'';" may cause incompatibility with the existing data and code'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_commit.yamlindex 66ce58abf6..58b8b737c7 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml@@ -9,7 +9,7 @@title: statement.disallow-commitcontent: 'Commit is not allowed, related statement: "COMMIT;"'startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -27,7 +27,7 @@title: statement.disallow-commitcontent: 'Commit is not allowed, related statement: "COMMIT;"'startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -35,6 +35,6 @@title: statement.disallow-commitcontent: 'Commit is not allowed, related statement: "COMMIT;"'startposition:- line: 6+ line: 7column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_limit.yamlindex 0204ec49e3..58918b0313 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml@@ -10,7 +10,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;" usesstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -23,7 +23,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;" usesstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -36,7 +36,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;" usesstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -49,7 +49,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;" usesstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -62,6 +62,6 @@title: statement.disallow-limitcontent: LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "DELETE FROM tech_book LIMIT 10;" usesstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_disallow_mix_in_ddl.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_mix_in_ddl.yamlindex 2455aa3b98..70e3e82b33 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_mix_in_ddl.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_mix_in_ddl.yaml@@ -6,7 +6,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDL, "DELETE FROM tech_book WHERE a > 1;" is not DDLstartposition:- line: 0+ line: 1column: 0endposition: null- statement: UPDATE tech_book SET id = 1;@@ -17,7 +17,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDL, "UPDATE tech_book SET id = 1;" is not DDLstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD COLUMN author TEXT; UPDATE tech_book SET id = 1;DELETE FROM tech_book WHERE a > 1;@@ -28,7 +28,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDL, "DELETE FROM tech_book WHERE a > 1;" is not DDLstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -36,6 +36,6 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDL, "UPDATE tech_book SET id = 1;" is not DDLstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_disallow_mix_in_dml.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_mix_in_dml.yamlindex 58503bd9b5..3c10935ca0 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_mix_in_dml.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_mix_in_dml.yaml@@ -10,6 +10,6 @@title: statement.disallow-mix-in-dmlcontent: Data change can only run DML, "ALTER TABLE tech_book ADD COLUMN author TEXT;" is not DMLstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yamlindex 7d2010f4a1..0747185c8a 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml@@ -10,7 +10,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;" usesstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -23,6 +23,6 @@title: statement.disallow-order-bycontent: ORDER BY clause is forbidden in DELETE and UPDATE statements, but "DELETE FROM tech_book ORDER BY id;" usesstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --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 4d9d503c4a..174411beb4 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@@ -10,7 +10,7 @@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'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -23,6 +23,6 @@title: statement.insert.disallow-order-by-randcontent: '"INSERT INTO tech_book SELECT * FROM tech_book ORDER BY RAND() LIMIT 1;" uses ORDER BY RAND in the INSERT statement'startposition:- line: 1+ line: 2column: 0endposition: nulldiff --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 0336efc79e..1c91852b83 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@@ -6,7 +6,7 @@title: statement.insert.must-specify-columncontent: The INSERT statement must specify columns but "INSERT INTO t_copy SELECT * FROM t;" does notstartposition:- line: 0+ line: 1column: 0endposition: null- statement: INSERT INTO tech_book(id, name) VALUES (1, '1');@@ -19,6 +19,6 @@title: statement.insert.must-specify-columncontent: The INSERT statement must specify columns but "INSERT INTO tech_book VALUES (1, '1');" does notstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml b/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yamlindex a363227dcc..cb9a101af6 100644--- a/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml+++ b/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml@@ -10,7 +10,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.'startposition:- line: 1+ line: 2column: 0endposition: null- statement: INSERT INTO tech_book SELECT * FROM tech_book;diff --git a/backend/plugin/advisor/mysql/test/statement_maximum_join_table_count.yaml b/backend/plugin/advisor/mysql/test/statement_maximum_join_table_count.yamlindex e308cbffa5..52741e930a 100644--- a/backend/plugin/advisor/mysql/test/statement_maximum_join_table_count.yaml+++ b/backend/plugin/advisor/mysql/test/statement_maximum_join_table_count.yaml@@ -8,6 +8,6 @@title: statement.maximum-join-table-countcontent: '"select name from hello join world on hello.id = world.id join baby on world.id = baby.id;" exceeds the maximum number of joins 2.'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_maximum_limit_value.yaml b/backend/plugin/advisor/mysql/test/statement_maximum_limit_value.yamlindex 7c53075e8d..3b0124f5ea 100644--- a/backend/plugin/advisor/mysql/test/statement_maximum_limit_value.yaml+++ b/backend/plugin/advisor/mysql/test/statement_maximum_limit_value.yaml@@ -7,6 +7,6 @@title: statement.maximum-limit-valuecontent: The limit value 1000000 exceeds the maximum allowed value 1000startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml b/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yamlindex 7f8182b0c1..d8f4b001a2 100644--- a/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml+++ b/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml@@ -10,7 +10,7 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -25,7 +25,7 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `t`startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -33,7 +33,7 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`startposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -48,7 +48,7 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -56,6 +56,6 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `t`startposition:- line: 3+ line: 4column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_require_algorithm_option.yaml b/backend/plugin/advisor/mysql/test/statement_require_algorithm_option.yamlindex f7790e095e..f54eeec6f2 100644--- a/backend/plugin/advisor/mysql/test/statement_require_algorithm_option.yaml+++ b/backend/plugin/advisor/mysql/test/statement_require_algorithm_option.yaml@@ -12,6 +12,6 @@title: statement.require-algorithm-optioncontent: ALTER TABLE statement should include ALGORITHM optionstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_require_lock_option.yaml b/backend/plugin/advisor/mysql/test/statement_require_lock_option.yamlindex 4bd9ebca01..995811338b 100644--- a/backend/plugin/advisor/mysql/test/statement_require_lock_option.yaml+++ b/backend/plugin/advisor/mysql/test/statement_require_lock_option.yaml@@ -12,7 +12,7 @@title: statement.require-lock-optioncontent: ALTER TABLE statement should include LOCK optionstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -26,6 +26,6 @@title: statement.require-lock-optioncontent: ALTER TABLE statement should include LOCK optionstartposition:- line: 2+ line: 3column: 0endposition: nulldiff --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 99f2aedd4b..367e6c3733 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@@ -6,7 +6,7 @@title: statement.select.no-select-allcontent: '"SELECT * FROM t;" uses SELECT all'startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT a, b FROM t;@@ -22,7 +22,7 @@title: statement.select.no-select-allcontent: '"SELECT * FROM t;" uses SELECT all'startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -30,7 +30,7 @@title: statement.select.no-select-allcontent: '"SELECT a, b FROM (SELECT * from t1 JOIN t2) t;" uses SELECT all'startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -48,7 +48,7 @@UNIONSELECT * FROM t2;" uses SELECT allstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -59,7 +59,7 @@UNIONSELECT * FROM t2;" uses SELECT allstartposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -77,7 +77,7 @@SELECT * FROM a) SELECT * FROM cte;" uses SELECT allstartposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -88,7 +88,7 @@SELECT * FROM a) SELECT * FROM cte;" uses SELECT allstartposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -106,6 +106,6 @@FROM aINNER JOIN b USING(id);" uses SELECT allstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_where_disallow_functions_and_calculations.yaml b/backend/plugin/advisor/mysql/test/statement_where_disallow_functions_and_calculations.yamlindex ef9e4a3fba..fb8629c62c 100644--- a/backend/plugin/advisor/mysql/test/statement_where_disallow_functions_and_calculations.yaml+++ b/backend/plugin/advisor/mysql/test/statement_where_disallow_functions_and_calculations.yaml@@ -6,6 +6,6 @@title: statement.where.disallow-functions-and-calculationscontent: Function is disallowed in where clause, but "SELECT * FROM employee WHERE id = RAND();" usesstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_where_maximum_logical_operator_count.yaml b/backend/plugin/advisor/mysql/test/statement_where_maximum_logical_operator_count.yamlindex 2b7e34d330..0435e73824 100644--- a/backend/plugin/advisor/mysql/test/statement_where_maximum_logical_operator_count.yaml+++ b/backend/plugin/advisor/mysql/test/statement_where_maximum_logical_operator_count.yaml@@ -6,7 +6,7 @@title: statement.where.maximum-logical-operator-countcontent: Number of tokens (5) in IN predicate operation exceeds limit (2) in statement "SELECT * FROM employee WHERE id IN (1, 2, 3, 4, 5);".startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * FROM employee WHERE id = 1 OR id = 2 OR id = 3 OR id = 4 OR id = 5;@@ -17,6 +17,6 @@title: statement.where.maximum-logical-operator-countcontent: Number of tokens (5) in the OR predicate operation exceeds limit (2) in statement "SELECT * FROM employee WHERE id = 1 OR id = 2 OR id = 3 OR id = 4 OR id = 5;".startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_where_no_equal_null.yaml b/backend/plugin/advisor/mysql/test/statement_where_no_equal_null.yamlindex d779003f7f..8d94416803 100644--- a/backend/plugin/advisor/mysql/test/statement_where_no_equal_null.yaml+++ b/backend/plugin/advisor/mysql/test/statement_where_no_equal_null.yaml@@ -13,6 +13,6 @@title: statement.where.no-equal-nullcontent: 'WHERE clause contains equal null: SELECT * FROM t WHERE name = ''test'' AND id = NULL;'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --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 2263740066..42329b42bd 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@@ -7,7 +7,7 @@title: statement.where.no-leading-wildcard-likecontent: '"DELETE FROM tech_book WHERE name like "%abc";" uses leading wildcard LIKE'startposition:- line: 0+ line: 1column: 0endposition: null- statement: |@@ -24,7 +24,7 @@title: statement.where.no-leading-wildcard-likecontent: '"SELECT * FROM t WHERE a LIKE ''%abc'';" uses leading wildcard LIKE'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -37,7 +37,7 @@title: statement.where.no-leading-wildcard-likecontent: '"SELECT * FROM t WHERE a LIKE ''abc'' OR a LIKE ''%abc'';" uses leading wildcard LIKE'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -57,7 +57,7 @@WHERE a LIKE '%acc'OR a LIKE '%abc';" uses leading wildcard LIKEstartposition:- line: 3+ line: 4column: 0endposition: null- status: 2@@ -69,7 +69,7 @@WHERE a LIKE '%acc'OR a LIKE '%abc';" uses leading wildcard LIKEstartposition:- line: 4+ line: 5column: 0endposition: null- statement: |@@ -93,7 +93,7 @@OR a LIKE '%abc') t1;" uses leading wildcard LIKEstartposition:- line: 4+ line: 5column: 0endposition: null- status: 2@@ -107,6 +107,6 @@OR a LIKE '%abc') t1;" uses leading wildcard LIKEstartposition:- line: 5+ line: 6column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/statement_where_require_select.yaml b/backend/plugin/advisor/mysql/test/statement_where_require_select.yamlindex 3296b24a00..e2a6040799 100644--- a/backend/plugin/advisor/mysql/test/statement_where_require_select.yaml+++ b/backend/plugin/advisor/mysql/test/statement_where_require_select.yaml@@ -12,7 +12,7 @@title: statement.where.require.selectcontent: '"SELECT id FROM book;" requires WHERE clause'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -40,7 +40,7 @@FROM book);" requires WHERE clausestartposition:- line: 4+ line: 5column: 0endposition: null- statement: |diff --git a/backend/plugin/advisor/mysql/test/statement_where_require_update_delete.yaml b/backend/plugin/advisor/mysql/test/statement_where_require_update_delete.yamlindex 3f538f3f71..30174d8af3 100644--- a/backend/plugin/advisor/mysql/test/statement_where_require_update_delete.yaml+++ b/backend/plugin/advisor/mysql/test/statement_where_require_update_delete.yaml@@ -12,7 +12,7 @@title: statement.where.require.update-deletecontent: '"DELETE FROM book;" requires WHERE clause'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |@@ -25,7 +25,7 @@title: statement.where.require.update-deletecontent: '"UPDATE book SET id = 1;" requires WHERE clause'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |diff --git a/backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml b/backend/plugin/advisor/mysql/test/system_charset_allowlist.yamlindex a9f954d259..068e5ada47 100644--- a/backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml+++ b/backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml@@ -10,7 +10,7 @@title: system.charset.allowlistcontent: '"CREATE TABLE t(a int) CHARSET ascii;" used disabled charset ''ascii'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -23,7 +23,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t CHARSET ascii;" used disabled charset ''ascii'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: ALTER DATABASE test CHARSET ascii;@@ -34,7 +34,7 @@title: system.charset.allowlistcontent: '"ALTER DATABASE test CHARSET ascii;" used disabled charset ''ascii'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(a varchar(255) CHARSET ascii);@@ -45,7 +45,7 @@title: system.charset.allowlistcontent: '"CREATE TABLE t(a varchar(255) CHARSET ascii);" used disabled charset ''ascii'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -58,7 +58,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t ADD COLUMN a varchar(255) CHARSET ascii;" used disabled charset ''ascii'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -71,7 +71,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t MODIFY COLUMN a varchar(255) CHARSET ascii;" used disabled charset ''ascii'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -84,7 +84,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARSET ascii;" used disabled charset ''ascii'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: /* this is a comment */diff --git a/backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml b/backend/plugin/advisor/mysql/test/system_collation_allowlist.yamlindex 76e9aca1de..b93a37b04a 100644--- a/backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml+++ b/backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml@@ -32,7 +32,7 @@FOREIGN KEY fk1(roomId) REFERENCES room(id),INDEX idx_userTable_content(content)) ENGINE = CSV COLLATE latin1_bin;" used disabled collation 'latin1_bin'startposition:- line: 11+ line: 12column: 0endposition: null- statement: |@@ -56,7 +56,7 @@title: system.collation.allowlistcontent: '"CREATE TABLE t(a int) COLLATE utf8mb4_polish_ci;" used disabled collation ''utf8mb4_polish_ci'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(a varchar(255));@@ -69,7 +69,7 @@title: system.collation.allowlistcontent: '"CREATE TABLE t(a int) COLLATE latin1_bin;" used disabled collation ''latin1_bin'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -82,7 +82,7 @@title: system.collation.allowlistcontent: '"ALTER TABLE t COLLATE latin1_bin;" used disabled collation ''latin1_bin'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: ALTER DATABASE test COLLATE latin1_bin;@@ -93,7 +93,7 @@title: system.collation.allowlistcontent: '"ALTER DATABASE test COLLATE latin1_bin;" used disabled collation ''latin1_bin'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin);@@ -104,7 +104,7 @@title: system.collation.allowlistcontent: '"CREATE TABLE t(a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin);" used disabled collation ''latin1_bin'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -117,7 +117,7 @@title: system.collation.allowlistcontent: '"ALTER TABLE t ADD COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin;" used disabled collation ''latin1_bin'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -130,7 +130,7 @@title: system.collation.allowlistcontent: '"ALTER TABLE t MODIFY COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin;" used disabled collation ''latin1_bin'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -143,6 +143,6 @@title: system.collation.allowlistcontent: '"ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin;" used disabled collation ''latin1_bin'''startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/system_event_disallow_create.yaml b/backend/plugin/advisor/mysql/test/system_event_disallow_create.yamlindex 12c81c8e6e..e5d06217df 100644--- a/backend/plugin/advisor/mysql/test/system_event_disallow_create.yaml+++ b/backend/plugin/advisor/mysql/test/system_event_disallow_create.yaml@@ -24,6 +24,6 @@SELECT NOW(), dataFROM main_table;" createsstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/system_function_disallow_create.yaml b/backend/plugin/advisor/mysql/test/system_function_disallow_create.yamlindex 506793652e..7c9a2d1d8b 100644--- a/backend/plugin/advisor/mysql/test/system_function_disallow_create.yaml+++ b/backend/plugin/advisor/mysql/test/system_function_disallow_create.yaml@@ -22,6 +22,6 @@RETURN result;END;" createsstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/system_function_disallowed_list.yaml b/backend/plugin/advisor/mysql/test/system_function_disallowed_list.yamlindex 0268c9d73f..5dacabf90d 100644--- a/backend/plugin/advisor/mysql/test/system_function_disallowed_list.yaml+++ b/backend/plugin/advisor/mysql/test/system_function_disallowed_list.yaml@@ -8,7 +8,7 @@title: system.function.disallowed-listcontent: Function "RAND" is disallowed, but "SELECT RAND();" usesstartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -29,7 +29,7 @@age INT);" usesstartposition:- line: 1+ line: 2column: 0endposition: null- statement: SELECT SLEEP(5);@@ -40,6 +40,6 @@title: system.function.disallowed-listcontent: Function "SLEEP" is disallowed, but "SELECT SLEEP(5);" usesstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/system_procedure_disallow_create.yaml b/backend/plugin/advisor/mysql/test/system_procedure_disallow_create.yamlindex a668fb97b5..5c7e438efe 100644--- a/backend/plugin/advisor/mysql/test/system_procedure_disallow_create.yaml+++ b/backend/plugin/advisor/mysql/test/system_procedure_disallow_create.yaml@@ -16,6 +16,6 @@SELECT 'Hello, World!' AS Message;END;" createsstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/system_view_disallow_create.yaml b/backend/plugin/advisor/mysql/test/system_view_disallow_create.yamlindex 9b8ff42f47..53369e9788 100644--- a/backend/plugin/advisor/mysql/test/system_view_disallow_create.yaml+++ b/backend/plugin/advisor/mysql/test/system_view_disallow_create.yaml@@ -8,6 +8,6 @@title: system.view.disallow-createcontent: View is forbidden, but "CREATE VIEW get_one AS SELECT 1;" createsstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/table_comment.yaml b/backend/plugin/advisor/mysql/test/table_comment.yamlindex 8ebbfb6fe6..6013318992 100644--- a/backend/plugin/advisor/mysql/test/table_comment.yaml+++ b/backend/plugin/advisor/mysql/test/table_comment.yaml@@ -8,7 +8,7 @@title: table.commentcontent: The length of table `t` comment should be within 10 charactersstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -21,7 +21,7 @@title: table.commentcontent: Table `t` requires commentsstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -34,6 +34,6 @@title: table.commentcontent: The length of table `t` comment should be within 10 charactersstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/table_disallow_partition.yaml b/backend/plugin/advisor/mysql/test/table_disallow_partition.yamlindex d1e6156169..2c1930dff2 100644--- a/backend/plugin/advisor/mysql/test/table_disallow_partition.yaml+++ b/backend/plugin/advisor/mysql/test/table_disallow_partition.yaml@@ -17,7 +17,7 @@PARTITION p1 VALUES LESS THAN (11));" createsstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -36,7 +36,7 @@PARTITION p1 VALUES LESS THAN (11));" createsstartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -59,7 +59,7 @@PARTITION p1 VALUES LESS THAN (11));" createsstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -71,6 +71,6 @@PARTITION p1 VALUES LESS THAN (11));" createsstartposition:- line: 4+ line: 5column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/table_disallow_set_charset.yaml b/backend/plugin/advisor/mysql/test/table_disallow_set_charset.yamlindex bb9e66c3c1..f5c0cd8df4 100644--- a/backend/plugin/advisor/mysql/test/table_disallow_set_charset.yaml+++ b/backend/plugin/advisor/mysql/test/table_disallow_set_charset.yaml@@ -14,7 +14,7 @@name VARCHAR(50)) CHARSET=utf8;" usesstartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -30,6 +30,6 @@title: table.disallow-set-charsetcontent: Set charset on tables is disallowed, but "ALTER TABLE employee CONVERT TO CHARACTER SET utf8;" usesstartposition:- line: 4+ line: 5column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/table_disallow_trigger.yaml b/backend/plugin/advisor/mysql/test/table_disallow_trigger.yamlindex a1adce8173..70747f9d93 100644--- a/backend/plugin/advisor/mysql/test/table_disallow_trigger.yaml+++ b/backend/plugin/advisor/mysql/test/table_disallow_trigger.yaml@@ -13,6 +13,6 @@Trigger is forbidden, but "CREATE TRIGGER ins_sum BEFORE INSERT ON accountFOR EACH ROW SET @sum = @sum + NEW.amount;" createsstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml b/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yamlindex 0a8e808562..28e86757a1 100644--- a/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml+++ b/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml@@ -13,7 +13,7 @@title: table.drop-naming-conventioncontent: '`foo` mismatches drop table naming convention, naming format should be "_delete$"'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -28,6 +28,6 @@title: table.drop-naming-conventioncontent: '`bar` mismatches drop table naming convention, naming format should be "_delete$"'startposition:- line: 3+ line: 4column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/table_no_duplicate_index.yaml b/backend/plugin/advisor/mysql/test/table_no_duplicate_index.yamlindex 513a6657e7..6b100d1074 100644--- a/backend/plugin/advisor/mysql/test/table_no_duplicate_index.yaml+++ b/backend/plugin/advisor/mysql/test/table_no_duplicate_index.yaml@@ -34,7 +34,7 @@title: table.no-duplicate-indexcontent: '`users` has duplicate index `idx_username_duplicate`'startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-@@ -53,7 +53,7 @@title: table.no-duplicate-indexcontent: '`orders` has duplicate index ``'startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-@@ -73,7 +73,7 @@title: table.no-duplicate-indexcontent: '`orders` has duplicate index `idx_duplicate`'startposition:- line: 8+ line: 9column: 0endposition: null- statement: |-@@ -91,7 +91,7 @@title: table.no-duplicate-indexcontent: '`orders` has duplicate index `idx_customer_id_duplicate`'startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-@@ -109,7 +109,7 @@title: table.no-duplicate-indexcontent: '`orders` has duplicate index `idx_customer_duplicate`'startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml b/backend/plugin/advisor/mysql/test/table_no_foreign_key.yamlindex e4a7883f64..44f68e7f4d 100644--- a/backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml+++ b/backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml@@ -8,7 +8,7 @@title: table.no-foreign-keycontent: Foreign key is not allowed in the table `tech_book`startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -21,6 +21,6 @@title: table.no-foreign-keycontent: Foreign key is not allowed in the table `book`startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/mysql/test/table_require_pk.yaml b/backend/plugin/advisor/mysql/test/table_require_pk.yamlindex f3c22eb98d..982cd16c96 100644--- a/backend/plugin/advisor/mysql/test/table_require_pk.yaml+++ b/backend/plugin/advisor/mysql/test/table_require_pk.yaml@@ -18,7 +18,7 @@title: table.require-pkcontent: Table `userTable` requires PRIMARY KEYstartposition:- line: 0+ line: 1column: 0endposition: null- statement: |@@ -45,7 +45,7 @@title: table.require-pkcontent: Table `t2` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -59,7 +59,7 @@title: table.require-pkcontent: Table `t2` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -77,7 +77,7 @@title: table.require-pkcontent: Table `t2` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -100,7 +100,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -113,7 +113,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -147,7 +147,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYstartposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -160,7 +160,7 @@title: table.require-pkcontent: Table `tech_book` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- statement: ALTER TABLE tech_book DROP COLUMN name;@@ -175,7 +175,7 @@title: table.require-pkcontent: Table `tech_book` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -188,6 +188,6 @@title: table.require-pkcontent: Table `tech_book` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/column_add_not_null_require_default.yaml b/backend/plugin/advisor/oracle/test/column_add_not_null_require_default.yamlindex cdb39478e8..1fe40b8a68 100644--- a/backend/plugin/advisor/oracle/test/column_add_not_null_require_default.yaml+++ b/backend/plugin/advisor/oracle/test/column_add_not_null_require_default.yaml@@ -6,7 +6,7 @@title: column.add-not-null-require-defaultcontent: Adding not null column "READER" requires default.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD reader int DEFAULT 0 NOT NULLdiff --git a/backend/plugin/advisor/oracle/test/column_comment.yaml b/backend/plugin/advisor/oracle/test/column_comment.yamlindex 379a7eab1b..a277992f12 100644--- a/backend/plugin/advisor/oracle/test/column_comment.yaml+++ b/backend/plugin/advisor/oracle/test/column_comment.yaml@@ -17,7 +17,7 @@title: column.commentcontent: Comment is required for column "TEST_DB"."T"."A"startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -30,7 +30,7 @@title: column.commentcontent: Comment is required for column "TEST_DB"."T"."D"startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -44,6 +44,6 @@title: column.commentcontent: Comment is required for column "TEST_DB"."T"."A"startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/column_maximum_character_length.yaml b/backend/plugin/advisor/oracle/test/column_maximum_character_length.yamlindex 809e108f09..4e5835cd8f 100644--- a/backend/plugin/advisor/oracle/test/column_maximum_character_length.yaml+++ b/backend/plugin/advisor/oracle/test/column_maximum_character_length.yaml@@ -10,7 +10,7 @@title: column.maximum-character-lengthcontent: The maximum character length is 20.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE public.tech_book ADD name_2 char(225)@@ -21,7 +21,7 @@title: column.maximum-character-lengthcontent: The maximum character length is 20.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY name char(225)@@ -32,6 +32,6 @@title: column.maximum-character-lengthcontent: The maximum character length is 20.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/column_maximum_varchar_length.yaml b/backend/plugin/advisor/oracle/test/column_maximum_varchar_length.yamlindex 193eecb516..7296c3ad30 100644--- a/backend/plugin/advisor/oracle/test/column_maximum_varchar_length.yaml+++ b/backend/plugin/advisor/oracle/test/column_maximum_varchar_length.yaml@@ -8,7 +8,7 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(name varchar(225));@@ -21,7 +21,7 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY name varchar(22225)@@ -32,6 +32,6 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/column_no_null.yaml b/backend/plugin/advisor/oracle/test/column_no_null.yamlindex 6f44ae04aa..45d80b0581 100644--- a/backend/plugin/advisor/oracle/test/column_no_null.yaml+++ b/backend/plugin/advisor/oracle/test/column_no_null.yaml@@ -10,7 +10,7 @@title: column.no-nullcontent: Column "ID" is nullable, which is not allowed.startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -18,7 +18,7 @@title: column.no-nullcontent: Column "NAME" is nullable, which is not allowed.startposition:- line: 2+ line: 3column: 0endposition: null- statement: CREATE TABLE book(id int, name varchar(255), PRIMARY KEY (id))@@ -29,7 +29,7 @@title: column.no-nullcontent: Column "NAME" is nullable, which is not allowed.startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int PRIMARY KEY, name varchar(255))@@ -40,7 +40,7 @@title: column.no-nullcontent: Column "NAME" is nullable, which is not allowed.startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int NOT NULL, name varchar(255))@@ -51,7 +51,7 @@title: column.no-nullcontent: Column "NAME" is nullable, which is not allowed.startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int PRIMARY KEY, name varchar(255) NOT NULL)@@ -64,7 +64,7 @@title: column.no-nullcontent: Column "READER" is nullable, which is not allowed.startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -83,7 +83,7 @@title: column.no-nullcontent: Column "NAME" is nullable, which is not allowed.startposition:- line: 0+ line: 1column: 0endposition: null- statement: -- this is a commentdiff --git a/backend/plugin/advisor/oracle/test/column_require_default.yaml b/backend/plugin/advisor/oracle/test/column_require_default.yamlindex 18e1c8d992..d9155e2d8b 100644--- a/backend/plugin/advisor/oracle/test/column_require_default.yaml+++ b/backend/plugin/advisor/oracle/test/column_require_default.yaml@@ -6,7 +6,7 @@title: column.require-defaultcontent: Column "A" doesn't have default valuestartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -21,6 +21,6 @@title: column.require-defaultcontent: Column "A" doesn't have default valuestartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/column_required.yaml b/backend/plugin/advisor/oracle/test/column_required.yamlindex 0129732ed0..032ef38480 100644--- a/backend/plugin/advisor/oracle/test/column_required.yaml+++ b/backend/plugin/advisor/oracle/test/column_required.yaml@@ -6,7 +6,7 @@title: column.requiredcontent: 'Table "BOOK" requires columns: "created_ts", "creator_id", "updated_ts", "updater_id"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -27,7 +27,7 @@title: column.requiredcontent: 'Table "TECH_BOOK" requires columns: "creator_id"'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -40,6 +40,6 @@title: column.requiredcontent: 'Table "TECH_BOOK" requires columns: "creator_id"'startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/column_type_disallow_list.yaml b/backend/plugin/advisor/oracle/test/column_type_disallow_list.yamlindex de2023d704..46d52a2c40 100644--- a/backend/plugin/advisor/oracle/test/column_type_disallow_list.yaml+++ b/backend/plugin/advisor/oracle/test/column_type_disallow_list.yaml@@ -8,7 +8,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column "B" isstartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -21,7 +21,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column "A" isstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -34,7 +34,7 @@title: column.type-disallow-listcontent: Disallow column type BINARY_FLOAT but column "D" isstartposition:- line: 1+ line: 2column: 0endposition: null- statement: CREATE TABLE t(a int, b BINARY_FLOAT);@@ -45,7 +45,7 @@title: column.type-disallow-listcontent: Disallow column type BINARY_FLOAT but column "B" isstartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -58,6 +58,6 @@title: column.type-disallow-listcontent: Disallow column type BINARY_FLOAT but column "A" isstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/index_key_number_limit.yaml b/backend/plugin/advisor/oracle/test/index_key_number_limit.yamlindex e1a0e1e6ea..3ff199980b 100644--- a/backend/plugin/advisor/oracle/test/index_key_number_limit.yaml+++ b/backend/plugin/advisor/oracle/test/index_key_number_limit.yaml@@ -12,7 +12,7 @@title: index.key-number-limitcontent: Index key number should be less than or equal to 5startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id int, name char(225), c1 int, c2 int, c3 int, c4 int, CONSTRAINT t_id_name UNIQUE (id, name, c1, c2, c3, c4));@@ -23,7 +23,7 @@title: index.key-number-limitcontent: Index key number should be less than or equal to 5startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -36,7 +36,7 @@title: index.key-number-limitcontent: Index key number should be less than or equal to 5startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -49,7 +49,7 @@title: index.key-number-limitcontent: Index key number should be less than or equal to 5startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -62,6 +62,6 @@title: index.key-number-limitcontent: Index key number should be less than or equal to 5startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/naming_identifier_case.yaml b/backend/plugin/advisor/oracle/test/naming_identifier_case.yamlindex d2617a14fb..2df5d901e6 100644--- a/backend/plugin/advisor/oracle/test/naming_identifier_case.yaml+++ b/backend/plugin/advisor/oracle/test/naming_identifier_case.yaml@@ -6,7 +6,7 @@title: naming.identifier.casecontent: Identifier "table" should be upper casestartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE tt(id int, name varchar(255))@@ -19,7 +19,7 @@title: naming.identifier.casecontent: Identifier "Tt" should be upper casestartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book RENAME TO analyzediff --git a/backend/plugin/advisor/oracle/test/naming_identifier_no_keyword.yaml b/backend/plugin/advisor/oracle/test/naming_identifier_no_keyword.yamlindex 001f6b3276..ee1b00001d 100644--- a/backend/plugin/advisor/oracle/test/naming_identifier_no_keyword.yaml+++ b/backend/plugin/advisor/oracle/test/naming_identifier_no_keyword.yaml@@ -6,7 +6,7 @@title: naming.identifier.no-keywordcontent: Identifier "NAME" is a keyword and should be avoidedstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -14,7 +14,7 @@title: naming.identifier.no-keywordcontent: Identifier "table" is a keyword and should be avoidedstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE "rlcmidzlevbivwvcntihenpoibtsdfasdfasdfiutqeb"(id int, name varchar(255))@@ -25,7 +25,7 @@title: naming.identifier.no-keywordcontent: Identifier "NAME" is a keyword and should be avoidedstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE analyze(id int, name varchar(255))@@ -36,7 +36,7 @@title: naming.identifier.no-keywordcontent: Identifier "NAME" is a keyword and should be avoidedstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book RENAME TO analyzediff --git a/backend/plugin/advisor/oracle/test/naming_table.yaml b/backend/plugin/advisor/oracle/test/naming_table.yamlindex 221b6123a3..74cf3aa260 100644--- a/backend/plugin/advisor/oracle/test/naming_table.yaml+++ b/backend/plugin/advisor/oracle/test/naming_table.yaml@@ -6,7 +6,7 @@title: naming.tablecontent: '"techBook" mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE "rlcmidzlevbivwvcntihenpoibtsdfasdfasdfiutqeb"(id int, name varchar(255))@@ -19,7 +19,7 @@title: naming.tablecontent: '"TECH_BOOK" mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE techBook(id int, name varchar(255))@@ -30,7 +30,7 @@title: naming.tablecontent: '"TECHBOOK" mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int, name varchar(255))@@ -41,7 +41,7 @@title: naming.tablecontent: '"BOOK" mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book RENAME TO "TechBook"@@ -52,7 +52,7 @@title: naming.tablecontent: '"TechBook" mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -65,7 +65,7 @@title: naming.tablecontent: '"TECHBOOK" mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -73,7 +73,7 @@title: naming.tablecontent: '"TECH_BOOK_TMP" mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -86,6 +86,6 @@title: naming.tablecontent: '"TECH_BOOK" mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/naming_table_no_keyword.yaml b/backend/plugin/advisor/oracle/test/naming_table_no_keyword.yamlindex 6e4d9eb069..e918cc2ff6 100644--- a/backend/plugin/advisor/oracle/test/naming_table_no_keyword.yaml+++ b/backend/plugin/advisor/oracle/test/naming_table_no_keyword.yaml@@ -6,7 +6,7 @@title: naming.table.no-keywordcontent: Table name "table" is a keyword identifier and should be avoided.startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE "rlcmidzlevbivwvcntihenpoibtsdfasdfasdfiutqeb"(id int, name varchar(255))@@ -19,7 +19,7 @@title: naming.table.no-keywordcontent: Table name "AVG" is a keyword identifier and should be avoided.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book RENAME TO avg@@ -30,7 +30,7 @@title: naming.table.no-keywordcontent: Table name "AVG" is a keyword identifier and should be avoided.startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/oracle/test/statement_disallow_mix_in_ddl.yaml b/backend/plugin/advisor/oracle/test/statement_disallow_mix_in_ddl.yamlindex ac6eea75ef..cb0ac15139 100644--- a/backend/plugin/advisor/oracle/test/statement_disallow_mix_in_ddl.yaml+++ b/backend/plugin/advisor/oracle/test/statement_disallow_mix_in_ddl.yaml@@ -6,7 +6,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDLstartposition:- line: 0+ line: 1column: 0endposition: null- statement: UPDATE tech_book SET id = 1;@@ -17,7 +17,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDLstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD author VARCHAR2(250); UPDATE tech_book SET id = 1;DELETE FROM tech_book WHERE a > 1;@@ -28,7 +28,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDLstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -36,6 +36,6 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDLstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/statement_disallow_mix_in_dml.yaml b/backend/plugin/advisor/oracle/test/statement_disallow_mix_in_dml.yamlindex f0d00cc47f..d38d170eaa 100644--- a/backend/plugin/advisor/oracle/test/statement_disallow_mix_in_dml.yaml+++ b/backend/plugin/advisor/oracle/test/statement_disallow_mix_in_dml.yaml@@ -10,6 +10,6 @@title: statement.disallow-mix-in-dmlcontent: Data change can only run DMLstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/statement_insert_must_specify_column.yaml b/backend/plugin/advisor/oracle/test/statement_insert_must_specify_column.yamlindex bf0c6f427b..7864251051 100644--- a/backend/plugin/advisor/oracle/test/statement_insert_must_specify_column.yaml+++ b/backend/plugin/advisor/oracle/test/statement_insert_must_specify_column.yaml@@ -8,6 +8,6 @@title: statement.insert.must-specify-columncontent: INSERT statement should specify column name.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/statement_select_no_select_all.yaml b/backend/plugin/advisor/oracle/test/statement_select_no_select_all.yamlindex 82b924dd68..91130b858f 100644--- a/backend/plugin/advisor/oracle/test/statement_select_no_select_all.yaml+++ b/backend/plugin/advisor/oracle/test/statement_select_no_select_all.yaml@@ -6,7 +6,7 @@title: statement.select.no-select-allcontent: Avoid using SELECT *.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT a, b FROM t@@ -19,7 +19,7 @@title: statement.select.no-select-allcontent: Avoid using SELECT *.startposition:- line: 0+ line: 1column: 0endposition: null- statement: INSERT INTO t SELECT * FROM t1@@ -30,6 +30,6 @@title: statement.select.no-select-allcontent: Avoid using SELECT *.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/statement_where_no_leading_wildcard_like.yaml b/backend/plugin/advisor/oracle/test/statement_where_no_leading_wildcard_like.yamlindex cfc3120b7b..ebc32e7a4d 100644--- a/backend/plugin/advisor/oracle/test/statement_where_no_leading_wildcard_like.yaml+++ b/backend/plugin/advisor/oracle/test/statement_where_no_leading_wildcard_like.yaml@@ -8,7 +8,7 @@title: statement.where.no-leading-wildcard-likecontent: Avoid using leading wildcard LIKE.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * FROM t WHERE a LIKE 'abc' OR a LIKE '%abc'@@ -19,7 +19,7 @@title: statement.where.no-leading-wildcard-likecontent: Avoid using leading wildcard LIKE.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * FROM t WHERE a LIKE '%acc' OR a LIKE '%abc'@@ -30,7 +30,7 @@title: statement.where.no-leading-wildcard-likecontent: Avoid using leading wildcard LIKE.startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -38,7 +38,7 @@title: statement.where.no-leading-wildcard-likecontent: Avoid using leading wildcard LIKE.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * FROM (SELECT * FROM t WHERE a LIKE '%acc' OR a LIKE '%abc') t1@@ -49,7 +49,7 @@title: statement.where.no-leading-wildcard-likecontent: Avoid using leading wildcard LIKE.startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -57,6 +57,6 @@title: statement.where.no-leading-wildcard-likecontent: Avoid using leading wildcard LIKE.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/statement_where_require_select.yaml b/backend/plugin/advisor/oracle/test/statement_where_require_select.yamlindex 55fcb5cbdc..2da67f4f75 100644--- a/backend/plugin/advisor/oracle/test/statement_where_require_select.yaml+++ b/backend/plugin/advisor/oracle/test/statement_where_require_select.yaml@@ -6,7 +6,7 @@title: statement.where.require.selectcontent: WHERE clause is required for SELECT statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT a FROM t WHERE a > 0@@ -19,7 +19,7 @@title: statement.where.require.selectcontent: WHERE clause is required for SELECT statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT 1 FROM dualdiff --git a/backend/plugin/advisor/oracle/test/statement_where_require_update_delete.yaml b/backend/plugin/advisor/oracle/test/statement_where_require_update_delete.yamlindex 680c13a6e3..3902319232 100644--- a/backend/plugin/advisor/oracle/test/statement_where_require_update_delete.yaml+++ b/backend/plugin/advisor/oracle/test/statement_where_require_update_delete.yaml@@ -6,7 +6,7 @@title: statement.where.require.update-deletecontent: WHERE clause is required for DELETE statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: UPDATE t1 SET a = 1@@ -17,7 +17,7 @@title: statement.where.require.update-deletecontent: WHERE clause is required for UPDATE statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: DELETE FROM t1 WHERE a > 0diff --git a/backend/plugin/advisor/oracle/test/table_comment.yaml b/backend/plugin/advisor/oracle/test/table_comment.yamlindex 7077cff7ff..f7323f7120 100644--- a/backend/plugin/advisor/oracle/test/table_comment.yaml+++ b/backend/plugin/advisor/oracle/test/table_comment.yaml@@ -13,7 +13,7 @@title: table.commentcontent: Comment is required for table "TEST_DB"."T"startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -27,7 +27,7 @@title: table.commentcontent: Comment is required for table "TEST_DB"."D"startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -41,7 +41,7 @@title: table.commentcontent: Comment is required for table "TEST_DB"."T"startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -54,6 +54,6 @@title: table.commentcontent: Table "TEST_DB"."T" comment is too long. The length of comment should be within 10 charactersstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/table_no_foreign_key.yaml b/backend/plugin/advisor/oracle/test/table_no_foreign_key.yamlindex 17ae5effa4..9f90004526 100644--- a/backend/plugin/advisor/oracle/test/table_no_foreign_key.yaml+++ b/backend/plugin/advisor/oracle/test/table_no_foreign_key.yaml@@ -6,7 +6,7 @@title: table.no-foreign-keycontent: Foreign key is not allowed in the table "TEST_DB"."TECH_BOOK".startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id INT, author_id INT, CONSTRAINT fk_book_author_id_author_id FOREIGN KEY (author_id) REFERENCES author (id))@@ -17,6 +17,6 @@title: table.no-foreign-keycontent: Foreign key is not allowed in the table "TEST_DB"."BOOK".startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/oracle/test/table_require_pk.yaml b/backend/plugin/advisor/oracle/test/table_require_pk.yamlindex 83dd8ea72b..b5c9575406 100644--- a/backend/plugin/advisor/oracle/test/table_require_pk.yaml+++ b/backend/plugin/advisor/oracle/test/table_require_pk.yaml@@ -10,7 +10,7 @@title: table.require-pkcontent: Table "TEST_DB"."T" requires PRIMARY KEY.startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -31,6 +31,6 @@title: table.require-pkcontent: Table "TEST_DB"."T" requires PRIMARY KEY.startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/snowflake/test/column_maximum_varchar_length.yaml b/backend/plugin/advisor/snowflake/test/column_maximum_varchar_length.yamlindex 1637365f19..3503e6c2d7 100644--- a/backend/plugin/advisor/snowflake/test/column_maximum_varchar_length.yaml+++ b/backend/plugin/advisor/snowflake/test/column_maximum_varchar_length.yaml@@ -8,7 +8,7 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE CUSTOMER(NAME VARCHAR);@@ -19,7 +19,7 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE PUBLIC.CUSTOMER ADD NAME_2 VARCHAR(22225);@@ -30,7 +30,7 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE PUBLIC.CUSTOMER MODIFY COLUMN NAME VARCHAR(22225);@@ -41,7 +41,7 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE PUBLIC.CUSTOMER MODIFY COLUMN NAME VARCHAR(20);@@ -54,6 +54,6 @@title: column.maximum-varchar-lengthcontent: The maximum varchar length is 2560.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/snowflake/test/column_no_null.yaml b/backend/plugin/advisor/snowflake/test/column_no_null.yamlindex c131d48ae6..d11e9c1d2a 100644--- a/backend/plugin/advisor/snowflake/test/column_no_null.yaml+++ b/backend/plugin/advisor/snowflake/test/column_no_null.yaml@@ -12,7 +12,7 @@title: column.no-nullcontent: Column AGE is nullable, which is not allowed.startposition:- line: 3+ line: 4column: 0endposition: null- status: 2@@ -20,7 +20,7 @@title: column.no-nullcontent: Column ADDRESS is nullable, which is not allowed.startposition:- line: 4+ line: 5column: 0endposition: null- statement: |-@@ -38,7 +38,7 @@title: column.no-nullcontent: Column ADDRESS is nullable, which is not allowed.startposition:- line: 4+ line: 5column: 0endposition: null- statement: |-@@ -57,7 +57,7 @@title: column.no-nullcontent: Column AGE is nullable, which is not allowed.startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE a ADD COLUMN age INT NOT NULL;@@ -70,6 +70,6 @@title: column.no-nullcontent: After dropping NOT NULL of column AGE, it will be nullable, which is not allowed.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/snowflake/test/column_required.yaml b/backend/plugin/advisor/snowflake/test/column_required.yamlindex edf6ffc68b..0c6f6aeab8 100644--- a/backend/plugin/advisor/snowflake/test/column_required.yaml+++ b/backend/plugin/advisor/snowflake/test/column_required.yaml@@ -19,7 +19,7 @@title: column.requiredcontent: Table t missing required column "created_ts"startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -27,7 +27,7 @@title: column.requiredcontent: Table t missing required column "creator_id"startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -35,7 +35,7 @@title: column.requiredcontent: Table t missing required column "id"startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -43,7 +43,7 @@title: column.requiredcontent: Table t missing required column "updated_ts"startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -51,7 +51,7 @@title: column.requiredcontent: Table t missing required column "updater_id"startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -68,7 +68,7 @@title: column.requiredcontent: Table t missing required column "updated_ts"startposition:- line: 4+ line: 5column: 0endposition: null- statement: ALTER TABLE t DROP COLUMN "created_ts";@@ -79,7 +79,7 @@title: column.requiredcontent: Table t missing required column "created_ts"startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE t DROP COLUMN creator_id;diff --git a/backend/plugin/advisor/snowflake/test/naming_identifier_case.yaml b/backend/plugin/advisor/snowflake/test/naming_identifier_case.yamlindex 13858733db..c2394b7a10 100644--- a/backend/plugin/advisor/snowflake/test/naming_identifier_case.yaml+++ b/backend/plugin/advisor/snowflake/test/naming_identifier_case.yaml@@ -17,7 +17,7 @@title: naming.identifier.casecontent: Identifier "address" should be upper casestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -33,7 +33,7 @@title: naming.identifier.casecontent: Identifier "address" should be upper casestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -51,7 +51,7 @@title: naming.identifier.casecontent: Identifier "address" should be upper casestartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE mytable RENAME COLUMN name TO address;diff --git a/backend/plugin/advisor/snowflake/test/naming_identifier_no_keyword.yaml b/backend/plugin/advisor/snowflake/test/naming_identifier_no_keyword.yamlindex 7e62c63452..37bbeb8e62 100644--- a/backend/plugin/advisor/snowflake/test/naming_identifier_no_keyword.yaml+++ b/backend/plugin/advisor/snowflake/test/naming_identifier_no_keyword.yaml@@ -10,7 +10,7 @@title: naming.identifier.no-keywordcontent: Identifier "CONNECT" is a keyword and should be avoidedstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -25,7 +25,7 @@title: naming.identifier.no-keywordcontent: Identifier "connect" is a keyword and should be avoidedstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -46,7 +46,7 @@title: naming.identifier.no-keywordcontent: Identifier "connect" is a keyword and should be avoidedstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -63,7 +63,7 @@title: naming.identifier.no-keywordcontent: Identifier "connect" is a keyword and should be avoidedstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE mytable RENAME COLUMN name TO age;diff --git a/backend/plugin/advisor/snowflake/test/naming_table.yaml b/backend/plugin/advisor/snowflake/test/naming_table.yamlindex 955efe7801..09424c9523 100644--- a/backend/plugin/advisor/snowflake/test/naming_table.yaml+++ b/backend/plugin/advisor/snowflake/test/naming_table.yaml@@ -10,7 +10,7 @@title: naming.tablecontent: '"lower_case_table_name_without_double_quotes" mismatches table naming convention, naming format should be "^[A-Z]+(_[A-Z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE "lower_case_table_name_with_double_quotes"(ID INT);@@ -21,7 +21,7 @@title: naming.tablecontent: '"lower_case_table_name_with_double_quotes" mismatches table naming convention, naming format should be "^[A-Z]+(_[A-Z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: "CREATE TABLE \"\U0001F608EMOJI\U0001F604\"(ID INT);"@@ -32,7 +32,7 @@title: naming.tablecontent: "\"\U0001F608EMOJI\U0001F604\" mismatches table naming convention, naming format should be \"^[A-Z]+(_[A-Z]+)*$\""startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE "lower_case_table_with_double_quotes" RENAME TO UPPER_CASE_TABLE_NAME_WITHOUT_DOUBLE_QUOTES;@@ -45,7 +45,7 @@title: naming.tablecontent: '"lower_case_table_with_double_quotes" mismatches table naming convention, naming format should be "^[A-Z]+(_[A-Z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -58,7 +58,7 @@title: naming.tablecontent: '"lower_case_table_with_double_quotes" mismatches table naming convention, naming format should be "^[A-Z]+(_[A-Z]+)*$"'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -71,7 +71,7 @@title: naming.tablecontent: '"lower_case_table_name_with_double_quotes" mismatches table naming convention, naming format should be "^[A-Z]+(_[A-Z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -84,6 +84,6 @@title: naming.tablecontent: '"lowercase" mismatches table naming convention, naming format should be "^[A-Z]+(_[A-Z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/snowflake/test/schema_backward_compatibility.yaml b/backend/plugin/advisor/snowflake/test/schema_backward_compatibility.yamlindex 32ab341411..57b165acb6 100644--- a/backend/plugin/advisor/snowflake/test/schema_backward_compatibility.yaml+++ b/backend/plugin/advisor/snowflake/test/schema_backward_compatibility.yaml@@ -6,7 +6,7 @@title: schema.backward-compatibilitycontent: Drop database "DB" may cause incompatibility with the existing data and codestartposition:- line: 0+ line: 1column: 0endposition: null- statement: DROP SCHEMA SCHEMA1;@@ -17,7 +17,7 @@title: schema.backward-compatibilitycontent: Drop schema "TEST_DB.SCHEMA1" may cause incompatibility with the existing data and codestartposition:- line: 0+ line: 1column: 0endposition: null- statement: DROP TABLE T;@@ -28,7 +28,7 @@title: schema.backward-compatibilitycontent: Drop table "TEST_DB.PUBLIC.T" may cause incompatibility with the existing data and codestartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE T DROP COLUMN COL1;@@ -39,7 +39,7 @@title: schema.backward-compatibilitycontent: Drop column "COL1" may cause incompatibility with the existing data and codestartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -52,7 +52,7 @@title: schema.backward-compatibilitycontent: Drop table "TEST_DB.PUBLIC.T" may cause incompatibility with the existing data and codestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/snowflake/test/statement_select_no_select_all.yaml b/backend/plugin/advisor/snowflake/test/statement_select_no_select_all.yamlindex 82b924dd68..91130b858f 100644--- a/backend/plugin/advisor/snowflake/test/statement_select_no_select_all.yaml+++ b/backend/plugin/advisor/snowflake/test/statement_select_no_select_all.yaml@@ -6,7 +6,7 @@title: statement.select.no-select-allcontent: Avoid using SELECT *.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT a, b FROM t@@ -19,7 +19,7 @@title: statement.select.no-select-allcontent: Avoid using SELECT *.startposition:- line: 0+ line: 1column: 0endposition: null- statement: INSERT INTO t SELECT * FROM t1@@ -30,6 +30,6 @@title: statement.select.no-select-allcontent: Avoid using SELECT *.startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/snowflake/test/statement_where_require_select.yaml b/backend/plugin/advisor/snowflake/test/statement_where_require_select.yamlindex 31d6e71a21..4ed1a2b7c4 100644--- a/backend/plugin/advisor/snowflake/test/statement_where_require_select.yaml+++ b/backend/plugin/advisor/snowflake/test/statement_where_require_select.yaml@@ -6,7 +6,7 @@title: statement.where.require.selectcontent: WHERE clause is required for SELECT statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * FROM t;@@ -17,7 +17,7 @@title: statement.where.require.selectcontent: WHERE clause is required for SELECT statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * FROM t WHERE b = 2;@@ -39,7 +39,7 @@title: statement.where.require.selectcontent: WHERE clause is required for SELECT statement.startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -47,7 +47,7 @@title: statement.where.require.selectcontent: WHERE clause is required for SELECT statement.startposition:- line: 4+ line: 5column: 0endposition: null- statement: |-@@ -63,7 +63,7 @@title: statement.where.require.selectcontent: WHERE clause is required for SELECT statement.startposition:- line: 1+ line: 2column: 0endposition: null- statement: SELECT 1;diff --git a/backend/plugin/advisor/snowflake/test/statement_where_require_update_delete.yaml b/backend/plugin/advisor/snowflake/test/statement_where_require_update_delete.yamlindex 17fc69b2de..8632c8b5c4 100644--- a/backend/plugin/advisor/snowflake/test/statement_where_require_update_delete.yaml+++ b/backend/plugin/advisor/snowflake/test/statement_where_require_update_delete.yaml@@ -6,7 +6,7 @@title: statement.where.require.update-deletecontent: WHERE clause is required for UPDATE statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: UPDATE t SET a = 1 WHERE b = 2;@@ -19,7 +19,7 @@title: statement.where.require.update-deletecontent: WHERE clause is required for DELETE statement.startposition:- line: 0+ line: 1column: 0endposition: null- statement: DELETE FROM t WHERE a = 1;diff --git a/backend/plugin/advisor/snowflake/test/table_drop_naming_convention.yaml b/backend/plugin/advisor/snowflake/test/table_drop_naming_convention.yamlindex f6a732b8b3..73ea0d3f31 100644--- a/backend/plugin/advisor/snowflake/test/table_drop_naming_convention.yaml+++ b/backend/plugin/advisor/snowflake/test/table_drop_naming_convention.yaml@@ -8,6 +8,6 @@title: table.drop-naming-conventioncontent: '"FOO" mismatches drop table naming convention, naming format should be "_delete$"'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/snowflake/test/table_no_foreign_key.yaml b/backend/plugin/advisor/snowflake/test/table_no_foreign_key.yamlindex 0a9ee48268..effb87326e 100644--- a/backend/plugin/advisor/snowflake/test/table_no_foreign_key.yaml+++ b/backend/plugin/advisor/snowflake/test/table_no_foreign_key.yaml@@ -12,7 +12,7 @@title: table.no-foreign-keycontent: FOREIGN KEY is not allowed in the table CUSTOMER.startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -30,7 +30,7 @@title: table.no-foreign-keycontent: FOREIGN KEY is not allowed in the table CUSTOMER.startposition:- line: 5+ line: 6column: 0endposition: null- statement: |-@@ -48,7 +48,7 @@title: table.no-foreign-keycontent: FOREIGN KEY is not allowed in the table CUSTOMER.startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-@@ -66,7 +66,7 @@title: table.no-foreign-keycontent: FOREIGN KEY is not allowed in the table "ANOTHER_SCHEMA"."CUSTOMER".startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -99,6 +99,6 @@title: table.no-foreign-keycontent: FOREIGN KEY is not allowed in the table CUSTOMER.startposition:- line: 12+ line: 13column: 0endposition: nulldiff --git a/backend/plugin/advisor/snowflake/test/table_require_pk.yaml b/backend/plugin/advisor/snowflake/test/table_require_pk.yamlindex 0b49c51895..bd0729e038 100644--- a/backend/plugin/advisor/snowflake/test/table_require_pk.yaml+++ b/backend/plugin/advisor/snowflake/test/table_require_pk.yaml@@ -29,7 +29,7 @@title: table.require-pkcontent: Table CUSTOMER requires PRIMARY KEY.startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -47,7 +47,7 @@title: table.require-pkcontent: Table CUSTOMER requires PRIMARY KEY.startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-@@ -90,7 +90,7 @@title: table.require-pkcontent: Table CUSTOMER requires PRIMARY KEY.startposition:- line: 8+ line: 9column: 0endposition: null- statement: |-@@ -126,7 +126,7 @@title: table.require-pkcontent: Table CUSTOMER requires PRIMARY KEY.startposition:- line: 23+ line: 24column: 0endposition: null- status: 2@@ -134,6 +134,6 @@title: table.require-pkcontent: Table ORDERING requires PRIMARY KEY.startposition:- line: 24+ line: 25column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_auto_increment_initial_value.yaml b/backend/plugin/advisor/tidb/test/column_auto_increment_initial_value.yamlindex 96494b4470..929710f0a4 100644--- a/backend/plugin/advisor/tidb/test/column_auto_increment_initial_value.yaml+++ b/backend/plugin/advisor/tidb/test/column_auto_increment_initial_value.yaml@@ -10,6 +10,6 @@title: column.auto-increment-initial-valuecontent: The initial auto-increment value in table `t` is 2, which doesn't equal 20startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_auto_increment_must_integer.yaml b/backend/plugin/advisor/tidb/test/column_auto_increment_must_integer.yamlindex 3ff4602c25..8eaecf3328 100644--- a/backend/plugin/advisor/tidb/test/column_auto_increment_must_integer.yaml+++ b/backend/plugin/advisor/tidb/test/column_auto_increment_must_integer.yaml@@ -8,7 +8,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typestartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -21,7 +21,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -34,7 +34,7 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -47,6 +47,6 @@title: column.auto-increment-must-integercontent: Auto-increment column `t`.`a` requires integer typestartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_auto_increment_must_unsigned.yaml b/backend/plugin/advisor/tidb/test/column_auto_increment_must_unsigned.yamlindex a8bcd479ab..de64d2965b 100644--- a/backend/plugin/advisor/tidb/test/column_auto_increment_must_unsigned.yaml+++ b/backend/plugin/advisor/tidb/test/column_auto_increment_must_unsigned.yaml@@ -8,7 +8,7 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typestartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -21,7 +21,7 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -34,7 +34,7 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typestartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -47,6 +47,6 @@title: column.auto-increment-must-unsignedcontent: Auto-increment column `t`.`a` is not UNSIGNED typestartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_comment.yaml b/backend/plugin/advisor/tidb/test/column_comment.yamlindex d1b36c9fcf..0f1d9f0894 100644--- a/backend/plugin/advisor/tidb/test/column_comment.yaml+++ b/backend/plugin/advisor/tidb/test/column_comment.yaml@@ -12,7 +12,7 @@title: column.commentcontent: The length of column `t`.`a` comment should be within 10 charactersstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -20,7 +20,7 @@title: column.commentcontent: Column `t`.`b` requires commentsstartposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -28,7 +28,7 @@title: column.commentcontent: Column `t`.`c` requires commentsstartposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -41,7 +41,7 @@title: column.commentcontent: Column `t`.`b` requires commentsstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -54,7 +54,7 @@title: column.commentcontent: The length of column `t`.`a` comment should be within 10 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -62,7 +62,7 @@title: column.commentcontent: Column `t`.`b` requires commentsstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -75,7 +75,7 @@title: column.commentcontent: The length of column `t`.`b` comment should be within 10 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -83,7 +83,7 @@title: column.commentcontent: Column `t`.`b` requires commentsstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -96,7 +96,7 @@title: column.commentcontent: The length of column `t`.`b` comment should be within 10 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -104,6 +104,6 @@title: column.commentcontent: The length of column `t`.`b` comment should be within 10 charactersstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_current_time_count_limit.yaml b/backend/plugin/advisor/tidb/test/column_current_time_count_limit.yamlindex 6bc89ba408..0a44bc65e0 100644--- a/backend/plugin/advisor/tidb/test/column_current_time_count_limit.yaml+++ b/backend/plugin/advisor/tidb/test/column_current_time_count_limit.yaml@@ -13,7 +13,7 @@title: column.current-time-count-limitcontent: Table `t` has 3 DEFAULT CURRENT_TIMESTAMP() columns. The count greater than 2.startposition:- line: 4+ line: 5column: 0endposition: null- statement: |-@@ -28,7 +28,7 @@title: column.current-time-count-limitcontent: Table `t` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.startposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -41,6 +41,6 @@title: column.current-time-count-limitcontent: Table `tech_book` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_disallow_change.yaml b/backend/plugin/advisor/tidb/test/column_disallow_change.yamlindex db3a4c5f20..699b64ca7d 100644--- a/backend/plugin/advisor/tidb/test/column_disallow_change.yaml+++ b/backend/plugin/advisor/tidb/test/column_disallow_change.yaml@@ -12,6 +12,6 @@title: column.disallow-changecontent: '"ALTER TABLE t CHANGE COLUMN b a int" contains CHANGE COLUMN statement'startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_disallow_change_type.yaml b/backend/plugin/advisor/tidb/test/column_disallow_change_type.yamlindex fa38efa34f..b5dad841bd 100644--- a/backend/plugin/advisor/tidb/test/column_disallow_change_type.yaml+++ b/backend/plugin/advisor/tidb/test/column_disallow_change_type.yaml@@ -6,7 +6,7 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book MODIFY id INTEGER UNSIGNED" changes column type'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY id int@@ -19,7 +19,7 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book MODIFY id bigint" changes column type'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book CHANGE name uname varchar(20)@@ -30,6 +30,6 @@title: column.disallow-change-typecontent: '"ALTER TABLE tech_book CHANGE name uname varchar(20)" changes column type'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_disallow_changing_order.yaml b/backend/plugin/advisor/tidb/test/column_disallow_changing_order.yamlindex 9c22b79d40..28819131c6 100644--- a/backend/plugin/advisor/tidb/test/column_disallow_changing_order.yaml+++ b/backend/plugin/advisor/tidb/test/column_disallow_changing_order.yaml@@ -12,7 +12,7 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t MODIFY COLUMN a int FIRST" changes column order'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -25,7 +25,7 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t CHANGE COLUMN a1 a int FIRST" changes column order'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -38,7 +38,7 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t MODIFY COLUMN a int AFTER b" changes column order'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -51,6 +51,6 @@title: column.disallow-changing-ordercontent: '"ALTER TABLE t CHANGE COLUMN a1 a int AFTER b" changes column order'startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_disallow_drop_in_index.yaml b/backend/plugin/advisor/tidb/test/column_disallow_drop_in_index.yamlindex 26c8378eff..28ade96008 100644--- a/backend/plugin/advisor/tidb/test/column_disallow_drop_in_index.yaml+++ b/backend/plugin/advisor/tidb/test/column_disallow_drop_in_index.yaml@@ -12,7 +12,7 @@title: column.disallow-drop-in-indexcontent: '`t`.`b` cannot drop index column'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -25,7 +25,7 @@title: column.disallow-drop-in-indexcontent: '`t`.`c` cannot drop index column'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -44,7 +44,7 @@title: column.disallow-drop-in-indexcontent: '`t`.`a` cannot drop index column'startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -52,6 +52,6 @@title: column.disallow-drop-in-indexcontent: '`t`.`c` cannot drop index column'startposition:- line: 2+ line: 3column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_disallow_set_charset.yaml b/backend/plugin/advisor/tidb/test/column_disallow_set_charset.yamlindex fe3a1f3029..d490f3db78 100644--- a/backend/plugin/advisor/tidb/test/column_disallow_set_charset.yaml+++ b/backend/plugin/advisor/tidb/test/column_disallow_set_charset.yaml@@ -12,7 +12,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "CREATE TABLE t(a varchar(20) CHARSET ascii)" doesstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD COLUMN a varchar(20) CHARSET ascii@@ -23,7 +23,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book ADD COLUMN a varchar(20) CHARSET ascii" doesstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY COLUMN id varchar(20) CHARSET ascii@@ -34,7 +34,7 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book MODIFY COLUMN id varchar(20) CHARSET ascii" doesstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book CHANGE COLUMN name name varchar(20) CHARSET ascii@@ -45,6 +45,6 @@title: column.disallow-set-charsetcontent: Disallow set column charset but "ALTER TABLE tech_book CHANGE COLUMN name name varchar(20) CHARSET ascii" doesstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_maximum_character_length.yaml b/backend/plugin/advisor/tidb/test/column_maximum_character_length.yamlindex fe0735ba3e..67f00e6289 100644--- a/backend/plugin/advisor/tidb/test/column_maximum_character_length.yaml+++ b/backend/plugin/advisor/tidb/test/column_maximum_character_length.yaml@@ -10,7 +10,7 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `name` is bigger than 20, please use VARCHAR insteadstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD COLUMN name_2 char(225)@@ -21,7 +21,7 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `name_2` is bigger than 20, please use VARCHAR insteadstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book CHANGE COLUMN name name char(225)@@ -32,7 +32,7 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `name` is bigger than 20, please use VARCHAR insteadstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY COLUMN name char(225)@@ -43,6 +43,6 @@title: column.maximum-character-lengthcontent: The length of the CHAR column `name` is bigger than 20, please use VARCHAR insteadstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_no_null.yaml b/backend/plugin/advisor/tidb/test/column_no_null.yamlindex 366d046ab0..c2196d9161 100644--- a/backend/plugin/advisor/tidb/test/column_no_null.yaml+++ b/backend/plugin/advisor/tidb/test/column_no_null.yaml@@ -9,7 +9,7 @@title: column.no-nullcontent: '`book`.`id` cannot have NULL value'startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -17,7 +17,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'startposition:- line: 2+ line: 3column: 0endposition: null- statement: CREATE TABLE book(id int PRIMARY KEY, name varchar(255))@@ -28,7 +28,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int NOT NULL, name varchar(255))@@ -39,7 +39,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int PRIMARY KEY, name varchar(255) NOT NULL)@@ -54,7 +54,7 @@title: column.no-nullcontent: '`book`.`id` cannot have NULL value'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -71,7 +71,7 @@title: column.no-nullcontent: '`book`.`name` cannot have NULL value'startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/tidb/test/column_require_default.yaml b/backend/plugin/advisor/tidb/test/column_require_default.yamlindex 538558e463..0da74b7784 100644--- a/backend/plugin/advisor/tidb/test/column_require_default.yaml+++ b/backend/plugin/advisor/tidb/test/column_require_default.yaml@@ -11,7 +11,7 @@title: column.require-defaultcontent: Column `t`.`b` doesn't have DEFAULT.startposition:- line: 2+ line: 3column: 0endposition: null- statement: CREATE TABLE t(a int primary key, b int default 1)@@ -28,7 +28,7 @@title: column.require-defaultcontent: Column `t`.`a` doesn't have DEFAULT.startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -42,7 +42,7 @@title: column.require-defaultcontent: Column `tech_book`.`b` doesn't have DEFAULT.startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -50,6 +50,6 @@title: column.require-defaultcontent: Column `tech_book`.`a` doesn't have DEFAULT.startposition:- line: 2+ line: 3column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/column_required.yaml b/backend/plugin/advisor/tidb/test/column_required.yamlindex e211e0f4f0..87dd89fbd0 100644--- a/backend/plugin/advisor/tidb/test/column_required.yaml+++ b/backend/plugin/advisor/tidb/test/column_required.yaml@@ -6,7 +6,7 @@title: column.requiredcontent: 'Table `book` requires columns: created_ts, creator_id, updated_ts, updater_id'startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -32,7 +32,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-@@ -59,7 +59,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-@@ -86,7 +86,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'startposition:- line: 6+ line: 7column: 0endposition: null- statement: |-@@ -113,7 +113,7 @@title: column.requiredcontent: 'Table `book` requires columns: updater_id'startposition:- line: 4+ line: 5column: 0endposition: null- statement: |-@@ -142,7 +142,7 @@title: column.requiredcontent: 'Table `book` requires columns: creator_id'startposition:- line: 4+ line: 5column: 0endposition: null- status: 2@@ -150,7 +150,7 @@title: column.requiredcontent: 'Table `student` requires columns: creator_id, updater_id'startposition:- line: 8+ line: 9column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/tidb/test/column_set_default_for_not_null.yaml b/backend/plugin/advisor/tidb/test/column_set_default_for_not_null.yamlindex 4994916ce2..8ca4b06ff2 100644--- a/backend/plugin/advisor/tidb/test/column_set_default_for_not_null.yaml+++ b/backend/plugin/advisor/tidb/test/column_set_default_for_not_null.yaml@@ -19,7 +19,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -42,7 +42,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -55,7 +55,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -76,7 +76,7 @@title: column.set-default-for-not-nullcontent: Column `book`.`id` is NOT NULL but doesn't have DEFAULTstartposition:- line: 1+ line: 2column: 0endposition: null- 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"diff --git a/backend/plugin/advisor/tidb/test/column_type_disallow_list.yaml b/backend/plugin/advisor/tidb/test/column_type_disallow_list.yamlindex cee30d79a8..438593123a 100644--- a/backend/plugin/advisor/tidb/test/column_type_disallow_list.yaml+++ b/backend/plugin/advisor/tidb/test/column_type_disallow_list.yaml@@ -8,7 +8,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` isstartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -21,7 +21,7 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` isstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -34,6 +34,6 @@title: column.type-disallow-listcontent: Disallow column type JSON but column `t`.`a` isstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/database_drop_empty_database.yaml b/backend/plugin/advisor/tidb/test/database_drop_empty_database.yamlindex f8397cd823..df7d4729cc 100644--- a/backend/plugin/advisor/tidb/test/database_drop_empty_database.yaml+++ b/backend/plugin/advisor/tidb/test/database_drop_empty_database.yaml@@ -6,6 +6,6 @@title: database.drop-empty-databasecontent: Database `test` is not allowed to drop if not emptystartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/index_key_number_limit.yaml b/backend/plugin/advisor/tidb/test/index_key_number_limit.yamlindex 847f958cc4..f7f49d2a72 100644--- a/backend/plugin/advisor/tidb/test/index_key_number_limit.yaml+++ b/backend/plugin/advisor/tidb/test/index_key_number_limit.yaml@@ -12,7 +12,7 @@title: index.key-number-limitcontent: The number of index `pk` in table `t` should be not greater than 5startposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -25,7 +25,7 @@title: index.key-number-limitcontent: The number of index `idx` in table `t` should be not greater than 5startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -38,7 +38,7 @@title: index.key-number-limitcontent: The number of index `uk` in table `t` should be not greater than 5startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -51,6 +51,6 @@title: index.key-number-limitcontent: The number of index `uk` in table `t` should be not greater than 5startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/index_no_duplicate_column.yaml b/backend/plugin/advisor/tidb/test/index_no_duplicate_column.yamlindex 5f303b5ac5..966c7a1e02 100644--- a/backend/plugin/advisor/tidb/test/index_no_duplicate_column.yaml+++ b/backend/plugin/advisor/tidb/test/index_no_duplicate_column.yaml@@ -11,7 +11,7 @@title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -24,7 +24,7 @@title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -37,7 +37,7 @@title: index.no-duplicate-columncontent: INDEX `idx_a` has duplicate column `t`.`a`startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -50,7 +50,7 @@title: index.no-duplicate-columncontent: PRIMARY KEY `pk_a` has duplicate column `t`.`a`startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -63,7 +63,7 @@title: index.no-duplicate-columncontent: UNIQUE KEY `uk_a` has duplicate column `t`.`a`startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -76,6 +76,6 @@title: index.no-duplicate-columncontent: FOREIGN KEY `fk_a` has duplicate column `t`.`a`startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/index_pk_type_limit.yaml b/backend/plugin/advisor/tidb/test/index_pk_type_limit.yamlindex 1b9e798752..2ce7e066b7 100644--- a/backend/plugin/advisor/tidb/test/index_pk_type_limit.yaml+++ b/backend/plugin/advisor/tidb/test/index_pk_type_limit.yaml@@ -6,7 +6,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT PRIMARY KEY)@@ -19,7 +19,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT, id2 VARCHAR(5), id3 VARCHAR(5), PRIMARY KEY(id, id2, id3))@@ -30,7 +30,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -38,7 +38,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT, id2 BIGINT, PRIMARY KEY(id, id2))@@ -55,7 +55,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -72,7 +72,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -85,7 +85,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -93,7 +93,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -114,7 +114,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -127,7 +127,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -135,7 +135,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id3` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -156,7 +156,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -173,7 +173,7 @@title: index.pk-type-limitcontent: Columns in primary key must be INT/BIGINT but `t`.`id2` is varchar(5)startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/tidb/test/index_primary_key_type_allowlist.yaml b/backend/plugin/advisor/tidb/test/index_primary_key_type_allowlist.yamlindex 37d4df5888..6aaaaa429b 100644--- a/backend/plugin/advisor/tidb/test/index_primary_key_type_allowlist.yaml+++ b/backend/plugin/advisor/tidb/test/index_primary_key_type_allowlist.yaml@@ -6,7 +6,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 allowliststartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT PRIMARY KEY)@@ -19,7 +19,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 allowliststartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT, id2 VARCHAR(5), id3 VARCHAR(5), PRIMARY KEY(id, id2, id3))@@ -30,7 +30,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 allowliststartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -38,7 +38,7 @@title: index.primary-key-type-allowlistcontent: The column `id3` in table `t` is one of the primary key, but its type "varchar" is not in allowliststartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT, id2 BIGINT, PRIMARY KEY(id, id2))@@ -55,7 +55,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -72,7 +72,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -85,7 +85,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -93,7 +93,7 @@title: index.primary-key-type-allowlistcontent: The column `id3` in table `t` is one of the primary key, but its type "varchar" is not in allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -114,7 +114,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -127,7 +127,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -135,7 +135,7 @@title: index.primary-key-type-allowlistcontent: The column `id3` in table `t` is one of the primary key, but its type "varchar" is not in allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -156,7 +156,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -173,7 +173,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 allowliststartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/tidb/test/index_total_number_limit.yaml b/backend/plugin/advisor/tidb/test/index_total_number_limit.yamlindex 4d45969a60..aeb466262d 100644--- a/backend/plugin/advisor/tidb/test/index_total_number_limit.yaml+++ b/backend/plugin/advisor/tidb/test/index_total_number_limit.yaml@@ -15,7 +15,7 @@title: index.total-number-limitcontent: The count of index in table `tech_book` should be no more than 5, but found 8startposition:- line: 4+ line: 5column: 0endposition: null- statement: |-@@ -32,7 +32,7 @@title: index.total-number-limitcontent: The count of index in table `t` should be no more than 5, but found 6startposition:- line: 5+ line: 6column: 0endposition: null- statement: |-@@ -52,6 +52,6 @@title: index.total-number-limitcontent: The count of index in table `t` should be no more than 5, but found 6startposition:- line: 8+ line: 9column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/index_type_no_blob.yaml b/backend/plugin/advisor/tidb/test/index_type_no_blob.yamlindex e2886c2559..f45cdd0c3d 100644--- a/backend/plugin/advisor/tidb/test/index_type_no_blob.yaml+++ b/backend/plugin/advisor/tidb/test/index_type_no_blob.yaml@@ -6,7 +6,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(b BLOB, mb MEDIUMBLOB, lb LONGBLOB, id INT, PRIMARY KEY(b(1), mb(2), lb(3), id))@@ -17,7 +17,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -25,7 +25,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -33,7 +33,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(b BLOB, mb MEDIUMBLOB, lb LONGBLOB, id INT, UNIQUE INDEX(b(1), mb(2), lb(3), id))@@ -44,7 +44,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -52,7 +52,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -60,7 +60,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(b BLOB, mb MEDIUMBLOB, lb LONGBLOB, id iNT, INDEX(b(1), mb(2), lb(3), id))@@ -71,7 +71,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -79,7 +79,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -87,7 +87,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(id INT, PRIMARY KEY(id))@@ -102,7 +102,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -115,7 +115,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -123,7 +123,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -131,7 +131,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -144,7 +144,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -152,7 +152,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -160,7 +160,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -180,7 +180,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`b` is blobstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -188,7 +188,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`mb` is mediumblobstartposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -196,7 +196,7 @@title: index.type-no-blobcontent: Columns in index must not be BLOB but `t`.`lb` is longblobstartposition:- line: 3+ line: 4column: 0endposition: null- statement: |-diff --git a/backend/plugin/advisor/tidb/test/naming_column.yaml b/backend/plugin/advisor/tidb/test/naming_column.yamlindex 3c72d6ef8d..38d5f3e770 100644--- a/backend/plugin/advisor/tidb/test/naming_column.yaml+++ b/backend/plugin/advisor/tidb/test/naming_column.yaml@@ -6,7 +6,7 @@title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int, gbhzmtchhsjzyrhdroxmyouwloxqezowdvhcbqalqcgqhfbjnvmhwrbggezmzeusx int)@@ -17,7 +17,7 @@title: naming.columncontent: '`book`.`gbhzmtchhsjzyrhdroxmyouwloxqezowdvhcbqalqcgqhfbjnvmhwrbggezmzeusx` mismatches column naming convention, its length should be within 64 characters'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id int, creator_id int)@@ -32,7 +32,7 @@title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 1+ line: 2column: 0endposition: null- statement: ALTER TABLE tech_book RENAME COLUMN id TO creator_id;@@ -52,7 +52,7 @@title: naming.columncontent: '`book`.`creatorId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 6+ line: 7column: 0endposition: null- statement: ALTER TABLE tech_book CHANGE COLUMN id creator_id int;@@ -73,7 +73,7 @@title: naming.columncontent: '`book`.`contentString` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 5+ line: 6column: 0endposition: null- statement: |-@@ -93,7 +93,7 @@title: naming.columncontent: '`book`.`createdTs` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -101,7 +101,7 @@title: naming.columncontent: '`book`.`updaterId` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 3+ line: 4column: 0endposition: null- status: 2@@ -109,7 +109,7 @@title: naming.columncontent: '`student`.`createdTs` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 7+ line: 8column: 0endposition: null- status: 2@@ -117,6 +117,6 @@title: naming.columncontent: '`student`.`updatedTs` mismatches column naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 8+ line: 9column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/naming_column_auto_increment.yaml b/backend/plugin/advisor/tidb/test/naming_column_auto_increment.yamlindex 5458695bc8..9f710d952e 100644--- a/backend/plugin/advisor/tidb/test/naming_column_auto_increment.yaml+++ b/backend/plugin/advisor/tidb/test/naming_column_auto_increment.yaml@@ -8,7 +8,7 @@title: naming.column.auto-incrementcontent: '`book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD COLUMN a int AUTO_INCREMENT@@ -19,7 +19,7 @@title: naming.column.auto-incrementcontent: '`tech_book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book CHANGE COLUMN id a int AUTO_INCREMENT@@ -30,7 +30,7 @@title: naming.column.auto-incrementcontent: '`tech_book`.`a` mismatches auto_increment column naming convention, naming format should be "^id$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY COLUMN name int AUTO_INCREMENT@@ -41,6 +41,6 @@title: naming.column.auto-incrementcontent: '`tech_book`.`name` mismatches auto_increment column naming convention, naming format should be "^id$"'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/naming_index_fk.yaml b/backend/plugin/advisor/tidb/test/naming_index_fk.yamlindex bc343b76bc..1e266de636 100644--- a/backend/plugin/advisor/tidb/test/naming_index_fk.yaml+++ b/backend/plugin/advisor/tidb/test/naming_index_fk.yaml@@ -8,7 +8,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD CONSTRAINT rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk FOREIGN KEY (author_id) REFERENCES author (id)@@ -19,7 +19,7 @@title: naming.index.fkcontent: Foreign key `rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk` in table `tech_book` mismatches the naming convention, its length should be within 64 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -27,7 +27,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 `rvemempmcmmhutaskvcidmwaldtfjdgmcpkhmibtadfydtkexpuzczrrneucthfwk`startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id INT, author_id INT, FOREIGN KEY fk_book_author_id_author_id (author_id) REFERENCES author (id))@@ -42,6 +42,6 @@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`startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/naming_index_idx.yaml b/backend/plugin/advisor/tidb/test/naming_index_idx.yamlindex eebe5b3520..1634033c1a 100644--- a/backend/plugin/advisor/tidb/test/naming_index_idx.yaml+++ b/backend/plugin/advisor/tidb/test/naming_index_idx.yaml@@ -8,7 +8,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE INDEX afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw ON tech_book(id, name)@@ -19,7 +19,7 @@title: naming.index.idxcontent: Index `afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw` in table `tech_book` mismatches the naming convention, its length should be within 64 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -27,7 +27,7 @@title: naming.index.idxcontent: Index in table `tech_book` mismatches the naming convention, expect "^$|^idx_tech_book_id_name$" but found `afvjwsgrbgqzjfrkmbcoxzstznuypasijbbcdykoboredqovetzfcmmqliaelyavw`startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book RENAME INDEX old_index TO idx_tech_book_id_name@@ -40,7 +40,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD INDEX idx_tech_book_id_name (id, name)@@ -53,7 +53,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE tech_book_copy(id INT PRIMARY KEY, name VARCHAR(20), INDEX idx_tech_book_copy_name (name))diff --git a/backend/plugin/advisor/tidb/test/naming_index_uk.yaml b/backend/plugin/advisor/tidb/test/naming_index_uk.yamlindex 9f14e8c53b..c772848e57 100644--- a/backend/plugin/advisor/tidb/test/naming_index_uk.yaml+++ b/backend/plugin/advisor/tidb/test/naming_index_uk.yaml@@ -8,7 +8,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE UNIQUE INDEX qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy ON tech_book(id, name)@@ -19,7 +19,7 @@title: naming.index.ukcontent: Unique key `qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy` in table `tech_book` mismatches the naming convention, its length should be within 64 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -27,7 +27,7 @@title: naming.index.ukcontent: Unique key in table `tech_book` mismatches the naming convention, expect "^$|^uk_tech_book_id_name$" but found `qtzmquwvlnttctfluoouxelxeliltcfzzstrtyocogwwyiyrflmrkbhbfasynlacy`startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD UNIQUE uk_tech_book_id_name (id, name)@@ -40,7 +40,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book RENAME INDEX old_uk TO uk_tech_book_id_name@@ -53,7 +53,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`startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id INT PRIMARY KEY, name VARCHAR(20), UNIQUE INDEX uk_book_name (name))diff --git a/backend/plugin/advisor/tidb/test/naming_table.yaml b/backend/plugin/advisor/tidb/test/naming_table.yamlindex 461693e561..717bfa5ccd 100644--- a/backend/plugin/advisor/tidb/test/naming_table.yaml+++ b/backend/plugin/advisor/tidb/test/naming_table.yaml@@ -6,7 +6,7 @@title: naming.tablecontent: '`techBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE tech_book_copy(id int, name varchar(255))@@ -19,7 +19,7 @@title: naming.tablecontent: '`cjnubexocfhqoogdmihudyahmmghviqkzvpixnwvxtxumvuannpwdcbtsgwrvzpde` mismatches table naming convention, its length should be within 64 characters'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book RENAME TO TechBook@@ -30,7 +30,7 @@title: naming.tablecontent: '`TechBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book RENAME TO tech_book_copy@@ -43,7 +43,7 @@title: naming.tablecontent: '`LiteraryBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE literary_book(a int);RENAME TABLE tech_book TO TechBook, literary_book TO LiteraryBook@@ -54,7 +54,7 @@title: naming.tablecontent: '`LiteraryBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -62,7 +62,7 @@title: naming.tablecontent: '`TechBook` mismatches table naming convention, naming format should be "^[a-z]+(_[a-z]+)*$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE literary_book(a int);RENAME TABLE tech_book TO tech_book_copy, literary_book TO literary_book_copydiff --git a/backend/plugin/advisor/tidb/test/schema_backward_compatibility.yaml b/backend/plugin/advisor/tidb/test/schema_backward_compatibility.yamlindex eea8404c57..5db634edbd 100644--- a/backend/plugin/advisor/tidb/test/schema_backward_compatibility.yaml+++ b/backend/plugin/advisor/tidb/test/schema_backward_compatibility.yaml@@ -6,7 +6,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book CHANGE name f2 TEXT" may cause incompatibility with the existing data and code'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY name TEXT@@ -17,7 +17,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT" may cause incompatibility with the existing data and code'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY name TEXT NULL@@ -28,7 +28,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT NULL" may cause incompatibility with the existing data and code'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY name TEXT NOT NULL@@ -39,7 +39,7 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT NOT NULL" may cause incompatibility with the existing data and code'startposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book MODIFY name TEXT COMMENT 'bla'@@ -50,6 +50,6 @@title: schema.backward-compatibilitycontent: '"ALTER TABLE tech_book MODIFY name TEXT COMMENT ''bla''" may cause incompatibility with the existing data and code'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_disallow_commit.yaml b/backend/plugin/advisor/tidb/test/statement_disallow_commit.yamlindex 66ce58abf6..58b8b737c7 100644--- a/backend/plugin/advisor/tidb/test/statement_disallow_commit.yaml+++ b/backend/plugin/advisor/tidb/test/statement_disallow_commit.yaml@@ -9,7 +9,7 @@title: statement.disallow-commitcontent: 'Commit is not allowed, related statement: "COMMIT;"'startposition:- line: 2+ line: 3column: 0endposition: null- statement: |-@@ -27,7 +27,7 @@title: statement.disallow-commitcontent: 'Commit is not allowed, related statement: "COMMIT;"'startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -35,6 +35,6 @@title: statement.disallow-commitcontent: 'Commit is not allowed, related statement: "COMMIT;"'startposition:- line: 6+ line: 7column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_disallow_limit.yaml b/backend/plugin/advisor/tidb/test/statement_disallow_limit.yamlindex 066b9b5e1d..82afdd872e 100644--- a/backend/plugin/advisor/tidb/test/statement_disallow_limit.yaml+++ b/backend/plugin/advisor/tidb/test/statement_disallow_limit.yaml@@ -8,7 +8,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" usesstartposition:- line: 0+ line: 1column: 0endposition: null- statement: INSERT INTO tech_book SELECT * FROM tech_book UNION SELECT * FROM tech_book LIMIT 1@@ -19,7 +19,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" usesstartposition:- line: 0+ line: 1column: 0endposition: null- statement: UPDATE tech_book SET name = 'my name' LIMIT 10@@ -30,7 +30,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" usesstartposition:- line: 0+ line: 1column: 0endposition: null- statement: DELETE FROM tech_book LIMIT 10@@ -41,6 +41,6 @@title: statement.disallow-limitcontent: LIMIT clause is forbidden in INSERT, UPDATE and DELETE statement, but "DELETE FROM tech_book LIMIT 10" usesstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_disallow_mix_in_ddl.yaml b/backend/plugin/advisor/tidb/test/statement_disallow_mix_in_ddl.yamlindex 2455aa3b98..70e3e82b33 100644--- a/backend/plugin/advisor/tidb/test/statement_disallow_mix_in_ddl.yaml+++ b/backend/plugin/advisor/tidb/test/statement_disallow_mix_in_ddl.yaml@@ -6,7 +6,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDL, "DELETE FROM tech_book WHERE a > 1;" is not DDLstartposition:- line: 0+ line: 1column: 0endposition: null- statement: UPDATE tech_book SET id = 1;@@ -17,7 +17,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDL, "UPDATE tech_book SET id = 1;" is not DDLstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book ADD COLUMN author TEXT; UPDATE tech_book SET id = 1;DELETE FROM tech_book WHERE a > 1;@@ -28,7 +28,7 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDL, "DELETE FROM tech_book WHERE a > 1;" is not DDLstartposition:- line: 0+ line: 1column: 0endposition: null- status: 2@@ -36,6 +36,6 @@title: statement.disallow-mix-in-ddlcontent: Alter schema can only run DDL, "UPDATE tech_book SET id = 1;" is not DDLstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_disallow_mix_in_dml.yaml b/backend/plugin/advisor/tidb/test/statement_disallow_mix_in_dml.yamlindex 58503bd9b5..3c10935ca0 100644--- a/backend/plugin/advisor/tidb/test/statement_disallow_mix_in_dml.yaml+++ b/backend/plugin/advisor/tidb/test/statement_disallow_mix_in_dml.yaml@@ -10,6 +10,6 @@title: statement.disallow-mix-in-dmlcontent: Data change can only run DML, "ALTER TABLE tech_book ADD COLUMN author TEXT;" is not DMLstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_disallow_order_by.yaml b/backend/plugin/advisor/tidb/test/statement_disallow_order_by.yamlindex 4832282e40..d62071bce6 100644--- a/backend/plugin/advisor/tidb/test/statement_disallow_order_by.yaml+++ b/backend/plugin/advisor/tidb/test/statement_disallow_order_by.yaml@@ -8,7 +8,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" usesstartposition:- line: 0+ line: 1column: 0endposition: null- statement: DELETE FROM tech_book ORDER BY id@@ -19,6 +19,6 @@title: statement.disallow-order-bycontent: ORDER BY clause is forbidden in DELETE and UPDATE statements, but "DELETE FROM tech_book ORDER BY id" usesstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_insert_disallow_order_by_rand.yaml b/backend/plugin/advisor/tidb/test/statement_insert_disallow_order_by_rand.yamlindex 7a07c5a492..eff7751c40 100644--- a/backend/plugin/advisor/tidb/test/statement_insert_disallow_order_by_rand.yaml+++ b/backend/plugin/advisor/tidb/test/statement_insert_disallow_order_by_rand.yaml@@ -8,6 +8,6 @@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'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_insert_must_specify_column.yaml b/backend/plugin/advisor/tidb/test/statement_insert_must_specify_column.yamlindex 797bb0af01..b089a7fc59 100644--- a/backend/plugin/advisor/tidb/test/statement_insert_must_specify_column.yaml+++ b/backend/plugin/advisor/tidb/test/statement_insert_must_specify_column.yaml@@ -8,6 +8,6 @@title: statement.insert.must-specify-columncontent: The INSERT statement must specify columns but "INSERT INTO tech_book VALUES (1, '1')" does notstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_maximum_limit_value.yaml b/backend/plugin/advisor/tidb/test/statement_maximum_limit_value.yamlindex 7c53075e8d..3b0124f5ea 100644--- a/backend/plugin/advisor/tidb/test/statement_maximum_limit_value.yaml+++ b/backend/plugin/advisor/tidb/test/statement_maximum_limit_value.yaml@@ -7,6 +7,6 @@title: statement.maximum-limit-valuecontent: The limit value 1000000 exceeds the maximum allowed value 1000startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_merge_alter_table.yaml b/backend/plugin/advisor/tidb/test/statement_merge_alter_table.yamlindex f87fe66db0..f7cf6ff5dc 100644--- a/backend/plugin/advisor/tidb/test/statement_merge_alter_table.yaml+++ b/backend/plugin/advisor/tidb/test/statement_merge_alter_table.yaml@@ -10,7 +10,7 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -25,7 +25,7 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `t`startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -33,7 +33,7 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`startposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -48,7 +48,7 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `tech_book`startposition:- line: 2+ line: 3column: 0endposition: null- status: 2@@ -56,6 +56,6 @@title: statement.merge-alter-tablecontent: There are 2 statements to modify table `t`startposition:- line: 3+ line: 4column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_select_no_select_all.yaml b/backend/plugin/advisor/tidb/test/statement_select_no_select_all.yamlindex 6eb19e5dd7..1187116383 100644--- a/backend/plugin/advisor/tidb/test/statement_select_no_select_all.yaml+++ b/backend/plugin/advisor/tidb/test/statement_select_no_select_all.yaml@@ -6,7 +6,7 @@title: statement.select.no-select-allcontent: '"SELECT * FROM t" uses SELECT all'startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT a, b FROM t@@ -19,6 +19,6 @@title: statement.select.no-select-allcontent: '"SELECT a, b FROM (SELECT * from t1 JOIN t2) t" uses SELECT all'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_where_no_leading_wildcard_like.yaml b/backend/plugin/advisor/tidb/test/statement_where_no_leading_wildcard_like.yamlindex 6df20f31e3..1e2a33d904 100644--- a/backend/plugin/advisor/tidb/test/statement_where_no_leading_wildcard_like.yaml+++ b/backend/plugin/advisor/tidb/test/statement_where_no_leading_wildcard_like.yaml@@ -8,7 +8,7 @@title: statement.where.no-leading-wildcard-likecontent: '"SELECT * FROM t WHERE a LIKE ''%abc''" uses leading wildcard LIKE'startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * FROM t WHERE a LIKE 'abc' OR a LIKE '%abc'@@ -19,7 +19,7 @@title: statement.where.no-leading-wildcard-likecontent: '"SELECT * FROM t WHERE a LIKE ''abc'' OR a LIKE ''%abc''" uses leading wildcard LIKE'startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * FROM t WHERE a LIKE '%acc' OR a LIKE '%abc'@@ -30,7 +30,7 @@title: statement.where.no-leading-wildcard-likecontent: '"SELECT * FROM t WHERE a LIKE ''%acc'' OR a LIKE ''%abc''" uses leading wildcard LIKE'startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT * FROM (SELECT * FROM t WHERE a LIKE '%acc' OR a LIKE '%abc') t1@@ -41,6 +41,6 @@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'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/statement_where_require_select.yaml b/backend/plugin/advisor/tidb/test/statement_where_require_select.yamlindex 19f9b761e2..e1ca84cf66 100644--- a/backend/plugin/advisor/tidb/test/statement_where_require_select.yaml+++ b/backend/plugin/advisor/tidb/test/statement_where_require_select.yaml@@ -6,7 +6,7 @@title: statement.where.require.selectcontent: '"SELECT id FROM tech_book" requires WHERE clause'startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT id FROM tech_book WHERE id > 0@@ -19,7 +19,7 @@title: statement.where.require.selectcontent: '"SELECT id FROM tech_book WHERE id > (SELECT max(id) FROM tech_book)" requires WHERE clause'startposition:- line: 0+ line: 1column: 0endposition: null- statement: SELECT CURDATE()diff --git a/backend/plugin/advisor/tidb/test/statement_where_require_update_delete.yaml b/backend/plugin/advisor/tidb/test/statement_where_require_update_delete.yamlindex d3a912fc86..1758f8553d 100644--- a/backend/plugin/advisor/tidb/test/statement_where_require_update_delete.yaml+++ b/backend/plugin/advisor/tidb/test/statement_where_require_update_delete.yaml@@ -6,7 +6,7 @@title: statement.where.require.update-deletecontent: '"DELETE FROM tech_book" requires WHERE clause'startposition:- line: 0+ line: 1column: 0endposition: null- statement: UPDATE tech_book SET id = 1@@ -17,7 +17,7 @@title: statement.where.require.update-deletecontent: '"UPDATE tech_book SET id = 1" requires WHERE clause'startposition:- line: 0+ line: 1column: 0endposition: null- statement: DELETE FROM tech_book WHERE id > 0diff --git a/backend/plugin/advisor/tidb/test/system_charset_allowlist.yaml b/backend/plugin/advisor/tidb/test/system_charset_allowlist.yamlindex 8370aff7a7..2ec46d36a0 100644--- a/backend/plugin/advisor/tidb/test/system_charset_allowlist.yaml+++ b/backend/plugin/advisor/tidb/test/system_charset_allowlist.yaml@@ -10,7 +10,7 @@title: system.charset.allowlistcontent: '"CREATE TABLE t(a int) CHARSET ascii" used disabled charset ''ascii'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -23,7 +23,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t CHARSET ascii" used disabled charset ''ascii'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: ALTER DATABASE test CHARSET ascii@@ -34,7 +34,7 @@title: system.charset.allowlistcontent: '"ALTER DATABASE test CHARSET ascii" used disabled charset ''ascii'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(a varchar(255) CHARSET ascii)@@ -45,7 +45,7 @@title: system.charset.allowlistcontent: '"CREATE TABLE t(a varchar(255) CHARSET ascii)" used disabled charset ''ascii'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -58,7 +58,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t ADD COLUMN a varchar(255) CHARSET ascii" used disabled charset ''ascii'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -71,7 +71,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t MODIFY COLUMN a varchar(255) CHARSET ascii" used disabled charset ''ascii'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -84,7 +84,7 @@title: system.charset.allowlistcontent: '"ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARSET ascii" used disabled charset ''ascii'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: /* this is a comment */diff --git a/backend/plugin/advisor/tidb/test/system_collation_allowlist.yaml b/backend/plugin/advisor/tidb/test/system_collation_allowlist.yamlindex 60e0ab78cb..c8e616d396 100644--- a/backend/plugin/advisor/tidb/test/system_collation_allowlist.yaml+++ b/backend/plugin/advisor/tidb/test/system_collation_allowlist.yaml@@ -6,7 +6,7 @@title: system.collation.allowlistcontent: '"CREATE TABLE t(a int) COLLATE utf8mb4_polish_ci" used disabled collation ''utf8mb4_polish_ci'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(a varchar(255))@@ -19,7 +19,7 @@title: system.collation.allowlistcontent: '"CREATE TABLE t(a int) COLLATE latin1_bin" used disabled collation ''latin1_bin'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -32,7 +32,7 @@title: system.collation.allowlistcontent: '"ALTER TABLE t COLLATE latin1_bin" used disabled collation ''latin1_bin'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: ALTER DATABASE test COLLATE latin1_bin@@ -43,7 +43,7 @@title: system.collation.allowlistcontent: '"ALTER DATABASE test COLLATE latin1_bin" used disabled collation ''latin1_bin'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin)@@ -54,7 +54,7 @@title: system.collation.allowlistcontent: '"CREATE TABLE t(a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin)" used disabled collation ''latin1_bin'''startposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -67,7 +67,7 @@title: system.collation.allowlistcontent: '"ALTER TABLE t ADD COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin" used disabled collation ''latin1_bin'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -80,7 +80,7 @@title: system.collation.allowlistcontent: '"ALTER TABLE t MODIFY COLUMN a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin" used disabled collation ''latin1_bin'''startposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -93,6 +93,6 @@title: system.collation.allowlistcontent: '"ALTER TABLE t CHANGE COLUMN a a varchar(255) CHARACTER SET latin1 COLLATE latin1_bin" used disabled collation ''latin1_bin'''startposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/table_comment.yaml b/backend/plugin/advisor/tidb/test/table_comment.yamlindex 31edcd26ed..a6e1e52b3c 100644--- a/backend/plugin/advisor/tidb/test/table_comment.yaml+++ b/backend/plugin/advisor/tidb/test/table_comment.yaml@@ -6,7 +6,7 @@title: table.commentcontent: The length of table `t` comment should be within 10 charactersstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(a int)@@ -17,7 +17,7 @@title: table.commentcontent: Table `t` requires commentsstartposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE t(a int) COMMENT 'sdlfkjalkseblkjduafelbnlsdfkljayue'@@ -28,6 +28,6 @@title: table.commentcontent: The length of table `t` comment should be within 10 charactersstartposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/table_disallow_partition.yaml b/backend/plugin/advisor/tidb/test/table_disallow_partition.yamlindex c6cdfd0fcd..5900d6ea22 100644--- a/backend/plugin/advisor/tidb/test/table_disallow_partition.yaml+++ b/backend/plugin/advisor/tidb/test/table_disallow_partition.yaml@@ -16,7 +16,7 @@PARTITION p1 VALUES LESS THAN (11))" createsstartposition:- line: 3+ line: 4column: 0endposition: null- statement: |-@@ -35,6 +35,6 @@PARTITION p1 VALUES LESS THAN (11))" createsstartposition:- line: 3+ line: 4column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/table_drop_naming_convention.yaml b/backend/plugin/advisor/tidb/test/table_drop_naming_convention.yamlindex 0bc06a44c6..7dd7f76328 100644--- a/backend/plugin/advisor/tidb/test/table_drop_naming_convention.yaml+++ b/backend/plugin/advisor/tidb/test/table_drop_naming_convention.yaml@@ -8,7 +8,7 @@title: table.drop-naming-conventioncontent: '`foo` mismatches drop table naming convention, naming format should be "_delete$"'startposition:- line: 0+ line: 1column: 0endposition: null- statement: DROP TABLE IF EXISTS foo_delete, bar@@ -19,6 +19,6 @@title: table.drop-naming-conventioncontent: '`bar` mismatches drop table naming convention, naming format should be "_delete$"'startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/table_no_foreign_key.yaml b/backend/plugin/advisor/tidb/test/table_no_foreign_key.yamlindex f97e8cd823..d16843f5d6 100644--- a/backend/plugin/advisor/tidb/test/table_no_foreign_key.yaml+++ b/backend/plugin/advisor/tidb/test/table_no_foreign_key.yaml@@ -6,7 +6,7 @@title: table.no-foreign-keycontent: Foreign key is not allowed in the table `tech_book`startposition:- line: 0+ line: 1column: 0endposition: null- statement: CREATE TABLE book(id INT, author_id INT, FOREIGN KEY fk_book_author_id_author_id (author_id) REFERENCES author (id))@@ -17,6 +17,6 @@title: table.no-foreign-keycontent: Foreign key is not allowed in the table `book`startposition:- line: 0+ line: 1column: 0endposition: nulldiff --git a/backend/plugin/advisor/tidb/test/table_require_pk.yaml b/backend/plugin/advisor/tidb/test/table_require_pk.yamlindex 41fa74936e..b87ed3b7a1 100644--- a/backend/plugin/advisor/tidb/test/table_require_pk.yaml+++ b/backend/plugin/advisor/tidb/test/table_require_pk.yaml@@ -10,7 +10,7 @@title: table.require-pkcontent: Table `no_pk` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- status: 2@@ -18,7 +18,7 @@title: table.require-pkcontent: Table `no_pk_fork` requires PRIMARY KEYstartposition:- line: 3+ line: 4column: 0endposition: null- statement: CREATE TABLE t(id INT PRIMARY KEY)@@ -33,7 +33,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYstartposition:- line: 0+ line: 1column: 0endposition: null- statement: |-@@ -54,7 +54,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -67,7 +67,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- statement: |-@@ -100,7 +100,7 @@title: table.require-pkcontent: Table `t` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: null- statement: ALTER TABLE tech_book ADD COLUMN a int, DROP COLUMN id, DROP COLUMN name@@ -111,7 +111,7 @@title: table.require-pkcontent: Table `tech_book` requires PRIMARY KEYstartposition:- line: 0+ line: 1column: 0endposition: null- statement: ALTER TABLE tech_book DROP COLUMN name@@ -126,6 +126,6 @@title: table.require-pkcontent: Table `tech_book` requires PRIMARY KEYstartposition:- line: 1+ line: 2column: 0endposition: nulldiff --git a/backend/tests/test-data/sql_review_mysql.yaml b/backend/tests/test-data/sql_review_mysql.yamlindex af6da0ecd4..bae74cf846 100644--- a/backend/tests/test-data/sql_review_mysql.yaml+++ b/backend/tests/test-data/sql_review_mysql.yaml@@ -2,24 +2,22 @@result:- |-{- "status": "SUCCESS",- "title": "OK"+ "status": "SUCCESS",+ "title": "OK"}run: false- statement: CREATE TABLE user(id);result:- |-{- "status": "ERROR",- "title": "Syntax error",- "content": "Syntax error at line 1:21 \nrelated text: CREATE TABLE user(id)",- "code": 201,- "sqlReviewReport": {- "line": 1,- "column": 21,- "startPosition": {- "line": 1,- "column": 21+ "status": "ERROR",+ "title": "Syntax error",+ "content": "Syntax error at line 1:21 \nrelated text: CREATE TABLE user(id)",+ "code": 201,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1,+ "column": 21}}}@@ -28,252 +26,302 @@result:- |-{- "status": "ERROR",- "title": "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",- "code": 501,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "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",+ "code": 501,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "ERROR",- "title": "table.require-pk",- "content": "Table `userTable` requires PRIMARY KEY",- "code": 601,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "table.require-pk",+ "content": "Table `userTable` requires PRIMARY KEY",+ "code": 601,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "ERROR",- "title": "table.no-foreign-key",- "content": "Foreign key is not allowed in the table `userTable`",- "code": 602,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "table.no-foreign-key",+ "content": "Foreign key is not allowed in the table `userTable`",+ "code": 602,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "ERROR",- "title": "column.type-disallow-list",- "content": "Disallow column type JSON but column `userTable`.`json_content` is",- "code": 411,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "column.type-disallow-list",+ "content": "Disallow column type JSON but column `userTable`.`json_content` is",+ "code": 411,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "naming.table",- "content": "`userTable` mismatches table naming convention, naming format should be \"^[a-z]+(_[a-z]+)*$\"",- "code": 301,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "naming.table",+ "content": "`userTable` mismatches table naming convention, naming format should be \"^[a-z]+(_[a-z]+)*$\"",+ "code": 301,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "naming.column",- "content": "`userTable`.`roomId` mismatches column naming convention, naming format should be \"^[a-z]+(_[a-z]+)*$\"",- "code": 302,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "naming.column",+ "content": "`userTable`.`roomId` mismatches column naming convention, naming format should be \"^[a-z]+(_[a-z]+)*$\"",+ "code": 302,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "naming.index.idx",- "content": "Index in table `userTable` mismatches the naming convention, expect \"^$|^idx_userTable_name$\" but found `idx1`",- "code": 303,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "naming.index.idx",+ "content": "Index in table `userTable` mismatches the naming convention, expect \"^$|^idx_userTable_name$\" but found `idx1`",+ "code": 303,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "naming.index.uk",- "content": "Unique key in table `userTable` mismatches the naming convention, expect \"^$|^uk_userTable_id_name$\" but found `uk1`",- "code": 304,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "naming.index.uk",+ "content": "Unique key in table `userTable` mismatches the naming convention, expect \"^$|^uk_userTable_id_name$\" but found `uk1`",+ "code": 304,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "naming.index.fk",- "content": "Foreign key in table `userTable` mismatches the naming convention, expect \"^$|^fk_userTable_roomId_room_id$\" but found `fk1`",- "code": 305,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "naming.index.fk",+ "content": "Foreign key in table `userTable` mismatches the naming convention, expect \"^$|^fk_userTable_roomId_room_id$\" but found `fk1`",+ "code": 305,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "table.comment",- "content": "Table `userTable` requires comments",- "code": 1032,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "table.comment",+ "content": "Table `userTable` requires comments",+ "code": 1032,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.required",- "content": "Table `userTable` requires columns: created_ts, creator_id, updated_ts, updater_id",- "code": 401,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.required",+ "content": "Table `userTable` requires columns: created_ts, creator_id, updated_ts, updater_id",+ "code": 401,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.no-null",- "content": "`userTable`.`name` cannot have NULL value",- "code": 402,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.no-null",+ "content": "`userTable`.`name` cannot have NULL value",+ "code": 402,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.no-null",- "content": "`userTable`.`roomId` cannot have NULL value",- "code": 402,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.no-null",+ "content": "`userTable`.`roomId` cannot have NULL value",+ "code": 402,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.set-default-for-not-null",- "content": "Column `userTable`.`id` is NOT NULL but doesn't have DEFAULT",- "code": 404,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.set-default-for-not-null",+ "content": "Column `userTable`.`id` is NOT NULL but doesn't have DEFAULT",+ "code": 404,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.comment",- "content": "Column `userTable`.`id` requires comments",- "code": 1032,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.comment",+ "content": "Column `userTable`.`id` requires comments",+ "code": 1032,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.comment",- "content": "Column `userTable`.`name` requires comments",- "code": 1032,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.comment",+ "content": "Column `userTable`.`name` requires comments",+ "code": 1032,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.comment",- "content": "Column `userTable`.`roomId` requires comments",- "code": 1032,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.comment",+ "content": "Column `userTable`.`roomId` requires comments",+ "code": 1032,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "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",- "code": 414,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "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",+ "code": 414,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.current-time-count-limit",- "content": "Table `userTable` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.",- "code": 419,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.current-time-count-limit",+ "content": "Table `userTable` has 2 ON UPDATE CURRENT_TIMESTAMP() columns. The count greater than 1.",+ "code": 419,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.require-default",- "content": "Column `userTable`.`id` doesn't have DEFAULT.",- "code": 420,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.require-default",+ "content": "Column `userTable`.`id` doesn't have DEFAULT.",+ "code": 420,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.require-default",- "content": "Column `userTable`.`name` doesn't have DEFAULT.",- "code": 420,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.require-default",+ "content": "Column `userTable`.`name` doesn't have DEFAULT.",+ "code": 420,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.require-default",- "content": "Column `userTable`.`roomId` doesn't have DEFAULT.",- "code": 420,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.require-default",+ "content": "Column `userTable`.`roomId` doesn't have DEFAULT.",+ "code": 420,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "index.type-no-blob",- "content": "Columns in index must not be BLOB but `userTable`.`content` is blob",- "code": 804,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "index.type-no-blob",+ "content": "Columns in index must not be BLOB but `userTable`.`content` is blob",+ "code": 804,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "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'",- "code": 1001,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "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'",+ "code": 1001,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "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'",- "code": 1201,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "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'",+ "code": 1201,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -281,62 +329,74 @@result:- |-{- "status": "ERROR",- "title": "column.auto-increment-must-integer",- "content": "Auto-increment column `t_auto`.`auto_id` requires integer type",- "code": 410,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "column.auto-increment-must-integer",+ "content": "Auto-increment column `t_auto`.`auto_id` requires integer type",+ "code": 410,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "naming.column.auto-increment",- "content": "`t_auto`.`auto_id` mismatches auto_increment column naming convention, naming format should be \"^id$\"",- "code": 307,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "naming.column.auto-increment",+ "content": "`t_auto`.`auto_id` mismatches auto_increment column naming convention, naming format should be \"^id$\"",+ "code": 307,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.required",- "content": "Table `t_auto` requires columns: created_ts, creator_id, id, updated_ts, updater_id",- "code": 401,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.required",+ "content": "Table `t_auto` requires columns: created_ts, creator_id, id, updated_ts, updater_id",+ "code": 401,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.auto-increment-initial-value",- "content": "The initial auto-increment value in table `t_auto` is 2, which doesn't equal 20",- "code": 416,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.auto-increment-initial-value",+ "content": "The initial auto-increment value in table `t_auto` is 2, which doesn't equal 20",+ "code": 416,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.auto-increment-must-unsigned",- "content": "Auto-increment column `t_auto`.`auto_id` is not UNSIGNED type",- "code": 417,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.auto-increment-must-unsigned",+ "content": "Auto-increment column `t_auto`.`auto_id` is not UNSIGNED type",+ "code": 417,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "index.pk-type-limit",- "content": "Columns in primary key must be INT/BIGINT but `t_auto`.`auto_id` is varchar(20)",- "code": 803,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "index.pk-type-limit",+ "content": "Columns in primary key must be INT/BIGINT but `t_auto`.`auto_id` is varchar(20)",+ "code": 803,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -344,32 +404,38 @@result:- |-{- "status": "ERROR",- "title": "statement.where.require.update-delete",- "content": "\"DELETE FROM tech_book;\" requires WHERE clause",- "code": 202,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "statement.where.require.update-delete",+ "content": "\"DELETE FROM tech_book;\" requires WHERE clause",+ "code": 202,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "ERROR",- "title": "statement.dml-dry-run",- "content": "\"DELETE FROM tech_book\" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.tech_book' doesn't exist",- "code": 208,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "statement.dml-dry-run",+ "content": "\"DELETE FROM tech_book\" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.tech_book' doesn't exist",+ "code": 208,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "statement.affected-row-limit",- "content": "\"DELETE FROM tech_book;\" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.tech_book' doesn't exist",- "code": 209,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "statement.affected-row-limit",+ "content": "\"DELETE FROM tech_book;\" dry runs failed: Error 1146 (42S02): Table 'testsqlreview.tech_book' doesn't exist",+ "code": 209,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -377,32 +443,38 @@result:- |-{- "status": "ERROR",- "title": "statement.where.no-leading-wildcard-like",- "content": "\"DELETE FROM tech_book WHERE name like \"%abc\";\" uses leading wildcard LIKE",- "code": 204,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "statement.where.no-leading-wildcard-like",+ "content": "\"DELETE FROM tech_book WHERE name like \"%abc\";\" uses leading wildcard LIKE",+ "code": 204,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "ERROR",- "title": "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",- "code": 208,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "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",+ "code": 208,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "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",- "code": 209,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "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",+ "code": 209,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -410,52 +482,62 @@result:- |-{- "status": "ERROR",- "title": "statement.select.no-select-all",- "content": "\"INSERT INTO t_copy SELECT * FROM t;\" uses SELECT all",- "code": 203,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "statement.select.no-select-all",+ "content": "\"INSERT INTO t_copy SELECT * FROM t;\" uses SELECT all",+ "code": 203,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "ERROR",- "title": "statement.where.require.select",- "content": "\"INSERT INTO t_copy SELECT * FROM t;\" requires WHERE clause",- "code": 202,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "statement.where.require.select",+ "content": "\"INSERT INTO t_copy SELECT * FROM t;\" requires WHERE clause",+ "code": 202,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "ERROR",- "title": "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",- "code": 208,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "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",+ "code": 208,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "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",- "code": 1101,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "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",+ "code": 1101,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "statement.insert.must-specify-column",- "content": "The INSERT statement must specify columns but \"INSERT INTO t_copy SELECT * FROM t;\" does not",- "code": 1107,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "statement.insert.must-specify-column",+ "content": "The INSERT statement must specify columns but \"INSERT INTO t_copy SELECT * FROM t;\" does not",+ "code": 1107,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -463,22 +545,26 @@result:- |-{- "status": "ERROR",- "title": "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",- "code": 208,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "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",+ "code": 208,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "statement.insert.must-specify-column",- "content": "The INSERT statement must specify columns but \"INSERT INTO t VALUES (1, 1, now(), 1, now());\" does not",- "code": 1107,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "statement.insert.must-specify-column",+ "content": "The INSERT statement must specify columns but \"INSERT INTO t VALUES (1, 1, now(), 1, now());\" does not",+ "code": 1107,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -486,22 +572,26 @@result:- |-{- "status": "ERROR",- "title": "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",- "code": 208,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "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",+ "code": 208,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "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",- "code": 209,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "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",+ "code": 209,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -509,12 +599,14 @@result:- |-{- "status": "ERROR",- "title": "statement.disallow-commit",- "content": "Commit is not allowed, related statement: \"COMMIT;\"",- "code": 206,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "statement.disallow-commit",+ "content": "Commit is not allowed, related statement: \"COMMIT;\"",+ "code": 206,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -522,44 +614,46 @@result:- |-{- "status": "SUCCESS",- "title": "OK"+ "status": "SUCCESS",+ "title": "OK"}run: true- statement: INSERT INTO user(id, name) values (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')result:- |-{- "status": "SUCCESS",- "title": "OK"+ "status": "SUCCESS",+ "title": "OK"}run: true- statement: DELETE FROM user WHERE id < 10result:- |-{- "status": "SUCCESS",- "title": "OK"+ "status": "SUCCESS",+ "title": "OK"}run: false- statement: INSERT INTO user(id, name) values (6, 'f'), (7, 'g'), (8, 'h'), (9, 'i'), (10, 'j')result:- |-{- "status": "SUCCESS",- "title": "OK"+ "status": "SUCCESS",+ "title": "OK"}run: true- statement: DELETE FROM user WHERE id <= 10result:- |-{- "status": "WARNING",- "title": "statement.affected-row-limit",- "content": "\"DELETE FROM user WHERE id <= 10;\" affected 10 rows (estimated). The count exceeds 5.",- "code": 209,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "statement.affected-row-limit",+ "content": "\"DELETE FROM user WHERE id <= 10;\" affected 10 rows (estimated). The count exceeds 5.",+ "code": 209,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -577,12 +671,14 @@result:- |-{- "status": "WARNING",- "title": "statement.insert.row-limit",- "content": "\"INSERT INTO user(id, name) SELECT id, name FROM (SELECT 1 AS id, 'a' AS name WHERE 1=1 UNION ALL\n SELECT 2 AS id, 'b' AS name WHERE 1=1 UNION ALL\n SELECT 3 AS id, 'c' AS name WHERE 1=1 UNION ALL\n SELECT 4 AS id, 'd' AS name WHERE 1=1 UNION ALL\n SELECT 5 AS id, 'e' AS name WHERE 1=1 UNION ALL\n SELECT 6 AS id, 'f' AS name WHERE 1=1 UNION ALL\n SELECT 7 AS id, 'g' AS name WHERE 1=1 UNION ALL\n SELECT 8 AS id, 'h' AS name WHERE 1=1 UNION ALL\n SELECT 9 AS id, 'i' AS name WHERE 1=1 UNION ALL\n SELECT 10 AS id, 'j' AS name WHERE 1=1) value_table WHERE 1=1;\" inserts 10 rows. The count exceeds 5.",- "code": 1101,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "statement.insert.row-limit",+ "content": "\"INSERT INTO user(id, name) SELECT id, name FROM (SELECT 1 AS id, 'a' AS name WHERE 1=1 UNION ALL\n SELECT 2 AS id, 'b' AS name WHERE 1=1 UNION ALL\n SELECT 3 AS id, 'c' AS name WHERE 1=1 UNION ALL\n SELECT 4 AS id, 'd' AS name WHERE 1=1 UNION ALL\n SELECT 5 AS id, 'e' AS name WHERE 1=1 UNION ALL\n SELECT 6 AS id, 'f' AS name WHERE 1=1 UNION ALL\n SELECT 7 AS id, 'g' AS name WHERE 1=1 UNION ALL\n SELECT 8 AS id, 'h' AS name WHERE 1=1 UNION ALL\n SELECT 9 AS id, 'i' AS name WHERE 1=1 UNION ALL\n SELECT 10 AS id, 'j' AS name WHERE 1=1) value_table WHERE 1=1;\" inserts 10 rows. The count exceeds 5.",+ "code": 1101,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -590,12 +686,14 @@result:- |-{- "status": "WARNING",- "title": "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",- "code": 1103,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "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",+ "code": 1103,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -603,12 +701,14 @@result:- |-{- "status": "WARNING",- "title": "table.disallow-partition",- "content": "Table partition is forbidden, but \"ALTER TABLE user PARTITION BY HASH(id) PARTITIONS 8;\" creates",- "code": 608,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "table.disallow-partition",+ "content": "Table partition is forbidden, but \"ALTER TABLE user PARTITION BY HASH(id) PARTITIONS 8;\" creates",+ "code": 608,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -618,55 +718,62 @@result:- |-{- "status": "WARNING",- "title": "statement.merge-alter-table",- "content": "There are 2 statements to modify table `user`",- "code": 207,- "sqlReviewReport": {- "line": 1,- "startPosition": {- "line": 1+ "status": "WARNING",+ "title": "statement.merge-alter-table",+ "content": "There are 2 statements to modify table `user`",+ "code": 207,+ "sqlReviewReport": {+ "startPosition": {+ "line": 2}}}- |-{- "status": "WARNING",- "title": "column.disallow-change-type",- "content": "\"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '' COMMENT 'COMMENT' FIRST;\" changes column type",- "code": 403,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.disallow-change-type",+ "content": "\"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '' COMMENT 'COMMENT' FIRST;\" changes column type",+ "code": 403,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.disallow-change",- "content": "\"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '' COMMENT 'COMMENT' FIRST;\" contains CHANGE COLUMN statement",- "code": 406,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.disallow-change",+ "content": "\"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '' COMMENT 'COMMENT' FIRST;\" contains CHANGE COLUMN statement",+ "code": 406,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "column.disallow-changing-order",- "content": "\"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '' COMMENT 'COMMENT' FIRST;\" changes column order",- "code": 407,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "column.disallow-changing-order",+ "content": "\"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '' COMMENT 'COMMENT' FIRST;\" changes column order",+ "code": 407,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "schema.backward-compatibility",- "content": "\"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '' COMMENT 'COMMENT' FIRST;\" may cause incompatibility with the existing data and code",- "code": 111,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "schema.backward-compatibility",+ "content": "\"ALTER TABLE user CHANGE name name varchar(320) NOT NULL DEFAULT '' COMMENT 'COMMENT' FIRST;\" may cause incompatibility with the existing data and code",+ "code": 111,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: false@@ -674,22 +781,26 @@result:- |-{- "status": "ERROR",- "title": "table.drop-naming-convention",- "content": "`user` mismatches drop table naming convention, naming format should be \"_delete$\"",- "code": 603,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "table.drop-naming-convention",+ "content": "`user` mismatches drop table naming convention, naming format should be \"_delete$\"",+ "code": 603,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}- |-{- "status": "WARNING",- "title": "schema.backward-compatibility",- "content": "\"DROP TABLE user;\" may cause incompatibility with the existing data and code",- "code": 103,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "schema.backward-compatibility",+ "content": "\"DROP TABLE user;\" may cause incompatibility with the existing data and code",+ "code": 103,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1+ }}}run: falsediff --git a/backend/tests/test-data/sql_review_pg.yaml b/backend/tests/test-data/sql_review_pg.yamlindex 30e8af99f5..68dd3b563a 100644--- a/backend/tests/test-data/sql_review_pg.yaml+++ b/backend/tests/test-data/sql_review_pg.yaml@@ -14,22 +14,21 @@result:- |-{- "status": "SUCCESS",- "title": "OK"+ "status": "SUCCESS",+ "title": "OK"}run: false- statement: CREATE TABLE user(id);result:- |-{- "status": "ERROR",- "title": "Syntax error",- "content": "syntax error at or near \"user\"",- "code": 201,- "sqlReviewReport": {- "line": 1,- "startPosition": {- "line": 1+ "status": "ERROR",+ "title": "Syntax error",+ "content": "syntax error at or near \"user\"",+ "code": 201,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1}}}@@ -46,131 +45,121 @@result:- |-{- "status": "ERROR",- "title": "table.require-pk",- "content": "Table \"public\".\"userTable\" requires PRIMARY KEY, related statement: \"CREATE TABLE \\\"userTable\\\"(\\n id INT,\\n name VARCHAR(255),\\n \\\"roomId\\\" INT,\\n CONSTRAINT uk1 UNIQUE (id, name),\\n CONSTRAINT fk1 FOREIGN KEY (\\\"roomId\\\") REFERENCES room(id)\\n );\"",- "code": 601,- "sqlReviewReport": {- "line": 6,- "startPosition": {- "line": 6+ "status": "ERROR",+ "title": "table.require-pk",+ "content": "Table \"public\".\"userTable\" requires PRIMARY KEY, related statement: \"CREATE TABLE \\\"userTable\\\"(\\n id INT,\\n name VARCHAR(255),\\n \\\"roomId\\\" INT,\\n CONSTRAINT uk1 UNIQUE (id, name),\\n CONSTRAINT fk1 FOREIGN KEY (\\\"roomId\\\") REFERENCES room(id)\\n );\"",+ "code": 601,+ "sqlReviewReport": {+ "startPosition": {+ "line": 6}}}- |-{- "status": "ERROR",- "title": "table.no-foreign-key",- "content": "Foreign key is not allowed in the table \"public\".\"userTable\", related statement: \"CREATE TABLE \"userTable\"(\n id INT,\n name VARCHAR(255),\n \"roomId\" INT,\n CONSTRAINT uk1 UNIQUE (id, name),\n CONSTRAINT fk1 FOREIGN KEY (\"roomId\") REFERENCES room(id)\n );\"",- "code": 602,- "sqlReviewReport": {- "line": 6,- "startPosition": {- "line": 6+ "status": "ERROR",+ "title": "table.no-foreign-key",+ "content": "Foreign key is not allowed in the table \"public\".\"userTable\", related statement: \"CREATE TABLE \"userTable\"(\n id INT,\n name VARCHAR(255),\n \"roomId\" INT,\n CONSTRAINT uk1 UNIQUE (id, name),\n CONSTRAINT fk1 FOREIGN KEY (\"roomId\") REFERENCES room(id)\n );\"",+ "code": 602,+ "sqlReviewReport": {+ "startPosition": {+ "line": 6}}}- |-{- "status": "WARNING",- "title": "naming.table",- "content": "\"userTable\" mismatches table naming convention, naming format should be \"^[a-z]+(_[a-z]+)*$\"",- "code": 301,- "sqlReviewReport": {- "line": 6,- "startPosition": {- "line": 6+ "status": "WARNING",+ "title": "naming.table",+ "content": "\"userTable\" mismatches table naming convention, naming format should be \"^[a-z]+(_[a-z]+)*$\"",+ "code": 301,+ "sqlReviewReport": {+ "startPosition": {+ "line": 6}}}- |-{- "status": "WARNING",- "title": "naming.column",- "content": "\"userTable\".\"roomId\" mismatches column naming convention, naming format should be \"^[a-z]+(_[a-z]+)*$\"",- "code": 302,- "sqlReviewReport": {- "line": 3,- "startPosition": {- "line": 3+ "status": "WARNING",+ "title": "naming.column",+ "content": "\"userTable\".\"roomId\" mismatches column naming convention, naming format should be \"^[a-z]+(_[a-z]+)*$\"",+ "code": 302,+ "sqlReviewReport": {+ "startPosition": {+ "line": 3}}}- |-{- "status": "WARNING",- "title": "naming.index.uk",- "content": "Unique key in table \"userTable\" mismatches the naming convention, expect \"^$|^uk_userTable_id_name$\" but found \"uk1\"",- "code": 304,- "sqlReviewReport": {- "line": 4,- "startPosition": {- "line": 4+ "status": "WARNING",+ "title": "naming.index.uk",+ "content": "Unique key in table \"userTable\" mismatches the naming convention, expect \"^$|^uk_userTable_id_name$\" but found \"uk1\"",+ "code": 304,+ "sqlReviewReport": {+ "startPosition": {+ "line": 4}}}- |-{- "status": "WARNING",- "title": "naming.index.fk",- "content": "Foreign key in table \"userTable\" mismatches the naming convention, expect \"^$|^fk_userTable_roomId_room_id$\" but found \"fk1\"",- "code": 305,- "sqlReviewReport": {- "line": 5,- "startPosition": {- "line": 5+ "status": "WARNING",+ "title": "naming.index.fk",+ "content": "Foreign key in table \"userTable\" mismatches the naming convention, expect \"^$|^fk_userTable_roomId_room_id$\" but found \"fk1\"",+ "code": 305,+ "sqlReviewReport": {+ "startPosition": {+ "line": 5}}}- |-{- "status": "WARNING",- "title": "column.required",- "content": "Table \"userTable\" requires columns: created_ts, creator_id, updated_ts, updater_id",- "code": 401,- "sqlReviewReport": {- "line": 6,- "startPosition": {- "line": 6+ "status": "WARNING",+ "title": "column.required",+ "content": "Table \"userTable\" requires columns: created_ts, creator_id, updated_ts, updater_id",+ "code": 401,+ "sqlReviewReport": {+ "startPosition": {+ "line": 6}}}- |-{- "status": "WARNING",- "title": "column.no-null",- "content": "Column \"id\" in \"public\".\"userTable\" cannot have NULL value",- "code": 402,- "sqlReviewReport": {- "line": 1,- "startPosition": {- "line": 1+ "status": "WARNING",+ "title": "column.no-null",+ "content": "Column \"id\" in \"public\".\"userTable\" cannot have NULL value",+ "code": 402,+ "sqlReviewReport": {+ "startPosition": {+ "line": 1}}}- |-{- "status": "WARNING",- "title": "column.no-null",- "content": "Column \"name\" in \"public\".\"userTable\" cannot have NULL value",- "code": 402,- "sqlReviewReport": {- "line": 2,- "startPosition": {- "line": 2+ "status": "WARNING",+ "title": "column.no-null",+ "content": "Column \"name\" in \"public\".\"userTable\" cannot have NULL value",+ "code": 402,+ "sqlReviewReport": {+ "startPosition": {+ "line": 2}}}- |-{- "status": "WARNING",- "title": "column.no-null",- "content": "Column \"roomId\" in \"public\".\"userTable\" cannot have NULL value",- "code": 402,- "sqlReviewReport": {- "line": 3,- "startPosition": {- "line": 3+ "status": "WARNING",+ "title": "column.no-null",+ "content": "Column \"roomId\" in \"public\".\"userTable\" cannot have NULL value",+ "code": 402,+ "sqlReviewReport": {+ "startPosition": {+ "line": 3}}}@@ -179,12 +168,12 @@result:- |-{- "status": "ERROR",- "title": "statement.where.require.update-delete",- "content": "\"DELETE FROM t\" requires WHERE clause",- "code": 202,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "statement.where.require.update-delete",+ "content": "\"DELETE FROM t\" requires WHERE clause",+ "code": 202,+ "sqlReviewReport": {+ "startPosition": {}}}run: false@@ -192,12 +181,12 @@result:- |-{- "status": "ERROR",- "title": "statement.where.no-leading-wildcard-like",- "content": "\"DELETE FROM t WHERE a like '%abc'\" uses leading wildcard LIKE",- "code": 204,- "sqlReviewReport": {- "startPosition": {}+ "status": "ERROR",+ "title": "statement.where.no-leading-wildcard-like",+ "content": "\"DELETE FROM t WHERE a like '%abc'\" uses leading wildcard LIKE",+ "code": 204,+ "sqlReviewReport": {+ "startPosition": {}}}run: false@@ -205,16 +194,16 @@result:- |-{- "status": "SUCCESS",- "title": "OK"+ "status": "SUCCESS",+ "title": "OK"}run: false- statement: INSERT INTO t VALUES (1), (2)result:- |-{- "status": "SUCCESS",- "title": "OK"+ "status": "SUCCESS",+ "title": "OK"}run: false- statement: |-@@ -230,20 +219,20 @@result:- |-{- "status": "SUCCESS",- "title": "OK"+ "status": "SUCCESS",+ "title": "OK"}run: true- statement: ALTER INDEX pk_tech_book_id RENAME TO pk1result:- |-{- "status": "WARNING",- "title": "naming.index.pk",- "content": "Primary key in table \"tech_book\" mismatches the naming convention, expect \"^$|^pk_tech_book_id$\" but found \"pk1\"",- "code": 306,- "sqlReviewReport": {- "startPosition": {}+ "status": "WARNING",+ "title": "naming.index.pk",+ "content": "Primary key in table \"tech_book\" mismatches the naming convention, expect \"^$|^pk_tech_book_id$\" but found \"pk1\"",+ "code": 306,+ "sqlReviewReport": {+ "startPosition": {}}}run: falsediff --git a/frontend/src/components/MonacoEditor/utils.ts b/frontend/src/components/MonacoEditor/utils.tsindex 18b9cad752..c886de1605 100644--- a/frontend/src/components/MonacoEditor/utils.ts+++ b/frontend/src/components/MonacoEditor/utils.ts@@ -152,6 +152,10 @@ export const positionWithOffset = (if (!selection || selection.isEmpty()) {return [line, column];}- const pos = selection.getStartPosition().delta(line - 1, column);- return [pos.lineNumber, pos.column - 1];+ // Convert 1-based relative position to absolute position.+ // Position proto uses 1-based line and column.+ // Monaco also uses 1-based line and column.+ // delta() takes 0-based offsets, so subtract 1 from both.+ const pos = selection.getStartPosition().delta(line - 1, column - 1);+ return [pos.lineNumber, pos.column];};diff --git a/frontend/src/types/proto-es/v1/common_pb.d.ts b/frontend/src/types/proto-es/v1/common_pb.d.tsindex 5e60c2329e..b30815d2d4 100644--- a/frontend/src/types/proto-es/v1/common_pb.d.ts+++ b/frontend/src/types/proto-es/v1/common_pb.d.ts@@ -11,13 +11,13 @@ import type { Message } from "@bufbuild/protobuf";export declare const file_v1_common: GenFile;/**- * Position in a text.- * Line is 0-based, Column is 1-based.- *- * Why this mixed numbering?- * - Line is 0-based to match LSP (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)- * and common programming practice (arrays/lists are 0-indexed)- * - Column is 1-based to match user expectations (text editors show "column 1" for the first character)+ * Position in a text expressed as one-based line and one-based column.+ * We use 1-based numbering to match the majority of industry standards:+ * - Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)+ * - GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)+ * - Most text editors display 1-based positions to users+ * Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),+ * but we follow the canonical user-facing standards.** Handling unknown positions:* - If the entire position is unknown, leave this field as nil/undefined@@ -25,14 +25,13 @@ export declare const file_v1_common: GenFile;* - If only column is known (rare), set column and leave line as 0* Frontends should check for nil/undefined/zero values and handle them appropriately.*- * When displaying to users, convert to 1-based: display "line X" as "line X+1".- ** @generated from message bytebase.v1.Position*/export declare type Position = Message<"bytebase.v1.Position"> & {/**- * Line position in a text (zero-based).- * First line of the text is line 0, second line is line 1, etc.+ * Line position in a text (one-based).+ * First line of the text is line 1.+ * A value of 0 indicates the line information is unknown.** @generated from field: int32 line = 1;*/diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex b1566df7e3..9e995fdd77 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -12428,29 +12428,28 @@ components:line:type: integerdescription: |-- Line position in a text (zero-based).- First line of the text is line 0, second line is line 1, etc.+ Line position in a text (one-based).+ First line of the text is line 1.+ A value of 0 indicates the line information is unknown.format: int32column:type: integerdescription: "Column position in a text (one-based).\n Column is measured in Unicode code points (characters/runes), not bytes or grapheme clusters.\n First character of the line is column 1.\n A value of 0 indicates the column information is unknown.\n\n Examples:\n - \"SELECT * FROM t\" - column 8 is '*'\n - \"SELECT 你好 FROM t\" - column 8 is '你' (even though it's at byte offset 7)\n - \"SELECT \U0001F600 FROM t\" - column 8 is '\U0001F600' (even though it's 4 bytes in UTF-8)"format: int32description: |-- Position in a text.- Line is 0-based, Column is 1-based.-- Why this mixed numbering?- - Line is 0-based to match LSP (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)- and common programming practice (arrays/lists are 0-indexed)- - Column is 1-based to match user expectations (text editors show "column 1" for the first character)+ Position in a text expressed as one-based line and one-based column.+ We use 1-based numbering to match the majority of industry standards:+ - Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)+ - GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)+ - Most text editors display 1-based positions to users+ Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),+ but we follow the canonical user-facing standards.Handling unknown positions:- If the entire position is unknown, leave this field as nil/undefined- If only line is known, set line and leave column as 0 (e.g., line=5, column=0)- If only column is known (rare), set column and leave line as 0Frontends should check for nil/undefined/zero values and handle them appropriately.-- When displaying to users, convert to 1-based: display "line X" as "line X+1".Postgres_Session:type: objectproperties:diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 0201a98e93..bf4569aa16 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -360,13 +360,13 @@ PageToken is used internally for obfuscating pagination tokens.<a name="bytebase-store-Position"></a>### Position-Position in a text.-Line is 0-based, Column is 1-based.--Why this mixed numbering?-- Line is 0-based to match LSP (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)- and common programming practice (arrays/lists are 0-indexed)-- Column is 1-based to match user expectations (text editors show "column 1" for the first character)+Position in a text expressed as one-based line and one-based column.+We use 1-based numbering to match the majority of industry standards:+- Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)+- GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)+- Most text editors display 1-based positions to users+Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),+but we follow the canonical user-facing standards.Handling unknown positions:- If the entire position is unknown, leave this field as nil/undefined@@ -374,12 +374,10 @@ Handling unknown positions:- If only column is known (rare), set column and leave line as 0Frontends should check for nil/undefined/zero values and handle them appropriately.-When displaying to users, convert to 1-based: display "line X" as "line X+1".-| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| line | [int32](#int32) | | Line position in a text (zero-based). First line of the text is line 0, second line is line 1, etc. |+| line | [int32](#int32) | | Line position in a text (one-based). First line of the text is line 1. A value of 0 indicates the line information is unknown. || column | [int32](#int32) | | Column position in a text (one-based). Column is measured in Unicode code points (characters/runes), not bytes or grapheme clusters. First character of the line is column 1. A value of 0 indicates the column information is unknown.Examples: - "SELECT * FROM t" - column 8 is '*' - "SELECT 你好 FROM t" - column 8 is '你' (even though it's at byte offset 7) - "SELECT 😀 FROM t" - column 8 is '😀' (even though it's 4 bytes in UTF-8) |diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex e5e90d7ad3..99dc521c27 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -1543,7 +1543,7 @@<h3 id="bytebase.store.Position">Position</h3>- <p>Position in a text.</p><p>Line is 0-based, Column is 1-based.</p><p>Why this mixed numbering?</p><p>- Line is 0-based to match LSP (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)</p><p>and common programming practice (arrays/lists are 0-indexed)</p><p>- Column is 1-based to match user expectations (text editors show "column 1" for the first character)</p><p>Handling unknown positions:</p><p>- If the entire position is unknown, leave this field as nil/undefined</p><p>- If only line is known, set line and leave column as 0 (e.g., line=5, column=0)</p><p>- If only column is known (rare), set column and leave line as 0</p><p>Frontends should check for nil/undefined/zero values and handle them appropriately.</p><p>When displaying to users, convert to 1-based: display "line X" as "line X+1".</p>+ <p>Position in a text expressed as one-based line and one-based column.</p><p>We use 1-based numbering to match the majority of industry standards:</p><p>- Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)</p><p>- GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)</p><p>- Most text editors display 1-based positions to users</p><p>Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),</p><p>but we follow the canonical user-facing standards.</p><p>Handling unknown positions:</p><p>- If the entire position is unknown, leave this field as nil/undefined</p><p>- If only line is known, set line and leave column as 0 (e.g., line=5, column=0)</p><p>- If only column is known (rare), set column and leave line as 0</p><p>Frontends should check for nil/undefined/zero values and handle them appropriately.</p><table class="field-table">@@ -1556,8 +1556,9 @@<td>line</td><td><a href="#int32">int32</a></td><td></td>- <td><p>Line position in a text (zero-based).-First line of the text is line 0, second line is line 1, etc. </p></td>+ <td><p>Line position in a text (one-based).+First line of the text is line 1.+A value of 0 indicates the line information is unknown. </p></td></tr><tr>diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 946fc3c94d..01fb047c92 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -760,13 +760,13 @@ Authorization method for RPC calls.<a name="bytebase-v1-Position"></a>### Position-Position in a text.-Line is 0-based, Column is 1-based.--Why this mixed numbering?-- Line is 0-based to match LSP (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)- and common programming practice (arrays/lists are 0-indexed)-- Column is 1-based to match user expectations (text editors show "column 1" for the first character)+Position in a text expressed as one-based line and one-based column.+We use 1-based numbering to match the majority of industry standards:+- Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)+- GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)+- Most text editors display 1-based positions to users+Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),+but we follow the canonical user-facing standards.Handling unknown positions:- If the entire position is unknown, leave this field as nil/undefined@@ -774,12 +774,10 @@ Handling unknown positions:- If only column is known (rare), set column and leave line as 0Frontends should check for nil/undefined/zero values and handle them appropriately.-When displaying to users, convert to 1-based: display "line X" as "line X+1".-| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| line | [int32](#int32) | | Line position in a text (zero-based). First line of the text is line 0, second line is line 1, etc. |+| line | [int32](#int32) | | Line position in a text (one-based). First line of the text is line 1. A value of 0 indicates the line information is unknown. || column | [int32](#int32) | | Column position in a text (one-based). Column is measured in Unicode code points (characters/runes), not bytes or grapheme clusters. First character of the line is column 1. A value of 0 indicates the column information is unknown.Examples: - "SELECT * FROM t" - column 8 is '*' - "SELECT 你好 FROM t" - column 8 is '你' (even though it's at byte offset 7) - "SELECT 😀 FROM t" - column 8 is '😀' (even though it's 4 bytes in UTF-8) |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex c3e6deef8c..0582d6f424 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -2974,7 +2974,7 @@ Example: UpdateRole with allow_missing requires both bb.roles.update<h3 id="bytebase.v1.Position">Position</h3>- <p>Position in a text.</p><p>Line is 0-based, Column is 1-based.</p><p>Why this mixed numbering?</p><p>- Line is 0-based to match LSP (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)</p><p>and common programming practice (arrays/lists are 0-indexed)</p><p>- Column is 1-based to match user expectations (text editors show "column 1" for the first character)</p><p>Handling unknown positions:</p><p>- If the entire position is unknown, leave this field as nil/undefined</p><p>- If only line is known, set line and leave column as 0 (e.g., line=5, column=0)</p><p>- If only column is known (rare), set column and leave line as 0</p><p>Frontends should check for nil/undefined/zero values and handle them appropriately.</p><p>When displaying to users, convert to 1-based: display "line X" as "line X+1".</p>+ <p>Position in a text expressed as one-based line and one-based column.</p><p>We use 1-based numbering to match the majority of industry standards:</p><p>- Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)</p><p>- GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)</p><p>- Most text editors display 1-based positions to users</p><p>Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),</p><p>but we follow the canonical user-facing standards.</p><p>Handling unknown positions:</p><p>- If the entire position is unknown, leave this field as nil/undefined</p><p>- If only line is known, set line and leave column as 0 (e.g., line=5, column=0)</p><p>- If only column is known (rare), set column and leave line as 0</p><p>Frontends should check for nil/undefined/zero values and handle them appropriately.</p><table class="field-table">@@ -2987,8 +2987,9 @@ Example: UpdateRole with allow_missing requires both bb.roles.update<td>line</td><td><a href="#int32">int32</a></td><td></td>- <td><p>Line position in a text (zero-based).-First line of the text is line 0, second line is line 1, etc. </p></td>+ <td><p>Line position in a text (one-based).+First line of the text is line 1.+A value of 0 indicates the line information is unknown. </p></td></tr><tr>