Skip to content
Browse files

Do not try to delete an internal relation if we just deleted an InnoD…

…B one
  • Loading branch information...
1 parent f3f8f15 commit 9949e5c0b73fcabdb13641fa75643f79a882f64d @lem9 lem9 committed Jul 11, 2007
Showing with 6 additions and 10 deletions.
  1. +1 −0 ChangeLog
  2. +5 −10 pmd_relation_upd.php
View
1 ChangeLog
@@ -91,6 +91,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- bug #1748633 Incorrect parameter validation for VIEWs
+ [lang] Russian revision, thanks to Victor Volkov and the users of
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)
View
15 pmd_relation_upd.php
@@ -18,15 +18,13 @@
list($DB1,$T1) = explode(".",$T1);
list($DB2,$T2) = explode(".",$T2);
-//++++++++++++++++++++++++++++++++++++++++++++++++++++ InnoDB ++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-
$tables = PMA_DBI_get_tables_full($db, $T1);
$type_T1 = strtoupper($tables[$T1]['ENGINE']);
$tables = PMA_DBI_get_tables_full($db, $T2);
$type_T2 = strtoupper($tables[$T2]['ENGINE']);
if ($type_T1 == 'INNODB' && $type_T2 == 'INNODB') {
+ // InnoDB
$existrel_innodb = PMA_getForeigners($DB2, $T2, '', 'innodb');
if (PMA_MYSQL_INT_VERSION >= 40013 && isset($existrel_innodb[$F2]['constraint'])) {
@@ -35,19 +33,17 @@
. PMA_backquote($existrel_innodb[$F2]['constraint']);
$upd_rs = PMA_DBI_query($upd_query);
}
-}
-//---------------------------------------------------------------------------------------------------
-
-
-PMA_query_as_cu('DELETE FROM '.$cfg['Server']['relation'].' WHERE '
+} else {
+ // internal relations
+ PMA_query_as_cu('DELETE FROM '.$cfg['Server']['relation'].' WHERE '
. 'master_db = \'' . PMA_sqlAddslashes($DB2) . '\''
. 'AND master_table = \'' . PMA_sqlAddslashes($T2) . '\''
. 'AND master_field = \'' . PMA_sqlAddslashes($F2) . '\''
. 'AND foreign_db = \'' . PMA_sqlAddslashes($DB1) . '\''
. 'AND foreign_table = \'' . PMA_sqlAddslashes($T1) . '\''
. 'AND foreign_field = \'' . PMA_sqlAddslashes($F1) . '\''
, FALSE, PMA_DBI_QUERY_STORE);
-
+}
PMD_return(1, 'strRelationDeleted');
function PMD_return($b,$ret)
@@ -58,4 +54,3 @@ function PMD_return($b,$ret)
die('<root act="relation_upd" return="'.$ret.'" b="'.$b.'" K="'.$K.'"></root>');
}
?>
-

0 comments on commit 9949e5c

Please sign in to comment.
Something went wrong with that request. Please try again.