postgres.git / summary / log / commit / refs
commit 95b6a40915cd03b9d1d09fc0bb4bcc374ee2165b
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Thu Jul 05 21:42:37 2018 +0000
logical decoding: beware of an unset specinsert change
Coverity complains that there is no protection in the code (at least in
non-assertion-enabled builds) against speculative insertion failing to
follow the expected protocol. Add an elog(ERROR) for the case.
src/backend/replication/logical/reorderbuffer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 478984376c2..47e669578f2 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -1572,6 +1572,8 @@ ReorderBufferCommit(ReorderBuffer *rb, TransactionId xid,
* use as a normal record. It'll be cleaned up at the end
* of INSERT processing.
*/
+ if (specinsert == NULL)
+ elog(ERROR, "invalid ordering of speculative insertion changes");
Assert(specinsert->data.tp.oldtuple == NULL);
change = specinsert;
change->action = REORDER_BUFFER_CHANGE_INSERT;
[parent: 301b2a1aad77]