synchronize did not work when tracking was enabled

This commit is contained in:
Marc Delisle
2009-10-18 12:32:30 +00:00
parent 27e13bfb1e
commit 40f66a3422
2 changed files with 13 additions and 0 deletions

View File

@@ -858,6 +858,11 @@ class PMA_Tracker
// Get database name // Get database name
$dbname = trim($GLOBALS['db'], '`'); $dbname = trim($GLOBALS['db'], '`');
// $dbname can be empty, for example when coming from Synchronize
// and this is a query for the remote server
if (empty($dbname)) {
return false;
}
// If we found a valid statement // If we found a valid statement
if(isset($result['identifier'])) if(isset($result['identifier']))

View File

@@ -551,6 +551,9 @@ if (isset($_REQUEST['Table_ids'])) {
${"{$con}_link"} = PMA_DBI_connect(${"{$con}_username"}, ${"{$con}_password"}, $is_controluser = false, ${"{$con}_server"}); ${"{$con}_link"} = PMA_DBI_connect(${"{$con}_username"}, ${"{$con}_password"}, $is_controluser = false, ${"{$con}_server"});
} else { } else {
${"{$con}_link"} = null; ${"{$con}_link"} = null;
// working on current server, so initialize this for tracking
// (does not work if user defined current server as a remote one)
$GLOBALS['db'] = ${"{$con}_db"};
} }
} // end foreach ($cons as $con) } // end foreach ($cons as $con)
@@ -1094,11 +1097,16 @@ if (isset($_REQUEST['synchronize_db'])) {
$src_link = PMA_DBI_connect($src_username, $src_password, $is_controluser = false, $_SESSION['src_server']); $src_link = PMA_DBI_connect($src_username, $src_password, $is_controluser = false, $_SESSION['src_server']);
} else { } else {
$src_link = $GLOBALS['userlink']; $src_link = $GLOBALS['userlink'];
// working on current server, so initialize this for tracking
// (does not work if user defined current server as a remote one)
$GLOBALS['db'] = $_SESSION['src_db'];
} }
if ('rmt' == $_SESSION['trg_type']) { if ('rmt' == $_SESSION['trg_type']) {
$trg_link = PMA_DBI_connect($trg_username, $trg_password, $is_controluser = false, $_SESSION['trg_server']); $trg_link = PMA_DBI_connect($trg_username, $trg_password, $is_controluser = false, $_SESSION['trg_server']);
} else { } else {
$trg_link = $GLOBALS['userlink']; $trg_link = $GLOBALS['userlink'];
// working on current server, so initialize this for tracking
$GLOBALS['db'] = $_SESSION['trg_db'];
} }
/** /**