bug #1826022 [privileges] unable to add user (MySQL 3.23) since PMA 2.11.2

This commit is contained in:
Marc Delisle
2007-11-07 12:46:56 +00:00
parent 9a19ae7fa8
commit 18a9fe81c1
3 changed files with 15 additions and 8 deletions

View File

@@ -749,11 +749,12 @@ if (!empty($adduser_submit) || !empty($change_copy)) {
}
$res = PMA_DBI_query(
'SELECT \'foo\' FROM `mysql`.`user`'
.' WHERE CONVERT(`User` USING utf8) COLLATE utf8_bin '
.' = CONVERT(\'' . PMA_sqlAddslashes($username) . '\' USING utf8) COLLATE utf8_bin '
.' AND CONVERT(`Host` USING utf8) COLLATE utf8_bin '
.' = CONVERT(\'' . PMA_sqlAddslashes($hostname) . '\' USING utf8) COLLATE utf8_bin ;',
.' WHERE ' . PMA_convert_using('User', 'unquoted', true)
.' = ' . PMA_convert_using(PMA_sqlAddslashes($username), 'quoted', true)
.' AND ' . PMA_convert_using('Host', 'unquoted', true)
.' = ' . PMA_convert_using($hostname, 'quoted', true) . ';',
null, PMA_DBI_QUERY_STORE);
if (PMA_DBI_num_rows($res) == 1) {
PMA_DBI_free_result($res);
$message = sprintf($GLOBALS['strUserAlreadyExists'], '[i]\'' . $username . '\'@\'' . $hostname . '\'[/i]');