Update ASTSelectWithUnionQuery.cpp

This commit is contained in:
Kseniia Sumarokova 2021-08-17 11:49:02 +03:00 committed by GitHub
parent 8da7f406af
commit 0950584f88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,9 +33,9 @@ void ASTSelectWithUnionQuery::formatQueryImpl(const FormatSettings & settings, F
auto mode_to_str = [&](auto mode)
{
if (mode == Mode::ALL)
return " ALL";
return "UNION ALL";
else if (mode == Mode::DISTINCT)
return " DISTINCT";
return "UNION DISTINCT";
else if (mode == Mode::INTERSECT)
return "INTERSECT";
else if (mode == Mode::EXCEPT)
@ -46,7 +46,7 @@ void ASTSelectWithUnionQuery::formatQueryImpl(const FormatSettings & settings, F
for (ASTs::const_iterator it = list_of_selects->children.begin(); it != list_of_selects->children.end(); ++it)
{
if (it != list_of_selects->children.begin())
settings.ostr << settings.nl_or_ws << indent_str << (settings.hilite ? hilite_keyword : "") << "UNION"
settings.ostr << settings.nl_or_ws << indent_str << (settings.hilite ? hilite_keyword : "")
<< mode_to_str((is_normalized) ? union_mode : list_of_modes[it - list_of_selects->children.begin() - 1])
<< (settings.hilite ? hilite_none : "");