summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/index_bounds.cpp
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2013-10-05 13:04:39 -0400
committerHari Khalsa <hkhalsa@10gen.com>2013-10-07 15:07:16 -0400
commita5c4104bb28f2870602a8c7a5e4a4b506dbc99a1 (patch)
tree3617caf0663936d4b109f3ff6ba590f307078f41 /src/mongo/db/query/index_bounds.cpp
parentb7660950c4888052f2c68a02f6667c114a72dfbd (diff)
downloadmongo-a5c4104bb28f2870602a8c7a5e4a4b506dbc99a1.tar.gz
SERVER-10471 merge index bounds, enumerate based on indices, bug fixes
Diffstat (limited to 'src/mongo/db/query/index_bounds.cpp')
-rw-r--r--src/mongo/db/query/index_bounds.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/query/index_bounds.cpp b/src/mongo/db/query/index_bounds.cpp
index 6177e7d5b61..b1f1d8eb911 100644
--- a/src/mongo/db/query/index_bounds.cpp
+++ b/src/mongo/db/query/index_bounds.cpp
@@ -201,15 +201,20 @@ namespace mongo {
}
}
- void IndexBoundsChecker::getStartKey(vector<const BSONElement*>* valueOut,
- vector<bool>* inclusiveOut) {
+ bool IndexBoundsChecker::getStartKey(vector<const BSONElement*>* valueOut,
+ vector<bool>* inclusiveOut) {
verify(valueOut->size() == _bounds->fields.size());
verify(inclusiveOut->size() == _bounds->fields.size());
for (size_t i = 0; i < _bounds->fields.size(); ++i) {
+ if (0 == _bounds->fields[i].intervals.size()) {
+ return false;
+ }
(*valueOut)[i] = &_bounds->fields[i].intervals[0].start;
(*inclusiveOut)[i] = _bounds->fields[i].intervals[0].startInclusive;
}
+
+ return true;
}
bool IndexBoundsChecker::findLeftmostProblem(const vector<BSONElement>& keyValues,