fix due to review

This commit is contained in:
Yarik Briukhovetskyi 2024-05-01 18:16:37 +02:00 committed by GitHub
parent e7b96d9ec0
commit 637eb754a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 12 deletions

View File

@ -50,10 +50,7 @@ void ASTDropQuery::formatQueryImpl(const FormatSettings & settings, FormatState
settings.ostr << "TEMPORARY ";
if (has_all_tables)
{
settings.ostr << "ALL TABLES ";
settings.ostr << "FROM "; /// When using `TRUNCATE ALL TABLES` we need to use the `FROM` keyword along with database name
}
settings.ostr << "ALL TABLES FROM ";
else if (!table && !database_and_tables && database)
settings.ostr << "DATABASE ";
else if (is_dictionary)

View File

@ -56,14 +56,12 @@ bool parseDropQuery(IParser::Pos & pos, ASTPtr & node, Expected & expected, cons
{
has_all_tables = true;
if (s_from.ignore(pos, expected))
{
if (s_if_exists.ignore(pos, expected))
if_exists = true;
return false;
if (!name_p.parse(pos, database, expected))
return false;
}
else
if (s_if_exists.ignore(pos, expected))
if_exists = true;
if (!name_p.parse(pos, database, expected))
return false;
}
else

View File

@ -40,7 +40,6 @@ bool ParserQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
ParserInsertQuery insert_p(end, allow_settings_after_format_in_insert);
ParserUseQuery use_p;
ParserSetQuery set_p;
ParserDropQuery drop_p;
ParserSystemQuery system_p;
ParserCreateUserQuery create_user_p;
ParserCreateRoleQuery create_role_p;