Flush privileges only when they are adjusted for atleast one column

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
This commit is contained in:
Deven Bansod 2015-06-30 02:22:14 +05:30
parent 011b71d631
commit bbd1dc8dab

View File

@ -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;
}