This commit is contained in:
kssenii 2022-04-26 11:24:24 +02:00
parent 81db081b88
commit c502a14404
4 changed files with 9 additions and 2 deletions

View File

@ -195,7 +195,7 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &,
else if (type == Type::DROP_FILESYSTEM_CACHE)
{
if (!filesystem_cache_path.empty())
settings.ostr << (settings.hilite ? hilite_none : "") << filesystem_cache_path;
settings.ostr << (settings.hilite ? hilite_none : "") << " " << filesystem_cache_path;
if (force_removal)
settings.ostr << (settings.hilite ? hilite_keyword : "") << " FORCE";
}

View File

@ -7,6 +7,7 @@
#include <Parsers/ParserInsertQuery.h>
#include <Parsers/ParserSetQuery.h>
#include <Parsers/ParserQuery.h>
#include <Parsers/ParserSystemQuery.h>
namespace DB
{
@ -62,6 +63,7 @@ bool ParserExplainQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected
ParserCreateTableQuery create_p;
ParserSelectWithUnionQuery select_p;
ParserInsertQuery insert_p(end, allow_settings_after_format_in_insert);
ParserSystemQuery system_p;
ASTPtr query;
if (kind == ASTExplainQuery::ExplainKind::ParsedAST)
{
@ -88,7 +90,8 @@ bool ParserExplainQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected
}
else if (select_p.parse(pos, query, expected) ||
create_p.parse(pos, query, expected) ||
insert_p.parse(pos, query, expected))
insert_p.parse(pos, query, expected) ||
system_p.parse(pos, query, expected))
explain_query->setExplainedQuery(std::move(query));
else
return false;

View File

@ -28,3 +28,5 @@ SELECT count() FROM system.filesystem_cache;
SYSTEM DROP FILESYSTEM CACHE './s3_cache/';
SELECT count() FROM system.filesystem_cache;
2
EXPLAIN SYNTAX SYSTEM DROP FILESYSTEM CACHE './s3_cache/' FORCE;
SYSTEM DROP FILESYSTEM CACHE ./s3_cache/ FORCE

View File

@ -32,3 +32,5 @@ SELECT count() FROM system.filesystem_cache;
SYSTEM DROP FILESYSTEM CACHE './s3_cache/';
SELECT count() FROM system.filesystem_cache;
EXPLAIN SYNTAX SYSTEM DROP FILESYSTEM CACHE './s3_cache/' FORCE;