mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-30 18:36:12 +01:00 
			
		
		
		
	 7aa86eb1e1
			
		
	
	
	7aa86eb1e1
	
	
	
		
			
			Problem was too tight condition on ha_commit_trans to not allow non transactional storage engines participate 2pc in Galera case. This is required because transaction using e.g. procedures might read mysql.proc table inside a trasaction and these tables use at the moment Aria storage engine that does not support 2pc. Fixed by allowing read only transactions to storage engines that do not support two phase commit to participate 2pc transaction. These will be committed later separately. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
		
			
				
	
	
		
			41 lines
		
	
	
	
		
			945 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
	
		
			945 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| connection node_2;
 | |
| connection node_1;
 | |
| SET AUTOCOMMIT=ON;
 | |
| SELECT @@autocommit;
 | |
| @@autocommit
 | |
| 1
 | |
| SET LOCAL enforce_storage_engine=InnoDB;
 | |
| CREATE TABLE t1(id int not null primary key auto_increment, name varchar(64)) ENGINE=InnoDB;
 | |
| INSERT INTO t1(name) VALUES ('name1'),('name3'),('name6'),('name2');
 | |
| CREATE PROCEDURE sel_proc()
 | |
| BEGIN
 | |
| DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
 | |
| SELECT * FROM t1;
 | |
| END|
 | |
| CREATE PROCEDURE ins_proc()
 | |
| BEGIN
 | |
| DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
 | |
| INSERT INTO t1 VALUES ('name_proc');
 | |
| END|
 | |
| SET AUTOCOMMIT=OFF;
 | |
| SELECT @@autocommit;
 | |
| @@autocommit
 | |
| 0
 | |
| START TRANSACTION;
 | |
| insert into t1(name) values('name10');
 | |
| select param_list, returns, db, type from mysql.proc where name='sel_proc';
 | |
| param_list	returns	db	type
 | |
| 		test	PROCEDURE
 | |
| call ins_proc();
 | |
| COMMIT;
 | |
| SET AUTOCOMMIT=ON;
 | |
| SELECT * FROM t1;
 | |
| id	name
 | |
| 1	name1
 | |
| 3	name3
 | |
| 5	name6
 | |
| 7	name2
 | |
| 9	name10
 | |
| DROP TABLE t1;
 | |
| DROP PROCEDURE sel_proc;
 | |
| DROP PROCEDURE ins_proc;
 |