diff --git a/pkg/executor/set_test.go b/pkg/executor/set_test.go index 425b76a862ae7..11380474ad02a 100644 --- a/pkg/executor/set_test.go +++ b/pkg/executor/set_test.go @@ -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 = ''") diff --git a/pkg/sessionctx/variable/sysvar.go b/pkg/sessionctx/variable/sysvar.go index 71b7ef4f21692..5b5cfb3df2821 100644 --- a/pkg/sessionctx/variable/sysvar.go +++ b/pkg/sessionctx/variable/sysvar.go @@ -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) }, diff --git a/tests/realtikvtest/addindextest3/functional_test.go b/tests/realtikvtest/addindextest3/functional_test.go index c2195d863c795..cd87920ab5e24 100644 --- a/tests/realtikvtest/addindextest3/functional_test.go +++ b/tests/realtikvtest/addindextest3/functional_test.go @@ -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)