2003-08-02 23:46:26 +02:00
|
|
|
# Test that GRANT is not replicated to the slave
|
|
|
|
# when --replicate-wild-ignore-table=mysql.%
|
|
|
|
# In BUG#980, this test would _randomly_ fail.
|
|
|
|
|
|
|
|
source include/master-slave.inc;
|
|
|
|
|
|
|
|
# do not be influenced by other tests.
|
|
|
|
connection master;
|
2004-07-08 15:54:07 +02:00
|
|
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
|
|
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
2003-08-02 23:46:26 +02:00
|
|
|
flush privileges;
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
|
|
|
# as these DELETE were not replicated, we need to do them manually on the
|
|
|
|
# slave.
|
2004-07-08 15:54:07 +02:00
|
|
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
|
|
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
2003-08-02 23:46:26 +02:00
|
|
|
flush privileges;
|
|
|
|
|
|
|
|
# test non-replication of GRANT
|
|
|
|
connection master;
|
|
|
|
grant select on *.* to rpl_ignore_grant@localhost;
|
|
|
|
grant drop on test.* to rpl_ignore_grant@localhost;
|
|
|
|
show grants for rpl_ignore_grant@localhost;
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
|
|
|
--error 1141 #("no such grant for user")
|
|
|
|
show grants for rpl_ignore_grant@localhost;
|
|
|
|
# check it another way
|
2004-07-08 15:54:07 +02:00
|
|
|
select count(*) from mysql.user where user=_binary'rpl_ignore_grant';
|
|
|
|
select count(*) from mysql.db where user=_binary'rpl_ignore_grant';
|
2003-08-02 23:46:26 +02:00
|
|
|
|
|
|
|
# test non-replication of SET PASSWORD
|
|
|
|
# first force creation of the user on slave (because as the user does not exist
|
|
|
|
# on slave, the SET PASSWORD may be replicated but silently do nothing; this is
|
|
|
|
# not what we want; we want it to be not-replicated).
|
|
|
|
grant select on *.* to rpl_ignore_grant@localhost;
|
|
|
|
connection master;
|
|
|
|
set password for rpl_ignore_grant@localhost=password("does it work?");
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
2004-07-08 15:54:07 +02:00
|
|
|
select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant';
|
2003-08-02 23:46:26 +02:00
|
|
|
|
|
|
|
# clear what we have done, to not influence other tests.
|
|
|
|
connection master;
|
2004-07-08 15:54:07 +02:00
|
|
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
|
|
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
2003-08-02 23:46:26 +02:00
|
|
|
flush privileges;
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
2004-07-08 15:54:07 +02:00
|
|
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
|
|
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
2003-08-02 23:46:26 +02:00
|
|
|
flush privileges;
|
2005-07-28 02:22:47 +02:00
|
|
|
|
|
|
|
# End of 4.1 tests
|