MCPcopy
hub / github.com/pingcap/tidb / LoadOptRuleBlacklist

Function LoadOptRuleBlacklist

pkg/executor/opt_rule_blacklist.go:40–53  ·  view source on GitHub ↗

LoadOptRuleBlacklist loads the latest data from table mysql.opt_rule_blacklist.

(ctx context.Context, sctx sessionctx.Context)

Source from the content-addressed store, hash-verified

38
39// LoadOptRuleBlacklist loads the latest data from table mysql.opt_rule_blacklist.
40func 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}

Callers 2

bootstrapSessionImplFunction · 0.92
NextMethod · 0.85

Calls 6

InsertMethod · 0.95
NewStringSetFunction · 0.92
ExecRestrictedSQLMethod · 0.65
GetStringMethod · 0.65
StoreMethod · 0.65

Tested by

no test coverage detected