Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#50204
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
jackysp authored and ti-chi-bot committed Jan 12, 2024
1 parent 1b13108 commit 50effdb
Show file tree
Hide file tree
Showing 5 changed files with 2,863 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cmd/explaintest/r/explain_easy_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ id estRows task access object operator info
Point_Get 1.00 root table:index_prune, index:PRIMARY(a, b)
explain format = 'brief' select * from index_prune WHERE a = 1010010404050976781 AND b = 26467085526790 GROUP BY b ORDER BY a limit 1;
id estRows task access object operator info
Point_Get 1.00 root table:index_prune, index:PRIMARY(a, b)
TopN 1.00 root explain_easy_stats.index_prune.a, offset:0, count:1
└─StreamAgg 1.00 root group by:explain_easy_stats.index_prune.b, funcs:firstrow(explain_easy_stats.index_prune.a)->explain_easy_stats.index_prune.a, funcs:firstrow(explain_easy_stats.index_prune.b)->explain_easy_stats.index_prune.b, funcs:firstrow(explain_easy_stats.index_prune.c)->explain_easy_stats.index_prune.c
└─Point_Get 1.00 root table:index_prune, index:PRIMARY(a, b)
drop table if exists t1, t2, t3, index_prune;
set @@session.tidb_opt_insubq_to_join_and_agg=1;
drop table if exists tbl;
Expand Down
4 changes: 2 additions & 2 deletions executor/historical_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func TestRecordHistoryStatsMetaAfterAnalyze(t *testing.T) {
tk.MustExec("delete from test.t where test.t.a = 1")
err = h.DumpStatsDeltaToKV(handle.DumpAll)
require.NoError(t, err)
tk.MustQuery(fmt.Sprintf("select modify_count, count from mysql.stats_meta where table_id = '%d' order by create_time desc", tableInfo.Meta().ID)).Sort().Check(
tk.MustQuery(fmt.Sprintf("select modify_count, count from mysql.stats_meta where table_id = '%d'", tableInfo.Meta().ID)).Sort().Check(
testkit.Rows("40 20"))
tk.MustQuery(fmt.Sprintf("select modify_count, count from mysql.stats_meta_history where table_id = '%d' order by create_time desc limit 1", tableInfo.Meta().ID)).Sort().Check(
testkit.Rows("40 20"))
Expand All @@ -146,7 +146,7 @@ func TestRecordHistoryStatsMetaAfterAnalyze(t *testing.T) {
tk.MustExec("update test.t set test.t.b = 4 where test.t.a = 2")
err = h.DumpStatsDeltaToKV(handle.DumpAll)
require.NoError(t, err)
tk.MustQuery(fmt.Sprintf("select modify_count, count from mysql.stats_meta where table_id = '%d' order by create_time desc", tableInfo.Meta().ID)).Sort().Check(
tk.MustQuery(fmt.Sprintf("select modify_count, count from mysql.stats_meta where table_id = '%d'", tableInfo.Meta().ID)).Sort().Check(
testkit.Rows("50 20"))
tk.MustQuery(fmt.Sprintf("select modify_count, count from mysql.stats_meta_history where table_id = '%d' order by create_time desc limit 1", tableInfo.Meta().ID)).Sort().Check(
testkit.Rows("50 20"))
Expand Down
60 changes: 60 additions & 0 deletions pkg/executor/test/executor/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "executor_test",
timeout = "short",
srcs = [
"executor_test.go",
"main_test.go",
],
flaky = True,
shard_count = 50,
deps = [
"//pkg/config",
"//pkg/ddl",
"//pkg/domain",
"//pkg/domain/infosync",
"//pkg/executor",
"//pkg/executor/internal/exec",
"//pkg/expression",
"//pkg/infoschema",
"//pkg/kv",
"//pkg/meta",
"//pkg/meta/autoid",
"//pkg/parser",
"//pkg/parser/model",
"//pkg/parser/mysql",
"//pkg/parser/terror",
"//pkg/planner",
"//pkg/planner/core",
"//pkg/session",
"//pkg/sessionctx",
"//pkg/sessionctx/stmtctx",
"//pkg/sessionctx/variable",
"//pkg/sessiontxn",
"//pkg/store/mockstore",
"//pkg/table/tables",
"//pkg/tablecodec",
"//pkg/testkit",
"//pkg/testkit/testdata",
"//pkg/types",
"//pkg/util",
"//pkg/util/dbterror/exeerrors",
"//pkg/util/memory",
"//pkg/util/mock",
"//pkg/util/replayer",
"//pkg/util/rowcodec",
"//pkg/util/sqlexec",
"//pkg/util/timeutil",
"@com_github_golang_protobuf//proto",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_pingcap_tipb//go-tipb",
"@com_github_stretchr_testify//require",
"@com_github_tikv_client_go_v2//oracle",
"@com_github_tikv_client_go_v2//testutils",
"@com_github_tikv_client_go_v2//tikv",
"@io_opencensus_go//stats/view",
"@org_uber_go_goleak//:goleak",
],
)
Loading

0 comments on commit 50effdb

Please sign in to comment.