Skip to content

Commit

Permalink
variable: remove text as a default type in the tidb_analyze_skip_colu…
Browse files Browse the repository at this point in the history
…mn_types (pingcap#53438)

close pingcap#52636
  • Loading branch information
hawkingrei authored and RidRisR committed May 23, 2024
1 parent 1939616 commit ba14af3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/executor/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -870,14 +870,14 @@ func TestSetVar(t *testing.T) {
tk.MustExec("set @@session.tidb_cdc_write_source = 0")
require.Equal(t, uint64(0), tk.Session().GetSessionVars().CDCWriteSource)

tk.MustQuery("select @@session.tidb_analyze_skip_column_types").Check(testkit.Rows("json,blob,mediumblob,longblob,text,mediumtext,longtext"))
tk.MustQuery("select @@session.tidb_analyze_skip_column_types").Check(testkit.Rows("json,blob,mediumblob,longblob,mediumtext,longtext"))
tk.MustExec("set @@session.tidb_analyze_skip_column_types = 'json, text, blob'")
tk.MustQuery("select @@session.tidb_analyze_skip_column_types").Check(testkit.Rows("json,text,blob"))
tk.MustExec("set @@session.tidb_analyze_skip_column_types = ''")
tk.MustQuery("select @@session.tidb_analyze_skip_column_types").Check(testkit.Rows(""))
tk.MustGetErrMsg("set @@session.tidb_analyze_skip_column_types = 'int,json'", "[variable:1231]Variable 'tidb_analyze_skip_column_types' can't be set to the value of 'int,json'")

tk.MustQuery("select @@global.tidb_analyze_skip_column_types").Check(testkit.Rows("json,blob,mediumblob,longblob,text,mediumtext,longtext"))
tk.MustQuery("select @@global.tidb_analyze_skip_column_types").Check(testkit.Rows("json,blob,mediumblob,longblob,mediumtext,longtext"))
tk.MustExec("set @@global.tidb_analyze_skip_column_types = 'json, text, blob'")
tk.MustQuery("select @@global.tidb_analyze_skip_column_types").Check(testkit.Rows("json,text,blob"))
tk.MustExec("set @@global.tidb_analyze_skip_column_types = ''")
Expand Down
2 changes: 1 addition & 1 deletion pkg/sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -2842,7 +2842,7 @@ var defaultSysVars = []*SysVar{
s.OptimizerFixControl = newMap
return nil
}},
{Scope: ScopeGlobal | ScopeSession, Name: TiDBAnalyzeSkipColumnTypes, Value: "json,blob,mediumblob,longblob,text,mediumtext,longtext", Type: TypeStr,
{Scope: ScopeGlobal | ScopeSession, Name: TiDBAnalyzeSkipColumnTypes, Value: "json,blob,mediumblob,longblob,mediumtext,longtext", Type: TypeStr,
Validation: func(vars *SessionVars, normalizedValue string, originalValue string, scope ScopeFlag) (string, error) {
return ValidAnalyzeSkipColumnTypes(normalizedValue)
},
Expand Down

0 comments on commit ba14af3

Please sign in to comment.