clickhouse: fixed ExpressionAnalyzer [#CONV-7444].

This commit is contained in:
Michael Kolupaev 2013-06-21 10:36:01 +00:00
parent f59d6e3320
commit c2455e1182

View File

@ -1027,18 +1027,21 @@ void ExpressionAnalyzer::removeUnusedColumns()
if (required.empty())
required.insert(ExpressionActions::getSmallestColumn(columns));
unknown_required_columns = required;
for (NamesAndTypesList::iterator it = columns.begin(); it != columns.end();)
{
NamesAndTypesList::iterator it0 = it;
++it;
unknown_required_columns.erase(it0->first);
if (!required.count(it0->first))
{
required.erase(it0->first);
columns.erase(it0);
}
}
unknown_required_columns = required;
}
Names ExpressionAnalyzer::getRequiredColumns()