diff --git a/ChangeLog b/ChangeLog index e4ad25ffb..be05a4896 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ $Source$ 2004-03-29 Marc Delisle * server_privileges.php: bug 923171, password error when copying a user + * server_privileges.php: bug 923227, copying a user with table privs 2004-03-26 Marc Delisle * left.php, db_details_structure.php, config.inc.php, Documentation.html, diff --git a/server_privileges.php b/server_privileges.php index f855064e3..3ca12497f 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -657,7 +657,9 @@ if (!empty($change_copy)) { PMA_DBI_free_result($res); $res = PMA_DBI_query('SELECT `Db`, `Table_name`, `Table_priv` FROM `mysql`.`tables_priv` WHERE `User` = "' . PMA_sqlAddslashes($old_username) . '" AND `Host` = "' . $old_hostname . '";', $userlink); while ($row = PMA_DBI_fetch_assoc($res)) { - $res2 = PMA_DBI_query('SELECT `Column_name`, `Column_priv` FROM `mysql`.`columns_priv` WHERE `User` = "' . PMA_sqlAddslashes($old_username) . '" AND `Host` = "' . $old_hostname . '" AND `Db` = "' . $row['Db'] . '";'); + + $res2 = PMA_DBI_query('SELECT `Column_name`, `Column_priv` FROM `mysql`.`columns_priv` WHERE `User` = "' . PMA_sqlAddslashes($old_username) . '" AND `Host` = "' . $old_hostname . '" AND `Db` = "' . $row['Db'] . '" AND `Table_name` = "' . $row['Table_name'] . '";'); + $tmp_privs1 = PMA_extractPrivInfo($row); $tmp_privs2 = array( 'Select' => array(),