mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
MDEV-5999 MySQL Bug#12766319 - 61865: RENAME USER DOES NOT WORK CORRECTLY - REQUIRES FLUSH PRIVILEGES
use update_hostname() to update the hostname. test case comes from commit 0abdeed1d6d Author: gopal.shankar@oracle.com <> Date: Thu Mar 29 00:20:54 2012 +0530 Bug#12766319 - 61865: RENAME USER DOES NOT WORK CORRECTLY - REQUIRES FLUSH PRIVILEGES
This commit is contained in:
@@ -2560,3 +2560,29 @@ Grants for mysqltest_u1@%
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'%'
|
||||
drop database mysqltest_db1;
|
||||
drop user mysqltest_u1;
|
||||
#
|
||||
# Bug#12766319 - 61865: RENAME USER DOES NOT WORK CORRECTLY -
|
||||
# REQUIRES FLUSH PRIVILEGES
|
||||
#
|
||||
CREATE USER foo@'127.0.0.1';
|
||||
GRANT ALL ON *.* TO foo@'127.0.0.1';
|
||||
# First attempt, should connect successfully
|
||||
SELECT user(), current_user();
|
||||
user() current_user()
|
||||
foo@localhost foo@127.0.0.1
|
||||
# Rename the user
|
||||
RENAME USER foo@'127.0.0.1' to foo@'127.0.0.0/255.0.0.0';
|
||||
# Second attempt, should connect successfully as its valid mask
|
||||
# This was failing without fix
|
||||
SELECT user(), current_user();
|
||||
user() current_user()
|
||||
foo@localhost foo@127.0.0.0/255.0.0.0
|
||||
# Rename the user back to original
|
||||
RENAME USER foo@'127.0.0.0/255.0.0.0' to foo@'127.0.0.1';
|
||||
# Third attempt, should connect successfully
|
||||
SELECT user(), current_user();
|
||||
user() current_user()
|
||||
foo@localhost foo@127.0.0.1
|
||||
# Clean-up
|
||||
DROP USER foo@'127.0.0.1';
|
||||
# End of Bug#12766319
|
||||
|
Reference in New Issue
Block a user