aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1999-03-10 12:16:09 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1999-03-10 12:16:09 +0000
commit2a76aa23e08e1b3b44865ef30fd72c05ef155e11 (patch)
treed02d335eef10046e4cd957675f27d2400a5d3f66
parentf8f0efb43d764426265ed3bed6e3de792619ec2b (diff)
downloadpostgresql-2a76aa23e08e1b3b44865ef30fd72c05ef155e11.tar.gz
postgresql-2a76aa23e08e1b3b44865ef30fd72c05ef155e11.zip
We have to return dummy tuple for empty targetlist!
Try select t1.x from t1, t2 where t1.y = 1 and t2.y = 1 - t2 scan target list will be empty and so no one tuple will be returned...
-rw-r--r--src/backend/executor/execQual.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index b1d29f3d8e5..87eeb835686 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.46 1999/02/23 07:33:44 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.47 1999/03/10 12:16:09 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1474,10 +1474,15 @@ ExecTargetList(List *targetlist,
* is this a new phenomenon? it might cause bogus behavior
* if we try to free this tuple later!! I put a hook in
* ExecProject to watch out for this case -mer 24 Aug 1992
+ *
+ * We must return dummy tuple!!! Try
+ * select t1.x from t1, t2 where t1.y = 1 and t2.y = 1
+ * - t2 scan target list will be empty and so no one tuple
+ * will be returned! But Mer was right - dummy tuple
+ * must be palloced... - vadim 03/01/1999
*/
- CXT1_printf("ExecTargetList: context is %d\n", CurrentMemoryContext);
*isDone = true;
- return (HeapTuple) true;
+ return (HeapTuple) palloc(1);
}
/*
@@ -1640,12 +1645,6 @@ ExecProject(ProjectionInfo *projInfo, bool *isDone)
tupValue = projInfo->pi_tupValue;
econtext = projInfo->pi_exprContext;
- if (targetlist == NIL)
- {
- *isDone = true;
- return (TupleTableSlot *) NULL;
- }
-
/*
* form a new (result) tuple
*/