summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/planner_analysis.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2016-08-26 16:23:22 -0400
committerDavid Storch <david.storch@10gen.com>2016-09-02 10:24:02 -0400
commit231de89b7c8e84b7b6cf638008b483ecab6ba1b6 (patch)
tree2b0143e02e4aa93ffee23c2a412264309f383d1e /src/mongo/db/query/planner_analysis.cpp
parent54488beeea99b3046931109c170d7e51cea0964d (diff)
downloadmongo-231de89b7c8e84b7b6cf638008b483ecab6ba1b6.tar.gz
SERVER-24508 BSONElement::ComparatorInterface
Diffstat (limited to 'src/mongo/db/query/planner_analysis.cpp')
-rw-r--r--src/mongo/db/query/planner_analysis.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/query/planner_analysis.cpp b/src/mongo/db/query/planner_analysis.cpp
index 7298959764f..47345801b95 100644
--- a/src/mongo/db/query/planner_analysis.cpp
+++ b/src/mongo/db/query/planner_analysis.cpp
@@ -33,6 +33,7 @@
#include <set>
#include <vector>
+#include "mongo/bson/simple_bsonelement_comparator.h"
#include "mongo/db/bson/dotted_path_support.h"
#include "mongo/db/index/expression_params.h"
#include "mongo/db/index/s2_common.h"
@@ -409,11 +410,12 @@ bool QueryPlannerAnalysis::explodeForSort(const CanonicalQuery& query,
// See if it's the order we're looking for.
BSONObj possibleSort = resultingSortBob.obj();
- if (!desiredSort.isPrefixOf(possibleSort)) {
+ if (!desiredSort.isPrefixOf(possibleSort, SimpleBSONElementComparator::kInstance)) {
// We can't get the sort order from the index scan. See if we can
// get the sort by reversing the scan.
BSONObj reversePossibleSort = QueryPlannerCommon::reverseSortObj(possibleSort);
- if (!desiredSort.isPrefixOf(reversePossibleSort)) {
+ if (!desiredSort.isPrefixOf(reversePossibleSort,
+ SimpleBSONElementComparator::kInstance)) {
// Can't get the sort order from the reversed index scan either. Give up.
return false;
} else {