mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	 41865cf3a6
			
		
	
	41865cf3a6
	
	
	
		
			
			replicate-*-table rules which exclude 'mysql' tables (e.g. replicate-wild-ignore-table=mysql.%). This was already the behaviour for GRANT/REVOKE, I'm extending it to SET PASSWORD because it seems very logical (the contrary seems illogical). 2 new tests: - one to test if GRANT and SET PASSWORD are replicated - one to test if they are not replicated if replicate-wild-ignore-table=mysql.% The 2nd is also a testcase for BUG#980.
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| # Test that GRANT and SET PASSWORD are replicated to the slave
 | |
| 
 | |
| source include/master-slave.inc;
 | |
| 
 | |
| # do not be influenced by other tests.
 | |
| connection master;
 | |
| delete from mysql.user where user='rpl_do_grant';
 | |
| delete from mysql.db where user='rpl_do_grant';
 | |
| flush privileges;
 | |
| save_master_pos;
 | |
| connection slave;
 | |
| sync_with_master;
 | |
| # if these DELETE did nothing on the master, we need to do them manually on the
 | |
| # slave.
 | |
| delete from mysql.user where user='rpl_ignore_grant';
 | |
| delete from mysql.db where user='rpl_ignore_grant';
 | |
| flush privileges;
 | |
| 
 | |
| # test replication of GRANT
 | |
| connection master;
 | |
| grant select on *.* to rpl_do_grant@localhost;
 | |
| grant drop on test.* to rpl_do_grant@localhost;
 | |
| save_master_pos;
 | |
| connection slave;
 | |
| sync_with_master;
 | |
| show grants for rpl_do_grant@localhost;
 | |
| 
 | |
| # test replication of SET PASSWORD
 | |
| connection master;
 | |
| set password for rpl_do_grant@localhost=password("does it work?");
 | |
| save_master_pos;
 | |
| connection slave;
 | |
| sync_with_master;
 | |
| select password<>'' from mysql.user where user='rpl_do_grant';
 | |
| 
 | |
| # clear what we have done, to not influence other tests.
 | |
| connection master;
 | |
| delete from mysql.user where user='rpl_do_grant';
 | |
| delete from mysql.db where user='rpl_do_grant';
 | |
| flush privileges;
 | |
| save_master_pos;
 | |
| connection slave;
 | |
| sync_with_master;
 | |
| # no need to delete manually, as the DELETEs must have done some real job on
 | |
| # master (updated binlog)
 | |
| flush privileges;
 |