dbms: development [#CONV-2944].

This commit is contained in:
Alexey Milovidov 2011-11-01 15:38:01 +00:00
parent 26c9af828e
commit 5bc7288e0d
2 changed files with 5 additions and 6 deletions

View File

@ -87,7 +87,7 @@ StoragePtr InterpreterCreateQuery::execute()
else if (!create.as_table.empty())
storage_name = (*context.databases)[as_database_name][as_table_name]->getName();
else
throw Exception("Incorrect CREATE query: required ENGINE or AS section.", ErrorCodes::INCORRECT_QUERY);
throw Exception("Incorrect CREATE query: required ENGINE.", ErrorCodes::INCORRECT_QUERY);
StoragePtr res = context.storage_factory->get(storage_name, data_path, table_name, columns);

View File

@ -76,7 +76,6 @@ bool ParserEngine::parseImpl(Pos & pos, Pos end, ASTPtr & storage, String & expe
ws.ignore(pos, end);
/// ENGINE
if (s_engine.ignore(pos, end, expected))
{
ws.ignore(pos, end);
@ -179,9 +178,11 @@ bool ParserCreateQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, String & ex
if (!engine_p.parse(pos, end, storage, expected))
return false;
}
else if (s_as.ignore(pos, end, expected))
else
{
if (!engine_p.parse(pos, end, storage, expected))
engine_p.parse(pos, end, storage, expected);
if (!s_as.ignore(pos, end, expected))
return false;
ws.ignore(pos, end);
@ -212,8 +213,6 @@ bool ParserCreateQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, String & ex
}
}
}
else
return false;
ASTCreateQuery * query = new ASTCreateQuery(StringRange(begin, pos));
node = query;