Do not use same function name in two contexts.
This commit is contained in:
@@ -28,7 +28,7 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
|
|||||||
$existrel_foreign = PMA_getForeigners($db, $T2, '', 'foreign');
|
$existrel_foreign = PMA_getForeigners($db, $T2, '', 'foreign');
|
||||||
if (isset($existrel_foreign[$F2])
|
if (isset($existrel_foreign[$F2])
|
||||||
&& isset($existrel_foreign[$F2]['constraint'])) {
|
&& isset($existrel_foreign[$F2]['constraint'])) {
|
||||||
PMD_return(0,'strErrorRelationExists');
|
PMD_return_new(0,'strErrorRelationExists');
|
||||||
}
|
}
|
||||||
// note: in InnoDB, the index does not requires to be on a PRIMARY
|
// note: in InnoDB, the index does not requires to be on a PRIMARY
|
||||||
// or UNIQUE key
|
// or UNIQUE key
|
||||||
@@ -60,14 +60,14 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
|
|||||||
if ($on_update != 'nix') {
|
if ($on_update != 'nix') {
|
||||||
$upd_query .= ' ON UPDATE ' . $on_update;
|
$upd_query .= ' ON UPDATE ' . $on_update;
|
||||||
}
|
}
|
||||||
PMA_DBI_try_query($upd_query) or PMD_return(0,'strErrorRelationAdded');
|
PMA_DBI_try_query($upd_query) or PMD_return_new(0,'strErrorRelationAdded');
|
||||||
PMD_return(1,'strForeignKeyRelationAdded');
|
PMD_return_new(1,'strForeignKeyRelationAdded');
|
||||||
}
|
}
|
||||||
|
|
||||||
// internal (pmadb) relation
|
// internal (pmadb) relation
|
||||||
} else {
|
} else {
|
||||||
if ($GLOBALS['cfgRelation']['relwork'] == false) {
|
if ($GLOBALS['cfgRelation']['relwork'] == false) {
|
||||||
PMD_return(0, 'strGeneralRelationFeat:strDisabled');
|
PMD_return_new(0, 'strGeneralRelationFeat:strDisabled');
|
||||||
} else {
|
} else {
|
||||||
// no need to recheck if the keys are primary or unique at this point,
|
// no need to recheck if the keys are primary or unique at this point,
|
||||||
// this was checked on the interface part
|
// this was checked on the interface part
|
||||||
@@ -83,14 +83,14 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
|
|||||||
. '\'' . PMA_sqlAddslashes($F1) . '\')';
|
. '\'' . PMA_sqlAddslashes($F1) . '\')';
|
||||||
|
|
||||||
if (PMA_query_as_cu($q , false, PMA_DBI_QUERY_STORE)) {
|
if (PMA_query_as_cu($q , false, PMA_DBI_QUERY_STORE)) {
|
||||||
PMD_return(1, 'strInternalRelationAdded');
|
PMD_return_new(1, 'strInternalRelationAdded');
|
||||||
} else {
|
} else {
|
||||||
PMD_return(0, 'strErrorRelationAdded');
|
PMD_return_new(0, 'strErrorRelationAdded');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMD_return($b,$ret)
|
function PMD_return_new($b,$ret)
|
||||||
{
|
{
|
||||||
global $db,$T1,$F1,$T2,$F2;
|
global $db,$T1,$F1,$T2,$F2;
|
||||||
header("Content-Type: text/xml; charset=utf-8");//utf-8 .$_GLOBALS['charset']
|
header("Content-Type: text/xml; charset=utf-8");//utf-8 .$_GLOBALS['charset']
|
||||||
|
@@ -35,7 +35,7 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// internal relations
|
// internal relations
|
||||||
PMA_query_as_cu('DELETE FROM '
|
PMA_query_as_cu('DELETE FROM '
|
||||||
. PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
|
. PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
|
||||||
. $cfg['Server']['relation'].' WHERE '
|
. $cfg['Server']['relation'].' WHERE '
|
||||||
. 'master_db = \'' . PMA_sqlAddslashes($DB2) . '\''
|
. 'master_db = \'' . PMA_sqlAddslashes($DB2) . '\''
|
||||||
@@ -46,9 +46,9 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
|
|||||||
. ' 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_upd(1, 'strRelationDeleted');
|
||||||
|
|
||||||
function PMD_return($b,$ret)
|
function PMD_return_upd($b,$ret)
|
||||||
{
|
{
|
||||||
global $K;
|
global $K;
|
||||||
header("Content-Type: text/xml; charset=utf-8");
|
header("Content-Type: text/xml; charset=utf-8");
|
||||||
|
Reference in New Issue
Block a user