1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-25679 Wrong result selecting from simple view with LIMIT and ORDER BY

Cherry-picking only test case.
This commit is contained in:
Igor Babaev
2021-06-22 12:23:13 -07:00
parent ce868cd89e
commit 7f24e37fbe
2 changed files with 38 additions and 0 deletions

View File

@ -3480,3 +3480,24 @@ Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,3 AS `d`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`c` AS `c` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`a` = 3 and `test`.`t1`.`pk` <= 2
drop view v1;
drop table t1,t2,t3;
#
# MDEV-25679: view / derived table defined as ordered select with LIMIT
#
create table t1 (a int);
insert into t1 values (3), (7), (1);
create view v1 as (select a from t1 limit 2) order by a desc;
(select a from t1 limit 2) order by a desc;
a
7
3
select * from v1;
a
7
3
select * from ((select a from t1 limit 2) order by a desc) dt;
a
3
7
drop view v1;
drop table t1;
# End of 10.2 tests