Skip to content

Commit

Permalink
*: hide the config global-kill and session var `tidb_enable_index_m…
Browse files Browse the repository at this point in the history
…erge_join` (#23395) (#23407)
  • Loading branch information
ti-srebot authored Mar 18, 2021
1 parent c822691 commit bcf1e37
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ type Experimental struct {
// Whether enable creating expression index.
AllowsExpressionIndex bool `toml:"allow-expression-index" json:"allow-expression-index"`
// Whether enable global kill.
EnableGlobalKill bool `toml:"enable-global-kill" json:"enable-global-kill"`
EnableGlobalKill bool `toml:"enable-global-kill" json:"-"`
}

var defTiKVCfg = tikvcfg.DefaultConfig()
Expand Down
2 changes: 0 additions & 2 deletions config/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,6 @@ history-size = 24
[experimental]
# enable creating expression index.
allow-expression-index = false
# enable global kill.
enable-global-kill = false

# server level isolation read by engines and labels
[isolation-read]
Expand Down
11 changes: 11 additions & 0 deletions executor/show_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,17 @@ func (s *testSuite5) TestInvisibleCoprCacheConfig(c *C) {
c.Assert(strings.Contains(configValue, coprCacheVal), Equals, true)
}

func (s *testSuite5) TestInvisibleGlobalKillConfig(c *C) {
se1, err := session.CreateSession(s.store)
c.Assert(err, IsNil)
tk := testkit.NewTestKitWithSession(c, s.store, se1)
rows := tk.MustQuery("show variables like '%config%'").Rows()
c.Assert(len(rows), Equals, 1)
configValue := rows[0][1].(string)
globalKillVal := "global-kill"
c.Assert(strings.Contains(configValue, globalKillVal), Equals, false)
}

func (s *testSerialSuite1) TestShowCreateTableWithIntegerDisplayLengthWarnings(c *C) {
parsertypes.TiDBStrictIntegerDisplayWidth = true
defer func() {
Expand Down
1 change: 1 addition & 0 deletions sessionctx/variable/tidb_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ var FeatureSwitchVariables = []string{
TiDBAnalyzeVersion,
TiDBPartitionPruneMode,
TiDBIntPrimaryKeyDefaultAsClustered,
TiDBEnableIndexMergeJoin,
}

// FilterImplicitFeatureSwitch is used to filter result of show variables, these switches should be turn blind to users.
Expand Down

0 comments on commit bcf1e37

Please sign in to comment.