mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
dbms: fix [#METR-13667]
This commit is contained in:
parent
14c231c055
commit
140b4545dd
@ -75,20 +75,20 @@ BlockInputStreams StorageSystemTables::read(
|
|||||||
|
|
||||||
ColumnWithNameAndType StorageSystemTables::getFilteredDatabases(ASTPtr query)
|
ColumnWithNameAndType StorageSystemTables::getFilteredDatabases(ASTPtr query)
|
||||||
{
|
{
|
||||||
ColumnWithNameAndType filtered_databases_column;
|
ColumnWithNameAndType column;
|
||||||
filtered_databases_column.name = "database";
|
column.name = "database";
|
||||||
filtered_databases_column.type = new DataTypeString;
|
column.type = new DataTypeString;
|
||||||
filtered_databases_column.column = new ColumnString;
|
column.column = new ColumnString;
|
||||||
|
|
||||||
Block filtered_databases_block;
|
Block block;
|
||||||
filtered_databases_block.insert(filtered_databases_column);
|
block.insert(column);
|
||||||
for (auto database_it = context.getDatabases().begin(); database_it != context.getDatabases().end(); ++database_it)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user