mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
add bug: second parenthesis ) not hilited in CREATE TABLE name AS (SELECT *) COMMENT 'hello'
This commit is contained in:
parent
5681f2c130
commit
f36ad31751
@ -443,7 +443,7 @@ void ASTCreateQuery::formatQueryImpl(const FormatSettings & settings, FormatStat
|
||||
<< (comment ? "(" : "")
|
||||
<< settings.nl_or_ws << (settings.hilite ? hilite_none : "");
|
||||
select->formatImpl(settings, state, frame);
|
||||
settings.ostr << (comment ? ")" : "");
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << (comment ? ")" : "") << (settings.hilite ? hilite_none : "");
|
||||
}
|
||||
|
||||
if (comment)
|
||||
|
@ -300,3 +300,14 @@ TEST(FormatHiliting, ASTKillQueryQuery)
|
||||
|
||||
compare(query, expected);
|
||||
}
|
||||
|
||||
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 expected = keyword("CREATE TABLE ") + identifier("name ") + keyword("AS( SELECT ") + "*" + keyword(")")
|
||||
+ keyword("COMMENT") + "'hello'";
|
||||
|
||||
compare(query, expected);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user