PMA\libraries\controllers\table\TableStructureController::adjustColumnPrivileges PHP Метод

adjustColumnPrivileges() защищенный Метод

Adjusts the Privileges for all the columns whose names have changed
protected adjustColumnPrivileges ( array $adjust_privileges ) : boolean
$adjust_privileges array assoc array of old col names mapped to new cols
Результат boolean $changed boolean whether at least one column privileges adjusted
    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;
    }