[MDEV-25679] Wrong result selecting from simple view with LIMIT and ORDER BY Created: 2021-05-14  Updated: 2021-07-21  Resolved: 2021-07-21

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.2, 10.3
Fix Version/s: 10.2.40, 10.3.31

Type: Bug Priority: Major
Reporter: Igor Babaev Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: None


 Description   

The following test case demonstrate the problem:

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;
select * from v1;

MariaDB [test]> (select a from t1 limit 2) order by a desc;
+------+
| a    |
+------+
|    7 |
|    3 |
+------+
2 rows in set (0.00 sec)
MariaDB [test]> select * from v1;
Empty set (0.00 sec)



 Comments   
Comment by Igor Babaev [ 2021-07-21 ]

A fix for this bug was pushed 10.2. It has to be merged only to 10.3.

Generated at Thu Feb 08 09:39:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.