Content-Length: 259293 | pFad | http://github.com/postgrespro/postgres/commit/6593c5b5dc39b179b1b7a3c947df2596af3e70c9

B4 Fix bug in freespace calculation in heap_multi_insert(). · postgrespro/postgres@6593c5b · GitHub
Skip to content

Commit 6593c5b

Browse files
committed
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.
1 parent 00b0c73 commit 6593c5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/heap/heapam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,7 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
21592159
{
21602160
HeapTuple heaptup = heaptuples[ndone + nthispage];
21612161

2162-
if (PageGetHeapFreeSpace(page) - saveFreeSpace < MAXALIGN(heaptup->t_len))
2162+
if (PageGetHeapFreeSpace(page) < MAXALIGN(heaptup->t_len) + saveFreeSpace)
21632163
break;
21642164

21652165
RelationPutHeapTuple(relation, buffer, heaptup);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/6593c5b5dc39b179b1b7a3c947df2596af3e70c9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy