diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2017-10-17 09:41:54 -0400 |
---|---|---|
committer | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2017-10-17 09:41:54 -0400 |
commit | ebd980fb0b0848092506106acbd77ca717795c3f (patch) | |
tree | 4d8661ab121e4895365e5a5a9352b99ac2ae8e3f /src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp | |
parent | d77201bbde61bf9e19eca81d73bbcb8bd85c757c (diff) | |
download | mongo-ebd980fb0b0848092506106acbd77ca717795c3f.tar.gz |
SERVER-31547: Check all WT error codes before reading cursors.
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp index fe6083c1ba3..3c06ffd1241 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp @@ -912,11 +912,16 @@ protected: void advanceWTCursor() { WT_CURSOR* c = _cursor->get(); int ret = WT_READ_CHECK(_forward ? c->next(c) : c->prev(c)); - if (ret == WT_NOTFOUND || hasWrongPrefix(c)) { + if (ret == WT_NOTFOUND) { _cursorAtEof = true; return; } invariantWTOK(ret); + if (hasWrongPrefix(c)) { + _cursorAtEof = true; + return; + } + _cursorAtEof = false; } |