@@ -29,7 +29,6 @@ import (
29
29
"github.com/pingcap/tidb/pkg/sessionctx/variable"
30
30
"github.com/pingcap/tidb/pkg/statistics"
31
31
"github.com/pingcap/tidb/pkg/statistics/handle/autoanalyze"
32
- "github.com/pingcap/tidb/pkg/statistics/handle/autoanalyze/exec"
33
32
statsutil "github.com/pingcap/tidb/pkg/statistics/handle/util"
34
33
"github.com/pingcap/tidb/pkg/statistics/handle/util/test"
35
34
"github.com/pingcap/tidb/pkg/testkit"
@@ -56,9 +55,9 @@ func TestEnableAutoAnalyzePriorityQueue(t *testing.T) {
56
55
require .NoError (t , h .DumpStatsDeltaToKV (true ))
57
56
is := dom .InfoSchema ()
58
57
require .NoError (t , h .Update (is ))
59
- exec .AutoAnalyzeMinCnt = 0
58
+ statistics .AutoAnalyzeMinCnt = 0
60
59
defer func () {
61
- exec .AutoAnalyzeMinCnt = 1000
60
+ statistics .AutoAnalyzeMinCnt = 1000
62
61
}()
63
62
require .True (t , dom .StatsHandle ().HandleAutoAnalyze ())
64
63
}
@@ -77,9 +76,9 @@ func TestAutoAnalyzeLockedTable(t *testing.T) {
77
76
tk .MustExec ("lock stats t" )
78
77
is := dom .InfoSchema ()
79
78
require .NoError (t , h .Update (is ))
80
- exec .AutoAnalyzeMinCnt = 0
79
+ statistics .AutoAnalyzeMinCnt = 0
81
80
defer func () {
82
- exec .AutoAnalyzeMinCnt = 1000
81
+ statistics .AutoAnalyzeMinCnt = 1000
83
82
}()
84
83
// Try to analyze the locked table, it should not analyze the table.
85
84
require .False (t , dom .StatsHandle ().HandleAutoAnalyze ())
@@ -104,9 +103,9 @@ func TestDisableAutoAnalyze(t *testing.T) {
104
103
require .NoError (t , h .Update (is ))
105
104
106
105
tk .MustExec ("set @@global.tidb_enable_auto_analyze = 0" )
107
- exec .AutoAnalyzeMinCnt = 0
106
+ statistics .AutoAnalyzeMinCnt = 0
108
107
defer func () {
109
- exec .AutoAnalyzeMinCnt = 1000
108
+ statistics .AutoAnalyzeMinCnt = 1000
110
109
}()
111
110
// Even auto analyze ratio is set to 0, we still need to analyze the unanalyzed tables.
112
111
require .True (t , dom .StatsHandle ().HandleAutoAnalyze ())
@@ -129,9 +128,9 @@ func TestAutoAnalyzeOnChangeAnalyzeVer(t *testing.T) {
129
128
tk .MustExec ("insert into t values(1)" )
130
129
tk .MustExec ("set @@global.tidb_analyze_version = 1" )
131
130
do := dom
132
- exec .AutoAnalyzeMinCnt = 0
131
+ statistics .AutoAnalyzeMinCnt = 0
133
132
defer func () {
134
- exec .AutoAnalyzeMinCnt = 1000
133
+ statistics .AutoAnalyzeMinCnt = 1000
135
134
}()
136
135
h := do .StatsHandle ()
137
136
err := h .HandleDDLEvent (<- h .DDLEventCh ())
@@ -309,10 +308,10 @@ func TestAutoAnalyzeSkipColumnTypes(t *testing.T) {
309
308
require .NoError (t , h .Update (dom .InfoSchema ()))
310
309
tk .MustExec ("set @@global.tidb_analyze_skip_column_types = 'json,blob,mediumblob,text,mediumtext'" )
311
310
312
- originalVal := exec .AutoAnalyzeMinCnt
313
- exec .AutoAnalyzeMinCnt = 0
311
+ originalVal := statistics .AutoAnalyzeMinCnt
312
+ statistics .AutoAnalyzeMinCnt = 0
314
313
defer func () {
315
- exec .AutoAnalyzeMinCnt = originalVal
314
+ statistics .AutoAnalyzeMinCnt = originalVal
316
315
}()
317
316
require .True (t , h .HandleAutoAnalyze ())
318
317
tk .MustQuery ("select job_info from mysql.analyze_jobs where job_info like '%auto analyze table%'" ).Check (testkit .Rows ("auto analyze table columns a, b, d with 256 buckets, 500 topn, 1 samplerate" ))
@@ -341,7 +340,7 @@ func TestAutoAnalyzeOnEmptyTable(t *testing.T) {
341
340
// to pass the stats.Pseudo check in autoAnalyzeTable
342
341
tk .MustExec ("analyze table t" )
343
342
// to pass the AutoAnalyzeMinCnt check in autoAnalyzeTable
344
- tk .MustExec ("insert into t values (1)" + strings .Repeat (", (1)" , int (exec .AutoAnalyzeMinCnt )))
343
+ tk .MustExec ("insert into t values (1)" + strings .Repeat (", (1)" , int (statistics .AutoAnalyzeMinCnt )))
345
344
require .NoError (t , dom .StatsHandle ().DumpStatsDeltaToKV (true ))
346
345
require .NoError (t , dom .StatsHandle ().Update (dom .InfoSchema ()))
347
346
@@ -376,7 +375,7 @@ func TestAutoAnalyzeOutOfSpecifiedTime(t *testing.T) {
376
375
// to pass the stats.Pseudo check in autoAnalyzeTable
377
376
tk .MustExec ("analyze table t" )
378
377
// to pass the AutoAnalyzeMinCnt check in autoAnalyzeTable
379
- tk .MustExec ("insert into t values (1)" + strings .Repeat (", (1)" , int (exec .AutoAnalyzeMinCnt )))
378
+ tk .MustExec ("insert into t values (1)" + strings .Repeat (", (1)" , int (statistics .AutoAnalyzeMinCnt )))
380
379
require .NoError (t , dom .StatsHandle ().DumpStatsDeltaToKV (true ))
381
380
require .NoError (t , dom .StatsHandle ().Update (dom .InfoSchema ()))
382
381
0 commit comments