summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/drop_collection.cpp
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2016-07-29 10:53:21 -0400
committerGeert Bosch <geert@mongodb.com>2016-08-01 16:32:15 -0400
commit3f68c01861b33b76965d39ba5bcbd84e2851afe3 (patch)
tree217c036189e064367cba2b5b652db20dd17dd8c1 /src/mongo/db/catalog/drop_collection.cpp
parent18b74d535c944a1b03effd7624ed3e3f08688da7 (diff)
downloadmongo-3f68c01861b33b76965d39ba5bcbd84e2851afe3.tar.gz
SERVER-24767 Replicate views
Diffstat (limited to 'src/mongo/db/catalog/drop_collection.cpp')
-rw-r--r--src/mongo/db/catalog/drop_collection.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/catalog/drop_collection.cpp b/src/mongo/db/catalog/drop_collection.cpp
index c436f758b76..52df162eb05 100644
--- a/src/mongo/db/catalog/drop_collection.cpp
+++ b/src/mongo/db/catalog/drop_collection.cpp
@@ -64,7 +64,8 @@ Status dropCollection(OperationContext* txn,
AutoGetDb autoDb(txn, dbname, MODE_X);
Database* const db = autoDb.getDb();
Collection* coll = db ? db->getCollection(collectionName) : nullptr;
- ViewDefinition* view = db ? db->getViewCatalog()->lookup(collectionName.ns()) : nullptr;
+ ViewDefinition* view =
+ db ? db->getViewCatalog()->lookup(txn, collectionName.ns()) : nullptr;
if (!db || (!coll && !view)) {
return Status(ErrorCodes::NamespaceNotFound, "ns not found");
@@ -100,7 +101,10 @@ Status dropCollection(OperationContext* txn,
result.append("nIndexesWas", numIndexes);
} else {
invariant(view);
- db->dropView(txn, collectionName.ns());
+ Status status = db->dropView(txn, collectionName.ns());
+ if (!status.isOK()) {
+ return status;
+ }
}
wunit.commit();
}