[MDEV-29554] View created on view with order by does not keep sorting Created: 2022-09-16  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.4, 10.5, 10.6, 10.11

Type: Bug Priority: Major
Reporter: Lena Startseva Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: view-protocol

Issue Links:
PartOf
is part of MDEV-27691 make working view-protocol Open

 Description   

Test:

create table t1 (a int);
insert into t1 values (3), (7), (1), (2), (4);
 
create view v1 as select * from t1 order by a;
create view v11 as select * from v1;
select * from v11;
drop view v1, v11;
drop table t1;

Expected result:

a
1
2
3
4
7

Actual result:

a
3
7
1
2
4

show create view v1;
View	Create View	character_set_client	collation_connection
v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` order by `t1`.`a`	latin1	latin1_swedish_ci
 
show create view v11;
View	Create View	character_set_client	collation_connection
v11	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v11` AS select `v1`.`a` AS `a` from `v1`	latin1	latin1_swedish_ci


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