summaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-07-26 19:31:51 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-07-26 19:31:51 +0000
commita998a692475845e10ba12a24c5af44b22737bd50 (patch)
treed82a26dd427190e1492a2fb21ccfe85e16c7da39 /src/backend/executor
parent5ffa0bb47a3ca975f257d665e38f2ba89625e112 (diff)
Code review for bigint-LIMIT patch. Fix missed planner dependency,
eliminate unnecessary code, force initdb because stored rules change (limit nodes are now supposed to be int8 not int4 expressions). Update comments and error messages, which still all said 'integer'.
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/nodeLimit.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/backend/executor/nodeLimit.c b/src/backend/executor/nodeLimit.c
index 99c474b1611..935b59a7223 100644
--- a/src/backend/executor/nodeLimit.c
+++ b/src/backend/executor/nodeLimit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeLimit.c,v 1.26 2006/07/26 00:34:48 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeLimit.c,v 1.27 2006/07/26 19:31:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -23,7 +23,6 @@
#include "executor/executor.h"
#include "executor/nodeLimit.h"
-#include "catalog/pg_type.h"
static void recompute_limits(LimitState *node);
@@ -227,24 +226,14 @@ recompute_limits(LimitState *node)
{
ExprContext *econtext = node->ps.ps_ExprContext;
bool isNull;
- Oid type;
-
+
if (node->limitOffset)
{
- type = ((Const *) node->limitOffset->expr)->consttype;
-
- if (type == INT8OID)
- node->offset =
+ node->offset =
DatumGetInt64(ExecEvalExprSwitchContext(node->limitOffset,
econtext,
&isNull,
NULL));
- else
- node->offset = DatumGetInt32(ExecEvalExprSwitchContext(node->limitOffset,
- econtext,
- &isNull,
- NULL));
-
/* Interpret NULL offset as no offset */
if (isNull)
node->offset = 0;
@@ -260,21 +249,11 @@ recompute_limits(LimitState *node)
if (node->limitCount)
{
node->noCount = false;
- type = ((Const *) node->limitCount->expr)->consttype;
-
- if (type == INT8OID)
- node->count =
+ node->count =
DatumGetInt64(ExecEvalExprSwitchContext(node->limitCount,
econtext,
&isNull,
NULL));
- else
- node->count = DatumGetInt32(ExecEvalExprSwitchContext(node->limitCount,
- econtext,
- &isNull,
- NULL));
-
-
/* Interpret NULL count as no count (LIMIT ALL) */
if (isNull)
node->noCount = true;