aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeLimit.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-11-05 00:15:54 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-11-05 00:15:54 +0000
commit11f7b29054fd24c7e6dd1d2a8734cbebf3585b25 (patch)
tree917e7ebbac724a341962e09cb9c775eaf2d1bab4 /src/backend/executor/nodeLimit.c
parent66436e66e1bfffb6ba3f11114c5b825e56437e7d (diff)
downloadpostgresql-11f7b29054fd24c7e6dd1d2a8734cbebf3585b25.tar.gz
postgresql-11f7b29054fd24c7e6dd1d2a8734cbebf3585b25.zip
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/executor/nodeLimit.c')
-rw-r--r--src/backend/executor/nodeLimit.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/backend/executor/nodeLimit.c b/src/backend/executor/nodeLimit.c
index c7bc666c2f9..9e0cef44ab1 100644
--- a/src/backend/executor/nodeLimit.c
+++ b/src/backend/executor/nodeLimit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeLimit.c,v 1.1 2000/10/26 21:35:15 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeLimit.c,v 1.2 2000/11/05 00:15:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -188,17 +188,11 @@ recompute_limits(Limit *node)
econtext,
&isNull,
NULL));
- /* Interpret NULL count as no count */
+ /* Interpret NULL count as no count (LIMIT ALL) */
if (isNull)
limitstate->noCount = true;
- else
- {
- /* Currently, LIMIT 0 is specified as meaning no limit.
- * I think this is pretty bogus, but ...
- */
- if (limitstate->count <= 0)
- limitstate->noCount = true;
- }
+ else if (limitstate->count < 0)
+ limitstate->count = 0;
}
else
{