Browse Source
MDEV-33828 : Transactional commit not supported by involved engine(s)
MDEV-33828 : Transactional commit not supported by involved engine(s)
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>bb-10.4-mdev-32401
committed by
Julius Goryavsky
6 changed files with 140 additions and 29 deletions
-
41mysql-test/suite/galera/r/MDEV-33828.result
-
26mysql-test/suite/galera/r/mdev-22063.result
-
4mysql-test/suite/galera/t/MDEV-33828.cnf
-
45mysql-test/suite/galera/t/MDEV-33828.test
-
12mysql-test/suite/galera/t/mdev-22063.test
-
41sql/handler.cc
@ -0,0 +1,41 @@ |
|||
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; |
@ -0,0 +1,4 @@ |
|||
!include ../galera_2nodes.cnf |
|||
|
|||
[mysqld] |
|||
log-bin |
@ -0,0 +1,45 @@ |
|||
--source include/galera_cluster.inc |
|||
--source include/have_innodb.inc |
|||
--source include/have_aria.inc |
|||
|
|||
SET AUTOCOMMIT=ON; |
|||
SELECT @@autocommit; |
|||
|
|||
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'); |
|||
|
|||
DELIMITER |; |
|||
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| |
|||
DELIMITER ;| |
|||
|
|||
SET AUTOCOMMIT=OFF; |
|||
SELECT @@autocommit; |
|||
|
|||
START TRANSACTION; |
|||
|
|||
insert into t1(name) values('name10'); |
|||
|
|||
select param_list, returns, db, type from mysql.proc where name='sel_proc'; |
|||
|
|||
call ins_proc(); |
|||
|
|||
COMMIT; |
|||
|
|||
SET AUTOCOMMIT=ON; |
|||
|
|||
SELECT * FROM t1; |
|||
DROP TABLE t1; |
|||
DROP PROCEDURE sel_proc; |
|||
DROP PROCEDURE ins_proc; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue