dbms: fix [#METR-13667]

This commit is contained in:
Pavel Kartavyy 2014-11-13 17:01:29 +03:00
parent 14c231c055
commit 140b4545dd

View File

@ -75,20 +75,20 @@ BlockInputStreams StorageSystemTables::read(
ColumnWithNameAndType StorageSystemTables::getFilteredDatabases(ASTPtr query)
{
ColumnWithNameAndType filtered_databases_column;
filtered_databases_column.name = "database";
filtered_databases_column.type = new DataTypeString;
filtered_databases_column.column = new ColumnString;
ColumnWithNameAndType column;
column.name = "database";
column.type = new DataTypeString;
column.column = new ColumnString;
Block filtered_databases_block;
filtered_databases_block.insert(filtered_databases_column);
Block block;
block.insert(column);
for (auto database_it = context.getDatabases().begin(); database_it != context.getDatabases().end(); ++database_it)
{
filtered_databases_column.column->insert(database_it->first);
column.column->insert(database_it->first);
}
VirtualColumnUtils::filterBlockWithQuery(query, filtered_databases_block, context);
VirtualColumnUtils::filterBlockWithQuery(query, block, context);
return filtered_databases_column;
return block.getByPosition(0);
}
}