| 96 | } |
| 97 | |
| 98 | BlockIO InterpreterDropQuery::executeSingleDropQuery(const ASTPtr & drop_query_ptr) |
| 99 | { |
| 100 | auto & drop = drop_query_ptr->as<ASTDropQuery &>(); |
| 101 | if (!drop.cluster.empty() && drop.table && !drop.if_empty && !maybeRemoveOnCluster(current_query_ptr, getContext())) |
| 102 | { |
| 103 | DDLQueryOnClusterParams params; |
| 104 | params.access_to_check = getRequiredAccessForDDLOnCluster(); |
| 105 | return executeDDLQueryOnCluster(current_query_ptr, getContext(), params); |
| 106 | } |
| 107 | |
| 108 | if (getContext()->getSettingsRef()[Setting::database_atomic_wait_for_drop_and_detach_synchronously]) |
| 109 | drop.sync = true; |
| 110 | |
| 111 | if (drop.table) |
| 112 | return executeToTable(drop); |
| 113 | if (drop.database && !drop.cluster.empty() && !maybeRemoveOnCluster(current_query_ptr, getContext())) |
| 114 | { |
| 115 | DDLQueryOnClusterParams params; |
| 116 | params.access_to_check = getRequiredAccessForDDLOnCluster(); |
| 117 | return executeDDLQueryOnCluster(current_query_ptr, getContext(), params); |
| 118 | } |
| 119 | if (drop.database) |
| 120 | return executeToDatabase(drop); |
| 121 | throw Exception(ErrorCodes::LOGICAL_ERROR, "Nothing to drop, both names are empty"); |
| 122 | } |
| 123 | |
| 124 | void InterpreterDropQuery::waitForTableToBeActuallyDroppedOrDetached(const ASTDropQuery & query, const DatabasePtr & db, const UUID & uuid_to_wait, ContextPtr context_) |
| 125 | { |
nothing calls this directly
no test coverage detected