summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/btree/row_srch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/row_srch.c')
-rw-r--r--src/third_party/wiredtiger/src/btree/row_srch.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/third_party/wiredtiger/src/btree/row_srch.c b/src/third_party/wiredtiger/src/btree/row_srch.c
index 26328dee4d6..9b69c0aa9ed 100644
--- a/src/third_party/wiredtiger/src/btree/row_srch.c
+++ b/src/third_party/wiredtiger/src/btree/row_srch.c
@@ -206,8 +206,8 @@ __check_leaf_key_range(
* Search a row-store tree for a specific key.
*/
int
-__wt_row_search(WT_CURSOR_BTREE *cbt, WT_ITEM *srch_key, bool insert, WT_REF *leaf, bool leaf_safe,
- bool *leaf_foundp)
+__wt_row_search(WT_SESSION_IMPL *session, WT_ITEM *srch_key, WT_REF *leaf, WT_CURSOR_BTREE *cbt,
+ bool insert, bool restore)
{
WT_BTREE *btree;
WT_COLLATOR *collator;
@@ -218,13 +218,11 @@ __wt_row_search(WT_CURSOR_BTREE *cbt, WT_ITEM *srch_key, bool insert, WT_REF *le
WT_PAGE_INDEX *pindex, *parent_pindex;
WT_REF *current, *descent;
WT_ROW *rip;
- WT_SESSION_IMPL *session;
size_t match, skiphigh, skiplow;
uint32_t base, indx, limit, read_flags;
int cmp, depth;
bool append_check, descend_right, done;
- session = (WT_SESSION_IMPL *)cbt->iface.session;
btree = S2BT(session);
collator = btree->collator;
item = cbt->tmp;
@@ -253,16 +251,21 @@ __wt_row_search(WT_CURSOR_BTREE *cbt, WT_ITEM *srch_key, bool insert, WT_REF *le
/*
* We may be searching only a single leaf page, not the full tree. In the normal case where we
* are searching a tree, check the page's parent keys before doing the full search, it's faster
- * when the cursor is being re-positioned. Skip that check if we know the page is the right one
- * (for example, when re-instantiating a page in memory, in that case we know the target must be
- * on the current page).
+ * when the cursor is being re-positioned. Skip this if the page is being re-instantiated in
+ * memory.
*/
if (leaf != NULL) {
- if (!leaf_safe) {
+ if (!restore) {
WT_RET(__check_leaf_key_range(session, srch_key, leaf, cbt));
- *leaf_foundp = cbt->compare == 0;
- if (!*leaf_foundp)
+ if (cbt->compare != 0) {
+ /*
+ * !!!
+ * WT_CURSOR.search_near uses the slot value to
+ * decide if there was an on-page match.
+ */
+ cbt->slot = 0;
return (0);
+ }
}
current = leaf;