diff options
author | Tatiana A. Nurnberg <azundris@mysql.com> | 2009-10-20 11:00:07 -0700 |
---|---|---|
committer | Tatiana A. Nurnberg <azundris@mysql.com> | 2009-10-20 11:00:07 -0700 |
commit | cf7e2e1db4e8e0a73196e2fc9174d8398e2cf476 (patch) | |
tree | b5d1038169ce7dc60fcd39fa7500908a66394ef9 /sql/records.cc | |
parent | 2490873f3ca2bfff63de6d1b72c1d18e742fdb68 (diff) | |
parent | 3f42e4bd24fc68180b51450a4a900cef3554a8b4 (diff) | |
download | mariadb-git-cf7e2e1db4e8e0a73196e2fc9174d8398e2cf476.tar.gz |
manual merge of 28141
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 9e040de3fda..398dad42c4f 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -57,6 +57,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]; @@ -292,6 +293,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 @@ -312,12 +319,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; @@ -380,16 +382,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; |