Skip to content

Commit 00ca308

Browse files
committed
Add additional tests for table functions in subqueries
1 parent acf761a commit 00ca308

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

enginetest/queries/table_func_scripts.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ var TableFunctionScriptTests = []ScriptTest{
150150
Query: "select x from sequence_table('x', 5) where exists (select y from sequence_table('y', 3) where x = y)",
151151
Expected: []sql.Row{{0}, {1}, {2}},
152152
},
153+
{
154+
Query: "select * from sequence_table('x', 3) l join lateral (select * from sequence_table('y', l.x)) r",
155+
Expected: []sql.Row{{1, 0}, {2, 0}, {2, 1}},
156+
},
157+
{
158+
Query: "select * from sequence_table('x', 3) l where exists (select * from sequence_table('y', l.x))",
159+
Expected: []sql.Row{{1}, {2}},
160+
},
153161
{
154162
Query: "select not_seq.x from sequence_table('x', 5) as seq",
155163
ExpectedErr: sql.ErrTableNotFound,

0 commit comments

Comments
 (0)