[MDEV-7411] order by in subselect not performed Created: 2015-01-05  Updated: 2015-01-06  Resolved: 2015-01-06

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.0.15
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Robert Hofer Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

ubuntu 14.04.1 LTS



 Description   

following statement represents a simplified query; I simulate a 3-row table with a union statement.
order by in the inner subselect does not affect the order of the outer select
in mysql it does.
statement:
SELECT * FROM (SELECT * FROM (SELECT 'a' UNION SELECT 'b' UNION SELECT 'c' )t order BY a desc)t
result: a,b,c
in Mysql: c,b,a (correct)



 Comments   
Comment by Elena Stepanova [ 2015-01-06 ]

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

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