mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
fix multiple usages of 'IN' operator with the same set
This commit is contained in:
parent
114f09cfca
commit
19528007fd
@ -409,7 +409,7 @@ bool ExpressionAnalyzer::makeAggregateDescriptions(ExpressionActionsPtr & action
|
|||||||
|
|
||||||
for (size_t i = 0; i < arguments.size(); ++i)
|
for (size_t i = 0; i < arguments.size(); ++i)
|
||||||
{
|
{
|
||||||
getRootActions(arguments[i], true, actions);
|
getRootActionsNoMakeSet(arguments[i], true, actions);
|
||||||
const std::string & name = arguments[i]->getColumnName();
|
const std::string & name = arguments[i]->getColumnName();
|
||||||
types[i] = actions->getSampleBlock().getByName(name).type;
|
types[i] = actions->getSampleBlock().getByName(name).type;
|
||||||
aggregate.argument_names[i] = name;
|
aggregate.argument_names[i] = name;
|
||||||
|
5
tests/queries/0_stateless/01136_multiple_sets.reference
Normal file
5
tests/queries/0_stateless/01136_multiple_sets.reference
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
2
|
||||||
|
2
|
||||||
|
2
|
||||||
|
1
|
||||||
|
1
|
12
tests/queries/0_stateless/01136_multiple_sets.sql
Normal file
12
tests/queries/0_stateless/01136_multiple_sets.sql
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
drop table if exists test;
|
||||||
|
|
||||||
|
create table test (project LowCardinality(String)) engine=MergeTree() order by project;
|
||||||
|
insert into test values ('val1'), ('val2'), ('val3');
|
||||||
|
|
||||||
|
select sum(project in ('val1', 'val2')) from test;
|
||||||
|
set force_primary_key = 1;
|
||||||
|
select sum(project in ('val1', 'val2')) from test where project in ('val1', 'val2');
|
||||||
|
select count() from test where project in ('val1', 'val2');
|
||||||
|
select project in ('val1', 'val2') from test where project in ('val1', 'val2');
|
||||||
|
|
||||||
|
drop table test;
|
Loading…
Reference in New Issue
Block a user