summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/sql_table.cc10
1 files changed, 10 insertions, 0 deletions
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))