summaryrefslogtreecommitdiff
path: root/src/mongo/db/s
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2022-04-20 15:27:51 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-20 17:02:43 +0000
commit42a0da5e29268a786cf9f4eb109492f7364d8090 (patch)
tree64b57c820a06dce943ecd62f5d1546b6368cdeac /src/mongo/db/s
parentb02798f3032ff6df56a45b4bcb9296b247c37be4 (diff)
downloadmongo-42a0da5e29268a786cf9f4eb109492f7364d8090.tar.gz
SERVER-65802 Return NamespaceExists when dropTarget=false but unsharded target collection exists
Diffstat (limited to 'src/mongo/db/s')
-rw-r--r--src/mongo/db/s/sharding_ddl_util.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/s/sharding_ddl_util.cpp b/src/mongo/db/s/sharding_ddl_util.cpp
index 741bbca1f42..d516fd5e668 100644
--- a/src/mongo/db/s/sharding_ddl_util.cpp
+++ b/src/mongo/db/s/sharding_ddl_util.cpp
@@ -382,7 +382,7 @@ void checkRenamePreconditions(OperationContext* opCtx,
// Check that the unsharded target collection doesn't exist
auto collectionCatalog = CollectionCatalog::get(opCtx);
auto targetColl = collectionCatalog->lookupCollectionByNamespace(opCtx, toNss);
- uassert(5807601,
+ uassert(ErrorCodes::NamespaceExists,
str::stream() << "Target collection " << toNss.ns()
<< " exists but dropTarget is not set",
!targetColl);