From 06eaf7232e9a920468c0f8d74dcf2fe8b555501c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 14:24:36 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- mysql-test/suite/roles/rename_user.test | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 mysql-test/suite/roles/rename_user.test (limited to 'mysql-test/suite/roles/rename_user.test') diff --git a/mysql-test/suite/roles/rename_user.test b/mysql-test/suite/roles/rename_user.test new file mode 100644 index 00000000..8c899352 --- /dev/null +++ b/mysql-test/suite/roles/rename_user.test @@ -0,0 +1,48 @@ +source include/not_embedded.inc; + +#create a user with no privileges +create user test_user@localhost; +create role test_role1; +grant test_role1 to test_user@localhost; +create role test_role2; +grant test_role2 to test_role1; + +use mysql; +--sorted_result +select * from roles_mapping; + +#regular user rename +rename user 'test_user'@'localhost' to 'test_user_rm'@'newhost'; +--sorted_result +select user, host from user where user like 'test%'; +--sorted_result +select * from roles_mapping; + +######### role rename does not work yet +#rename user 'test_role2'@'' to 'test_role2_rm'@''; +#--sorted_result +#select user, host from user where user like 'test%'; +#--sorted_result +#select * from roles_mapping; +# +##role rename +#rename user 'test_role1'@'' to 'test_role1_rm'@''; +#--sorted_result +#select user, host from user where user like 'test%'; +#--sorted_result +#select * from roles_mapping; + +delete from mysql.roles_mapping; +delete from mysql.user where user like 'test%'; +flush privileges; + +--echo # +--echo # MDEV-29131 Assertion `status == 0' failed when renaming user after deleting table roles_mapping +--echo # +create role r; +rename table mysql.roles_mapping to test.t1; +rename user current_user to a@a; +rename user a@a to root@localhost; +rename table test.t1 to mysql.roles_mapping; +drop role r; + -- cgit v1.2.3