mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
fix misplaced ( in ASTCreateQuery.cpp
This commit is contained in:
parent
e984e221ce
commit
264c129a96
@ -440,8 +440,8 @@ void ASTCreateQuery::formatQueryImpl(const FormatSettings & settings, FormatStat
|
||||
if (select)
|
||||
{
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << " AS"
|
||||
<< (comment ? "(" : "")
|
||||
<< settings.nl_or_ws << (settings.hilite ? hilite_none : "");
|
||||
<< settings.nl_or_ws
|
||||
<< (comment ? "(" : "") << (settings.hilite ? hilite_none : "");
|
||||
select->formatImpl(settings, state, frame);
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << (comment ? ")" : "") << (settings.hilite ? hilite_none : "");
|
||||
}
|
||||
|
@ -321,10 +321,9 @@ TEST(FormatHiliting, ASTKillQueryQuery)
|
||||
|
||||
TEST(FormatHiliting, ASTCreateQuery)
|
||||
{
|
||||
// The misplaced space around ( is on purpose, as this bug will fixed in a separate PR.
|
||||
String query = "CREATE TABLE name AS( SELECT *) COMMENT 'hello'";
|
||||
String query = "CREATE TABLE name AS (SELECT *) COMMENT 'hello'";
|
||||
|
||||
String expected = keyword("CREATE TABLE ") + "name " + keyword("AS( SELECT ") + "*" + keyword(") ")
|
||||
String expected = keyword("CREATE TABLE ") + "name " + keyword("AS (SELECT ") + "*" + keyword(") ")
|
||||
+ keyword("COMMENT ") + "'hello'";
|
||||
|
||||
compare(query, expected);
|
||||
|
Loading…
Reference in New Issue
Block a user