summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2019-09-13 06:06:36 +0000
committerevergreen <evergreen@mongodb.com>2019-09-13 06:06:36 +0000
commit11eaee8aace14a3b8ba1d7c3ab462e8badc8ffee (patch)
tree7d334be32ba03d2739559d30da3c0edd01561fb4 /src/mongo
parentbf9a3a3bd3055237b72d50d8f86b43420ea10d68 (diff)
downloadmongo-11eaee8aace14a3b8ba1d7c3ab462e8badc8ffee.tar.gz
SERVER-10456 do not use sparse indexes as shard key indexes
(cherry picked from commit 0e6b9119f4d3a0fae681ed28220bc55ed1469f81)
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/catalog/index_catalog_impl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/catalog/index_catalog_impl.cpp b/src/mongo/db/catalog/index_catalog_impl.cpp
index 4e37bffe820..6dc6672782f 100644
--- a/src/mongo/db/catalog/index_catalog_impl.cpp
+++ b/src/mongo/db/catalog/index_catalog_impl.cpp
@@ -1187,7 +1187,7 @@ const IndexDescriptor* IndexCatalogImpl::findShardKeyPrefixedIndex(OperationCont
const IndexDescriptor* desc = ii->next()->descriptor();
bool hasSimpleCollation = desc->infoObj().getObjectField("collation").isEmpty();
- if (desc->isPartial())
+ if (desc->isPartial() || desc->isSparse())
continue;
if (!shardKey.isPrefixOf(desc->keyPattern(), SimpleBSONElementComparator::kInstance))