Fix tests

This commit is contained in:
Nikolay Degterinsky 2021-10-15 11:41:25 +03:00
parent 63faf0212d
commit ca7e318191
3 changed files with 3 additions and 3 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()); return table_function_ptr->execute(query.table_function, getContext(), table_function_ptr->getName());
} }
if (query.getDatabase().empty() && query.getTable().empty()) if (query.table_id)
{ {
query.table_id = getContext()->resolveStorageID(query.table_id); query.table_id = getContext()->resolveStorageID(query.table_id);
} }

View File

@ -69,7 +69,7 @@ void ASTInsertQuery::formatImpl(const FormatSettings & settings, FormatState & s
else else
{ {
settings.ostr << (settings.hilite ? hilite_none : "") settings.ostr << (settings.hilite ? hilite_none : "")
<< (!database ? backQuoteIfNeed(getDatabase()) + "." : "") << backQuoteIfNeed(getTable()); << (database ? backQuoteIfNeed(getDatabase()) + "." : "") << backQuoteIfNeed(getTable());
} }
if (columns) if (columns)

View File

@ -55,7 +55,7 @@ public:
res->children.clear(); res->children.clear();
if (database) { res->database = database->clone(); res->children.push_back(res->database); } if (database) { res->database = database->clone(); res->children.push_back(res->database); }
if (table) { res->columns = columns->clone(); res->children.push_back(res->table); } if (table) { res->table = table->clone(); res->children.push_back(res->table); }
if (columns) { res->columns = columns->clone(); res->children.push_back(res->columns); } if (columns) { res->columns = columns->clone(); res->children.push_back(res->columns); }
if (select) { res->select = select->clone(); res->children.push_back(res->select); } if (select) { res->select = select->clone(); res->children.push_back(res->select); }
if (watch) { res->watch = watch->clone(); res->children.push_back(res->watch); } if (watch) { res->watch = watch->clone(); res->children.push_back(res->watch); }