diff options
author | Judah Schvimer <judah@mongodb.com> | 2016-09-15 10:20:59 -0400 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2016-09-15 10:20:59 -0400 |
commit | 4dc41d135737dbda0a9ecc70af75687dd5df9099 (patch) | |
tree | 381dcdf024db4da65d20051a430a4f7515c122d6 /src/mongo/db/dbhelpers.cpp | |
parent | 97dd4a8eebfb2a2dc2e3a5e0907c8fc6e859c0ac (diff) | |
download | mongo-4dc41d135737dbda0a9ecc70af75687dd5df9099.tar.gz |
SERVER-26033 Allow simple range to exclude start key
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r-- | src/mongo/db/dbhelpers.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 53e73c11119..82fb612ddf8 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -295,7 +295,7 @@ BSONObj Helpers::inferKeyPattern(const BSONObj& o) { long long Helpers::removeRange(OperationContext* txn, const KeyRange& range, - bool maxInclusive, + BoundInclusion boundInclusion, const WriteConcernOptions& writeConcern, RemoveSaver* callback, bool fromMigrate, @@ -337,10 +337,12 @@ long long Helpers::removeRange(OperationContext* txn, // Extend bounds to match the index we found + invariant(IndexBounds::isStartIncludedInBound(boundInclusion)); // Extend min to get (min, MinKey, MinKey, ....) min = Helpers::toKeyFormat(indexKeyPattern.extendRangeBound(range.minKey, false)); // If upper bound is included, extend max to get (max, MaxKey, MaxKey, ...) // If not included, extend max to get (max, MinKey, MinKey, ....) + const bool maxInclusive = IndexBounds::isEndIncludedInBound(boundInclusion); max = Helpers::toKeyFormat(indexKeyPattern.extendRangeBound(range.maxKey, maxInclusive)); } @@ -369,7 +371,7 @@ long long Helpers::removeRange(OperationContext* txn, desc, min, max, - maxInclusive, + boundInclusion, PlanExecutor::YIELD_MANUAL, InternalPlanner::FORWARD, InternalPlanner::IXSCAN_FETCH)); |