From 40f66a3422c20ba82357d67d725e7e4ecff82026 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 18 Oct 2009 12:32:30 +0000 Subject: [PATCH] synchronize did not work when tracking was enabled --- libraries/Tracker.class.php | 5 +++++ server_synchronize.php | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/libraries/Tracker.class.php b/libraries/Tracker.class.php index 735653a77..44c7c7d31 100644 --- a/libraries/Tracker.class.php +++ b/libraries/Tracker.class.php @@ -858,6 +858,11 @@ class PMA_Tracker // Get database name $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(isset($result['identifier'])) diff --git a/server_synchronize.php b/server_synchronize.php index 3dfa9413b..6e873c34a 100644 --- a/server_synchronize.php +++ b/server_synchronize.php @@ -551,6 +551,9 @@ if (isset($_REQUEST['Table_ids'])) { ${"{$con}_link"} = PMA_DBI_connect(${"{$con}_username"}, ${"{$con}_password"}, $is_controluser = false, ${"{$con}_server"}); } else { ${"{$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) @@ -1094,11 +1097,16 @@ if (isset($_REQUEST['synchronize_db'])) { $src_link = PMA_DBI_connect($src_username, $src_password, $is_controluser = false, $_SESSION['src_server']); } else { $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']) { $trg_link = PMA_DBI_connect($trg_username, $trg_password, $is_controluser = false, $_SESSION['trg_server']); } else { $trg_link = $GLOBALS['userlink']; + // working on current server, so initialize this for tracking + $GLOBALS['db'] = $_SESSION['trg_db']; } /**