summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_planner_geo_test.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2017-06-08 17:47:22 -0400
committerDavid Storch <david.storch@10gen.com>2017-06-20 13:41:53 -0400
commit50623596fb62da49a2b1495d5e0cd852faf91f9f (patch)
tree6d44397d8ade87fa1a29bb888a9251cdaf44a53e /src/mongo/db/query/query_planner_geo_test.cpp
parent9022c80626cc1316f83e657591f1f19f3db7237b (diff)
downloadmongo-50623596fb62da49a2b1495d5e0cd852faf91f9f.tar.gz
SERVER-19402 Change find command semantics for sorting on an array field.
This eliminates the behavior in which the lowest-valued in-bounds index key was chosen as the sort key. After this change, we instead choose the lowest key overall, which may or may not be in-bounds. This change prevents the sort order from depending on either the query predicate or the implementation details of the query planner. Note that it is no longer correct for a multikey index to provide a sort over an array field. However, a non-array field of a multikey index can provide a sort when that index has path-level multikeyness metadata.
Diffstat (limited to 'src/mongo/db/query/query_planner_geo_test.cpp')
-rw-r--r--src/mongo/db/query/query_planner_geo_test.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/query/query_planner_geo_test.cpp b/src/mongo/db/query/query_planner_geo_test.cpp
index 96b71acdb3d..a4efc42195b 100644
--- a/src/mongo/db/query/query_planner_geo_test.cpp
+++ b/src/mongo/db/query/query_planner_geo_test.cpp
@@ -708,7 +708,8 @@ TEST_F(QueryPlannerTest, CompoundGeoNoGeoPredicateMultikey) {
"{sort: {pattern: {creationDate: 1}, limit: 0, node: {sortKeyGen: "
"{node: {cscan: {dir: 1}}}}}}");
assertSolutionExists(
- "{fetch: {node: {ixscan: {pattern: {creationDate: 1, 'foo.bar': '2dsphere'}}}}}");
+ "{sort: {pattern: {creationDate: 1}, limit: 0, node: {sortKeyGen: {node: {fetch: {node: "
+ "{ixscan: {pattern: {creationDate: 1, 'foo.bar': '2dsphere'}}}}}}}}}");
}
// Test that a 2dsphere index can satisfy a whole index scan solution if the query has a GEO