mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #46043 from ucasfl/view-syntax
Forbid wrong create view syntax
This commit is contained in:
commit
2190a2a6c4
@ -1299,14 +1299,13 @@ bool ParserCreateViewQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expec
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (ParserKeyword{"TO INNER UUID"}.ignore(pos, expected))
|
||||
if (is_materialized_view && ParserKeyword{"TO INNER UUID"}.ignore(pos, expected))
|
||||
{
|
||||
ParserStringLiteral literal_p;
|
||||
if (!literal_p.parse(pos, to_inner_uuid, expected))
|
||||
return false;
|
||||
}
|
||||
else if (ParserKeyword{"TO"}.ignore(pos, expected))
|
||||
else if (is_materialized_view && ParserKeyword{"TO"}.ignore(pos, expected))
|
||||
{
|
||||
// TO [db.]table
|
||||
if (!table_name_p.parse(pos, to_table, expected))
|
||||
|
@ -0,0 +1 @@
|
||||
CREATE VIEW X TO Y AS SELECT 1; -- { clientError 62 }
|
Loading…
Reference in New Issue
Block a user