summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-03-31 07:42:01 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-03-31 07:42:01 -0400
commita5bb492b41e4121ff69776ba70072585aef405af (patch)
tree5e754cca9fab79b44f3bbabe89cbee1ef45edbe6
parentf2055cab87688cbb26da659c8038dbb4f032eb30 (diff)
downloadmongo-a5bb492b41e4121ff69776ba70072585aef405af.tar.gz
When looking for the next-larger item (__col_insert_search_gt), stay
at the same level if the checked record is equal to the searched for record (can't happen in the current use of this code, but it's the correct thing to do in a skiplist). When looking for the next-smaller item (__col_insert_search_lt), the search still has to be greater-than, reference #1835.
-rw-r--r--src/include/column.i8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/column.i b/src/include/column.i
index 62422d3ddde..fc1f372b2a9 100644
--- a/src/include/column.i
+++ b/src/include/column.i
@@ -30,7 +30,7 @@ __col_insert_search_gt(WT_INSERT_HEAD *inshead, uint64_t recno)
*/
ins = NULL;
for (i = WT_SKIP_MAXDEPTH - 1, insp = &inshead->head[i]; i >= 0;)
- if (*insp != NULL && recno > WT_INSERT_RECNO(*insp)) {
+ if (*insp != NULL && recno >= WT_INSERT_RECNO(*insp)) {
ins = *insp; /* GTE: keep going at this level */
insp = &(*insp)->next[i];
} else {
@@ -79,11 +79,11 @@ __col_insert_search_lt(WT_INSERT_HEAD *inshead, uint64_t recno)
* go as far as possible at each level before stepping down to the next.
*/
for (i = WT_SKIP_MAXDEPTH - 1, insp = &inshead->head[i]; i >= 0;)
- if (*insp != NULL && recno < WT_INSERT_RECNO(*insp)) {
- ins = *insp; /* LT: keep going at this level */
+ if (*insp != NULL && recno > WT_INSERT_RECNO(*insp)) {
+ ins = *insp; /* GT: keep going at this level */
insp = &(*insp)->next[i];
} else {
- --i; /* GTE: drop down a level */
+ --i; /* LTE: drop down a level */
--insp;
}