Skip to content

Commit

Permalink
logical decoding: beware of an unset specinsert change
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alvherre committed Jul 5, 2018
1 parent 7acbb48 commit bba8c61
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/backend/replication/logical/reorderbuffer.c
Expand Up @@ -1519,6 +1519,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;
Expand Down

0 comments on commit bba8c61

Please sign in to comment.