Skip to content

Commit 95b6a40

Browse files
committed
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.
1 parent 301b2a1 commit 95b6a40

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backend/replication/logical/reorderbuffer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,6 +1572,8 @@ ReorderBufferCommit(ReorderBuffer *rb, TransactionId xid,
15721572
* use as a normal record. It'll be cleaned up at the end
15731573
* of INSERT processing.
15741574
*/
1575+
if (specinsert == NULL)
1576+
elog(ERROR, "invalid ordering of speculative insertion changes");
15751577
Assert(specinsert->data.tp.oldtuple == NULL);
15761578
change = specinsert;
15771579
change->action = REORDER_BUFFER_CHANGE_INSERT;

0 commit comments

Comments
 (0)