summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authormarko@hundin.mysql.fi <>2004-04-02 16:25:48 +0300
committermarko@hundin.mysql.fi <>2004-04-02 16:25:48 +0300
commit23a5fc55588a2acea2d529ae4d7c8696c6f8522c (patch)
tree751da20f73c4984ede631acbed2ecfa9bcfe50f6 /sql
parent0219adc00b4eef180c0bf00ed7a32567e722231f (diff)
downloadmariadb-git-23a5fc55588a2acea2d529ae4d7c8696c6f8522c.tar.gz
InnoDB: ignore intra-database foreign key references between tables
when dropping database (Bug #3058)
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innodb.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index b0de417eb2f..5a929237e3b 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -3631,7 +3631,8 @@ ha_innobase::delete_table(
/* Drop the table in InnoDB */
- error = row_drop_table_for_mysql(norm_name, trx);
+ error = row_drop_table_for_mysql(norm_name, trx,
+ thd->lex.sql_command == SQLCOM_DROP_DB);
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
@@ -3670,7 +3671,7 @@ innobase_drop_database(
trx_t* trx;
char* ptr;
int error;
- char namebuf[10000];
+ char* namebuf;
/* Get the transaction associated with the current thd, or create one
if not yet created */
@@ -3690,6 +3691,7 @@ innobase_drop_database(
}
ptr++;
+ namebuf = my_malloc(len + 2, MYF(0));
memcpy(namebuf, ptr, len);
namebuf[len] = '/';
@@ -3706,6 +3708,7 @@ innobase_drop_database(
}
error = row_drop_database_for_mysql(namebuf, trx);
+ my_free(namebuf, MYF(0));
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs