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

This commit is contained in:
Marc Delisle
2006-10-01 18:11:44 +00:00
parent 1d27b1087f
commit 1060b0fa14
2 changed files with 7 additions and 1 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - ChangeLog
$Id$ $Id$
$Source$ $Source$
2006-10-01 Marc Delisle <lem9@users.sourceforge.net>
### 2.9.0.1 released from MAINT_2_9_0
* 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/database_interface.lib.php, bug #1566904, typo in require, * libraries/database_interface.lib.php, bug #1566904, typo in require,
thanks to Björn Wiberg - bwiberg. thanks to Björn Wiberg - bwiberg.

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";
} }