diff options
Diffstat (limited to 'src/test/regress/expected/rangefuncs.out')
-rw-r--r-- | src/test/regress/expected/rangefuncs.out | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/test/regress/expected/rangefuncs.out b/src/test/regress/expected/rangefuncs.out index 8c61c0c15e0..91acd52062d 100644 --- a/src/test/regress/expected/rangefuncs.out +++ b/src/test/regress/expected/rangefuncs.out @@ -944,3 +944,55 @@ FROM 3 | FROM 10000000876 | from 10000000876 (3 rows) +-- check whole-row-Var handling in nested lateral functions (bug #11703) +create function extractq2(t int8_tbl) returns int8 as $$ + select t.q2 +$$ language sql immutable; +explain (verbose, costs off) +select x from int8_tbl, extractq2(int8_tbl) f(x); + QUERY PLAN +------------------------------------------ + Nested Loop + Output: f.x + -> Seq Scan on public.int8_tbl + Output: int8_tbl.q1, int8_tbl.q2 + -> Function Scan on f + Output: f.x + Function Call: int8_tbl.q2 +(7 rows) + +select x from int8_tbl, extractq2(int8_tbl) f(x); + x +------------------- + 456 + 4567890123456789 + 123 + 4567890123456789 + -4567890123456789 +(5 rows) + +create function extractq2_2(t int8_tbl) returns table(ret1 int8) as $$ + select extractq2(t) +$$ language sql immutable; +explain (verbose, costs off) +select x from int8_tbl, extractq2_2(int8_tbl) f(x); + QUERY PLAN +----------------------------------- + Nested Loop + Output: ((int8_tbl.*).q2) + -> Seq Scan on public.int8_tbl + Output: int8_tbl.* + -> Result + Output: (int8_tbl.*).q2 +(6 rows) + +select x from int8_tbl, extractq2_2(int8_tbl) f(x); + x +------------------- + 456 + 4567890123456789 + 123 + 4567890123456789 + -4567890123456789 +(5 rows) + |