1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-09 22:41:56 +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

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.121 2002/05/12 20:10:03 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.122 2002/05/12 23:43:02 tgl Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
@ -1083,9 +1083,13 @@ _readFunc(void)
token = pg_strtok(&length); /* now read it */
local_node->funcid = atooid(token);
token = pg_strtok(&length); /* get :functype */
token = pg_strtok(&length); /* get :funcresulttype */
token = pg_strtok(&length); /* now read it */
local_node->functype = atooid(token);
local_node->funcresulttype = atooid(token);
token = pg_strtok(&length); /* get :funcretset */
token = pg_strtok(&length); /* now read it */
local_node->funcretset = strtobool(token);
local_node->func_fcache = NULL;
@ -1119,6 +1123,10 @@ _readOper(void)
token = pg_strtok(&length); /* now read it */
local_node->opresulttype = atooid(token);
token = pg_strtok(&length); /* get :opretset */
token = pg_strtok(&length); /* now read it */
local_node->opretset = strtobool(token);
local_node->op_fcache = NULL;
return local_node;
@ -1991,26 +1999,6 @@ _readJoinInfo(void)
return local_node;
}
/* ----------------
* _readIter()
*
* ----------------
*/
static Iter *
_readIter(void)
{
Iter *local_node;
char *token;
int length;
local_node = makeNode(Iter);
token = pg_strtok(&length); /* eat :iterexpr */
local_node->iterexpr = nodeRead(true); /* now read it */
return local_node;
}
/* ----------------
* parsePlanString
@ -2124,8 +2112,6 @@ parsePlanString(void)
return_value = _readRestrictInfo();
else if (length == 8 && strncmp(token, "JOININFO", length) == 0)
return_value = _readJoinInfo();
else if (length == 4 && strncmp(token, "ITER", length) == 0)
return_value = _readIter();
else if (length == 5 && strncmp(token, "QUERY", length) == 0)
return_value = _readQuery();
else if (length == 6 && strncmp(token, "NOTIFY", length) == 0)