Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix(test): stable order (#11112)
p0ny143a0f483941
diff --git a/backend/plugin/advisor/mysql/advisor_statement_disallow_mix_dml.go b/backend/plugin/advisor/mysql/advisor_statement_disallow_mix_dml.goindex a39330333b..eec36ed436 100644--- a/backend/plugin/advisor/mysql/advisor_statement_disallow_mix_dml.go+++ b/backend/plugin/advisor/mysql/advisor_statement_disallow_mix_dml.go@@ -50,8 +50,11 @@ func (*StatementDisallowMixDMLAdvisor) Check(ctx advisor.Context, _ string) ([]afor table, dmlCount := range checker.dmlStatementCount {if len(dmlCount) > 1 {content := "Found"- for t, count := range dmlCount {- content += fmt.Sprintf(" %d %s,", count, t)+ for _, t := range []string{"DELETE", "INSERT", "UPDATE"} {+ count, ok := dmlCount[t]+ if ok {+ content += fmt.Sprintf(" %d %s,", count, t)+ }}content = strings.TrimSuffix(content, ",")content += fmt.Sprintf(" on table `%s`.`%s`, disallow mixing different types of DML statements", table.database, table.table)diff --git a/backend/plugin/advisor/mysql/test/statement_disallow_mix_dml.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_mix_dml.yamlindex f94c27ba98..a082d839de 100644--- a/backend/plugin/advisor/mysql/test/statement_disallow_mix_dml.yaml+++ b/backend/plugin/advisor/mysql/test/statement_disallow_mix_dml.yaml@@ -21,7 +21,7 @@- status: WARNcode: 227title: statement.disallow-mix-dml- content: Found 1 UPDATE, 1 DELETE on table ``.`tech_book`, disallow mixing different types of DML statements+ content: Found 1 DELETE, 1 UPDATE on table ``.`tech_book`, disallow mixing different types of DML statementsline: 0column: 0details: ""