From dc3f3ce69430ed1608c0134da7a7e95f527c3d7c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 16:23:54 +0500 Subject: delete.result, delete.test: A fix (bug #5733: Table handler error with self-join multi-table DELETE). records.cc: A fix (bug #5733: Table handler error with self-join multi-table DELETE). sql/records.cc: ]A fix (bug #5733: Table handler error with self-join multi-table DELETE). mysql-test/t/delete.test: A fix (bug #5733: Table handler error with self-join multi-table DELETE). mysql-test/r/delete.result: A fix (bug #5733: Table handler error with self-join multi-table DELETE). --- sql/records.cc | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'sql') diff --git a/sql/records.cc b/sql/records.cc index 415e75a467b..02ae2e06141 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -131,17 +131,26 @@ 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 (tmp == HA_ERR_END_OF_FILE) - tmp= -1; - else + if (info->thd->killed) { - if (info->print_error) - info->file->print_error(tmp,MYF(0)); - if (tmp < 0) // Fix negative BDB errno - tmp=1; + my_error(ER_SERVER_SHUTDOWN, MYF(0)); + return 1; + } + if (tmp != HA_ERR_RECORD_DELETED) + { + if (tmp == HA_ERR_END_OF_FILE) + tmp= -1; + else + { + if (info->print_error) + info->file->print_error(tmp,MYF(0)); + if (tmp < 0) // Fix negative BDB errno + tmp=1; + } + break; } } return tmp; -- cgit v1.2.1