diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2016-06-02 14:37:16 -0400 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2016-06-02 14:37:16 -0400 |
commit | 656480dfdb308884868a23ac41f9708b1b376431 (patch) | |
tree | f35687742e45830cf8821329b37dcd14fcc7ec44 | |
parent | e7ab7280a24eb71f6915feb30f44050a54322a81 (diff) | |
download | mongo-656480dfdb308884868a23ac41f9708b1b376431.tar.gz |
SERVER-23618 Fix bad rebase in 0d2f72f5471f7c0f283ceea314c48d2e25d7d556
-rw-r--r-- | src/mongo/db/query/query_planner.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/query/query_planner.cpp b/src/mongo/db/query/query_planner.cpp index faad7ca6aae..2b76ac930f9 100644 --- a/src/mongo/db/query/query_planner.cpp +++ b/src/mongo/db/query/query_planner.cpp @@ -851,6 +851,12 @@ Status QueryPlanner::plan(const CanonicalQuery& query, continue; } + // If the index collation differs from the query collation, the index should not be + // used to provide a sort, because strings will be ordered incorrectly. + if (!CollatorInterface::collatorsMatch(index.collator, query.getCollator())) { + continue; + } + // Partial indexes can only be used to provide a sort only if the query predicate is // compatible. if (index.filterExpr && !expression::isSubsetOf(query.root(), index.filterExpr)) { |