diff options
author | Jason Rassi <rassi@10gen.com> | 2015-04-28 17:58:55 -0400 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2015-04-28 19:57:37 -0400 |
commit | 3a8a48c8ad1f7665f7ca5ad8492197bded0c472b (patch) | |
tree | 3a8a5dd4ae368c091a929ab586d029fa0b2908da /src/mongo/db/dbhelpers.cpp | |
parent | 59d18d4cac011174d1b1f566e89aea3cb74ca8f5 (diff) | |
download | mongo-3a8a48c8ad1f7665f7ca5ad8492197bded0c472b.tar.gz |
SERVER-17915 Partial indexes shouldn't be eligible as shard key index
- Adds new public method IndexDescriptor::isPartial().
- Replaces IndexCatalog::findIndexByPrefix() with
IndexCatalog::findShardKeyPrefixedIndex().
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r-- | src/mongo/db/dbhelpers.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 22ac295e4a0..1d7cae4632c 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -302,9 +302,9 @@ namespace mongo { // Therefore, any multi-key index prefixed by shard key cannot be multikey over // the shard key fields. const IndexDescriptor* idx = - collection->getIndexCatalog()->findIndexByPrefix(txn, - shardKeyPattern, - false /* allow multi key */); + collection->getIndexCatalog()->findShardKeyPrefixedIndex(txn, + shardKeyPattern, + false); // requireSingleKey if ( idx == NULL ) return false; @@ -509,7 +509,7 @@ namespace mongo { // Require single key IndexDescriptor *idx = - collection->getIndexCatalog()->findIndexByPrefix( txn, range.keyPattern, true ); + collection->getIndexCatalog()->findShardKeyPrefixedIndex( txn, range.keyPattern, true ); if ( idx == NULL ) { return Status( ErrorCodes::IndexNotFound, range.keyPattern.toString() ); |