mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix PREWHERE with WHERE in case of always true PREWHERE
This commit is contained in:
parent
b0f05f82b9
commit
16cd70aee9
@ -1043,6 +1043,10 @@ void MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(ReadResult & r
|
||||
}
|
||||
/// Filter in WHERE instead
|
||||
else
|
||||
{
|
||||
if (prewhere_info->remove_prewhere_column)
|
||||
result.columns.erase(result.columns.begin() + prewhere_column_pos);
|
||||
else
|
||||
{
|
||||
auto type = getSampleBlock().getByName(prewhere_info->prewhere_column_name).type;
|
||||
ColumnWithTypeAndName col(result.getFilterHolder()->convertToFullColumnIfConst(), std::make_shared<DataTypeUInt8>(), "");
|
||||
@ -1050,5 +1054,6 @@ void MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(ReadResult & r
|
||||
result.clearFilter(); // Acting as a flag to not filter in PREWHERE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,5 @@
|
||||
drop table if exists data_02021;
|
||||
create table data_02021 (key Int) engine=MergeTree() order by key;
|
||||
insert into data_02021 values (1);
|
||||
select count() from data_02021 prewhere 1 or ignore(key) where ignore(key)=0;
|
||||
drop table data_02021;
|
Loading…
Reference in New Issue
Block a user