summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/innodb/t/undo_upgrade.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/innodb/t/undo_upgrade.test
parentInitial commit. (diff)
downloadmariadb-upstream.tar.xz
mariadb-upstream.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/innodb/t/undo_upgrade.test')
-rw-r--r--mysql-test/suite/innodb/t/undo_upgrade.test78
1 files changed, 78 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/t/undo_upgrade.test b/mysql-test/suite/innodb/t/undo_upgrade.test
new file mode 100644
index 00000000..9c0da017
--- /dev/null
+++ b/mysql-test/suite/innodb/t/undo_upgrade.test
@@ -0,0 +1,78 @@
+--source include/have_innodb.inc
+--source include/innodb_page_size.inc
+--source include/not_embedded.inc
+
+--echo #
+--echo # MDEV-19229 Allow innodb_undo_tablespaces to be changed
+--echo # after database creation
+--echo #
+call mtr.add_suppression("Found .* prepared XA transactions");
+call mtr.add_suppression("InnoDB: Plugin initialization aborted");
+call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
+call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
+call mtr.add_suppression("InnoDB: Cannot change innodb_undo_tablespaces=\\d+ because previous shutdown was not with innodb_fast_shutdown=0");
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
+--echo # case 1: XA transaction alone left
+--source include/wait_all_purged.inc
+XA START 'zombie';
+INSERT INTO t1 VALUES(2);
+XA END 'zombie';
+XA PREPARE 'zombie';
+
+--source include/restart_mysqld.inc
+
+--echo # Display 4 undo tablespaces
+select @@global.innodb_undo_tablespaces;
+
+--echo # Should list 4 undo log tablespaces
+list_files $MYSQLD_DATADIR undo*;
+
+XA COMMIT 'zombie';
+
+--echo # case 2: Successful innodb_undo_tablespace upgrade
+SET GLOBAL innodb_fast_shutdown=0;
+
+let $restart_parameters=--innodb_undo_tablespaces=2;
+--source include/restart_mysqld.inc
+
+--echo # Display 2 undo tablespaces
+SELECT @@global.innodb_undo_tablespaces;
+
+--echo # Should list 2 undo log tablespaces
+list_files $MYSQLD_DATADIR undo*;
+
+DROP TABLE t1;
+--source include/wait_all_purged.inc
+
+--echo # case 3: Reduce the innodb_undo_tablespace to 0
+let $restart_parameters=--innodb_undo_tablespaces=0;
+--source include/restart_mysqld.inc
+
+--echo # Display 0 undo tablespace
+SELECT @@global.innodb_undo_tablespaces;
+
+--echo # Shouldn't list any undo log tablespaces
+list_files $MYSQLD_DATADIR undo*;
+
+--echo # case 4: Change undo tablespace when force_recovery < 5
+let $restart_parameters=--innodb_undo_tablespaces=2 --innodb_force_recovery=4;
+--source include/restart_mysqld.inc
+
+--echo # Display 2 undo tablespace
+SELECT @@global.innodb_undo_tablespaces;
+
+--echo # Should list 2 undo log tablespaces
+list_files $MYSQLD_DATADIR undo*;
+
+--echo # case 5: Fail to change undo tablespace when force_recovery > 4
+let $restart_parameters=--innodb_undo_tablespaces=4 --innodb_force_recovery=5;
+--source include/restart_mysqld.inc
+
+--echo # Display 2 undo tablespace
+SELECT @@global.innodb_undo_tablespaces;
+
+--echo # Should list 2 undo log tablespaces, not 4
+list_files $MYSQLD_DATADIR undo*;