diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-07-05 17:42:37 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-07-05 17:42:37 -0400 |
commit | bba8c612117416907f332fce8b9e80b748e0b798 (patch) | |
tree | 0979a39b6b9c1a183802aac1d97fc722f8e72a04 | |
parent | 7acbb481c808effffae7033b5ea1069112d6545f (diff) | |
download | postgresql-bba8c612117416907f332fce8b9e80b748e0b798.tar.gz postgresql-bba8c612117416907f332fce8b9e80b748e0b798.zip |
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.
-rw-r--r-- | src/backend/replication/logical/reorderbuffer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index 8226a20ae08..69ae504d78c 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -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; |