projects
/
postgresql-pgindent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8daf82e
)
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:55 +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 7557e735b68119b53de4384046925b99600a6b11..2dd472f9bc25b03511912b12ad19f96237fc52e2 100644
(file)
--- 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;