Skip to content

Commit

Permalink
test: test case for issue_169
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Mar 21, 2024
1 parent a162ef0 commit 24da39b
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions tests/slt/subquery.slt
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ select * from t1 where a <= (select 4) and a > (select 1)
----
1 3 4

# query III
# select * from t1 where a <= (select 4) and (-a + 1) < (select 1) - 1
# ----
# 1 3 4
query III
select * from t1 where a <= (select 4) and (-a + 1) < (select 1) - 1
----
1 3 4

statement ok
insert into t1 values (2, 3, 3), (3, 1, 4);
Expand Down Expand Up @@ -70,4 +70,29 @@ select * from t1 where a not in (select 1) and b = 3
2 3 3

statement ok
drop table t1;
drop table t1;

statement ok
create table t2(id int primary key, a int not null, b int not null);

# https://github.com/KipData/FnckSQL/issues/169
statement ok
create table t3(id int primary key, a int not null, c int not null);

statement ok
insert into t2 values (0, 1, 2), (3, 4, 5);

statement ok
insert into t3 values (0, 2, 2), (3, 8, 5);

query III
SELECT id, a, b FROM t2 WHERE a*2 in (SELECT a FROM t3 where a/2 in (select a from t2));
----
0 1 2
3 4 5

statement ok
drop table t2;

statement ok
drop table t3;

0 comments on commit 24da39b

Please sign in to comment.