mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-7792 - SQL Parsing Error - UNION AND ORDER BY WITH JOIN
ORDER BY against union may confuse name resolution context, causing valid SQL statements to fail. The purpose of context change was presumably intended for the duration of gathering field list for ORDER BY. However it isn't actually required (name resolution context is never accessed by the latter). See also alternative solution (in MySQL 5.7): 92145b95.
This commit is contained in:
@ -643,3 +643,10 @@ CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW
|
||||
SET default_storage_engine = NEW.INNODB;
|
||||
ERROR 42S22: Unknown column 'INNODB' in 'NEW'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-7792 - SQL Parsing Error - UNION AND ORDER BY WITH JOIN
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
SELECT * FROM t1 JOIN ((SELECT 1 AS b) UNION ALL (SELECT 2 AS b) ORDER BY b DESC) s1 WHERE a=1;
|
||||
a b
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user