1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-10232: Scalar result of subquery changes after adding an outer select stmt

In a subquery, we don't have to maintain order
Added a fix such that order is considered when there is a limit clause.
This commit is contained in:
Varun Gupta
2017-01-21 00:56:33 +05:30
parent 8a4d605500
commit 213fc700b6
3 changed files with 25 additions and 2 deletions

View File

@ -2442,3 +2442,15 @@ i
drop table t1, t2, t3;
SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size;
#
# MDEV-10232 Scalar result of subquery changes after adding an outer select stmt
#
create table t1(c1 int, c2 int, primary key(c2));
insert into t1 values(2,1),(1,2);
select (select c1 from t1 group by c1,c2 order by c1 limit 1) as x;
x
1
(select c1 from t1 group by c1,c2 order by c1 limit 1);
c1
1
drop table t1;