From e1b22ab9a1f0acfaec4cf3077b94e49fbadf2684 Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Thu, 23 Apr 2009 19:52:39 +0200 Subject: [PATCH] Bug#33146 CHECKSUM TABLE is not interruptable by KILL QUERY statement Commit 55629 applied to 5.0-bugteam and 5.1-bugteam: Check for thd->killed in CHECKSUM loop. --- sql/sql_table.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index eec6ad626f0..08ea093f2c8 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4376,6 +4376,16 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) { for (;;) { + if (thd->killed) + { + /* + we've been killed; let handler clean up, and remove the + partial current row from the recordset (embedded lib) + */ + t->file->ha_rnd_end(); + thd->protocol->remove_last_row(); + goto err; + } ha_checksum row_crc= 0; int error= t->file->rnd_next(t->record[0]); if (unlikely(error))