summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-04-27 16:46:54 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-04-27 17:07:37 +0530
commitb862377c3e9a6818bc2d5265c19edeee79a293fc (patch)
treea03df6b1a347438b18208099fa28ef31104373f7 /mysql-test/suite/innodb/t
parent2b0d5b78c2bbe2bdd763a8e2ed12be644bd705d2 (diff)
downloadmariadb-git-b862377c3e9a6818bc2d5265c19edeee79a293fc.tar.gz
MDEV-25503 InnoDB hangs on startup during recovery
InnoDB startup hangs if a DDL transaction needs to be rolled back and a recovered transaction on statistics tables exists. In that case, InnoDB should rollback the transaction which holds locks on innodb_table_stats or innodb_index_stats during trx_rollback_or_clean_recovered().
Diffstat (limited to 'mysql-test/suite/innodb/t')
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-tempfile.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
index e6fafd936c8..7e4244d09f8 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
@@ -12,6 +12,8 @@
--source include/innodb_page_size.inc
+--source include/have_debug_sync.inc
+
call mtr.add_suppression("Cannot find index f2 in InnoDB index dictionary.");
call mtr.add_suppression("InnoDB indexes are inconsistent with what defined in .frm for table .*");
call mtr.add_suppression("Table test/t1 contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the MariaDB .*");
@@ -69,3 +71,23 @@ disconnect con1;
SHOW KEYS FROM t1;
DROP TABLE t1;
remove_files_wildcard $datadir/test #sql-*.frm;
+
+--echo #
+--echo # MDEV-25503 InnoDB hangs on startup during recovery
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=1;
+connect (con1,localhost,root,,);
+BEGIN;
+DELETE FROM mysql.innodb_table_stats;
+
+connect (con2,localhost,root,,);
+SET DEBUG_SYNC='inplace_after_index_build SIGNAL blocked WAIT_FOR ever';
+send ALTER TABLE t1 FORCE;
+
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR blocked';
+--let $shutdown_timeout=0
+--source include/restart_mysqld.inc
+SELECT * FROM t1;
+DROP TABLE t1;
+remove_files_wildcard $datadir/test #sql-*.frm;