Fix const column in set index.

This commit is contained in:
Amos Bird 2020-11-21 13:30:16 +08:00
parent 6787f98476
commit 6b4512809c
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
3 changed files with 11 additions and 1 deletions

View File

@ -205,7 +205,7 @@ bool Set::insertFromBlock(const Block & block)
{
for (size_t i = 0; i < keys_size; ++i)
{
auto filtered_column = block.getByPosition(i).column->filter(filter->getData(), rows);
auto filtered_column = key_columns[i]->filter(filter->getData(), rows);
if (set_elements[i]->empty())
set_elements[i] = filtered_column;
else

View File

@ -0,0 +1,9 @@
drop table if exists insub;
create table insub (i int, j int) engine MergeTree order by i settings index_granularity = 1;
insert into insub select number a, a + 2 from numbers(10);
SET max_rows_to_read = 2;
select * from insub where i in (select toInt32(3) from numbers(10));
drop table if exists insub;