LoadOptRuleBlacklist loads the latest data from table mysql.opt_rule_blacklist.
(ctx context.Context, sctx sessionctx.Context)
| 38 | |
| 39 | // LoadOptRuleBlacklist loads the latest data from table mysql.opt_rule_blacklist. |
| 40 | func LoadOptRuleBlacklist(ctx context.Context, sctx sessionctx.Context) (err error) { |
| 41 | exec := sctx.GetRestrictedSQLExecutor() |
| 42 | rows, _, err := exec.ExecRestrictedSQL(ctx, nil, "select HIGH_PRIORITY name from mysql.opt_rule_blacklist") |
| 43 | if err != nil { |
| 44 | return err |
| 45 | } |
| 46 | newDisabledLogicalRules := set.NewStringSet() |
| 47 | for _, row := range rows { |
| 48 | name := row.GetString(0) |
| 49 | newDisabledLogicalRules.Insert(name) |
| 50 | } |
| 51 | plannercore.DefaultDisabledLogicalRulesList.Store(newDisabledLogicalRules) |
| 52 | return nil |
| 53 | } |
no test coverage detected