fix inserts into unknown table, ex. 'table function url(...)'

This commit is contained in:
chertus 2018-07-13 21:06:47 +03:00
parent 1d7f6c32a0
commit 53f1f4794d

View File

@ -7,6 +7,9 @@ namespace DB
{ {
void TableMetadata::loadFromContext(const Context & context) void TableMetadata::loadFromContext(const Context & context)
{ {
if (!context.isTableExist(database, table))
return;
StoragePtr storage = context.getTable(database, table); StoragePtr storage = context.getTable(database, table);
const ColumnsDescription & table_columns = storage->getColumns(); const ColumnsDescription & table_columns = storage->getColumns();
column_defaults = table_columns.defaults; column_defaults = table_columns.defaults;