[MDEV-8621] MySQL and MariaDB results on derived_table are not the same Created: 2015-08-14  Updated: 2015-08-18  Resolved: 2015-08-18

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.0.14, 10.0.21
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Gabor Aron Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Linux



 Description   

CREATE DATABASE `derived_issue`;
 
CREATE TABLE `derived_issue`.`test` (
  `num` int(11) NOT NULL
);
 
INSERT INTO `derived_issue`.`test` (num)
VALUES (12345),(1),(1234),(12),(123),(123456);
 
SELECT * 
FROM (
	SELECT num 
	FROM `derived_issue`.`test`
	ORDER BY num DESC
) derived_table;

on MariaDB the derived_table result

12345
1
1234
12
123
123456

on MySQL the results is what is expected

123456
12345
1234
123
12
1

not matter what engine or version you use the MariaDB give wrong order



 Comments   
Comment by Gabor Aron [ 2015-08-15 ]

Close this ticket i found the answer

https://mariadb.com/kb/en/mariadb/why-is-order-by-in-a-from-subquery-ignored/

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