From a3c4e465e4f48644adb6fe81dd329ee976d9d0b6 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 2 Jan 2007 15:40:25 +0000 Subject: [PATCH] bug #1614087, deleting a user having a global GRANT privilege fails under MySQL 4.1.x --- ChangeLog | 2 ++ server_privileges.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 617c12f4b..7b4771ad2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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ř * libraries/common.lib.php: Add
to allow selecting whole SQL by diff --git a/server_privileges.php b/server_privileges.php index 17708a2ed..ae8a302e9 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -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') . ';';