Loading mysql-test/r/delete.result +11 −0 Original line number Diff line number Diff line Loading @@ -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; mysql-test/t/delete.test +10 −0 Original line number Diff line number Diff line Loading @@ -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; sql/records.cc +18 −9 Original line number Diff line number Diff line Loading @@ -131,8 +131,15 @@ void end_read_record(READ_RECORD *info) static int rr_quick(READ_RECORD *info) { int tmp=info->select->quick->get_next(); if (tmp) int tmp; while ((tmp= info->select->quick->get_next())) { if (info->thd->killed) { my_error(ER_SERVER_SHUTDOWN, MYF(0)); return 1; } if (tmp != HA_ERR_RECORD_DELETED) { if (tmp == HA_ERR_END_OF_FILE) tmp= -1; Loading @@ -143,6 +150,8 @@ static int rr_quick(READ_RECORD *info) if (tmp < 0) // Fix negative BDB errno tmp=1; } break; } } return tmp; } Loading Loading
mysql-test/r/delete.result +11 −0 Original line number Diff line number Diff line Loading @@ -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;
mysql-test/t/delete.test +10 −0 Original line number Diff line number Diff line Loading @@ -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;
sql/records.cc +18 −9 Original line number Diff line number Diff line Loading @@ -131,8 +131,15 @@ void end_read_record(READ_RECORD *info) static int rr_quick(READ_RECORD *info) { int tmp=info->select->quick->get_next(); if (tmp) int tmp; while ((tmp= info->select->quick->get_next())) { if (info->thd->killed) { my_error(ER_SERVER_SHUTDOWN, MYF(0)); return 1; } if (tmp != HA_ERR_RECORD_DELETED) { if (tmp == HA_ERR_END_OF_FILE) tmp= -1; Loading @@ -143,6 +150,8 @@ static int rr_quick(READ_RECORD *info) if (tmp < 0) // Fix negative BDB errno tmp=1; } break; } } return tmp; } Loading