summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/executor/nodeLimit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/executor/nodeLimit.c b/src/backend/executor/nodeLimit.c
index 7557e735b6..2dd472f9bc 100644
--- a/src/backend/executor/nodeLimit.c
+++ b/src/backend/executor/nodeLimit.c
@@ -120,7 +120,7 @@ ExecLimit(LimitState *node)
* the state machine state to record having done so.
*/
if (!node->noCount &&
- node->position >= node->offset + node->count)
+ node->position - node->offset >= node->count)
{
node->lstate = LIMIT_WINDOWEND;
return NULL;