diff --git a/sqle/driver/mysql/rule/rule_list.go b/sqle/driver/mysql/rule/rule_list.go index 1f5c216c3..265cf78da 100644 --- a/sqle/driver/mysql/rule/rule_list.go +++ b/sqle/driver/mysql/rule/rule_list.go @@ -1857,7 +1857,7 @@ var sourceRuleHandlers = []*SourceHandler{ Name: DMLCheckAffectedRows, Desc: plocale.DMLCheckAffectedRowsDesc, Annotation: plocale.DMLCheckAffectedRowsAnnotation, - Level: driverV2.RuleLevelError, + Level: driverV2.RuleLevelWarn, Category: plocale.RuleTypeDMLConvention, Params: []*SourceParam{ { @@ -2001,7 +2001,7 @@ var sourceRuleHandlers = []*SourceHandler{ Name: DMLCheckSelectRows, Desc: plocale.DMLCheckSelectRowsDesc, Annotation: plocale.DMLCheckSelectRowsAnnotation, - Level: driverV2.RuleLevelError, + Level: driverV2.RuleLevelWarn, Category: plocale.RuleTypeDMLConvention, Params: []*SourceParam{ { diff --git a/sqle/model/utils.go b/sqle/model/utils.go index cd7159fb8..babfd4561 100644 --- a/sqle/model/utils.go +++ b/sqle/model/utils.go @@ -13,7 +13,6 @@ import ( "text/template" "time" - mysqlRule "github.com/actiontech/sqle/sqle/driver/mysql/rule" driverV2 "github.com/actiontech/sqle/sqle/driver/v2" "github.com/actiontech/sqle/sqle/errors" "github.com/actiontech/sqle/sqle/log" @@ -442,9 +441,6 @@ func (s *Storage) CreateDefaultTemplateIfNotExist(projectId ProjectUID, rules ma if rule.Level != driverV2.RuleLevelError { continue } - if forbiddenRules[dbType+"_"+rule.Name] { - continue - } modelRule := GenerateRuleByDriverRule(rule, dbType) ruleList = append(ruleList, RuleTemplateRule{ RuleTemplateId: t.ID, @@ -462,27 +458,6 @@ func (s *Storage) CreateDefaultTemplateIfNotExist(projectId ProjectUID, rules ma return nil } -// 这里禁止了会向数据源下发SQL的规则,防止影响数据库性能 -var forbiddenRules = map[string]bool{ - "MySQL_" + mysqlRule.DMLCheckSelectRows: true, - "MySQL_" + mysqlRule.DMLCheckAffectedRows: true, - "MySQL_" + mysqlRule.ConfigOptimizeIndexEnabled: true, - "MySQL_" + mysqlRule.DDLCheckIndexOption: true, - "MySQL_" + mysqlRule.DDLCheckCompositeIndexDistinction: true, - "Oracle_Oracle_011": true, - "Oracle_Oracle_012": true, - "Oracle_Oracle_017": true, - "Oracle_Oracle_019": true, - "Oracle_Oracle_044": true, - "Oracle_Oracle_046": true, - "Oracle_Oracle_050": true, - "Oracle_Oracle_077": true, - "Oracle_Oracle_078": true, - "Oracle_Oracle_080": true, - "SQL Server_ddl_check_index_count": true, - "SQL Server_ddl_check_index_column_with_blob": true, -} - func (s *Storage) GetDefaultRuleTemplateName(dbType string) string { return fmt.Sprintf("default_%v", dbType) }