Designer: their could be an internal relation to delete even if engine is InnoDB
This commit is contained in:
@@ -21,6 +21,8 @@ $type_T1 = strtoupper($tables[$T1]['ENGINE']);
|
|||||||
$tables = PMA_DBI_get_tables_full($db, $T2);
|
$tables = PMA_DBI_get_tables_full($db, $T2);
|
||||||
$type_T2 = strtoupper($tables[$T2]['ENGINE']);
|
$type_T2 = strtoupper($tables[$T2]['ENGINE']);
|
||||||
|
|
||||||
|
$try_to_delete_internal_relation = false;
|
||||||
|
|
||||||
if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) && $type_T1 == $type_T2) {
|
if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) && $type_T1 == $type_T2) {
|
||||||
// InnoDB
|
// InnoDB
|
||||||
$existrel_foreign = PMA_getForeigners($DB2, $T2, '', 'foreign');
|
$existrel_foreign = PMA_getForeigners($DB2, $T2, '', 'foreign');
|
||||||
@@ -30,8 +32,14 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
|
|||||||
. ' DROP FOREIGN KEY '
|
. ' DROP FOREIGN KEY '
|
||||||
. PMA_backquote($existrel_foreign[$F2]['constraint']);
|
. PMA_backquote($existrel_foreign[$F2]['constraint']);
|
||||||
$upd_rs = PMA_DBI_query($upd_query);
|
$upd_rs = PMA_DBI_query($upd_query);
|
||||||
|
} else {
|
||||||
|
// there can be an internal relation even if InnoDB
|
||||||
|
$try_to_delete_internal_relation = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$try_to_delete_internal_relation = true;
|
||||||
|
}
|
||||||
|
if ($try_to_delete_internal_relation) {
|
||||||
// internal relations
|
// internal relations
|
||||||
PMA_query_as_controluser('DELETE FROM '
|
PMA_query_as_controluser('DELETE FROM '
|
||||||
. PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
|
. PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
|
||||||
|
Reference in New Issue
Block a user