]> granicus.if.org Git - postgresql/blobdiff - src/test/regress/expected/subselect.out
Fix whole-row Var evaluation to cope with resjunk columns (again).
[postgresql] / src / test / regress / expected / subselect.out
index ad870f665fc1ec6a367bb7c32a037e2df986d450..30cff04cb707b7610c14819e4232819f724e2d16 100644 (file)
@@ -504,6 +504,31 @@ select (select (a.*)::text) from view_a a;
  (42)
 (1 row)
 
+--
+-- Check that whole-row Vars reading the result of a subselect don't include
+-- any junk columns therein
+--
+select q from (select max(f1) from int4_tbl group by f1 order by f1) q;
+       q       
+---------------
+ (-2147483647)
+ (-123456)
+ (0)
+ (123456)
+ (2147483647)
+(5 rows)
+
+with q as (select max(f1) from int4_tbl group by f1 order by f1)
+  select q from q;
+       q       
+---------------
+ (-2147483647)
+ (-123456)
+ (0)
+ (123456)
+ (2147483647)
+(5 rows)
+
 --
 -- Test case for sublinks pushed down into subselects via join alias expansion
 --