Fix trash

This commit is contained in:
Alexey Milovidov 2024-02-19 11:09:37 +01:00
parent baf0fa1458
commit db9026b5ac
2 changed files with 28 additions and 12 deletions

View File

@ -0,0 +1,23 @@
#include <Parsers/ASTDescribeCacheQuery.h>
#include <Common/quoteString.h>
namespace DB
{
String ASTDescribeCacheQuery::getID(char) const { return "DescribeCacheQuery"; }
ASTPtr ASTDescribeCacheQuery::clone() const
{
auto res = std::make_shared<ASTDescribeCacheQuery>(*this);
cloneOutputOptions(*res);
return res;
}
void ASTDescribeCacheQuery::formatQueryImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const
{
settings.ostr << (settings.hilite ? hilite_keyword : "") << "DESCRIBE FILESYSTEM CACHE" << (settings.hilite ? hilite_none : "")
<< " " << quoteString(cache_name);
}
}

View File

@ -1,6 +1,8 @@
#pragma once #pragma once
#include <Parsers/ASTQueryWithOutput.h> #include <Parsers/ASTQueryWithOutput.h>
namespace DB namespace DB
{ {
@ -9,20 +11,11 @@ class ASTDescribeCacheQuery : public ASTQueryWithOutput
public: public:
String cache_name; String cache_name;
String getID(char) const override { return "DescribeCacheQuery"; } String getID(char) const override;
ASTPtr clone() const override;
ASTPtr clone() const override
{
auto res = std::make_shared<ASTDescribeCacheQuery>(*this);
cloneOutputOptions(*res);
return res;
}
protected: protected:
void formatQueryImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override void formatQueryImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override;
{
settings.ostr << (settings.hilite ? hilite_keyword : "") << "DESCRIBE FILESYSTEM CACHE" << (settings.hilite ? hilite_none : "") << " " << cache_name;
}
}; };
} }