Merge pull request #66505 from ClickHouse/fix-double-whitespace-in-explain-ast

Fix double whitespace in EXPLAIN AST CREATE
This commit is contained in:
Alexey Milovidov 2024-07-18 01:25:37 +00:00 committed by GitHub
commit 4ac48f08c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 3 deletions

View File

@ -265,6 +265,16 @@ ASTPtr ASTCreateQuery::clone() const
return res; return res;
} }
String ASTCreateQuery::getID(char delim) const
{
String res = attach ? "AttachQuery" : "CreateQuery";
String database = getDatabase();
if (!database.empty())
res += (delim + getDatabase());
res += (delim + getTable());
return res;
}
void ASTCreateQuery::formatQueryImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const void ASTCreateQuery::formatQueryImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const
{ {
frame.need_parens = false; frame.need_parens = false;

View File

@ -136,7 +136,7 @@ public:
bool create_or_replace{false}; bool create_or_replace{false};
/** Get the text that identifies this element. */ /** Get the text that identifies this element. */
String getID(char delim) const override { return (attach ? "AttachQuery" : "CreateQuery") + (delim + getDatabase()) + delim + getTable(); } String getID(char delim) const override;
ASTPtr clone() const override; ASTPtr clone() const override;

View File

@ -21,7 +21,6 @@
#include <Processors/QueryPlan/QueryPlan.h> #include <Processors/QueryPlan/QueryPlan.h>
#include <Processors/QueryPlan/ReadFromPreparedSource.h> #include <Processors/QueryPlan/ReadFromPreparedSource.h>
#include <Processors/Transforms/FilterTransform.h>
#include <Parsers/ASTFunction.h> #include <Parsers/ASTFunction.h>
#include <Parsers/ASTIdentifier.h> #include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTTablesInSelectQuery.h> #include <Parsers/ASTTablesInSelectQuery.h>