-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Morgan Douglas <mdouglas47@bloomberg.net>
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This file implements tests for table-valued-functions implemented using | ||
# eponymous virtual tables. | ||
|
||
set testdir [file dirname $argv0] | ||
source $testdir/tester.tcl | ||
|
||
# Ticket 174827501 | ||
do_test tabfunc01-100 { | ||
db eval { | ||
select * | ||
from ( | ||
values | ||
(1, '{"x":1}'), | ||
(2, '{"x":1, "y": 2}') | ||
) | ||
left join json_each(column2, '$.y') y; | ||
} | ||
} {1 {{"x":1}} {} {} {} {} {} {} {} {} 2 {{"x":1, "y": 2}} {} 2 integer 2 4 {} {$.y} {$.y}} | ||
|
||
# Ticket 174827501 | ||
do_test tabfunc01-101 { | ||
db eval { | ||
select * from | ||
generate_series(1, 2) a | ||
left join generate_series(2, 3) b | ||
on a.value=b.value; | ||
} | ||
} {1 {} 2 2} | ||
|
||
# Ticket 174827501 | ||
do_test tabfunc01-102 { | ||
db eval { | ||
create table a(value int); | ||
insert into a(value) values(1), (2); | ||
select * from a | ||
left join generate_series(2, 3) b | ||
on a.value=b.value; | ||
} | ||
} {1 {} 2 2} | ||
|
||
# Ticket 174827501 | ||
do_test tabfunc01-103 { | ||
db eval { | ||
create table b(value int); | ||
insert into b(value) values(2), (3); | ||
select * from generate_series(1, 2) a | ||
left join b | ||
on a.value=b.value; | ||
} | ||
} {1 {} 2 2} | ||
|
||
finish_test |