Merge pull request #8185 from vitlibar/fix-drop-dictionary-if-exists

Fix DROP DICTIONARY IF EXISTS
This commit is contained in:
alexey-milovidov 2019-12-13 02:47:06 +03:00 committed by GitHub
commit ad76a1bafb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -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))
{

View File

@ -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;