2008-01-25 15:02:26 +08:00
|
|
|
# BUG#33862 completely failed DROP USER statement gets replicated
|
|
|
|
|
|
|
|
--source include/master-slave.inc
|
|
|
|
|
|
|
|
#
|
|
|
|
# remove all users will be used in the test
|
|
|
|
#
|
2008-02-04 12:22:37 +01:00
|
|
|
connection master;
|
2008-01-31 15:53:47 +01:00
|
|
|
set session sql_log_bin=0;
|
2008-01-25 15:02:26 +08:00
|
|
|
delete from mysql.user where Host='fakehost';
|
2008-01-31 15:53:47 +01:00
|
|
|
set session sql_log_bin=1;
|
2008-02-04 12:22:37 +01:00
|
|
|
|
2008-01-31 15:53:47 +01:00
|
|
|
connection slave;
|
|
|
|
set session sql_log_bin=0;
|
|
|
|
delete from mysql.user where Host='fakehost';
|
|
|
|
set session sql_log_bin=1;
|
2008-01-25 15:02:26 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Test create user
|
|
|
|
#
|
|
|
|
connection master;
|
|
|
|
create user 'foo'@'fakehost';
|
|
|
|
--error ER_CANNOT_USER
|
|
|
|
create user 'foo'@'fakehost', 'bar'@'fakehost';
|
|
|
|
--error ER_CANNOT_USER
|
|
|
|
create user 'foo'@'fakehost', 'bar'@'fakehost';
|
|
|
|
|
|
|
|
sync_slave_with_master;
|
|
|
|
select Host,User from mysql.user where Host='fakehost';
|
|
|
|
|
|
|
|
#
|
|
|
|
# Test rename user
|
|
|
|
#
|
|
|
|
connection master;
|
|
|
|
rename user 'foo'@'fakehost' to 'foofoo'@'fakehost';
|
|
|
|
--error ER_CANNOT_USER
|
|
|
|
rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost' to 'barbar'@'fakehost';
|
|
|
|
--error ER_CANNOT_USER
|
|
|
|
rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'not_exist_user2'@'fakehost' to 'barfoo'@'fakehost';
|
|
|
|
|
|
|
|
sync_slave_with_master;
|
|
|
|
select Host,User from mysql.user where Host='fakehost';
|
|
|
|
|
|
|
|
#
|
|
|
|
# Test drop user
|
|
|
|
#
|
|
|
|
connection master;
|
|
|
|
drop user 'foofoo'@'fakehost';
|
|
|
|
--error ER_CANNOT_USER
|
|
|
|
drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost';
|
|
|
|
--error ER_CANNOT_USER
|
|
|
|
drop user 'not_exist_user1'@'fakehost', 'not_exist_user2'@'fakehost';
|
|
|
|
|
|
|
|
sync_slave_with_master;
|
|
|
|
select Host,User from mysql.user where Host='fakehost';
|
|
|
|
|
|
|
|
#
|
|
|
|
# show the binlog events on the master
|
|
|
|
#
|
|
|
|
connection master;
|
|
|
|
source include/show_binlog_events.inc;
|