fix iterating over list

This commit is contained in:
Anton Popov 2021-07-21 21:47:20 +03:00
parent 47c1bb3416
commit a36c387e4e

View File

@ -506,12 +506,15 @@ bool ColumnsDescription::hasColumnOrSubcolumn(GetFlags flags, const String & col
void ColumnsDescription::addSubcolumnsToList(NamesAndTypesList & source_list) const
{
NamesAndTypesList subcolumns_list;
for (const auto & col : source_list)
{
auto range = subcolumns.get<1>().equal_range(col.name);
if (range.first != range.second)
source_list.insert(source_list.end(), range.first, range.second);
subcolumns_list.insert(subcolumns_list.end(), range.first, range.second);
}
source_list.splice(source_list.end(), std::move(subcolumns_list));
}
NamesAndTypesList ColumnsDescription::getAllWithSubcolumns() const