| 72 | |
| 73 | |
| 74 | BlockIO InterpreterDropQuery::execute() |
| 75 | { |
| 76 | auto & drop = query_ptr->as<ASTDropQuery &>(); |
| 77 | if (!drop.cluster.empty()) |
| 78 | return executeDDLQueryOnCluster(query_ptr, getContext(), getRequiredAccessForDDLOnCluster()); |
| 79 | |
| 80 | if (getContext()->getSettingsRef().database_atomic_wait_for_drop_and_detach_synchronously) |
| 81 | drop.no_delay = true; |
| 82 | if (drop.table.empty() && drop.database.empty() && !drop.catalog.empty()) |
| 83 | return executeToCatalog(drop); |
| 84 | else if (drop.is_snapshot) |
| 85 | return executeToSnapshot(drop); |
| 86 | else if (!drop.table.empty()) |
| 87 | return executeToTable(drop); |
| 88 | else if (!drop.database.empty()) |
| 89 | return executeToDatabase(drop); |
| 90 | else |
| 91 | throw Exception("Nothing to drop, both names are empty", ErrorCodes::LOGICAL_ERROR); |
| 92 | } |
| 93 | |
| 94 | |
| 95 | void InterpreterDropQuery::waitForTableToBeActuallyDroppedOrDetached(const ASTDropQuery & query, const DatabasePtr & db, const UUID & uuid_to_wait) |
no test coverage detected