mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 10:31:57 +00:00
Merge pull request #23763 from amosbird/rowfilterfix
Fix crash when prewhere and row policy filter are both in effect with empty result
This commit is contained in:
commit
4bb56849b3
@ -941,7 +941,10 @@ void MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(ReadResult & r
|
|||||||
|
|
||||||
auto columns = block.getColumns();
|
auto columns = block.getColumns();
|
||||||
filterColumns(columns, row_level_filter);
|
filterColumns(columns, row_level_filter);
|
||||||
block.setColumns(columns);
|
if (columns.empty())
|
||||||
|
block = block.cloneEmpty();
|
||||||
|
else
|
||||||
|
block.setColumns(columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
prewhere_info->prewhere_actions->execute(block);
|
prewhere_info->prewhere_actions->execute(block);
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
drop table if exists tbl;
|
||||||
|
create table tbl (s String, i int) engine MergeTree order by i;
|
||||||
|
|
||||||
|
insert into tbl values ('123', 123);
|
||||||
|
|
||||||
|
drop row policy if exists filter on tbl;
|
||||||
|
create row policy filter on tbl using (s = 'non_existing_domain') to all;
|
||||||
|
|
||||||
|
select * from tbl prewhere s = '123' where i = 123;
|
||||||
|
|
||||||
|
drop row policy filter on tbl;
|
||||||
|
drop table tbl;
|
Loading…
Reference in New Issue
Block a user