1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00
When handling DELETE ... FROM if there is no
condition it is internally transformed to 
TRUNCATE for more efficient execution by the
storage handler.
The check for validity of the optional ORDER BY 
clause is done after the check for the above 
optimization and will not be performed if the
optimization can be applied.
Moved the validity check for ORDER BY before 
the optimization so it performed regardless of
the optimization.
This commit is contained in:
gkodinov/kgeorge@macbook.gmz
2007-02-23 18:49:41 +02:00
parent bcf1596d8b
commit f88aec9e7a
3 changed files with 48 additions and 16 deletions

View File

@@ -214,3 +214,12 @@ select count(*) from t1;
count(*)
0
drop table t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
DELETE FROM t1 ORDER BY x;
ERROR 42S22: Unknown column 'x' in 'order clause'
DELETE FROM t1 ORDER BY t2.x;
ERROR 42S22: Unknown column 't2.x' in 'order clause'
DELETE FROM t1 ORDER BY (SELECT x);
ERROR 42S22: Unknown column 'x' in 'field list'
DROP TABLE t1;