1FLUSH TABLES; 2call mtr.add_suppression("Found 1 prepared XA transactions"); 3# 4# MDEV-13797 InnoDB may hang if shutdown is initiated soon after startup 5# while rolling back recovered incomplete transactions 6# 7CREATE TABLE t (a INT) ENGINE=InnoDB; 8BEGIN; 9COMMIT; 10connect con$c,localhost,root,,; 11CREATE TABLE t8 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB; 12XA START 'x'; 13INSERT INTO t8 (a) SELECT NULL FROM t; 14UPDATE t8 SET a=a+100, b=a; 15DELETE FROM t8; 16XA END 'x'; 17XA PREPARE 'x'; 18connect con$c,localhost,root,,; 19CREATE TABLE t7 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB; 20BEGIN; 21INSERT INTO t7 (a) SELECT NULL FROM t; 22UPDATE t7 SET a=a+100, b=a; 23DELETE FROM t7; 24connect con$c,localhost,root,,; 25CREATE TABLE t6 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB; 26BEGIN; 27INSERT INTO t6 (a) SELECT NULL FROM t; 28UPDATE t6 SET a=a+100, b=a; 29DELETE FROM t6; 30connect con$c,localhost,root,,; 31CREATE TABLE t5 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB; 32BEGIN; 33INSERT INTO t5 (a) SELECT NULL FROM t; 34UPDATE t5 SET a=a+100, b=a; 35DELETE FROM t5; 36connect con$c,localhost,root,,; 37CREATE TABLE t4 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB; 38BEGIN; 39INSERT INTO t4 (a) SELECT NULL FROM t; 40UPDATE t4 SET a=a+100, b=a; 41DELETE FROM t4; 42connect con$c,localhost,root,,; 43CREATE TABLE t3 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB; 44BEGIN; 45INSERT INTO t3 (a) SELECT NULL FROM t; 46UPDATE t3 SET a=a+100, b=a; 47DELETE FROM t3; 48connect con$c,localhost,root,,; 49CREATE TABLE t2 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB; 50BEGIN; 51INSERT INTO t2 (a) SELECT NULL FROM t; 52UPDATE t2 SET a=a+100, b=a; 53DELETE FROM t2; 54connect con$c,localhost,root,,; 55CREATE TABLE t1 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB; 56BEGIN; 57INSERT INTO t1 (a) SELECT NULL FROM t; 58UPDATE t1 SET a=a+100, b=a; 59DELETE FROM t1; 60INSERT INTO t1(a) SELECT NULL FROM t; 61INSERT INTO t1(a) SELECT NULL FROM t1; 62INSERT INTO t1(a) SELECT NULL FROM t1; 63INSERT INTO t1(a) SELECT NULL FROM t1; 64INSERT INTO t1(a) SELECT NULL FROM t1; 65connection default; 66SET GLOBAL innodb_flush_log_at_trx_commit=1; 67CREATE TABLE u(a SERIAL) ENGINE=INNODB; 68FLUSH TABLES; 69# restart 70# restart 71XA RECOVER; 72formatID gtrid_length bqual_length data 731 1 0 x 74# restart 75DROP TABLE t,u; 76