diff options
author | Ian Boros <ian.boros@10gen.com> | 2018-07-31 13:32:15 -0400 |
---|---|---|
committer | Ian Boros <ian.boros@10gen.com> | 2018-08-31 10:59:42 -0400 |
commit | 7b42fb9ded007e90bd4961c46afa046af92675a8 (patch) | |
tree | ab8158bdb18fb1145cb51f25036d935949ee4181 /src/mongo/db/commands/index_filter_commands_test.cpp | |
parent | dc076ee0d1c4b9463084b51694957dc63f8ba593 (diff) | |
download | mongo-7b42fb9ded007e90bd4961c46afa046af92675a8.tar.gz |
SERVER-35333 caching plans for allPaths indexes
Diffstat (limited to 'src/mongo/db/commands/index_filter_commands_test.cpp')
-rw-r--r-- | src/mongo/db/commands/index_filter_commands_test.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/mongo/db/commands/index_filter_commands_test.cpp b/src/mongo/db/commands/index_filter_commands_test.cpp index ffc0419616d..7a4a4497807 100644 --- a/src/mongo/db/commands/index_filter_commands_test.cpp +++ b/src/mongo/db/commands/index_filter_commands_test.cpp @@ -426,8 +426,13 @@ TEST(IndexFilterCommandsTest, SetAndClearFiltersCollation) { // Create a plan cache. Add an index so that indexability is included in the plan cache keys. PlanCache planCache; - planCache.notifyOfIndexEntries( - {IndexEntry(fromjson("{a: 1}"), false, false, false, "index_name", NULL, BSONObj())}); + planCache.notifyOfIndexEntries({IndexEntry(fromjson("{a: 1}"), + false, + false, + false, + IndexEntry::Identifier{"index_name"}, + NULL, + BSONObj())}); // Inject query shapes with and without collation into plan cache. addQueryShapeToPlanCache( @@ -494,17 +499,27 @@ TEST(IndexFilterCommandsTest, SetAndClearFiltersCollation) { TEST(IndexFilterCommandsTest, SetFilterAcceptsIndexNames) { CollatorInterfaceMock reverseCollator(CollatorInterfaceMock::MockType::kReverseString); - IndexEntry collatedIndex( - fromjson("{a: 1}"), false, false, false, "a_1:rev", nullptr, BSONObj()); + IndexEntry collatedIndex(fromjson("{a: 1}"), + false, + false, + false, + IndexEntry::Identifier{"a_1:rev"}, + nullptr, + BSONObj()); collatedIndex.collator = &reverseCollator; QueryTestServiceContext serviceContext; auto opCtx = serviceContext.makeOperationContext(); QuerySettings querySettings; PlanCache planCache; - planCache.notifyOfIndexEntries( - {IndexEntry(fromjson("{a: 1}"), false, false, false, "a_1", nullptr, BSONObj()), - collatedIndex}); + planCache.notifyOfIndexEntries({IndexEntry(fromjson("{a: 1}"), + false, + false, + false, + IndexEntry::Identifier{"a_1"}, + nullptr, + BSONObj()), + collatedIndex}); addQueryShapeToPlanCache(opCtx.get(), &planCache, "{a: 2}", "{}", "{}", "{}"); ASSERT_TRUE(planCacheContains(opCtx.get(), planCache, "{a: 2}", "{}", "{}", "{}")); |