Skip to content

Commit

Permalink
test: port unit test from #55286 to master
Browse files Browse the repository at this point in the history
Signed-off-by: lance6716 <lance6716@gmail.com>
  • Loading branch information
lance6716 authored and ti-chi-bot committed Sep 24, 2024
1 parent 55eefb6 commit 3ea4f28
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/session/bootstraptest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ go_test(
"main_test.go",
],
flaky = True,
shard_count = 11,
shard_count = 12,
deps = [
"//pkg/config",
"//pkg/ddl",
Expand All @@ -17,6 +17,7 @@ go_test(
"//pkg/meta",
"//pkg/parser/model",
"//pkg/parser/terror",
"//pkg/planner/core",
"//pkg/server/handler",
"//pkg/session", #keep
"//pkg/sessionctx",
Expand Down
17 changes: 17 additions & 0 deletions pkg/session/bootstraptest/bootstrap_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/pingcap/tidb/pkg/meta"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/parser/terror"
plannercore "github.com/pingcap/tidb/pkg/planner/core"
"github.com/pingcap/tidb/pkg/server/handler"
"github.com/pingcap/tidb/pkg/session"
"github.com/pingcap/tidb/pkg/sessionctx"
Expand Down Expand Up @@ -848,3 +849,19 @@ func TestUpgradeWithPauseDDL(t *testing.T) {
" PARTITION `p3` VALUES LESS THAN (4096),\n" +
" PARTITION `p4` VALUES LESS THAN (7096))"))
}

func TestUpgradeWithCrossJoinDisabled(t *testing.T) {
session.SupportUpgradeHTTPOpVer--
ddl.SetWaitTimeWhenErrorOccurred(1 * time.Microsecond)
backup := plannercore.AllowCartesianProduct.Load()
t.Cleanup(func() {
plannercore.AllowCartesianProduct.Store(backup)
})
plannercore.AllowCartesianProduct.Store(false)

store, dom := session.CreateStoreAndBootstrap(t)
defer func() {
dom.Close()
require.NoError(t, store.Close())
}()
}

0 comments on commit 3ea4f28

Please sign in to comment.