summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/drop_indexes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/catalog/drop_indexes.cpp')
-rw-r--r--src/mongo/db/catalog/drop_indexes.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/catalog/drop_indexes.cpp b/src/mongo/db/catalog/drop_indexes.cpp
index ecbbf35893c..f5e76e677a5 100644
--- a/src/mongo/db/catalog/drop_indexes.cpp
+++ b/src/mongo/db/catalog/drop_indexes.cpp
@@ -349,7 +349,7 @@ void dropReadyIndexes(OperationContext* opCtx,
uassert(
ErrorCodes::CannotDropShardKeyIndex,
"Cannot drop the only compatible index for this collection's shard key",
- !isLastShardKeyIndex(
+ !isLastNonHiddenShardKeyIndex(
opCtx, collection, indexCatalog, indexName, collDescription.getKeyPattern()));
}
@@ -523,11 +523,11 @@ DropIndexesReply dropIndexes(OperationContext* opCtx,
if (collDescription.isSharded()) {
uassert(ErrorCodes::CannotDropShardKeyIndex,
"Cannot drop the only compatible index for this collection's shard key",
- !isLastShardKeyIndex(opCtx,
- collection->getCollection(),
- indexCatalog,
- indexName,
- collDescription.getKeyPattern()));
+ !isLastNonHiddenShardKeyIndex(opCtx,
+ collection->getCollection(),
+ indexCatalog,
+ indexName,
+ collDescription.getKeyPattern()));
}
auto desc =