summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/cursor/cur_join.c
diff options
context:
space:
mode:
authorChenhao Qu <chenhao.qu@mongodb.com>2020-07-13 05:03:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-13 05:17:46 +0000
commitc957403d177c8b83c3d3693b29d7af73f34ffdfc (patch)
treeff99382c8e535716e4f5f19332cc5f248a33a3bb /src/third_party/wiredtiger/src/cursor/cur_join.c
parent74ab0cdac56e1cc62fc96d3ca3be3ddfa54f2bcb (diff)
downloadmongo-c957403d177c8b83c3d3693b29d7af73f34ffdfc.tar.gz
Import wiredtiger: 4c6b28fb2bdd12681391b1e1eb11070d391aae57 from branch mongodb-4.6v4.34
ref: c97151853e..4c6b28fb2b for: 4.5.1 WT-6511 cursor join: explicitly advance the iterator when finished with a clause
Diffstat (limited to 'src/third_party/wiredtiger/src/cursor/cur_join.c')
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_join.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/src/cursor/cur_join.c b/src/third_party/wiredtiger/src/cursor/cur_join.c
index 06159cb54bd..53923282fc0 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_join.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_join.c
@@ -201,7 +201,8 @@ err:
/*
* __curjoin_iter_bump --
* Called to advance the iterator to the next endpoint, which may in turn advance to the next
- * entry.
+ * entry. We cannot skip a call to this at the end of an iteration because we'll need to advance
+ * the position to the end.
*/
static int
__curjoin_iter_bump(WT_CURSOR_JOIN_ITER *iter)
@@ -482,8 +483,14 @@ __curjoin_entry_in_range(
}
if (!passed) {
- if (iter != NULL && (iter->is_equal || F_ISSET(end, WT_CURJOIN_END_LT)))
+ if (iter != NULL && (iter->is_equal || F_ISSET(end, WT_CURJOIN_END_LT))) {
+ /*
+ * Even though this cursor is done, we still need to bump (advance it), to mark the
+ * iteration as complete.
+ */
+ WT_RET(__curjoin_iter_bump(iter));
return (WT_NOTFOUND);
+ }
if (!disjunction)
return (WT_NOTFOUND);
iter = NULL;