From 5128afb0b7cc1d9576890aedd8247e04ae898d64 Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Wed, 22 Dec 2021 19:41:25 +0300 Subject: [PATCH] Do not prepend whitespace in grouping sets --- src/Parsers/ASTExpressionList.cpp | 3 --- src/Parsers/ASTSelectQuery.cpp | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Parsers/ASTExpressionList.cpp b/src/Parsers/ASTExpressionList.cpp index c81a35fb80d..2590c6b2941 100644 --- a/src/Parsers/ASTExpressionList.cpp +++ b/src/Parsers/ASTExpressionList.cpp @@ -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); diff --git a/src/Parsers/ASTSelectQuery.cpp b/src/Parsers/ASTSelectQuery.cpp index 71ed4a3fe7b..53c820a180d 100644 --- a/src/Parsers/ASTSelectQuery.cpp +++ b/src/Parsers/ASTSelectQuery.cpp @@ -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 << " (";