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:
76f7ad1
)
Avoid integer overflow when LIMIT + OFFSET >= 2^63.
REL8_3_STABLE
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:46 +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 1755268211e16a42774eb2242f835cd40ca69258..7e0b98211f4e8f18defb385cea574536396b2c1b 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;