Skip to content

Commit

Permalink
variable: add all text series types into tidb_analyze_skip_column_typ…
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored and terry1purcell committed May 17, 2024
1 parent 7c53058 commit 825d466
Show file tree
Hide file tree
Showing 3 changed files with 4 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"))
tk.MustQuery("select @@session.tidb_analyze_skip_column_types").Check(testkit.Rows("json,blob,mediumblob,longblob,text,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"))
tk.MustQuery("select @@global.tidb_analyze_skip_column_types").Check(testkit.Rows("json,blob,mediumblob,longblob,text,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", Type: TypeStr,
{Scope: ScopeGlobal | ScopeSession, Name: TiDBAnalyzeSkipColumnTypes, Value: "json,blob,mediumblob,longblob,text,mediumtext,longtext", Type: TypeStr,
Validation: func(vars *SessionVars, normalizedValue string, originalValue string, scope ScopeFlag) (string, error) {
return ValidAnalyzeSkipColumnTypes(normalizedValue)
},
Expand Down
1 change: 1 addition & 0 deletions tests/realtikvtest/addindextest3/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func TestDDLTestEstimateTableRowSize(t *testing.T) {
tk.MustExec(insertSQL)
}
tk.MustQuery("split table t between (0) and (1000000) regions 2;").Check(testkit.Rows("4 1"))
tk.MustExec("set global tidb_analyze_skip_column_types=`json,blob,mediumblob,longblob`")
tk.MustExec("analyze table t;")
tbl, err = dom.InfoSchema().TableByName(model.NewCIStr("test"), model.NewCIStr("t"))
require.NoError(t, err)
Expand Down

0 comments on commit 825d466

Please sign in to comment.