From 48f2027e42e6b84ae9721adac166fc3b56a4e6d6 Mon Sep 17 00:00:00 2001 From: xuhuaiyu <391585975@qq.com> Date: Thu, 18 Mar 2021 15:25:57 +0800 Subject: [PATCH] *: hide the config and session var --- config/config.go | 2 +- config/config.toml.example | 2 -- executor/show_test.go | 11 +++++++++++ sessionctx/variable/tidb_vars.go | 1 + 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index 8e1a4fe1d4214..923a3cba0a7ec 100644 --- a/config/config.go +++ b/config/config.go @@ -534,7 +534,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() diff --git a/config/config.toml.example b/config/config.toml.example index 60e86c847f205..975c095b53671 100644 --- a/config/config.toml.example +++ b/config/config.toml.example @@ -468,8 +468,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] diff --git a/executor/show_test.go b/executor/show_test.go index 600c47c7c0586..ecc858cbaf2dd 100644 --- a/executor/show_test.go +++ b/executor/show_test.go @@ -1133,6 +1133,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() { diff --git a/sessionctx/variable/tidb_vars.go b/sessionctx/variable/tidb_vars.go index 8acc5841bd1a6..dcedbd56affc6 100644 --- a/sessionctx/variable/tidb_vars.go +++ b/sessionctx/variable/tidb_vars.go @@ -714,6 +714,7 @@ var FeatureSwitchVariables = []string{ TiDBPartitionPruneMode, TiDBIntPrimaryKeyDefaultAsClustered, TiDBEnableExtendedStats, + TiDBEnableIndexMergeJoin, } // FilterImplicitFeatureSwitch is used to filter result of show variables, these switches should be turn blind to users.