summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/rewriteheap.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-11-09 17:40:09 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-11-09 17:48:54 +0200
commit6d2697ab1fe066ebf634c6a998d2b03fff210249 (patch)
tree22b02cc5d399da97a02469a86c49e1b41ff754d3 /src/backend/access/heap/rewriteheap.c
parent99a87edadee6d1eb6f6b8e00aded239b7157720b (diff)
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.
Diffstat (limited to 'src/backend/access/heap/rewriteheap.c')
-rw-r--r--src/backend/access/heap/rewriteheap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 33cf6b54c7a..547137a7c5c 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -630,7 +630,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");