mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #8185 from vitlibar/fix-drop-dictionary-if-exists
Fix DROP DICTIONARY IF EXISTS
This commit is contained in:
commit
ad76a1bafb
@ -164,7 +164,7 @@ BlockIO InterpreterDropQuery::executeToDictionary(
|
||||
|
||||
auto ddl_guard = (!no_ddl_lock ? context.getDDLGuard(database_name, dictionary_name) : nullptr);
|
||||
|
||||
DatabasePtr database = tryGetDatabase(database_name, false);
|
||||
DatabasePtr database = tryGetDatabase(database_name, if_exists);
|
||||
|
||||
if (!database || !database->isDictionaryExist(context, dictionary_name))
|
||||
{
|
||||
|
@ -1,3 +1,5 @@
|
||||
DROP TABLE IF EXISTS dictdb.table_for_dict;
|
||||
DROP DICTIONARY IF EXISTS dictdb.dict_exists;
|
||||
DROP DATABASE IF EXISTS dictdb;
|
||||
|
||||
CREATE DATABASE dictdb ENGINE = Ordinary;
|
||||
@ -37,4 +39,6 @@ LAYOUT(FLAT());
|
||||
|
||||
SELECT dictGetFloat64('dictdb.dict_exists', 'value', toUInt64(1));
|
||||
|
||||
DROP DATABASE IF EXISTS dictdb;
|
||||
DROP TABLE dictdb.table_for_dict;
|
||||
DROP DICTIONARY dictdb.dict_exists;
|
||||
DROP DATABASE dictdb;
|
||||
|
Loading…
Reference in New Issue
Block a user