mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-05 19:09:58 +08:00
Avoid integer overflow when LIMIT + OFFSET >= 2^63.
This fixes bug #6139 reported by Hitoshi Harada.
This commit is contained in:
parent
78e957dd46
commit
f00fbad6bd
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user