aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2018-07-05 17:42:37 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2018-07-05 17:42:37 -0400
commit05c7426bac43aa3f07c32f40c16a78712d1f0c87 (patch)
treec9c3102954104db31b28acf8e23f14d9cc0e6549 /src
parentd5176fa1e3c38ee651c9937b33e673db7cd4d9e8 (diff)
downloadpostgresql-05c7426bac43aa3f07c32f40c16a78712d1f0c87.tar.gz
postgresql-05c7426bac43aa3f07c32f40c16a78712d1f0c87.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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/replication/logical/reorderbuffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 5792cd14a09..d3ec1370510 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -1474,6 +1474,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;