summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/sql_admin.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 21afa1154f6..3fa00b81f2e 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -499,8 +499,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
DBUG_PRINT("admin", ("table: '%s'.'%s'", table->db, table->table_name));
DEBUG_SYNC(thd, "admin_command_kill_before_modify");
- if (thd->is_killed())
- break;
strxmov(table_name, db, ".", table->table_name, NullS);
thd->open_options|= extra_open_options;
table->lock_type= lock_type;
@@ -515,6 +513,13 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
: lock_type >= TL_WRITE_ALLOW_WRITE
? MDL_SHARED_WRITE : MDL_SHARED_READ);
+ if (thd->check_killed())
+ {
+ fatal_error= true;
+ result_code= HA_ADMIN_FAILED;
+ goto send_result;
+ }
+
/* open only one table from local list of command */
while (1)
{