From fed7ee340b77b8d634ec073b330f4928ccd3486b Mon Sep 17 00:00:00 2001
From: "gkodinov/kgeorge@magare.gmz" <>
Date: Thu, 2 Aug 2007 17:11:35 +0300
Subject: [PATCH] Bug #30193: crash during drop table and kill

When DROP TABLE detects that it has been killed
by another thread it must unlock the table names
it locked.

Fixed by backporting the 5.1 error handling code.
---
 sql/sql_table.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index d83100aa439..e0104f11be5 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -256,8 +256,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
       drop_locked_tables(thd, db, table->table_name);
       if (thd->killed)
       {
-        thd->no_warnings_for_error= 0;
-	DBUG_RETURN(-1);
+        error=-1;
+        goto err_with_placeholders;
       }
       alias= (lower_case_table_names == 2) ? table->alias : table->table_name;
       /* remove form file and isam files */
@@ -338,6 +338,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
     }
   }
 
+err_with_placeholders:
   if (!drop_temporary)
     unlock_table_names(thd, tables, (TABLE_LIST*) 0);
   thd->no_warnings_for_error= 0;
-- 
2.30.9