protected function adjustColumnPrivileges($adjust_privileges)
{
$changed = false;
if (Util_lib\get($GLOBALS, 'col_priv', false) && Util_lib\get($GLOBALS, 'is_reload_priv', false)) {
$this->dbi->selectDb('mysql');
// For Column specific privileges
foreach ($adjust_privileges as $oldCol => $newCol) {
$this->dbi->query(sprintf('UPDATE %s SET Column_name = "%s"
WHERE Db = "%s"
AND Table_name = "%s"
AND Column_name = "%s";', Util::backquote('columns_priv'), $newCol, $this->db, $this->table, $oldCol));
// i.e. if atleast one column privileges adjusted
$changed = true;
}
if ($changed) {
// Finally FLUSH the new privileges
$this->dbi->query("FLUSH PRIVILEGES;");
}
}
return $changed;
}