1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Get rid of long-since-vestigial Iter node type, in favor of adding a

returns-set boolean field in Func and Oper nodes.  This allows cleaner,
more reliable tests for expressions returning sets in the planner and
parser.  For example, a WHERE clause returning a set is now detected
and complained of in the parser, not only at runtime.
This commit is contained in:
Tom Lane
2002-05-12 23:43:04 +00:00
parent f9e4f611a1
commit 3389a110d4
33 changed files with 297 additions and 676 deletions

View File

@@ -20,7 +20,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.131 2002/05/12 20:10:03 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.132 2002/05/12 23:43:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -130,6 +130,8 @@ _equalOper(Oper *a, Oper *b)
return false;
if (a->opresulttype != b->opresulttype)
return false;
if (a->opretset != b->opretset)
return false;
/*
* We do not examine opid or op_fcache, since these are logically
@@ -139,7 +141,8 @@ _equalOper(Oper *a, Oper *b)
* (Besides, op_fcache is executor state, which we don't check --- see
* notes at head of file.)
*
* It's probably not really necessary to check opresulttype either...
* It's probably not really necessary to check opresulttype or opretset,
* either...
*/
return true;
@@ -210,7 +213,9 @@ _equalFunc(Func *a, Func *b)
{
if (a->funcid != b->funcid)
return false;
if (a->functype != b->functype)
if (a->funcresulttype != b->funcresulttype)
return false;
if (a->funcretset != b->funcretset)
return false;
/* Note we do not look at func_fcache; see notes for _equalOper */
@@ -538,12 +543,6 @@ _equalJoinInfo(JoinInfo *a, JoinInfo *b)
return true;
}
static bool
_equalIter(Iter *a, Iter *b)
{
return equal(a->iterexpr, b->iterexpr);
}
static bool
_equalStream(Stream *a, Stream *b)
{
@@ -1884,9 +1883,6 @@ equal(void *a, void *b)
case T_ArrayRef:
retval = _equalArrayRef(a, b);
break;
case T_Iter:
retval = _equalIter(a, b);
break;
case T_RelabelType:
retval = _equalRelabelType(a, b);
break;