Fix tests

This commit is contained in:
Nikolay Degterinsky 2021-10-13 10:00:00 +03:00
parent 49c1a52f34
commit 2ed72501d1
2 changed files with 6 additions and 5 deletions

View File

@ -65,7 +65,7 @@ StoragePtr InterpreterInsertQuery::getTable(ASTInsertQuery & query)
return table_function_ptr->execute(query.table_function, getContext(), table_function_ptr->getName());
}
if (query.getDatabase().empty() && query.getDatabase().empty())
if (query.getDatabase().empty() && query.getTable().empty())
{
query.table_id = getContext()->resolveStorageID(query.table_id);
}

View File

@ -240,6 +240,11 @@ bool ParserInsertQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
{
query->database = database;
query->table = table;
if (database)
query->children.push_back(database);
if (table)
query->children.push_back(table);
}
tryGetIdentifierNameInto(format, query->format);
@ -251,10 +256,6 @@ bool ParserInsertQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
query->data = data != end ? data : nullptr;
query->end = end;
if (database)
query->children.push_back(database);
if (table)
query->children.push_back(table);
if (columns)
query->children.push_back(columns);
if (select)