bug #1614087, deleting a user having a

global GRANT privilege fails under MySQL 4.1.x
This commit is contained in:
Marc Delisle
2007-01-02 15:40:25 +00:00
parent 499213c3cc
commit a3c4e465e4
2 changed files with 5 additions and 0 deletions

View File

@@ -9,6 +9,8 @@ $HeadURL$
* Designer: various fixes and improvements (for example support
for MSIE 6), thanks to Ivan Kirillov
* pdf_pages.php: undefined $pdf_page_number when no auto layout
* server_privileges.php: bug #1614087, deleting a user having a
global GRANT privilege fails under MySQL 4.1.x
2007-01-02 Michal Čihař <michal@cihar.com>
* libraries/common.lib.php: Add <div> to allow selecting whole SQL by

View File

@@ -1147,6 +1147,9 @@ if (!empty($delete) || (!empty($change_copy) && $mode < 4)) {
unset($res);
}
if ( PMA_MYSQL_INT_VERSION >= 40101 ) {
if (PMA_MYSQL_INT_VERSION < 50002) {
$queries[] = 'REVOKE GRANT OPTION ON *.* FROM \'' . PMA_sqlAddslashes($this_user) . '\'@\'' . $this_host . '\';';
}
$queries[] = 'DROP USER \'' . PMA_sqlAddslashes($this_user) . '\'@\'' . $this_host . '\';';
} else {
$queries[] = 'DELETE FROM `mysql`.`user` WHERE ' . PMA_convert_using('User') . ' = ' . PMA_convert_using(PMA_sqlAddslashes($this_user), 'quoted') . ' AND ' . PMA_convert_using('Host') . ' = ' . PMA_convert_using($this_host, 'quoted') . ';';