From bac62a06bbf8b19a891d7a25a78b572f007f75ec Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Mon, 8 Jul 2019 16:25:35 +0200 Subject: [PATCH] Fix assertion in decoding multi-insert The assertion in the code for logical decoding of a multi-insert didn't take multi-inserts into the catalog into consideration, but the actual decoding did. This assertion hasn't tripped since we don't logically decode catalog inserts and until now there are no multi inserts into the catalog. If that happens thoug, this assert will trip so better fix it now. --- src/backend/replication/logical/decode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/replication/logical/decode.c b/src/backend/replication/logical/decode.c index 151c3ef882..5468a6ecb8 100644 --- a/src/backend/replication/logical/decode.c +++ b/src/backend/replication/logical/decode.c @@ -974,7 +974,8 @@ DecodeMultiInsert(LogicalDecodingContext *ctx, XLogRecordBuffer *buf) ReorderBufferQueueChange(ctx->reorder, XLogRecGetXid(r), buf->origptr, change); } - Assert(data == tupledata + tuplelen); + Assert(xlrec->flags & XLH_INSERT_CONTAINS_NEW_TUPLE && + data == tupledata + tuplelen); } /* -- 2.14.1.145.gb3622a4ee