Do not use same function name in two contexts.

This commit is contained in:
Michal Čihař
2008-11-24 10:10:36 +00:00
parent 741fdb5061
commit c892873ae3
2 changed files with 11 additions and 11 deletions

View File

@@ -28,7 +28,7 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
$existrel_foreign = PMA_getForeigners($db, $T2, '', 'foreign');
if (isset($existrel_foreign[$F2])
&& 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
// or UNIQUE key
@@ -60,14 +60,14 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
if ($on_update != 'nix') {
$upd_query .= ' ON UPDATE ' . $on_update;
}
PMA_DBI_try_query($upd_query) or PMD_return(0,'strErrorRelationAdded');
PMD_return(1,'strForeignKeyRelationAdded');
PMA_DBI_try_query($upd_query) or PMD_return_new(0,'strErrorRelationAdded');
PMD_return_new(1,'strForeignKeyRelationAdded');
}
// internal (pmadb) relation
// internal (pmadb) relation
} else {
if ($GLOBALS['cfgRelation']['relwork'] == false) {
PMD_return(0, 'strGeneralRelationFeat:strDisabled');
PMD_return_new(0, 'strGeneralRelationFeat:strDisabled');
} else {
// no need to recheck if the keys are primary or unique at this point,
// 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) . '\')';
if (PMA_query_as_cu($q , false, PMA_DBI_QUERY_STORE)) {
PMD_return(1, 'strInternalRelationAdded');
PMD_return_new(1, 'strInternalRelationAdded');
} 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;
header("Content-Type: text/xml; charset=utf-8");//utf-8 .$_GLOBALS['charset']

View File

@@ -35,7 +35,7 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
}
} else {
// internal relations
PMA_query_as_cu('DELETE FROM '
PMA_query_as_cu('DELETE FROM '
. PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
. $cfg['Server']['relation'].' WHERE '
. '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) . '\''
, 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;
header("Content-Type: text/xml; charset=utf-8");