mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-05 19:09:58 +08:00
Fix bug in freespace calculation in heap_multi_insert().
If the amount of freespace on page was less than the amount reserved by fillfactor, the calculation would underflow. This fixes bug #6643 reported by Tomonari Katsumata.
This commit is contained in:
parent
00b0c73f1f
commit
6593c5b5dc
@ -2159,7 +2159,7 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
|
||||
{
|
||||
HeapTuple heaptup = heaptuples[ndone + nthispage];
|
||||
|
||||
if (PageGetHeapFreeSpace(page) - saveFreeSpace < MAXALIGN(heaptup->t_len))
|
||||
if (PageGetHeapFreeSpace(page) < MAXALIGN(heaptup->t_len) + saveFreeSpace)
|
||||
break;
|
||||
|
||||
RelationPutHeapTuple(relation, buffer, heaptup);
|
||||
|
Loading…
Reference in New Issue
Block a user