trap error 1452 when adding a foreign key and the constraint fails

This commit is contained in:
Marc Delisle
2006-10-01 18:09:24 +00:00
parent e22c66d558
commit 04283677f5
2 changed files with 4 additions and 1 deletions

View File

@@ -9,6 +9,8 @@ $Source$
### 2.9.0.1 released from MAINT_2_9_0 ### 2.9.0.1 released from MAINT_2_9_0
* libraries/database_interface.lib.php: bug #1568341, * libraries/database_interface.lib.php: bug #1568341,
case sensitivity in database names case sensitivity in database names
* tbl_relation.php: trap error 1452 when adding a foreign key
and a constraint fails
2006-09-29 Marc Delisle <lem9@users.sourceforge.net> 2006-09-29 Marc Delisle <lem9@users.sourceforge.net>
* libraries/grab_globals.lib.php: fix attack via _FILES, * libraries/grab_globals.lib.php: fix attack via _FILES,

View File

@@ -201,7 +201,8 @@ if (isset($_REQUEST['destination_innodb'])) {
if (isset($upd_query)) { if (isset($upd_query)) {
$upd_rs = PMA_DBI_try_query($upd_query); $upd_rs = PMA_DBI_try_query($upd_query);
$tmp_error = PMA_DBI_getError(); $tmp_error = PMA_DBI_getError();
if (substr($tmp_error, 1, 4) == '1216') { if (substr($tmp_error, 1, 4) == '1216'
|| substr($tmp_error, 1, 4) == '1452') {
PMA_mysqlDie($tmp_error, $upd_query, FALSE, '', FALSE); PMA_mysqlDie($tmp_error, $upd_query, FALSE, '', FALSE);
echo PMA_showMySQLDocu('manual_Table_types', 'InnoDB_foreign_key_constraints') . "\n"; echo PMA_showMySQLDocu('manual_Table_types', 'InnoDB_foreign_key_constraints') . "\n";
} }