summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2021-12-26 12:51:04 +0100
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2021-12-26 12:51:04 +0100
commit55bb933a880bf048ebc4ce6c6e239dcc8268958d (patch)
treea3a24c56995df41758205f8f6a4e3cbccf793a19 /mysql-test/suite
parentbe20b3b03f9c522d17b3454214981506549063eb (diff)
parent681b7784b6bb3d735d0a745f5891844f43becc90 (diff)
downloadmariadb-git-55bb933a880bf048ebc4ce6c6e239dcc8268958d.tar.gz
Merge branch 10.4 into 10.5st-10.5-julius
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/binlog/t/binlog_sf.test8
-rw-r--r--mysql-test/suite/galera/disabled.def1
-rw-r--r--mysql-test/suite/galera/r/MDEV-20793.result7
-rw-r--r--mysql-test/suite/galera/r/MDEV-22051.result1
-rw-r--r--mysql-test/suite/galera/r/MDEV-27276.result36
-rw-r--r--mysql-test/suite/galera/r/galera_UK_conflict.result57
-rw-r--r--mysql-test/suite/galera/r/galera_fk_cascade_delete.result110
-rw-r--r--mysql-test/suite/galera/r/galera_split_brain.result1
-rw-r--r--mysql-test/suite/galera/t/MDEV-20793.test26
-rw-r--r--mysql-test/suite/galera/t/MDEV-22051.test1
-rw-r--r--mysql-test/suite/galera/t/MDEV-27276.test44
-rw-r--r--mysql-test/suite/galera/t/galera_UK_conflict.test8
-rw-r--r--mysql-test/suite/galera/t/galera_fk_cascade_delete.test186
-rw-r--r--mysql-test/suite/galera/t/galera_split_brain.test1
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#332.test1
-rw-r--r--mysql-test/suite/galera_3nodes/disabled.def8
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result4
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test10
-rw-r--r--mysql-test/suite/galera_sr/r/galera_sr_slow.result13
-rw-r--r--mysql-test/suite/galera_sr/t/galera_sr_slow.test11
-rw-r--r--mysql-test/suite/innodb/r/log_file.result1
-rw-r--r--mysql-test/suite/innodb/r/read_only_recover_committed.result7
-rw-r--r--mysql-test/suite/innodb/r/temporary_table.result1
-rw-r--r--mysql-test/suite/innodb/t/log_file.test3
-rw-r--r--mysql-test/suite/innodb/t/read_only_recover_committed.test7
-rw-r--r--mysql-test/suite/innodb/t/temporary_table.test2
-rw-r--r--mysql-test/suite/large_tests/r/maria_recover_encrypted.result53
-rw-r--r--mysql-test/suite/large_tests/t/maria_recover_encrypted.test90
-rw-r--r--mysql-test/suite/rpl/disabled.def1
-rw-r--r--mysql-test/suite/versioning/r/partition.result9
-rw-r--r--mysql-test/suite/versioning/t/partition.test10
31 files changed, 691 insertions, 27 deletions
diff --git a/mysql-test/suite/binlog/t/binlog_sf.test b/mysql-test/suite/binlog/t/binlog_sf.test
index 05b31afcb58..fecc4736972 100644
--- a/mysql-test/suite/binlog/t/binlog_sf.test
+++ b/mysql-test/suite/binlog/t/binlog_sf.test
@@ -1,4 +1,3 @@
--- source include/have_log_bin.inc
# We change binlog format inside the test, so no need to re-run with
# more than one binlog_format.
@@ -9,13 +8,9 @@
# save status
-let $oblf=`select @@SESSION.BINLOG_FORMAT`;
let $otfc=`select @@log_bin_trust_function_creators`;
-
set global log_bin_trust_function_creators=0;
-
-
# fail *on definition*
set binlog_format=STATEMENT;
@@ -186,6 +181,7 @@ drop function fn16456;
# restore status
--disable_query_log
-eval set binlog_format=$oblf;
+set binlog_format=STATEMENT;
eval set global log_bin_trust_function_creators=$otfc;
+reset master;
--enable_query_log
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index f4f18ce03e7..8fc0bf6d2c3 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -39,5 +39,4 @@ mysql-wsrep#198 : MDEV-24446: galera.mysql-wsrep#198 MTR failed: query 'reap' fa
partition : MDEV-19958 Galera test failure on galera.partition
query_cache: MDEV-15805 Test failure on galera.query_cache
versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
-galera_ssl_mode_server : Certificate CA mismatch
galera_bf_abort_at_after_statement : Unstable
diff --git a/mysql-test/suite/galera/r/MDEV-20793.result b/mysql-test/suite/galera/r/MDEV-20793.result
index b420c8720f5..feb068f258f 100644
--- a/mysql-test/suite/galera/r/MDEV-20793.result
+++ b/mysql-test/suite/galera/r/MDEV-20793.result
@@ -9,7 +9,6 @@ connection node_1;
SET SESSION wsrep_retry_autocommit = 0;
START TRANSACTION;
UPDATE t1 SET f2 = 1;
-SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
connection node_1_ctrl;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
@@ -24,9 +23,15 @@ UPDATE t1 SET f2 = 2 WHERE f1 = 5;
connection node_1_ctrl;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
connection node_1;
+SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
COMMIT;
connection node_1_ctrl;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET SESSION debug_sync = "now WAIT_FOR reached";
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_slave_enter_sync';
diff --git a/mysql-test/suite/galera/r/MDEV-22051.result b/mysql-test/suite/galera/r/MDEV-22051.result
index 0e9756dd20e..229e26fd32a 100644
--- a/mysql-test/suite/galera/r/MDEV-22051.result
+++ b/mysql-test/suite/galera/r/MDEV-22051.result
@@ -18,3 +18,4 @@ INSERT INTO t1 VALUES (1);
ERROR HY000: Can't execute the query because you have a conflicting read lock
UNLOCK TABLES;
DROP TABLE t1;
+CALL mtr.add_suppression("CREATE TABLE isolation failure");
diff --git a/mysql-test/suite/galera/r/MDEV-27276.result b/mysql-test/suite/galera/r/MDEV-27276.result
new file mode 100644
index 00000000000..7e5b29fad7e
--- /dev/null
+++ b/mysql-test/suite/galera/r/MDEV-27276.result
@@ -0,0 +1,36 @@
+connection node_2;
+connection node_1;
+connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+connection node_1;
+CREATE TABLE p (id INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+connection node_1;
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+INSERT INTO p VALUES(1,0);
+connection node_1a;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+connection node_2;
+CREATE TABLE c(id INT NOT NULL PRIMARY KEY, p_id INT, FOREIGN KEY (p_id) REFERENCES p(id) ON DELETE CASCADE) ENGINE=InnoDB;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_master_enter_sync';
+connection node_1;
+COMMIT;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_master_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+connection node_1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+connection node_2;
+SELECT * FROM p;
+id f2
+SELECT * FROM c;
+id p_id
+DROP TABLE c;
+DROP TABLE p;
diff --git a/mysql-test/suite/galera/r/galera_UK_conflict.result b/mysql-test/suite/galera/r/galera_UK_conflict.result
index cc7e17d7c58..b0420d58ede 100644
--- a/mysql-test/suite/galera/r/galera_UK_conflict.result
+++ b/mysql-test/suite/galera/r/galera_UK_conflict.result
@@ -71,6 +71,31 @@ INSERT INTO t1 VALUES (8,8,8);
SELECT COUNT(*) FROM t1;
COUNT(*)
7
+SELECT * FROM t1;
+f1 f2 f3
+1 1 0
+3 3 1
+4 4 2
+5 5 2
+7 7 7
+8 8 8
+10 10 0
+connection node_1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+SELECT * FROM t1;
+f1 f2 f3
+1 1 0
+3 3 1
+4 4 2
+5 5 2
+7 7 7
+8 8 8
+10 10 0
+DROP TABLE t1;
+test scenario 2
+connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 int, f3 int, unique key keyj (f2));
INSERT INTO t1 VALUES (1, 1, 0);
INSERT INTO t1 VALUES (3, 3, 0);
@@ -92,9 +117,9 @@ SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync';
connection node_1;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-7
+COMMIT;
+connection node_1a;
+SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_replay_cb";
@@ -125,8 +150,32 @@ f1 f2 f3
3 3 1
4 4 2
5 5 2
-8 8 8
10 10 0
INSERT INTO t1 VALUES (7,7,7);
INSERT INTO t1 VALUES (8,8,8);
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+SELECT * FROM t1;
+f1 f2 f3
+1 1 0
+3 3 1
+4 4 2
+5 5 2
+7 7 7
+8 8 8
+10 10 0
+connection node_1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+SELECT * FROM t1;
+f1 f2 f3
+1 1 0
+3 3 1
+4 4 2
+5 5 2
+7 7 7
+8 8 8
+10 10 0
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_delete.result b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result
index 808e32b8cb2..9bb004d0ed8 100644
--- a/mysql-test/suite/galera/r/galera_fk_cascade_delete.result
+++ b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result
@@ -48,3 +48,113 @@ id parent_id
DROP TABLE child;
DROP TABLE parent;
DROP TABLE grandparent;
+
+Scenario 2, testing PA applying with FK cascade delete
+
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ON DELETE CASCADE,
+CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1)
+ON DELETE CASCADE);
+connection node_2;
+set global wsrep_slave_threads=DEFAULT;
+SELECT * FROM p1;
+f1 f2
+SELECT * FROM p2;
+f1 f2
+SELECT * FROM c;
+f1 p1_id p2_id f2
+connection node_1;
+DROP TABLE c;
+DROP TABLE p1,p2;
+
+Scenario 4, testing PA applying with FK cascade delete on
+more than one level
+
+CREATE TABLE gp1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE gp2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT pfk_3 FOREIGN KEY (p1_id) REFERENCES gp1 (f1)
+ON DELETE CASCADE
+) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY,p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT pfk_4 FOREIGN KEY (p1_id) REFERENCES gp2 (f1)
+ON DELETE CASCADE
+) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ON DELETE CASCADE,
+CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1)
+ON DELETE CASCADE) ENGINE=INNODB;
+connection node_2;
+set global wsrep_slave_threads=DEFAULT;
+SELECT * FROM gp1;
+f1 f2
+SELECT * FROM gp2;
+f1 f2
+SELECT * FROM p1;
+f1 p1_id p2_id f2
+SELECT * FROM p2;
+f1 p1_id p2_id f2
+SELECT * FROM c;
+f1 p1_id p2_id f2
+connection node_1;
+DROP TABLE c;
+DROP TABLE p1,p2;
+DROP TABLE gp1,gp2;
+
+Scenario 3, testing PA applying with FK cascade delete on
+more than one level in a diamond topology
+
+CREATE TABLE ggp1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE gp1 (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT pfk_6 FOREIGN KEY (p1_id) REFERENCES ggp1 (f1)
+ON DELETE CASCADE
+) ENGINE=INNODB;
+CREATE TABLE gp2 (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT pfk_5 FOREIGN KEY (p1_id) REFERENCES ggp1 (f1)
+ON DELETE CASCADE
+) ENGINE=INNODB;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT pfk_3 FOREIGN KEY (p1_id) REFERENCES gp1 (f1)
+ON DELETE CASCADE
+) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY,p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT pfk_4 FOREIGN KEY (p1_id) REFERENCES gp2 (f1)
+ON DELETE CASCADE
+) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ON DELETE CASCADE,
+CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1)
+ON DELETE CASCADE) ENGINE=INNODB;
+connection node_2;
+set global wsrep_slave_threads=DEFAULT;
+SELECT * FROM ggp1;
+f1 f2
+SELECT * FROM gp2;
+f1 p1_id p2_id f2
+SELECT * FROM gp1;
+f1 p1_id p2_id f2
+SELECT * FROM p1;
+f1 p1_id p2_id f2
+SELECT * FROM p2;
+f1 p1_id p2_id f2
+SELECT * FROM c;
+f1 p1_id p2_id f2
+connection node_1;
+DROP TABLE c;
+DROP TABLE p1,p2;
+DROP TABLE gp1,gp2;
+DROP TABLE ggp1;
diff --git a/mysql-test/suite/galera/r/galera_split_brain.result b/mysql-test/suite/galera/r/galera_split_brain.result
index 08f9060d2a9..374fb31afd1 100644
--- a/mysql-test/suite/galera/r/galera_split_brain.result
+++ b/mysql-test/suite/galera/r/galera_split_brain.result
@@ -4,6 +4,7 @@ connection node_1;
connection node_2;
call mtr.add_suppression("WSREP: TO isolation failed for: ");
connection node_1;
+call mtr.add_suppression("CREATE TABLE isolation failure");
connection node_2;
Killing server ...
connection node_1;
diff --git a/mysql-test/suite/galera/t/MDEV-20793.test b/mysql-test/suite/galera/t/MDEV-20793.test
index 13ff3cbe77b..6835a73a2a4 100644
--- a/mysql-test/suite/galera/t/MDEV-20793.test
+++ b/mysql-test/suite/galera/t/MDEV-20793.test
@@ -30,9 +30,9 @@ SET GLOBAL wsrep_slave_threads = 2;
SET SESSION wsrep_retry_autocommit = 0;
START TRANSACTION;
UPDATE t1 SET f2 = 1;
-SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
--connection node_1_ctrl
+# set sync point for incoming applier
--let $galera_sync_point = apply_monitor_slave_enter_sync
--source include/galera_set_sync_point.inc
@@ -42,8 +42,11 @@ SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
INSERT INTO t1 VALUES (2, 2);
--connection node_1_ctrl
+# wait to see the INSERT from node_2 reaching applier sync point
--source include/galera_wait_sync_point.inc
--source include/galera_clear_sync_point.inc
+
+# set sync point to catch other write set applying from node_2
--let $galera_sync_point = local_monitor_slave_enter_sync
--source include/galera_set_sync_point.inc
@@ -52,17 +55,38 @@ INSERT INTO t1 VALUES (2, 2);
UPDATE t1 SET f2 = 2 WHERE f1 = 5;
--connection node_1_ctrl
+# wait until both appliers are stopped in sync points
--let $galera_sync_point = apply_monitor_slave_enter_sync local_monitor_slave_enter_sync
--source include/galera_wait_sync_point.inc
+--source include/galera_clear_sync_point.inc
+
+# set sync point for catching node_1 transaction just before committing
+--let $galera_sync_point = after_replicate_sync
+--source include/galera_set_sync_point.inc
--connection node_1
+# set sync point, which will stop execution after COMMIT has been BF aborted
+# and send the COMMIT, it should stop in commit_monitor_master_enter_sync point
+SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
--send COMMIT
--connection node_1_ctrl
+# wait until both appliers and local COMMIT are idle in their sync points
+--let $galera_sync_point = after_replicate_sync apply_monitor_slave_enter_sync local_monitor_slave_enter_sync
+--source include/galera_wait_sync_point.inc
+
+# release local COMMIT processing, it will continue and pause first before certification,
+--let $galera_sync_point = after_replicate_sync
+--source include/galera_signal_sync_point.inc
+
+# release first applier (INSERT), it should BF abort the local COMMIT processing
--let $galera_sync_point = apply_monitor_slave_enter_sync
--source include/galera_signal_sync_point.inc
+
+# wait to see that COMMIT was BF aborted and has reached replaying state
SET SESSION debug_sync = "now WAIT_FOR reached";
+# release the latter applier, with real lock conflict
--let $galera_sync_point = local_monitor_slave_enter_sync
--source include/galera_signal_sync_point.inc
--source include/galera_clear_sync_point.inc
diff --git a/mysql-test/suite/galera/t/MDEV-22051.test b/mysql-test/suite/galera/t/MDEV-22051.test
index b7332c47d69..a5f05f5cf3b 100644
--- a/mysql-test/suite/galera/t/MDEV-22051.test
+++ b/mysql-test/suite/galera/t/MDEV-22051.test
@@ -31,3 +31,4 @@ INSERT INTO t1 VALUES (1);
UNLOCK TABLES;
DROP TABLE t1;
+CALL mtr.add_suppression("CREATE TABLE isolation failure");
diff --git a/mysql-test/suite/galera/t/MDEV-27276.test b/mysql-test/suite/galera/t/MDEV-27276.test
new file mode 100644
index 00000000000..1c589c9e85b
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-27276.test
@@ -0,0 +1,44 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source include/galera_have_debug_sync.inc
+
+#
+# Testing CREATE TABLE statement having foreign key constraint,
+# while having concurrent DML for the referenced parent table.
+#
+# The replication of CREATE TABLE should have all referenced table names
+# appended in the key set, and DML on the parent table should be considered as
+# conflicting.
+#
+# There are related test scenarios in test mysql-wsrep#332, where a regular table
+# is altered by adding new foreign key reference.
+#
+# We use concurrency facility of test MW-369 to setup the conflict between DDL and DML
+#
+
+# Open connection node_1a here, MW-369.inc will use it later
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+# create FK parent table
+--connection node_1
+CREATE TABLE p (id INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+
+# setup conflicting queries
+--let $mw_369_parent_query = INSERT INTO p VALUES(1,0)
+--let $mw_369_child_query = CREATE TABLE c(id INT NOT NULL PRIMARY KEY, p_id INT, FOREIGN KEY (p_id) REFERENCES p(id) ON DELETE CASCADE) ENGINE=InnoDB
+
+# execute above queries through separate nodes
+--source MW-369.inc
+
+# Expect certification failure
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
diff --git a/mysql-test/suite/galera/t/galera_UK_conflict.test b/mysql-test/suite/galera/t/galera_UK_conflict.test
index 25f414a5764..7a14821cc32 100644
--- a/mysql-test/suite/galera/t/galera_UK_conflict.test
+++ b/mysql-test/suite/galera/t/galera_UK_conflict.test
@@ -207,14 +207,16 @@ INSERT INTO t1 VALUES (5, 5, 2);
--source include/galera_set_sync_point.inc
--connection node_1
---let $wait_condition = SELECT COUNT(*) = 7 FROM t1
---source include/wait_condition.inc
-SELECT COUNT(*) FROM t1;
+--send COMMIT
+
+--connection node_1a
# wait for the local commit to enter in commit monitor wait state
--let $galera_sync_point = apply_monitor_slave_enter_sync commit_monitor_master_enter_sync
--source include/galera_wait_sync_point.inc
--source include/galera_clear_sync_point.inc
+# first applier is now waiting in before commit, and local trx in commit monitor
+
# set sync point before replaying
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_replay_cb";
diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_delete.test b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test
index 49b54f0f7f0..901fc1fc6d1 100644
--- a/mysql-test/suite/galera/t/galera_fk_cascade_delete.test
+++ b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test
@@ -68,3 +68,189 @@ SELECT * FROM child;
DROP TABLE child;
DROP TABLE parent;
DROP TABLE grandparent;
+
+--echo
+--echo Scenario 2, testing PA applying with FK cascade delete
+--echo
+
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ ON DELETE CASCADE,
+ CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1)
+ ON DELETE CASCADE);
+
+--let $count = 100
+--disable_query_log
+while ($count)
+{
+ --eval INSERT INTO p1 VALUES ($count, 0);
+ --eval INSERT INTO p2 VALUES ($count, 0);
+ --eval INSERT INTO c VALUES ($count, $count, $count, 0);
+ --dec $count
+}
+
+--connection node_2
+set global wsrep_slave_threads=2;
+
+--connection node_1
+--let $count = 100
+while ($count)
+{
+ --eval DELETE FROM p2 WHERE f1=$count;
+ --eval DELETE FROM p1 WHERE f1=$count;
+
+--dec $count
+}
+--enable_query_log
+
+--connection node_2
+set global wsrep_slave_threads=DEFAULT;
+
+
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+--connection node_1
+DROP TABLE c;
+DROP TABLE p1,p2;
+
+--echo
+--echo Scenario 4, testing PA applying with FK cascade delete on
+--echo more than one level
+--echo
+CREATE TABLE gp1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE gp2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT pfk_3 FOREIGN KEY (p1_id) REFERENCES gp1 (f1)
+ ON DELETE CASCADE
+ ) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY,p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT pfk_4 FOREIGN KEY (p1_id) REFERENCES gp2 (f1)
+ ON DELETE CASCADE
+ ) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ ON DELETE CASCADE,
+ CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1)
+ ON DELETE CASCADE) ENGINE=INNODB;
+
+--let $count = 100
+--disable_query_log
+while ($count)
+{
+ --eval INSERT INTO gp1 VALUES ($count, 0);
+ --eval INSERT INTO gp2 VALUES ($count, 0);
+ --eval INSERT INTO p1 VALUES ($count, $count, $count, 0);
+ --eval INSERT INTO p2 VALUES ($count, $count, $count, 0);
+ --eval INSERT INTO c VALUES ($count, $count, $count, 0);
+ --dec $count
+}
+
+--connection node_2
+set global wsrep_slave_threads=2;
+
+--connection node_1
+--let $count = 100
+while ($count)
+{
+ --eval DELETE FROM gp1 WHERE f1=$count;
+ --eval DELETE FROM gp2 WHERE f1=$count;
+
+--dec $count
+}
+--enable_query_log
+
+--connection node_2
+set global wsrep_slave_threads=DEFAULT;
+
+SELECT * FROM gp1;
+SELECT * FROM gp2;
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+--connection node_1
+DROP TABLE c;
+DROP TABLE p1,p2;
+DROP TABLE gp1,gp2;
+
+--echo
+--echo Scenario 3, testing PA applying with FK cascade delete on
+--echo more than one level in a diamond topology
+--echo
+CREATE TABLE ggp1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE gp1 (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT pfk_6 FOREIGN KEY (p1_id) REFERENCES ggp1 (f1)
+ ON DELETE CASCADE
+ ) ENGINE=INNODB;
+CREATE TABLE gp2 (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT pfk_5 FOREIGN KEY (p1_id) REFERENCES ggp1 (f1)
+ ON DELETE CASCADE
+ ) ENGINE=INNODB;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT pfk_3 FOREIGN KEY (p1_id) REFERENCES gp1 (f1)
+ ON DELETE CASCADE
+ ) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY,p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT pfk_4 FOREIGN KEY (p1_id) REFERENCES gp2 (f1)
+ ON DELETE CASCADE
+ ) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+ f2 INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ ON DELETE CASCADE,
+ CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1)
+ ON DELETE CASCADE) ENGINE=INNODB;
+
+--let $count = 100
+--disable_query_log
+while ($count)
+{
+ --eval INSERT INTO ggp1 VALUES ($count, 0);
+ --eval INSERT INTO gp1 VALUES ($count, $count, $count, 0);
+ --eval INSERT INTO gp2 VALUES ($count, $count, $count, 0);
+ --eval INSERT INTO p1 VALUES ($count, $count, $count, 0);
+ --eval INSERT INTO p2 VALUES ($count, $count, $count, 0);
+ --eval INSERT INTO c VALUES ($count, $count, $count, 0);
+ --dec $count
+}
+
+--connection node_2
+set global wsrep_slave_threads=2;
+
+--connection node_1
+--let $count = 100
+while ($count)
+{
+ --eval DELETE FROM ggp1 WHERE f1=$count;
+
+--dec $count
+}
+--enable_query_log
+
+--connection node_2
+set global wsrep_slave_threads=DEFAULT;
+
+SELECT * FROM ggp1;
+SELECT * FROM gp2;
+SELECT * FROM gp1;
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+--connection node_1
+DROP TABLE c;
+DROP TABLE p1,p2;
+DROP TABLE gp1,gp2;
+DROP TABLE ggp1;
diff --git a/mysql-test/suite/galera/t/galera_split_brain.test b/mysql-test/suite/galera/t/galera_split_brain.test
index ccdfd3fd506..b1ea9c9b4ab 100644
--- a/mysql-test/suite/galera/t/galera_split_brain.test
+++ b/mysql-test/suite/galera/t/galera_split_brain.test
@@ -17,6 +17,7 @@ call mtr.add_suppression("WSREP: TO isolation failed for: ");
--connection node_1
--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+call mtr.add_suppression("CREATE TABLE isolation failure");
--connection node_2
--source include/kill_galera.inc
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#332.test b/mysql-test/suite/galera/t/mysql-wsrep#332.test
index 674a5c3de52..e216dfe79d4 100644
--- a/mysql-test/suite/galera/t/mysql-wsrep#332.test
+++ b/mysql-test/suite/galera/t/mysql-wsrep#332.test
@@ -111,3 +111,4 @@ SELECT * FROM c;
DROP TABLE c;
DROP TABLE p1;
DROP TABLE p2;
+
diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def
index b58ae8332d6..855137c13a3 100644
--- a/mysql-test/suite/galera_3nodes/disabled.def
+++ b/mysql-test/suite/galera_3nodes/disabled.def
@@ -15,7 +15,15 @@ galera_gtid_2_cluster : MDEV-23775 Galera test failure on galera_3nodes.galera_g
galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(}
galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query
galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query
+galera_pc_bootstrap : MDEV-24097 MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
galera_safe_to_bootstrap : MDEV-24097 galera_3nodes.galera_safe_to_bootstrap MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
galera_slave_options_do : MDEV-8798
galera_slave_options_ignore : MDEV-8798
galera_vote_rejoin_mysqldump : MDEV-24481: galera_3nodes.galera_vote_rejoin_mysqldump MTR failed: mysql_shutdown failed
+galera_ipv6_mariabackup : MDEV-24097 MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
+galera_ipv6_mariabackup_section : MDEV-24097 MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
+galera_ipv6_rsync : MDEV-24097 MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
+galera_ipv6_rsync_section : MDEV-24097 MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
+galera_ssl_reload : MDEV-24097 MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
+galera_toi_vote : MDEV-24097 MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
+galera_wsrep_schema_init : MDEV-24097 MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
index 3b0c32547fe..9f1d3fec16e 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
@@ -8,10 +8,10 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
INSERT INTO t1 VALUES (01), (02), (03), (04), (05);
connection node_2;
Unloading wsrep provider ...
-SET GLOBAL wsrep_provider = 'none';
+SET GLOBAL wsrep_cluster_address = '';
connection node_3;
Unloading wsrep provider ...
-SET GLOBAL wsrep_provider = 'none';
+SET GLOBAL wsrep_cluster_address = '';
connection node_1;
INSERT INTO t1 VALUES (11), (12), (13), (14), (15);
INSERT INTO t1 VALUES (21), (22), (23), (24), (25);
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
index b77a810f37d..210a4c2331e 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
@@ -29,9 +29,11 @@ INSERT INTO t1 VALUES (01), (02), (03), (04), (05);
# Disconnect nodes #2 and #3
--connection node_2
+--let $wsrep_cluster_address_orig2 = `select @@wsrep_cluster_address`
--source suite/galera/include/galera_stop_replication.inc
--connection node_3
+--let $wsrep_cluster_address_orig3 = `select @@wsrep_cluster_address`
--source suite/galera/include/galera_stop_replication.inc
--connection node_1
@@ -51,8 +53,8 @@ INSERT INTO t1 VALUES (21), (22), (23), (24), (25);
# ... and restart providers to force IST
--connection node_2
--disable_query_log
---eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
---eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+SET GLOBAL wsrep_cluster_address='';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig2';
--enable_query_log
--connection node_1
@@ -60,8 +62,8 @@ INSERT INTO t1 VALUES (31), (32), (33), (34), (35);
--connection node_3
--disable_query_log
---eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
---eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+SET GLOBAL wsrep_cluster_address='';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig3';
--enable_query_log
--connection node_1
diff --git a/mysql-test/suite/galera_sr/r/galera_sr_slow.result b/mysql-test/suite/galera_sr/r/galera_sr_slow.result
new file mode 100644
index 00000000000..a03aac0d085
--- /dev/null
+++ b/mysql-test/suite/galera_sr/r/galera_sr_slow.result
@@ -0,0 +1,13 @@
+connection node_2;
+connection node_1;
+connection node_1;
+SET GLOBAL wsrep_trx_fragment_unit='bytes';
+SET GLOBAL wsrep_trx_fragment_size=10240000;
+SET GLOBAL slow_query_log=ON;
+SET GLOBAL log_output='TABLE';
+SELECT SLEEP(10);
+SLEEP(10)
+0
+SET GLOBAL wsrep_trx_fragment_unit=DEFAULT;
+SET GLOBAL wsrep_trx_fragment_size=DEFAULT;
+SET GLOBAL log_output=DEFAULT;
diff --git a/mysql-test/suite/galera_sr/t/galera_sr_slow.test b/mysql-test/suite/galera_sr/t/galera_sr_slow.test
new file mode 100644
index 00000000000..d98305102fc
--- /dev/null
+++ b/mysql-test/suite/galera_sr/t/galera_sr_slow.test
@@ -0,0 +1,11 @@
+--source include/galera_cluster.inc
+
+--connection node_1
+SET GLOBAL wsrep_trx_fragment_unit='bytes';
+SET GLOBAL wsrep_trx_fragment_size=10240000;
+SET GLOBAL slow_query_log=ON;
+SET GLOBAL log_output='TABLE';
+SELECT SLEEP(10);
+SET GLOBAL wsrep_trx_fragment_unit=DEFAULT;
+SET GLOBAL wsrep_trx_fragment_size=DEFAULT;
+SET GLOBAL log_output=DEFAULT;
diff --git a/mysql-test/suite/innodb/r/log_file.result b/mysql-test/suite/innodb/r/log_file.result
index 83ca8f07b63..591bd60c2ac 100644
--- a/mysql-test/suite/innodb/r/log_file.result
+++ b/mysql-test/suite/innodb/r/log_file.result
@@ -16,7 +16,6 @@ WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /File .path.to.non-existent.*ib_logfile101: 'create' returned OS error \d+/ in mysqld.1.err
-# Remove ibdata1 & ibdata2
# Successfully let InnoDB create tablespaces
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES
diff --git a/mysql-test/suite/innodb/r/read_only_recover_committed.result b/mysql-test/suite/innodb/r/read_only_recover_committed.result
index e7895ce6d46..f0579a98024 100644
--- a/mysql-test/suite/innodb/r/read_only_recover_committed.result
+++ b/mysql-test/suite/innodb/r/read_only_recover_committed.result
@@ -66,6 +66,13 @@ SELECT * FROM t;
a
3
20
+#
+# MDEV-27332 SIGSEGV in fetch_data_into_cache
+#
+BEGIN;
+SELECT trx_state FROM information_schema.innodb_trx;
+trx_state
+COMMIT;
# restart
SELECT * FROM t;
a
diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result
index 79b5a3de064..7e470c34c32 100644
--- a/mysql-test/suite/innodb/r/temporary_table.result
+++ b/mysql-test/suite/innodb/r/temporary_table.result
@@ -138,6 +138,7 @@ show tables;
Tables_in_test
create temporary table t1 (keyc int, c1 char(100), c2 char(100)) engine = innodb;
ERROR HY000: Can't create table `test`.`t1` (errno: 165 "Table is read only")
+SET GLOBAL innodb_encrypt_tables=DEFAULT;
# test various bad start-up parameters
FOUND 2 /InnoDB: Unable to create temporary file/ in mysqld.1.err
# restart: --innodb_data_file_path=ibdata1:12M:autoextend --innodb_temp_data_file_path=ibdata1:12M:autoextend
diff --git a/mysql-test/suite/innodb/t/log_file.test b/mysql-test/suite/innodb/t/log_file.test
index 76fb013fb8b..2962d58b165 100644
--- a/mysql-test/suite/innodb/t/log_file.test
+++ b/mysql-test/suite/innodb/t/log_file.test
@@ -65,9 +65,6 @@ eval $check_no_innodb;
let SEARCH_PATTERN=File .path.to.non-existent.*ib_logfile101: 'create' returned OS error \d+;
--source include/search_pattern_in_file.inc
---echo # Remove ibdata1 & ibdata2
---remove_file $bugdir/ibdata1
---remove_file $bugdir/ibdata2
--list_files $bugdir
--echo # Successfully let InnoDB create tablespaces
diff --git a/mysql-test/suite/innodb/t/read_only_recover_committed.test b/mysql-test/suite/innodb/t/read_only_recover_committed.test
index 9ad09bb9b3a..439f57e9fad 100644
--- a/mysql-test/suite/innodb/t/read_only_recover_committed.test
+++ b/mysql-test/suite/innodb/t/read_only_recover_committed.test
@@ -78,6 +78,13 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT * FROM t;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
SELECT * FROM t;
+
+--echo #
+--echo # MDEV-27332 SIGSEGV in fetch_data_into_cache
+--echo #
+BEGIN;
+SELECT trx_state FROM information_schema.innodb_trx;
+COMMIT;
--let $restart_parameters=
--source include/restart_mysqld.inc
SELECT * FROM t;
diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test
index 9ad43188da2..092aeb8a466 100644
--- a/mysql-test/suite/innodb/t/temporary_table.test
+++ b/mysql-test/suite/innodb/t/temporary_table.test
@@ -122,6 +122,8 @@ show tables;
--error ER_CANT_CREATE_TABLE
create temporary table t1 (keyc int, c1 char(100), c2 char(100)) engine = innodb;
+SET GLOBAL innodb_encrypt_tables=DEFAULT;
+
--echo # test various bad start-up parameters
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err;
diff --git a/mysql-test/suite/large_tests/r/maria_recover_encrypted.result b/mysql-test/suite/large_tests/r/maria_recover_encrypted.result
new file mode 100644
index 00000000000..a7293d45db6
--- /dev/null
+++ b/mysql-test/suite/large_tests/r/maria_recover_encrypted.result
@@ -0,0 +1,53 @@
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS proc_insert_many;
+CREATE TABLE t1 (
+field1 INTEGER NOT NULL,
+field2 INTEGER NOT NULL,
+field3 INTEGER NOT NULL,
+KEY i_1 (field1),
+KEY i_2 (field2),
+KEY i_3 (field3),
+KEY i_12 (field1, field2),
+KEY i_13 (field1, field3),
+KEY i_21 (field2, field1),
+KEY i_23 (field2, field3),
+KEY i_31 (field3, field1),
+KEY i_32 (field3, field2),
+KEY i_123 (field1, field2, field3),
+KEY i_132 (field1, field3, field2),
+KEY i_213 (field2, field1, field3),
+KEY i_231 (field2, field3, field1),
+KEY i_312 (field3, field1, field2),
+KEY i_321 (field3, field2, field1)
+) ENGINE=Aria;
+CREATE PROCEDURE proc_insert_many()
+BEGIN
+DECLARE iRow INT DEFAULT 0;
+insertRows: LOOP
+IF (iRow = 70000) THEN
+LEAVE insertRows;
+END IF;
+INSERT INTO t1 VALUES (1000000+iRow,2000000+iRow,3000000+iRow);
+SET iRow = iRow + 1;
+END LOOP insertRows;
+END|
+LOCK TABLES t1 WRITE;
+CALL proc_insert_many();
+UNLOCK TABLES;
+SET debug_dbug="d,crash_shutdown";
+shutdown;
+ERROR HY000: Lost connection to MySQL server during query
+SELECT * FROM t1 ORDER BY 1 DESC LIMIT 10;
+field1 field2 field3
+1069999 2069999 3069999
+1069998 2069998 3069998
+1069997 2069997 3069997
+1069996 2069996 3069996
+1069995 2069995 3069995
+1069994 2069994 3069994
+1069993 2069993 3069993
+1069992 2069992 3069992
+1069991 2069991 3069991
+1069990 2069990 3069990
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS proc_insert_many;
diff --git a/mysql-test/suite/large_tests/t/maria_recover_encrypted.test b/mysql-test/suite/large_tests/t/maria_recover_encrypted.test
new file mode 100644
index 00000000000..4c590e5e1f9
--- /dev/null
+++ b/mysql-test/suite/large_tests/t/maria_recover_encrypted.test
@@ -0,0 +1,90 @@
+# MDEV-18187: If server crashes before flushing index pages in an
+# encrypted Aria table, it could permanently fail to repair the table
+
+--source include/have_maria.inc
+--source include/default_charset.inc
+
+# Cleanup
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS proc_insert_many;
+--enable_warnings
+
+# --------
+
+# Configure encryption
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--write_file $MYSQLTEST_VARDIR/key.txt
+1;76025E3ADC78D74819927DB02AAA4C35
+EOF
+
+--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/key.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# Create table with many indexes so that its index size grows quickly
+# and it can be grown to needed size without too many inserts
+CREATE TABLE t1 (
+ field1 INTEGER NOT NULL,
+ field2 INTEGER NOT NULL,
+ field3 INTEGER NOT NULL,
+ KEY i_1 (field1),
+ KEY i_2 (field2),
+ KEY i_3 (field3),
+ KEY i_12 (field1, field2),
+ KEY i_13 (field1, field3),
+ KEY i_21 (field2, field1),
+ KEY i_23 (field2, field3),
+ KEY i_31 (field3, field1),
+ KEY i_32 (field3, field2),
+ KEY i_123 (field1, field2, field3),
+ KEY i_132 (field1, field3, field2),
+ KEY i_213 (field2, field1, field3),
+ KEY i_231 (field2, field3, field1),
+ KEY i_312 (field3, field1, field2),
+ KEY i_321 (field3, field2, field1)
+) ENGINE=Aria;
+
+# Create procedures to insert many rows.
+DELIMITER |;
+CREATE PROCEDURE proc_insert_many()
+BEGIN
+ DECLARE iRow INT DEFAULT 0;
+ insertRows: LOOP
+ IF (iRow = 70000) THEN
+ LEAVE insertRows;
+ END IF;
+
+ INSERT INTO t1 VALUES (1000000+iRow,2000000+iRow,3000000+iRow);
+ SET iRow = iRow + 1;
+ END LOOP insertRows;
+END|
+DELIMITER ;|
+
+# Call the procedure to insert rows.
+# Use 'LOCK TABLES' to make things a lot faster.
+# Note that his code doesn't reproduce for some reason:
+# INSERT INTO t1 SELECT 1000000+seq,2000000+seq,3000000+seq FROM seq_1_to_70000;
+LOCK TABLES t1 WRITE;
+CALL proc_insert_many();
+UNLOCK TABLES;
+
+# Crash and restart the server while it's still flushing index
+--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/key.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET debug_dbug="d,crash_shutdown";
+--error 2013
+shutdown;
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# Access the table to trigger repair; validate repaired data
+SELECT * FROM t1 ORDER BY 1 DESC LIMIT 10;
+
+# --------
+
+# Cleanup
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS proc_insert_many;
diff --git a/mysql-test/suite/rpl/disabled.def b/mysql-test/suite/rpl/disabled.def
index 34f23c5494e..bdc01f9efcb 100644
--- a/mysql-test/suite/rpl/disabled.def
+++ b/mysql-test/suite/rpl/disabled.def
@@ -10,7 +10,6 @@
#
##############################################################################
-#rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings
rpl_partition_archive : MDEV-5077 2013-09-27 svoj Cannot exchange partition with archive table
rpl_row_binlog_max_cache_size : MDEV-11092
rpl_row_index_choice : MDEV-11666
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index 1dd369b8bca..7b359007408 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -1139,6 +1139,15 @@ explain partitions select * from t1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pn # NULL NULL NULL NULL # #
drop table t1;
+#
+# MDEV-27244 Table corruption upon adding serial data type
+#
+create table t1 (f int, key(f)) with system versioning
+partition by system_time limit 10 (partition p0 history, partition pn current);
+alter table t1 add x serial;
+alter table t1 add partition (partition p1 history);
+alter table t1 add partition (partition p2 history);
+drop table t1;
# End of 10.3 tests
#
# MDEV-22283 Server crashes in key_copy or unexpected error 156: The table already existed in the storage engine
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index ac7a3ebfd55..d13993042c8 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -1014,6 +1014,16 @@ explain partitions select * from t1 for system_time as of '2000-01-01 02:00:00';
explain partitions select * from t1;
drop table t1;
+--echo #
+--echo # MDEV-27244 Table corruption upon adding serial data type
+--echo #
+create table t1 (f int, key(f)) with system versioning
+partition by system_time limit 10 (partition p0 history, partition pn current);
+alter table t1 add x serial;
+alter table t1 add partition (partition p1 history);
+alter table t1 add partition (partition p2 history);
+drop table t1;
+
--echo # End of 10.3 tests
--echo #