Commit 7c9d00e0 authored by Sergei Golubchik's avatar Sergei Golubchik

Bug #24595639: INCORRECT BEHAVIOR IN QUERY WITH UNION AND GROUP BY

test case
parent 9b3360ea
......@@ -1978,3 +1978,21 @@ d
2016-06-04 00:00:00
drop table t1;
End of 5.0 tests
create table t1 (a int, b int);
insert into t1 values (1,1),(2,2),(3,3);
create table t2 (c varchar(30), d varchar(30));
insert into t1 values ('1','1'),('2','2'),('4','4');
create table t3 (e int, f int);
insert into t3 values (1,1),(2,2),(31,31),(32,32);
select e,f, (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3;
e f sub
1 1 1
2 2 1
31 31 0
32 32 0
select avg(f), (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3 group by sub;
avg(f) sub
31.5000 0
1.5000 1
drop table t1,t2,t3;
End of 5.5 tests
......@@ -1370,3 +1370,18 @@ order by d;
drop table t1;
--echo End of 5.0 tests
#
# Bug #24595639: INCORRECT BEHAVIOR IN QUERY WITH UNION AND GROUP BY
#
create table t1 (a int, b int);
insert into t1 values (1,1),(2,2),(3,3);
create table t2 (c varchar(30), d varchar(30));
insert into t1 values ('1','1'),('2','2'),('4','4');
create table t3 (e int, f int);
insert into t3 values (1,1),(2,2),(31,31),(32,32);
select e,f, (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3;
select avg(f), (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3 group by sub;
drop table t1,t2,t3;
--echo End of 5.5 tests
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment