example from Jim Dew. Add some simple regression tests, since this is
an area we seem to break regularly :-(
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.185 2005/11/22 18:17:10 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.186 2005/12/14 16:28:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
Assert(variable->varno != OUTER);
slot = econtext->ecxt_scantuple;
- tuple = slot->tts_tuple;
+ tuple = ExecFetchSlotTuple(slot);
tupleDesc = slot->tts_tupleDescriptor;
/*
mary | 8
(58 rows)
+--
+-- Test some cases involving whole-row Var referencing a subquery
+--
+select foo from (select 1) as foo;
+ foo
+-----
+ (1)
+(1 row)
+
+select foo from (select null) as foo;
+ foo
+-----
+ ()
+(1 row)
+
+select foo from (select 'xyzzy',1,null) as foo;
+ foo
+------------
+ (xyzzy,1,)
+(1 row)
+
--
SELECT p.name, p.age FROM person* p ORDER BY age using >, name;
+--
+-- Test some cases involving whole-row Var referencing a subquery
+--
+select foo from (select 1) as foo;
+select foo from (select null) as foo;
+select foo from (select 'xyzzy',1,null) as foo;