1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-21 15:54:08 +03:00

In rewriteheap.c (used by VACUUM FULL and CLUSTER), calculate the tuple

length stored in the line pointer the same way it's calculated in the normal
heap_insert() codepath. As noted by Jeff Davis, the length stored by
raw_heap_insert() included padding but the one stored by the normal codepath
did not. While the mismatch seems to be harmless, inconsistency isn't good,
and the normal codepath has received a lot more testing over the years.

Backpatch to 8.3 where the heap rewrite code was introduced.
This commit is contained in:
Heikki Linnakangas 2010-11-09 17:40:09 +02:00
parent 99a87edade
commit 6d2697ab1f

View File

@ -630,7 +630,7 @@ raw_heap_insert(RewriteState state, HeapTuple tup)
} }
/* And now we can insert the tuple into the page */ /* And now we can insert the tuple into the page */
newoff = PageAddItem(page, (Item) heaptup->t_data, len, newoff = PageAddItem(page, (Item) heaptup->t_data, heaptup->t_len,
InvalidOffsetNumber, false, true); InvalidOffsetNumber, false, true);
if (newoff == InvalidOffsetNumber) if (newoff == InvalidOffsetNumber)
elog(ERROR, "failed to add tuple"); elog(ERROR, "failed to add tuple");