mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	 070f5ad497
			
		
	
	070f5ad497
	
	
	
		
			
			Bug#11733 (COMMITs should not happen if read-only is set) Bug#22009 (Can write to a read-only server under some circumstances) See the work log for details The change consist of a) acquiring the global read lock in SET GLOBAL READONLY b) honoring opt_readonly in ha_commit_trans(), c) honoring opt_readonly in mysql_lock_tables(). a) takes care of the server stability, b) makes the transactional tables safe (Bug 11733) c) makes the non transactional tables safe (Bug 22009)
		
			
				
	
	
		
			19 lines
		
	
	
		
			502 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			502 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| DROP TABLE IF EXISTS table_11733 ;
 | |
| grant CREATE, SELECT, DROP on *.* to test@localhost;
 | |
| set global read_only=0;
 | |
| create table table_11733 (a int) engine=InnoDb;
 | |
| BEGIN;
 | |
| insert into table_11733 values(11733);
 | |
| set global read_only=1;
 | |
| select @@global.read_only;
 | |
| @@global.read_only
 | |
| 1
 | |
| select * from table_11733 ;
 | |
| a
 | |
| 11733
 | |
| COMMIT;
 | |
| ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 | |
| set global read_only=0;
 | |
| drop table table_11733 ;
 | |
| drop user test@localhost;
 |