MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / executeSingleDropQuery

Method executeSingleDropQuery

src/Interpreters/InterpreterDropQuery.cpp:98–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98BlockIO 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
124void InterpreterDropQuery::waitForTableToBeActuallyDroppedOrDetached(const ASTDropQuery & query, const DatabasePtr & db, const UUID & uuid_to_wait, ContextPtr context_)
125{

Callers

nothing calls this directly

Calls 5

maybeRemoveOnClusterFunction · 0.85
executeDDLQueryOnClusterFunction · 0.85
ExceptionClass · 0.70
getContextFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected