Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser: support multi bracket for subquery #29656

Merged
merged 14 commits into from
Dec 2, 2021
Next Next commit
encounter s/r conflict
  • Loading branch information
sylzd committed Nov 10, 2021
commit 5826d0d176b9f27df80fe9609afcfade13191f3a
18 changes: 18 additions & 0 deletions executor/cte_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,21 @@ func TestCTEWithLimit(t *testing.T) {
rows = tk.MustQuery("with recursive cte1(c1) as (select c1 from t1 union all select c1 + 1 from cte1 limit 4 offset 4) select * from cte1;")
rows.Check(testkit.Rows("3", "4", "3", "4"))
}



// See https://github.com/pingcap/tidb/issues/29416
func TestIssue29416(t *testing.T) {
t.Parallel()
store, close := testkit.CreateMockStore(t)
defer close()

tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("drop table if exists t1")

tk.MustExec("create table t1 (a int not null, b char (10) not null);")
tk.MustExec("insert into t1 values (1, 'a')")
tk.MustQuery("((select * from t1)) union (select * from t1);")
tk.MustQuery("select * from (((select * from t1)) union (select * from t1) union (select * from t1)) a;")
}
Loading