Skip to content

Commit bba8c61

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 7acbb48 commit bba8c61

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
@@ -1519,6 +1519,8 @@ ReorderBufferCommit(ReorderBuffer *rb, TransactionId xid,
15191519
* use as a normal record. It'll be cleaned up at the end
15201520
* of INSERT processing.
15211521
*/
1522+
if (specinsert == NULL)
1523+
elog(ERROR, "invalid ordering of speculative insertion changes");
15221524
Assert(specinsert->data.tp.oldtuple == NULL);
15231525
change = specinsert;
15241526
change->action = REORDER_BUFFER_CHANGE_INSERT;

0 commit comments

Comments
 (0)