diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-02-26 09:11:32 -0500 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-03-20 08:26:08 -0400 |
commit | 7948bd50e4f43e0285fac0a11170871db81fff7c (patch) | |
tree | bf7187da5a18d9cfc06abb18abad55851d08b731 /src/mongo/db | |
parent | d8d3d3ab1cef37bcc6f65182463b83eaf4669e17 (diff) | |
download | mongo-7948bd50e4f43e0285fac0a11170871db81fff7c.tar.gz |
SERVER-33149 createIndexes fails to report an error when index is not created with the specified name
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/catalog/index_catalog_impl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/catalog/index_catalog_impl.cpp b/src/mongo/db/catalog/index_catalog_impl.cpp index 7f7d98b17c5..d43a7242df5 100644 --- a/src/mongo/db/catalog/index_catalog_impl.cpp +++ b/src/mongo/db/catalog/index_catalog_impl.cpp @@ -678,7 +678,7 @@ Status IndexCatalogImpl::_doesSpecConflictWithExisting(OperationContext* opCtx, const IndexDescriptor* desc = findIndexByKeyPatternAndCollationSpec(opCtx, key, collation, findInProgressIndexes); if (desc) { - LOG(2) << "index already exists with diff name " << name << " pattern: " << key + LOG(2) << "Index already exists with a different name: " << name << " pattern: " << key << " collation: " << collation; IndexDescriptor temp(_collection, _getAccessMethodName(key), spec); @@ -688,8 +688,9 @@ Status IndexCatalogImpl::_doesSpecConflictWithExisting(OperationContext* opCtx, << " already exists with different options: " << desc->infoObj()); - return Status(ErrorCodes::IndexAlreadyExists, - str::stream() << "index already exists with different name: " << name); + return Status(ErrorCodes::IndexOptionsConflict, + str::stream() << "Index with name: " << name + << " already exists with a different name"); } } |