diff options
| author | Tom Lane | 2000-11-05 00:15:54 +0000 |
|---|---|---|
| committer | Tom Lane | 2000-11-05 00:15:54 +0000 |
| commit | 11f7b29054fd24c7e6dd1d2a8734cbebf3585b25 (patch) | |
| tree | 917e7ebbac724a341962e09cb9c775eaf2d1bab4 /src/backend/nodes | |
| parent | 66436e66e1bfffb6ba3f11114c5b825e56437e7d (diff) | |
Allow ORDER BY, LIMIT in sub-selects. Fix most (not all) cases where
the grammar did not allow redundant parentheses around sub-selects.
Distinguish LIMIT ALL from LIMIT 0; make the latter behave as one would
expect.
Diffstat (limited to 'src/backend/nodes')
| -rw-r--r-- | src/backend/nodes/copyfuncs.c | 8 | ||||
| -rw-r--r-- | src/backend/nodes/equalfuncs.c | 14 |
2 files changed, 17 insertions, 5 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 9435a396f07..406e85ce623 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.128 2000/10/31 10:22:10 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.129 2000/11/05 00:15:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1826,6 +1826,7 @@ _copySelectStmt(SelectStmt *from) Node_Copy(from, newnode, distinctClause); if (from->into) newnode->into = pstrdup(from->into); + newnode->istemp = from->istemp; Node_Copy(from, newnode, targetList); Node_Copy(from, newnode, fromClause); Node_Copy(from, newnode, whereClause); @@ -1835,10 +1836,13 @@ _copySelectStmt(SelectStmt *from) if (from->portalname) newnode->portalname = pstrdup(from->portalname); newnode->binary = from->binary; - newnode->istemp = from->istemp; Node_Copy(from, newnode, limitOffset); Node_Copy(from, newnode, limitCount); Node_Copy(from, newnode, forUpdate); + newnode->op = from->op; + newnode->all = from->all; + Node_Copy(from, newnode, larg); + Node_Copy(from, newnode, rarg); return newnode; } diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 8519fd6115e..08087136a10 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -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.78 2000/10/31 10:22:10 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.79 2000/11/05 00:15:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -686,6 +686,8 @@ _equalSelectStmt(SelectStmt *a, SelectStmt *b) return false; if (!equalstr(a->into, b->into)) return false; + if (a->istemp != b->istemp) + return false; if (!equal(a->targetList, b->targetList)) return false; if (!equal(a->fromClause, b->fromClause)) @@ -702,14 +704,20 @@ _equalSelectStmt(SelectStmt *a, SelectStmt *b) return false; if (a->binary != b->binary) return false; - if (a->istemp != b->istemp) - return false; if (!equal(a->limitOffset, b->limitOffset)) return false; if (!equal(a->limitCount, b->limitCount)) return false; if (!equal(a->forUpdate, b->forUpdate)) return false; + if (a->op != b->op) + return false; + if (a->all != b->all) + return false; + if (!equal(a->larg, b->larg)) + return false; + if (!equal(a->rarg, b->rarg)) + return false; return true; } |
