Skip to content

Commit

Permalink
test: port unit test from #55286 to master (#55293)
Browse files Browse the repository at this point in the history
close #55250
  • Loading branch information
lance6716 committed Aug 8, 2024
1 parent a9a5b97 commit 3357f26
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,14 +8,15 @@ go_test(
"main_test.go",
],
flaky = True,
shard_count = 11,
shard_count = 12,
deps = [
"//pkg/config",
"//pkg/ddl",
"//pkg/kv",
"//pkg/meta",
"//pkg/parser/model",
"//pkg/parser/terror",
"//pkg/planner/core",
"//pkg/server/handler",
"//pkg/session", #keep
"//pkg/session/types",
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 @@ -30,6 +30,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"
sessiontypes "github.com/pingcap/tidb/pkg/session/types"
Expand Down Expand Up @@ -852,3 +853,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 3357f26

Please sign in to comment.