projects
/
users
/
c2main
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6ff8f8
)
Avoid integer overflow when LIMIT + OFFSET >= 2^63.
author
Heikki Linnakangas
<
[email protected]
>
Tue, 2 Aug 2011 07:47:17 +0000
(10:47 +0300)
committer
Heikki Linnakangas
<
[email protected]
>
Tue, 2 Aug 2011 08:31:15 +0000
(11:31 +0300)
This fixes bug #6139 reported by Hitoshi Harada.
src/backend/executor/nodeLimit.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/executor/nodeLimit.c
b/src/backend/executor/nodeLimit.c
index 0626b8be3718864b2cf0216b68361a73d6e1fc85..d002848bd32783fb8591ad7ac4a1b576473ea9d5 100644
(file)
--- a/
src/backend/executor/nodeLimit.c
+++ b/
src/backend/executor/nodeLimit.c
@@
-125,7
+125,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;