8000 In rewriteheap.c (used by VACUUM FULL and CLUSTER), calculate the tuple · justtesting112233/postgres@7c0af83 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c0af83

Browse files
committed
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.
1 parent 658a630 commit 7c0af83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/heap/rewriteheap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ raw_heap_insert(RewriteState state, HeapTuple tup)
636636
}
637637

638638
/* And now we can insert the tuple into the page */
639-
newoff = PageAddItem(page, (Item) heaptup->t_data, len,
639+
newoff = PageAddItem(page, (Item) heaptup->t_data, heaptup->t_len,
640640
InvalidOffsetNumber, false, true);
641641
if (newoff == InvalidOffsetNumber)
642642
elog(ERROR, "failed to add tuple");

0 commit comments

Comments
 (0)
0