From 11f7b29054fd24c7e6dd1d2a8734cbebf3585b25 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 5 Nov 2000 00:15:54 +0000 Subject: 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. --- src/backend/executor/nodeLimit.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/backend/executor/nodeLimit.c') 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 { -- cgit v1.2.3