mariadb/mysql-test/suite/galera/t/MDEV-33828.test
Jan Lindström 7aa86eb1e1 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>
2024-04-09 12:21:53 +02:00

45 lines
931 B
Text

--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;