summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/delete.result11
-rw-r--r--mysql-test/t/delete.test10
2 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index abc8245e69f..7353e687ae7 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -50,3 +50,14 @@ select count(*) from t1;
count(*)
0
drop table t1;
+create table t1 (a int not null auto_increment primary key, b char(32));
+insert into t1 (b) values ('apple'), ('apple');
+select * from t1;
+a b
+1 apple
+2 apple
+delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a;
+select * from t1;
+a b
+1 apple
+drop table t1;
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 904d959d148..07cb9155b3f 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -61,3 +61,13 @@ select count(*) from t1;
drop table t1;
+#
+# Bug #5733: Table handler error with self-join multi-table DELETE
+#
+
+create table t1 (a int not null auto_increment primary key, b char(32));
+insert into t1 (b) values ('apple'), ('apple');
+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;