mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge 10.4 into 10.5
This commit is contained in:
@ -2479,6 +2479,80 @@ eval $q3;
|
||||
|
||||
drop table t1,t2,t3;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29139: Redundant IN/ALL/ANY predicand in GROUP BY clause of
|
||||
--echo # IN/ALL/ANY/EXISTS subquery
|
||||
--echo #
|
||||
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
create table t3 (c int);
|
||||
create table t4 (d int);
|
||||
|
||||
insert into t1 values (3), (1);
|
||||
insert into t2 values (3), (2);
|
||||
insert into t3 values (4), (2);
|
||||
insert into t4 values (1), (7);
|
||||
|
||||
let $q1=
|
||||
select b from t2
|
||||
where exists (select c from t3
|
||||
group by (select a from t1 where a = 1) in (select d from t4));
|
||||
|
||||
eval explain extended $q1;
|
||||
eval $q1;
|
||||
|
||||
eval prepare stmt from "$q1";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
let $q2=
|
||||
select b from t2
|
||||
where exists (select c from t3
|
||||
group by (select a from t1 where a = 1) >=
|
||||
any (select d from t4));
|
||||
|
||||
eval explain extended $q2;
|
||||
eval $q2;
|
||||
|
||||
let $q3=
|
||||
select b from t2
|
||||
where exists (select c from t3
|
||||
group by (select a from t1 where a = 1) <
|
||||
all (select d from t4));
|
||||
|
||||
eval explain extended $q3;
|
||||
eval $q3;
|
||||
|
||||
let $q4=
|
||||
select b from t2
|
||||
where b in (select c from t3
|
||||
group by (select a from t1 where a = 1) in (select d from t4));
|
||||
|
||||
eval explain extended $q4;
|
||||
eval $q4;
|
||||
|
||||
let $q5=
|
||||
select b from t2
|
||||
where b >= any (select c from t3
|
||||
group by (select a from t1 where a = 1) in
|
||||
(select d from t4));
|
||||
|
||||
eval explain extended $q5;
|
||||
eval $q5;
|
||||
|
||||
let $q6=
|
||||
select b from t2
|
||||
where b <= all (select c from t3
|
||||
group by (select a from t1 where a = 1) in
|
||||
(select d from t4));
|
||||
|
||||
eval explain extended $q6;
|
||||
eval $q6;
|
||||
|
||||
drop table t1,t2,t3,t4;
|
||||
|
||||
--echo # End of 10.3 tests
|
||||
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user