summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth
diff options
context:
space:
mode:
authorDavid Hatch <david.hatch@mongodb.com>2016-07-08 17:16:15 -0400
committerDavid Hatch <david.hatch@mongodb.com>2016-07-28 22:33:08 -0400
commit13448cde4947adb5c935bb034187480365cf692f (patch)
tree2cf01918467d33755976588fac7dedb530530c7a /src/mongo/db/auth
parent3a9e531cd088b6c10bec4b1d9d6ea49b3db8ce7a (diff)
downloadmongo-13448cde4947adb5c935bb034187480365cf692f.tar.gz
SERVER-24239 Allow creation of indexes with the same key pattern.
Diffstat (limited to 'src/mongo/db/auth')
-rw-r--r--src/mongo/db/auth/auth_index_d.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/auth/auth_index_d.cpp b/src/mongo/db/auth/auth_index_d.cpp
index 8f45cfda0e3..427900c8377 100644
--- a/src/mongo/db/auth/auth_index_d.cpp
+++ b/src/mongo/db/auth/auth_index_d.cpp
@@ -97,10 +97,11 @@ Status verifySystemIndexes(OperationContext* txn) {
}
IndexCatalog* indexCatalog = collection->getIndexCatalog();
- IndexDescriptor* oldIndex = NULL;
+ std::vector<IndexDescriptor*> indexes;
+ indexCatalog->findIndexesByKeyPattern(txn, v1SystemUsersKeyPattern, false, &indexes);
- if (indexCatalog &&
- (oldIndex = indexCatalog->findIndexByKeyPattern(txn, v1SystemUsersKeyPattern))) {
+ if (indexCatalog && !indexes.empty()) {
+ fassert(ErrorCodes::AmbiguousIndexKeyPattern, indexes.size() == 1);
return Status(ErrorCodes::AuthSchemaIncompatible,
"Old 2.4 style user index identified. "
"The authentication schema needs to be updated by "