aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2016-03-06 16:27:20 -0800
committerAndres Freund <andres@anarazel.de>2016-03-06 16:27:20 -0800
commitfb3ea0465c1710c565e98d4b3e37aebb4e487eaf (patch)
tree304c8128eac06716da4d0a1d33115f7c0af2dd1c
parent3fa4715c506128405631e84bc91efb90e95b0ca7 (diff)
downloadpostgresql-fb3ea0465c1710c565e98d4b3e37aebb4e487eaf.tar.gz
postgresql-fb3ea0465c1710c565e98d4b3e37aebb4e487eaf.zip
Fix wrong allocation size in c8f621c43.
In c8f621c43 I forgot to account for MAXALIGN when allocating a new tuplebuf in ReorderBufferGetTupleBuf(). That happens to currently not cause active problems on a number of platforms because the affected pointer is already aligned, but others, like ppc and hppa, trigger this in the regression test, due to a debug memset clearing memory. Fix that. Backpatch: 9.4, like the previous commit.
-rw-r--r--src/backend/replication/logical/reorderbuffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index a1479fe949f..8eadb4bed18 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -481,7 +481,8 @@ ReorderBufferGetTupleBuf(ReorderBuffer *rb, Size tuple_len)
{
tuple = (ReorderBufferTupleBuf *)
MemoryContextAlloc(rb->context,
- sizeof(ReorderBufferTupleBuf) + alloc_len);
+ sizeof(ReorderBufferTupleBuf) +
+ MAXIMUM_ALIGNOF + alloc_len);
tuple->alloc_tuple_size = alloc_len;
tuple->tuple.t_data = ReorderBufferTupleBufData(tuple);
}