-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- insert.slt - join_left_inner.slt - limit.slt - where.slt tips: fix `limit` operator
- Loading branch information
Showing
8 changed files
with
301 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
statement ok | ||
create table t(id int primary key, v1 int null, v2 int null, v3 int null) | ||
|
||
statement ok | ||
insert into t values (0,1,10,100) | ||
|
||
statement ok | ||
insert into t values (1,1,10,100), (2,2,20,200), (3,3,30,300), (4,4,40,400) | ||
|
||
statement ok | ||
insert into t(id, v1, v2, v3) values (5, 1,10,100) | ||
|
||
statement ok | ||
insert into t(id, v1, v2) values (6,1,10) | ||
|
||
statement ok | ||
insert into t(id, v2, v1) values (7,1,10) | ||
|
||
statement ok | ||
insert into t values (8,NULL,NULL,NULL) | ||
|
||
query III rowsort | ||
select * from t | ||
---- | ||
0 1 10 100 | ||
1 1 10 100 | ||
2 2 20 200 | ||
3 3 30 300 | ||
4 4 40 400 | ||
5 1 10 100 | ||
6 1 10 null | ||
7 10 1 null | ||
8 null null null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
statement ok | ||
create table x(id int primary key, a int, b int); | ||
|
||
statement ok | ||
create table y(id int primary key, c int, d int); | ||
|
||
statement ok | ||
insert into x values (0, 1, 2), (1, 1, 3); | ||
|
||
query IIII | ||
select a, b, c, d from x join y on a = c; | ||
---- | ||
|
||
statement ok | ||
insert into y values (0, 1, 5), (1, 1, 6), (2, 2, 7); | ||
|
||
query IIII | ||
select a, b, c, d from x join y on a = c; | ||
---- | ||
1 2 1 5 | ||
1 3 1 5 | ||
1 2 1 6 | ||
1 3 1 6 | ||
|
||
statement ok | ||
drop table x; | ||
|
||
statement ok | ||
drop table y; | ||
|
||
statement ok | ||
create table a(id int primary key, v1 int, v2 int); | ||
|
||
statement ok | ||
create table b(id int primary key, v3 int, v4 int); | ||
|
||
statement ok | ||
insert into a values (0, 1, 1), (1, 2, 2), (2, 3, 3); | ||
|
||
query IIII rowsort | ||
select v1, v2, v3, v4 from a left join b on v1 = v3; | ||
---- | ||
1 1 null null | ||
2 2 null null | ||
3 3 null null | ||
|
||
statement ok | ||
insert into b values (0, 1, 100), (1, 3, 300), (2, 4, 400); | ||
|
||
query IIII rowsort | ||
select v1, v2, v3, v4 from a left join b on v1 = v3; | ||
---- | ||
1 1 1 100 | ||
2 2 null null | ||
3 3 3 300 | ||
|
||
statement ok | ||
drop table a; | ||
|
||
statement ok | ||
drop table b; | ||
|
||
statement ok | ||
create table a(id int primary key, v1 int, v2 int); | ||
|
||
statement ok | ||
create table b(id int primary key, v3 int, v4 int, v5 int); | ||
|
||
statement ok | ||
insert into a values (0, 1, 1), (1, 2, 2), (2, 3, 3); | ||
|
||
statement ok | ||
insert into b values (0, 1, 1, 1), (1, 2, 2, 2), (2, 3, 3, 4), (3, 1, 1, 5); | ||
|
||
query IIIII | ||
select v1, v2, v3, v4, v5 from a join b on v1 = v3 and v2 = v4; | ||
---- | ||
1 1 1 1 1 | ||
2 2 2 2 2 | ||
3 3 3 3 4 | ||
1 1 1 1 5 | ||
|
||
query IIIII | ||
select v1, v2, v3, v4, v5 from a join b on v1 = v3 and v2 = v4 and v1 < v5; | ||
---- | ||
3 3 3 3 4 | ||
1 1 1 1 5 | ||
|
||
statement ok | ||
drop table a; | ||
|
||
statement ok | ||
drop table b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
statement ok | ||
create table t(id int primary key, v1 int not null, v2 int not null) | ||
|
||
statement ok | ||
insert into t values (0, 1, 1), (1, 4, 2), (2, 3, 3), (3, 10, 12), (4, 2, 5) | ||
|
||
query I | ||
select v1 from t limit 3 | ||
---- | ||
1 | ||
4 | ||
3 | ||
|
||
query I | ||
select v1 from t offset 2 | ||
---- | ||
3 | ||
10 | ||
2 | ||
|
||
query I | ||
select v1 from t limit 2 offset 2 | ||
---- | ||
3 | ||
10 | ||
|
||
query I | ||
select v1 from t limit 6 | ||
---- | ||
1 | ||
4 | ||
3 | ||
10 | ||
2 | ||
|
||
query I | ||
select v1 from t limit 0 | ||
---- | ||
|
||
query I | ||
select v1 from t offset 5 | ||
---- | ||
|
||
# test case for https://github.com/risinglightdb/risinglight/issues/264 | ||
statement ok | ||
insert into t values (5, 1, 1) | ||
|
||
query I | ||
select v1 from t limit 0 | ||
---- |
Oops, something went wrong.