From bbd1dc8dab33bc6df8035d99e0c39b8990e08e39 Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Tue, 30 Jun 2015 02:22:14 +0530 Subject: [PATCH] Flush privileges only when they are adjusted for atleast one column Signed-off-by: Deven Bansod --- libraries/structure.lib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 241e4bcd8c..5dfbce32bb 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -2596,6 +2596,7 @@ function PMA_updateColumns($db, $table) if (isset($_REQUEST['field_adjust_privileges'][$i]) && ! empty($_REQUEST['field_adjust_privileges'][$i]) + && $_REQUEST['field_orig'][$i] != $_REQUEST['field_name'][$i] ) { $adjust_privileges[$_REQUEST['field_orig'][$i]] = $_REQUEST['field_name'][$i]; } @@ -2799,9 +2800,11 @@ function PMA_adjustColumnPrivileges($db, $table, $adjust_privileges) $changed = true; } - // Finally FLUSH the new privileges - $flushPrivQuery = "FLUSH PRIVILEGES;"; - $GLOBALS['dbi']->query($flushPrivQuery); + if ($changed) { + // Finally FLUSH the new privileges + $flushPrivQuery = "FLUSH PRIVILEGES;"; + $GLOBALS['dbi']->query($flushPrivQuery); + } return $changed; }