summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-08-31 12:05:09 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-08-31 12:05:09 -0400
commit2a274a57c5e77a5da8353294c27d761467acf664 (patch)
tree875b94fa56697e8446017bbc4a77f069da08c279 /src
parent46331aa9234551b0084a00b11e35e9ce31263062 (diff)
downloadmongo-2a274a57c5e77a5da8353294c27d761467acf664.tar.gz
Fix WiredTiger Coverity #1320903: if all of the updates were aborted,
the primary loop exits with skipped not set and the maximum transaction left at its initial value of WT_TXN_NONE, so the test we have will be branch true and return -- however, it's a cheap test to be explicit.
Diffstat (limited to 'src')
-rw-r--r--src/reconcile/rec_write.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c
index 83233f93e2b..236368793b2 100644
--- a/src/reconcile/rec_write.c
+++ b/src/reconcile/rec_write.c
@@ -1078,6 +1078,16 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r,
}
/*
+ * If all of the updates were aborted, quit. This test is not strictly
+ * necessary because the above loop exits with skipped not set and the
+ * maximum transaction left at its initial value of WT_TXN_NONE, so
+ * the test below will be branch true and return, but it's cheap and a
+ * little more explicit, and makes Coverity happy.
+ */
+ if (max_txn == WT_TXN_NONE)
+ return (0);
+
+ /*
* Track the maximum transaction ID in the page. We store this in the
* tree at the end of reconciliation in the service of checkpoints, it
* is used to avoid discarding trees from memory when they have changes