Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros committed Apr 16, 2024
1 parent 64bfea1 commit 221270a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion planner/core/issuetest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ go_test(
srcs = ["planner_issue_test.go"],
flaky = True,
race = "on",
shard_count = 9,
shard_count = 10,
deps = ["//testkit"],
)
14 changes: 14 additions & 0 deletions planner/core/issuetest/planner_issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,17 @@ func TestIssue48969(t *testing.T) {
tk.MustExec("update test2 set value=0 where test2.id in (select * from v1);")
tk.MustQuery("select * from test2").Check(testkit.Rows("1 0", "2 0", "3 0", "4 4", "5 5"))
}

func TestIssue51670(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("create table A(a int primary key, b int);")
tk.MustExec("create table B(b int primary key);")
tk.MustExec("create table C(c int primary key, b int);")
tk.MustExec("insert into A values (2, 1), (3, 2);")
tk.MustExec("insert into B values (1), (2);")
// The two should return the same result set.
tk.MustQuery("select b.b from A a left join (B b left join C c on b.b = c.b) on b.b = a.b where a.a in (2, 3);").Sort().Check(testkit.Rows("1", "2"))
tk.MustQuery("select b.b from A a left join (B b left join C c on b.b = c.b) on b.b = a.b where a.a in (2, 3, null);").Sort().Check(testkit.Rows("1", "2"))
}

0 comments on commit 221270a

Please sign in to comment.