mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Fix off-by-one error in 2781b4bea7db357be59f9a5fd73ca1eb12ff5a79.
Spotted by Tom Lane.
This commit is contained in:
parent
3c2aa0c6f2
commit
85bb81de53
@ -4332,7 +4332,7 @@ AfterTriggerEnlargeQueryState(void)
|
||||
|
||||
if (afterTriggers.maxquerydepth == 0)
|
||||
{
|
||||
int new_alloc = Max(afterTriggers.query_depth, 8);
|
||||
int new_alloc = Max(afterTriggers.query_depth + 1, 8);
|
||||
|
||||
afterTriggers.query_stack = (AfterTriggerEventList *)
|
||||
MemoryContextAlloc(TopTransactionContext,
|
||||
@ -4346,7 +4346,8 @@ AfterTriggerEnlargeQueryState(void)
|
||||
{
|
||||
/* repalloc will keep the stack in the same context */
|
||||
int old_alloc = afterTriggers.maxquerydepth;
|
||||
int new_alloc = Max(afterTriggers.query_depth, old_alloc * 2);
|
||||
int new_alloc = Max(afterTriggers.query_depth + 1,
|
||||
old_alloc * 2);
|
||||
|
||||
afterTriggers.query_stack = (AfterTriggerEventList *)
|
||||
repalloc(afterTriggers.query_stack,
|
||||
|
Loading…
x
Reference in New Issue
Block a user