mirror of
https://github.com/postgres/postgres.git
synced 2026-04-11 20:16:33 -04:00
Avoid integer overflow when LIMIT + OFFSET >= 2^63.
This fixes bug #6139 reported by Hitoshi Harada.
This commit is contained in:
parent
c1b910ed18
commit
bc6616aaed
1 changed files with 1 additions and 1 deletions
|
|
@ -127,7 +127,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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue