From 24bb12793d1b09cdb1bf24dcb4f6a860fd3b2f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 23 May 2016 08:42:08 +0200 Subject: [PATCH] Fix locking issues when importing SQL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running import (or generally any SQL query), some tables might be locked. This will cause queries to not locked tables to fail. And this is exacly what we do with control user link. So let's have separate link for control queries even if we're using same credentials as for main link. Fixes #12219 Signed-off-by: Michal Čihař --- ChangeLog | 1 + libraries/common.inc.php | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1cf8075e4f..82460a1896 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ phpMyAdmin - ChangeLog - issue #12229 Avoid storing objects in session when debugging SQL - issue #12249 Fix cookie path on IIS - issue #11705 Fix occassional 200 errors on Windows +- issue #12219 Fix locking issues when importing SQL 4.6.1 (2016-05-02) - issue #12120 PMA_Util not found in insert_edit.lib.php diff --git a/libraries/common.inc.php b/libraries/common.inc.php index b84bc374d3..95bdd382af 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -881,7 +881,15 @@ if (! defined('PMA_MINIMUM_COMMON')) { } if (! $controllink) { - $controllink = $userlink; + /* + * Open separate connection for control queries, this is needed + * to avoid problems with table locking used in main connection + * and phpMyAdmin issuing queries to configuration storage, which + * is not locked by that time. + */ + $controllink = $GLOBALS['dbi']->connect( + $cfg['Server']['user'], $cfg['Server']['password'], false + ); } $auth_plugin->storeUserCredentials();