From 26de9061e8c4462152b4bcff2b9cbb80cde12de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 23 Jun 2016 07:42:40 +0300 Subject: Merge following commit from 5.5: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit ef92aaf9ece92c873ae0f3448ab2274c958ba3fe Author: Jan Lindström Date: Wed Jun 22 22:37:28 2016 +0300 MDEV-10083: Orphan ibd file when playing with foreign keys Analysis: row_drop_table_for_mysql did not allow dropping referenced table even in case when actual creating of the referenced table was not successfull if foreign_key_checks=1. Fix: Allow dropping referenced table even if foreign_key_checks=1 if actual table create returned error. --- storage/innobase/handler/ha_innodb.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'storage/innobase/handler') diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 06fd6591d89..9d976d685ed 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -10686,7 +10686,8 @@ ha_innobase::delete_table( /* Drop the table in InnoDB */ err = row_drop_table_for_mysql( - norm_name, trx, thd_sql_command(thd) == SQLCOM_DROP_DB); + norm_name, trx, thd_sql_command(thd) == SQLCOM_DROP_DB, + FALSE); if (err == DB_TABLE_NOT_FOUND @@ -10717,7 +10718,8 @@ ha_innobase::delete_table( #endif err = row_drop_table_for_mysql( par_case_name, trx, - thd_sql_command(thd) == SQLCOM_DROP_DB); + thd_sql_command(thd) == SQLCOM_DROP_DB, + FALSE); } } -- cgit v1.2.1