| 14 | } |
| 15 | |
| 16 | void DetachDatabase::executeInternal(ExecutionContext* context) { |
| 17 | auto clientContext = context->clientContext; |
| 18 | auto dbManager = main::DatabaseManager::Get(*clientContext); |
| 19 | if (dbManager->hasAttachedDatabase(dbName) && |
| 20 | dbManager->getAttachedDatabase(dbName)->getDBType() == common::ATTACHED_LBUG_DB_TYPE) { |
| 21 | clientContext->setDefaultDatabase(nullptr /* defaultDatabase */); |
| 22 | } |
| 23 | dbManager->detachDatabase(dbName); |
| 24 | appendMessage("Detached database successfully.", storage::MemoryManager::Get(*clientContext)); |
| 25 | } |
| 26 | |
| 27 | } // namespace processor |
| 28 | } // namespace lbug |
nothing calls this directly
no test coverage detected