Do not try to delete an internal relation if we just deleted an InnoDB one
This commit is contained in:
@@ -18,6 +18,7 @@ $HeadURL$
|
|||||||
- bug #1748633 Incorrect parameter validation for VIEWs
|
- bug #1748633 Incorrect parameter validation for VIEWs
|
||||||
+ [lang] Russian revision, thanks to Victor Volkov and the users of
|
+ [lang] Russian revision, thanks to Victor Volkov and the users of
|
||||||
php-myadmin.ru
|
php-myadmin.ru
|
||||||
|
- Do not try to delete an internal relation if we just deleted an InnoDB one
|
||||||
|
|
||||||
2.10.2.0 (2007-06-15)
|
2.10.2.0 (2007-06-15)
|
||||||
|
|
||||||
|
@@ -11,15 +11,13 @@ include_once 'pmd_save_pos.php';
|
|||||||
list($DB1,$T1) = explode(".",$T1);
|
list($DB1,$T1) = explode(".",$T1);
|
||||||
list($DB2,$T2) = explode(".",$T2);
|
list($DB2,$T2) = explode(".",$T2);
|
||||||
|
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++ InnoDB ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
|
|
||||||
$tables = PMA_DBI_get_tables_full($db, $T1);
|
$tables = PMA_DBI_get_tables_full($db, $T1);
|
||||||
$type_T1 = strtoupper($tables[$T1]['ENGINE']);
|
$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']);
|
||||||
|
|
||||||
if ($type_T1 == 'INNODB' && $type_T2 == 'INNODB') {
|
if ($type_T1 == 'INNODB' && $type_T2 == 'INNODB') {
|
||||||
|
// InnoDB
|
||||||
$existrel_innodb = PMA_getForeigners($DB2, $T2, '', 'innodb');
|
$existrel_innodb = PMA_getForeigners($DB2, $T2, '', 'innodb');
|
||||||
|
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40013 && isset($existrel_innodb[$F2]['constraint'])) {
|
if (PMA_MYSQL_INT_VERSION >= 40013 && isset($existrel_innodb[$F2]['constraint'])) {
|
||||||
@@ -28,11 +26,8 @@ if ($type_T1 == 'INNODB' && $type_T2 == 'INNODB') {
|
|||||||
. PMA_backquote($existrel_innodb[$F2]['constraint']);
|
. PMA_backquote($existrel_innodb[$F2]['constraint']);
|
||||||
$upd_rs = PMA_DBI_query($upd_query);
|
$upd_rs = PMA_DBI_query($upd_query);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
//---------------------------------------------------------------------------------------------------
|
PMA_query_as_cu('DELETE FROM '.$cfg['Server']['relation'].' WHERE '
|
||||||
|
|
||||||
|
|
||||||
PMA_query_as_cu('DELETE FROM '.$cfg['Server']['relation'].' WHERE '
|
|
||||||
. 'master_db = \'' . PMA_sqlAddslashes($DB2) . '\''
|
. 'master_db = \'' . PMA_sqlAddslashes($DB2) . '\''
|
||||||
. 'AND master_table = \'' . PMA_sqlAddslashes($T2) . '\''
|
. 'AND master_table = \'' . PMA_sqlAddslashes($T2) . '\''
|
||||||
. 'AND master_field = \'' . PMA_sqlAddslashes($F2) . '\''
|
. 'AND master_field = \'' . PMA_sqlAddslashes($F2) . '\''
|
||||||
@@ -40,7 +35,7 @@ PMA_query_as_cu('DELETE FROM '.$cfg['Server']['relation'].' WHERE '
|
|||||||
. 'AND foreign_table = \'' . PMA_sqlAddslashes($T1) . '\''
|
. 'AND foreign_table = \'' . PMA_sqlAddslashes($T1) . '\''
|
||||||
. 'AND foreign_field = \'' . PMA_sqlAddslashes($F1) . '\''
|
. 'AND foreign_field = \'' . PMA_sqlAddslashes($F1) . '\''
|
||||||
, FALSE, PMA_DBI_QUERY_STORE);
|
, FALSE, PMA_DBI_QUERY_STORE);
|
||||||
|
}
|
||||||
PMD_return(1, 'strRelationDeleted');
|
PMD_return(1, 'strRelationDeleted');
|
||||||
|
|
||||||
function PMD_return($b,$ret)
|
function PMD_return($b,$ret)
|
||||||
|
Reference in New Issue
Block a user