summaryrefslogtreecommitdiff
path: root/mysql-test/t/delete.test
diff options
context:
space:
mode:
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 865e1746fd3..306447dbd5a 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -163,6 +163,17 @@ delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5;
delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5;
drop table t1;
+#
+# Bug#17711: DELETE doesn't use index when ORDER BY, LIMIT and
+# non-restricting WHERE is present.
+#
+create table t1(f1 int primary key);
+insert into t1 values (4),(3),(1),(2);
+delete from t1 where (@a:= f1) order by f1 limit 1;
+select @a;
+drop table t1;
+
+--echo End of 4.1 tests
# End of 4.1 tests
#