diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-11-06 17:20:27 +0300 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-11-06 17:20:27 +0300 |
commit | 2ca5b2c7916fe5312617aa992d5292e724af75f0 (patch) | |
tree | 3fcae3d99a56ba99d825ae4457901d49e4b474e3 /sql/records.cc | |
parent | 7a90f041cc3b6db8600e9469cab6d436653552ec (diff) | |
parent | 26fc5583196f7b88256cb733be033757a0517266 (diff) | |
download | mariadb-git-2ca5b2c7916fe5312617aa992d5292e724af75f0.tar.gz |
Manual merge from mysql-trunk-merge.
Diffstat (limited to 'sql/records.cc')
-rw-r--r-- | sql/records.cc | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/sql/records.cc b/sql/records.cc index 9b5ea40478e..93b19aefbaf 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -62,6 +62,7 @@ void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table, { empty_record(table); bzero((char*) info,sizeof(*info)); + info->thd= thd; info->table= table; info->file= table->file; info->record= table->record[0]; @@ -297,6 +298,12 @@ void end_read_record(READ_RECORD *info) static int rr_handle_error(READ_RECORD *info, int error) { + if (info->thd->killed) + { + info->thd->send_kill_message(); + return 1; + } + if (error == HA_ERR_END_OF_FILE) error= -1; else @@ -317,12 +324,7 @@ static int rr_quick(READ_RECORD *info) 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 (info->thd->killed || (tmp != HA_ERR_RECORD_DELETED)) { tmp= rr_handle_error(info, tmp); break; @@ -385,16 +387,11 @@ int rr_sequential(READ_RECORD *info) int tmp; while ((tmp=info->file->rnd_next(info->record))) { - if (info->thd->killed) - { - info->thd->send_kill_message(); - return 1; - } /* rnd_next can return RECORD_DELETED for MyISAM when one thread is reading and another deleting without locks. */ - if (tmp != HA_ERR_RECORD_DELETED) + if (info->thd->killed || (tmp != HA_ERR_RECORD_DELETED)) { tmp= rr_handle_error(info, tmp); break; |