summaryrefslogtreecommitdiff
path: root/mysql-test/t/delete.test
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-02-15 18:45:42 -0800
committerunknown <igor@rurik.mysql.com>2005-02-15 18:45:42 -0800
commit3d35d3066d624fb1b07efc33b5a560debc4f3e02 (patch)
tree4ed11dc8b44f901fd0c2f37a9f2e36eb0e7a8a56 /mysql-test/t/delete.test
parent113078d27681c6d42ad212498c5692e7f832d1aa (diff)
downloadmariadb-git-3d35d3066d624fb1b07efc33b5a560debc4f3e02.tar.gz
delete.result, delete.test:
Added a test case for bug #8392. sql_delete.cc: Fixed bug #8392. The bug caused a crash for a delete statement with ORDER BY that explicitly referred to the modified table. sql/sql_delete.cc: Fixed bug #8392. The bug caused a crash for a delete statement with ORDER BY that explicitly referred to the modified table. mysql-test/t/delete.test: Added a test case for bug #8392. mysql-test/r/delete.result: Added a test case for bug #8392.
Diffstat (limited to 'mysql-test/t/delete.test')
-rw-r--r--mysql-test/t/delete.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 07cb9155b3f..5fcdd6263ed 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -71,3 +71,14 @@ select * from t1;
delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a;
select * from t1;
drop table t1;
+
+#
+# Bug #8392: delete with ORDER BY containing a direct reference to the table
+#
+
+CREATE TABLE t1 ( a int PRIMARY KEY );
+DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
+INSERT INTO t1 VALUES (0),(1),(2);
+DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1;
+SELECT * FROM t1;
+DROP TABLE t1;