postgres.git / summary / log / commit / refs
commit 39a67533975c8cbadf3d755216cea3ec2c3ce64c
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Tue Nov 09 15:40:09 2010 +0000
First released in: 9.1.0, 8.3.13, 8.4.6, 9.0.2
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.
src/backend/access/heap/rewriteheap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index e35fbeb9b1a..378b0ad6208 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -636,7 +636,7 @@ raw_heap_insert(RewriteState state, HeapTuple tup)
}
/* 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);
if (newoff == InvalidOffsetNumber)
elog(ERROR, "failed to add tuple");
[parent: e55e4c9ced48]