mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug #26186:
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. mysql-test/r/delete.result: Bug #26186: test case mysql-test/t/delete.test: Bug #26186: test case sql/sql_delete.cc: Bug #26186: do validity check of the ORDER BY before deciding to skip it.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user