Do not prepend whitespace in grouping sets

This commit is contained in:
Dmitry Novik 2021-12-22 19:41:25 +03:00 committed by Dmitry Novik
parent fb5766287c
commit 5128afb0b7
2 changed files with 1 additions and 3 deletions

View File

@ -66,10 +66,7 @@ void ASTExpressionList::formatImplMultiline(const FormatSettings & settings, For
frame_nested.surround_each_list_element_with_parens = false;
if (frame.surround_each_list_element_with_parens)
{
settings.ostr << "(";
frame_nested.expression_list_prepend_whitespace = false;
}
(*it)->formatImpl(settings, state, frame_nested);

View File

@ -114,6 +114,7 @@ void ASTSelectQuery::formatImpl(const FormatSettings & s, FormatState & state, F
{
auto nested_frame = frame;
nested_frame.surround_each_list_element_with_parens = true;
nested_frame.expression_list_prepend_whitespace = false;
nested_frame.indent++;
s.ostr << (s.hilite ? hilite_keyword : "") << s.nl_or_ws << indent_str << (s.one_line ? "" : " ") << "GROUPING SETS" << (s.hilite ? hilite_none : "");
s.ostr << " (";