storages: support for CREATE MATERIALIZED VIEW IF NOT EXISTS [METR-9965]

This commit is contained in:
Sergey Fedorov 2014-02-11 18:54:31 +00:00
parent 288fa5af8e
commit a182091621

View File

@ -329,15 +329,22 @@ bool ParserCreateQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, String & ex
}
} else {
/// VIEW or MATERIALIZED VIEW
if (s_materialized.ignore(pos, end, expected))
if (s_materialized.ignore(pos, end, expected) && ws.ignore(pos, end, expected))
is_materialized_view = true;
else
is_view = true;
ws.ignore(pos, end, expected);
if (!s_view.ignore(pos, end, expected))
if (!s_view.ignore(pos, end, expected) || !ws.ignore(pos, end, expected))
return false;
ws.ignore(pos, end);
if (s_if.ignore(pos, end, expected)
&& ws.ignore(pos, end)
&& s_not.ignore(pos, end, expected)
&& ws.ignore(pos, end)
&& s_exists.ignore(pos, end, expected)
&& ws.ignore(pos, end))
if_not_exists = true;
if (!name_p.parse(pos, end, table, expected))
return false;
ws.ignore(pos, end);