mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
fix bugs (now tests pass)
This commit is contained in:
parent
da5285004d
commit
ed22d0f028
@ -161,8 +161,8 @@ void ASTDictionary::formatImpl(const FormatSettings & settings, FormatState & st
|
||||
|
||||
if (source)
|
||||
{
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << settings.nl_or_ws << "SOURCE("
|
||||
<< (settings.hilite ? hilite_none : "");
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << settings.nl_or_ws << "SOURCE"
|
||||
<< (settings.hilite ? hilite_none : "") << "(";
|
||||
source->formatImpl(settings, state, frame);
|
||||
settings.ostr << ")";
|
||||
}
|
||||
|
@ -66,6 +66,8 @@ void ASTDictionaryAttributeDeclaration::formatImpl(const FormatSettings & settin
|
||||
|
||||
if (is_object_id)
|
||||
settings.ostr << ' ' << (settings.hilite ? hilite_keyword : "") << "IS_OBJECT_ID";
|
||||
|
||||
settings.ostr << (settings.hilite ? hilite_none : "");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -692,7 +692,7 @@ void ASTFunction::formatImplWithoutAlias(const FormatSettings & settings, Format
|
||||
{
|
||||
std::string nl_or_nothing = settings.one_line ? "" : "\n";
|
||||
std::string indent_str = settings.one_line ? "" : std::string(4u * frame.indent, ' ');
|
||||
settings.ostr << (settings.hilite ? hilite_function : "") << name << "(" << nl_or_nothing;
|
||||
settings.ostr << (settings.hilite ? hilite_function : "") << name << (settings.hilite ? hilite_none : "") << "(" << nl_or_nothing;
|
||||
FormatStateStacked frame_nested = frame;
|
||||
frame_nested.need_parens = false;
|
||||
++frame_nested.indent;
|
||||
|
@ -29,11 +29,13 @@ void ASTKillQueryQuery::formatQueryImpl(const FormatSettings & settings, FormatS
|
||||
break;
|
||||
}
|
||||
|
||||
settings.ostr << (settings.hilite ? hilite_none : "");
|
||||
|
||||
formatOnCluster(settings);
|
||||
|
||||
if (where_expression)
|
||||
{
|
||||
settings.ostr << " WHERE " << (settings.hilite ? hilite_none : "");
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << " WHERE " << (settings.hilite ? hilite_none : "");
|
||||
where_expression->formatImpl(settings, state, frame);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,9 @@ void ASTWithAlias::formatImpl(const FormatSettings & settings, FormatState & sta
|
||||
/// This is needed because the query can become extraordinary large after substitution of aliases.
|
||||
if (!alias.empty() && !state.printed_asts_with_alias.emplace(frame.current_select, alias, getTreeHash()).second)
|
||||
{
|
||||
settings.ostr << (settings.hilite ? IAST::hilite_identifier : "");
|
||||
settings.writeIdentifier(alias);
|
||||
settings.ostr << (settings.hilite ? IAST::hilite_none : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -18,6 +18,7 @@ void ASTWithElement::formatImpl(const FormatSettings & settings, FormatState & s
|
||||
{
|
||||
std::string indent_str = settings.one_line ? "" : std::string(4 * frame.indent, ' ');
|
||||
|
||||
settings.ostr << (settings.hilite ? hilite_alias : "");
|
||||
settings.writeIdentifier(name);
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << " AS" << (settings.hilite ? hilite_none : "");
|
||||
settings.ostr << settings.nl_or_ws << indent_str;
|
||||
|
Loading…
Reference in New Issue
Block a user