diff options
author | unknown <heikki@hundin.mysql.fi> | 2004-02-02 00:10:45 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2004-02-02 00:10:45 +0200 |
commit | 08177508f5db7c003ebbe1fe16e17dd02fff49b0 (patch) | |
tree | c00e983defe37f950e64718fcfe3a3ca0daabadc /sql/ha_innodb.cc | |
parent | 7eefcb75db0707dbc8044808390f047b60484454 (diff) | |
download | mariadb-git-08177508f5db7c003ebbe1fe16e17dd02fff49b0.tar.gz |
dict0dict.c:
Remove redundant code; parse both the database name and the table name in a FOREIGN KEY constraint with quotes in mind
row0mysql.c, ha_innodb.cc, sql_table.cc:
Return error message Cannot delete or update a parent row... if we try to drop a table which is referenced by a FOREIGN KEY constraint, and the user has not set foreign_key_checks=0
sql/sql_table.cc:
Return error message Cannot delete or update a parent row... if we try to drop a table which is referenced by a FOREIGN KEY constraint, and the user has not set foreign_key_checks=0
sql/ha_innodb.cc:
Return error message Cannot delete or update a parent row... if we try to drop a table which is referenced by a FOREIGN KEY constraint, and the user has not set foreign_key_checks=0
innobase/row/row0mysql.c:
Return error message Cannot delete or update a parent row... if we try to drop a table which is referenced by a FOREIGN KEY constraint, and the user has not set foreign_key_checks=0
innobase/dict/dict0dict.c:
Remove redundant code; parse both the database name and the table name in a FOREIGN KEY constraint with quotes in mind
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r-- | sql/ha_innodb.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index bcd1130dcdb..68052014f57 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -276,7 +276,7 @@ convert_error_code_to_mysql( } else if (error == (int) DB_CANNOT_DROP_CONSTRAINT) { - return(HA_WRONG_CREATE_OPTION); + return(HA_ERR_ROW_IS_REFERENCED); } else if (error == (int) DB_COL_APPEARS_TWICE_IN_INDEX) { @@ -3572,6 +3572,7 @@ ha_innobase::delete_table( int error; trx_t* parent_trx; trx_t* trx; + THD *thd= current_thd; char norm_name[1000]; DBUG_ENTER("ha_innobase::delete_table"); @@ -3597,6 +3598,14 @@ ha_innobase::delete_table( trx->mysql_thd = current_thd; trx->mysql_query_str = &((*current_thd).query); + if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) { + trx->check_foreigns = FALSE; + } + + if (thd->options & OPTION_RELAXED_UNIQUE_CHECKS) { + trx->check_unique_secondary = FALSE; + } + name_len = strlen(name); assert(name_len < 1000); |