summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-11-26 17:20:07 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-11-26 17:20:07 +0200
commit7dcbc33db5bd5282f35266ead5d78095848ee0f5 (patch)
treec6715d3d11c49416f7ae3a501adf0d7ab8e95750
parent8fe34dd45f39b22ae0134532b5b5247e4e8620fe (diff)
parent36359157cf2af0161f9ff856ed49c5a147c541f3 (diff)
downloadmariadb-git-7dcbc33db5bd5282f35266ead5d78095848ee0f5.tar.gz
Merge 10.3 into 10.4
-rw-r--r--.travis.yml2
-rw-r--r--extra/yassl/src/ssl.cpp16
-rw-r--r--mysql-test/include/innodb_encrypt_tables.combinations14
-rw-r--r--mysql-test/include/innodb_encrypt_tables.inc4
-rw-r--r--mysql-test/suite/galera/disabled.def10
-rw-r--r--mysql-test/suite/galera/include/have_xtrabackup.inc4
-rw-r--r--mysql-test/suite/galera/r/galera_autoinc_sst_mariabackup.result47
-rw-r--r--mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff114
-rw-r--r--mysql-test/suite/galera/r/galera_ist_mariabackup.result287
-rw-r--r--mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff114
-rw-r--r--mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs.result96
-rw-r--r--mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff19
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key.result3
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup_table_options.result997
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff106
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result97
-rw-r--r--mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff103
-rw-r--r--mysql-test/suite/galera/r/galera_var_reject_queries.result1
-rw-r--r--mysql-test/suite/galera/r/partition.result18
-rw-r--r--mysql-test/suite/galera/suite.pm4
-rw-r--r--mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.test96
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mariabackup.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mariabackup.test16
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf14
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.test12
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.test14
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf16
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.test228
-rw-r--r--mysql-test/suite/galera/t/galera_var_reject_queries.test7
-rw-r--r--mysql-test/suite/galera/t/partition.test14
-rw-r--r--mysql-test/suite/galera_3nodes/disabled.def3
-rw-r--r--mysql-test/suite/innodb/r/truncate.result21
-rw-r--r--mysql-test/suite/innodb/t/truncate.test21
-rw-r--r--sql/sql_parse.cc3
-rw-r--r--sql/table.cc1
-rw-r--r--sql/wsrep_mysqld.cc22
-rw-r--r--sql/wsrep_mysqld.h4
-rw-r--r--sql/wsrep_var.cc3
-rw-r--r--storage/innobase/btr/btr0btr.cc56
-rw-r--r--storage/innobase/btr/btr0bulk.cc6
-rw-r--r--storage/innobase/btr/btr0cur.cc11
-rw-r--r--storage/innobase/btr/btr0defragment.cc10
-rw-r--r--storage/innobase/btr/btr0scrub.cc8
-rw-r--r--storage/innobase/btr/btr0sea.cc8
-rw-r--r--storage/innobase/dict/dict0load.cc2
-rw-r--r--storage/innobase/dict/dict0stats.cc2
-rw-r--r--storage/innobase/fil/fil0fil.cc4
-rw-r--r--storage/innobase/fts/fts0fts.cc14
-rw-r--r--storage/innobase/gis/gis0rtree.cc6
-rw-r--r--storage/innobase/gis/gis0sea.cc8
-rw-r--r--storage/innobase/handler/ha_innodb.cc29
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc2
-rw-r--r--storage/innobase/include/row0mysql.h5
-rw-r--r--storage/innobase/include/row0row.h2
-rw-r--r--storage/innobase/lock/lock0lock.cc11
-rw-r--r--storage/innobase/page/page0page.cc2
-rw-r--r--storage/innobase/row/row0ftsort.cc8
-rw-r--r--storage/innobase/row/row0import.cc2
-rw-r--r--storage/innobase/row/row0log.cc8
-rw-r--r--storage/innobase/row/row0merge.cc14
-rw-r--r--storage/innobase/row/row0mysql.cc40
-rw-r--r--storage/innobase/row/row0quiesce.cc8
-rw-r--r--storage/innobase/row/row0sel.cc2
-rw-r--r--storage/innobase/row/row0uins.cc2
-rw-r--r--storage/innobase/row/row0upd.cc2
68 files changed, 2589 insertions, 274 deletions
diff --git a/.travis.yml b/.travis.yml
index 95e0796099b..629e3b31523 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,7 +11,7 @@ language: cpp
os:
- linux
- osx
-osx_image: xcode9.1
+osx_image: xcode10.1
compiler:
- gcc
- clang
diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 51e1bd1ab21..d0234a6b68e 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -295,6 +295,7 @@ int SSL_connect(SSL* ssl)
sendClientHello(*ssl);
if (!ssl->GetError())
ssl->useStates().UseConnect() = CLIENT_HELLO_SENT;
+ /* fall through */
case CLIENT_HELLO_SENT :
neededState = ssl->getSecurity().get_resuming() ?
@@ -302,13 +303,14 @@ int SSL_connect(SSL* ssl)
while (ssl->getStates().getClient() < neededState) {
if (ssl->GetError()) break;
processReply(*ssl);
- // if resumption failed, reset needed state
+ // if resumption failed, reset needed state
if (neededState == serverFinishedComplete)
if (!ssl->getSecurity().get_resuming())
neededState = serverHelloDoneComplete;
}
if (!ssl->GetError())
ssl->useStates().UseConnect() = FIRST_REPLY_DONE;
+ /* fall through */
case FIRST_REPLY_DONE :
if(ssl->getCrypto().get_certManager().sendVerify())
@@ -326,6 +328,7 @@ int SSL_connect(SSL* ssl)
if (!ssl->GetError())
ssl->useStates().UseConnect() = FINISHED_DONE;
+ /* fall through */
case FINISHED_DONE :
if (!ssl->getSecurity().get_resuming())
@@ -335,6 +338,7 @@ int SSL_connect(SSL* ssl)
}
if (!ssl->GetError())
ssl->useStates().UseConnect() = SECOND_REPLY_DONE;
+ /* fall through */
case SECOND_REPLY_DONE :
ssl->verifyState(serverFinishedComplete);
@@ -343,7 +347,7 @@ int SSL_connect(SSL* ssl)
if (ssl->GetError()) {
GetErrors().Add(ssl->GetError());
return SSL_FATAL_ERROR;
- }
+ }
return SSL_SUCCESS;
default :
@@ -371,7 +375,6 @@ int SSL_accept(SSL* ssl)
ssl->SetError(no_error);
if (ssl->GetError() == YasslError(SSL_ERROR_WANT_WRITE)) {
-
ssl->SetError(no_error);
ssl->SendWriteBuffered();
if (!ssl->GetError())
@@ -385,6 +388,7 @@ int SSL_accept(SSL* ssl)
processReply(*ssl);
if (!ssl->GetError())
ssl->useStates().UseAccept() = ACCEPT_FIRST_REPLY_DONE;
+ /* fall through */
case ACCEPT_FIRST_REPLY_DONE :
sendServerHello(*ssl);
@@ -401,9 +405,10 @@ int SSL_accept(SSL* ssl)
sendServerHelloDone(*ssl);
ssl->flushBuffer();
}
-
+
if (!ssl->GetError())
ssl->useStates().UseAccept() = SERVER_HELLO_DONE;
+ /* fall through */
case SERVER_HELLO_DONE :
if (!ssl->getSecurity().get_resuming()) {
@@ -414,6 +419,7 @@ int SSL_accept(SSL* ssl)
}
if (!ssl->GetError())
ssl->useStates().UseAccept() = ACCEPT_SECOND_REPLY_DONE;
+ /* fall through */
case ACCEPT_SECOND_REPLY_DONE :
sendChangeCipher(*ssl);
@@ -422,6 +428,7 @@ int SSL_accept(SSL* ssl)
if (!ssl->GetError())
ssl->useStates().UseAccept() = ACCEPT_FINISHED_DONE;
+ /* fall through */
case ACCEPT_FINISHED_DONE :
if (ssl->getSecurity().get_resuming()) {
@@ -432,6 +439,7 @@ int SSL_accept(SSL* ssl)
}
if (!ssl->GetError())
ssl->useStates().UseAccept() = ACCEPT_THIRD_REPLY_DONE;
+ /* fall through */
case ACCEPT_THIRD_REPLY_DONE :
ssl->useLog().ShowTCP(ssl->getSocket().get_fd());
diff --git a/mysql-test/include/innodb_encrypt_tables.combinations b/mysql-test/include/innodb_encrypt_tables.combinations
new file mode 100644
index 00000000000..cb32fea998a
--- /dev/null
+++ b/mysql-test/include/innodb_encrypt_tables.combinations
@@ -0,0 +1,14 @@
+[crypt]
+innodb_encrypt_tables=ON
+plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+loose-file-key-management
+loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
+file-key-management-encryption-algorithm=aes_ctr
+
+[clear]
+innodb_encrypt_tables=OFF
+plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+loose-file-key-management
+loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
+file-key-management-encryption-algorithm=aes_ctr
+
diff --git a/mysql-test/include/innodb_encrypt_tables.inc b/mysql-test/include/innodb_encrypt_tables.inc
new file mode 100644
index 00000000000..31ab7999aef
--- /dev/null
+++ b/mysql-test/include/innodb_encrypt_tables.inc
@@ -0,0 +1,4 @@
+# The goal of including this file is to enable innodb_encrypt_tables combinations
+# (see include/innodb_encrypt_tables.combinations)
+
+--source include/have_innodb.inc
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index e84832458a3..8be4f7e4748 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -44,8 +44,16 @@ galera_kill_ddl : MDEV-17108 Test failure on galera.galera_kill_ddl
galera_var_node_address : MDEV-17151 Galera test failure on galera.galera_var_node_address
galera_binlog_stmt_autoinc: MDEV-17106 Test failure on galera.galera_binlog_stmt_autoinc
galera_gc_fc_limit : MDEV-17061 Test failure on galera.galera_gc_fc_limit
-partition : MDEV-13881 galera.partition failed in buildbot with wrong result
galera_as_slave_replication_budle : MDEV-15785 Test case galera_as_slave_replication_bundle caused debug assertion
galera_wan : MDEV-17259: Test failure on galera.galera_wan
galera_pc_ignore_sb : MDEV-17357 Test failure on galera.galera_pc_ignore_sb
galera_drop_database : test
+galera_autoinc_sst_xtrabackup : xtrabackup is deprecated
+galera_ist_xtrabackup-v2 : xtrabackup is deprecated
+galera_sst_xtrabackup-v2_data_dir : xtrabackup is deprecated
+galera_sst_xtrabackup-v2_encrypt_with_key : xtrabackup is deprecated
+galera_sst_xtrabackup-v2-options : xtrabackup is deprecated
+galera_ist_innodb_flush_logs : xtrabackup is deprecated
+galera_sst_xtrabackup-v2 : xtrabackup is deprecated
+
+galera_sst_mariabackup_table_options : refuses to start due to encryption
diff --git a/mysql-test/suite/galera/include/have_xtrabackup.inc b/mysql-test/suite/galera/include/have_xtrabackup.inc
deleted file mode 100644
index 0dd693f2c63..00000000000
--- a/mysql-test/suite/galera/include/have_xtrabackup.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-#
-# suite.pm will make sure that all tests including this file
-# will be skipped as needed
-#
diff --git a/mysql-test/suite/galera/r/galera_autoinc_sst_mariabackup.result b/mysql-test/suite/galera/r/galera_autoinc_sst_mariabackup.result
new file mode 100644
index 00000000000..d0fac1e3d14
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_autoinc_sst_mariabackup.result
@@ -0,0 +1,47 @@
+connection node_1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+CREATE PROCEDURE p1 ()
+BEGIN
+DECLARE x INT DEFAULT 1;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+WHILE 1 DO
+INSERT INTO t1 VALUES (DEFAULT);
+COMMIT;
+END WHILE;
+END|
+CALL p1();;
+connection node_2;
+CALL p1();;
+connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
+connection node_2a;
+Killing server ...
+INSERT INTO t1 VALUES (DEFAULT);
+connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+connection node_1a;
+INSERT INTO t1 VALUES (DEFAULT);
+connection node_1;
+Got one of the listed errors
+connection node_2;
+Got one of the listed errors
+connection node_1a;
+connection node_2a;
+count_equal
+1
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE
+2
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+connection node_1a;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE
+2
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff
new file mode 100644
index 00000000000..9684e290778
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff
@@ -0,0 +1,114 @@
+--- r/galera_ist_mariabackup.result 2018-11-21 22:30:21.968817468 +0200
++++ r/galera_ist_mariabackup.reject 2018-11-22 09:16:27.832601754 +0200
+@@ -285,3 +285,111 @@
+ DROP TABLE t1;
+ COMMIT;
+ SET AUTOCOMMIT=ON;
++Performing State Transfer on a server that has been killed and restarted
++while a DDL was in progress on it
++connection node_1;
++CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++connection node_2;
++START TRANSACTION;
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++COMMIT;
++SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
++connection node_1;
++ALTER TABLE t1 ADD COLUMN f2 INTEGER;
++connection node_2;
++SET wsrep_sync_wait = 0;
++Killing server ...
++connection node_1;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++COMMIT;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++connection node_2;
++Performing --wsrep-recover ...
++connection node_2;
++Starting server ...
++Using --wsrep-start-position when starting mysqld ...
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++COMMIT;
++connection node_1;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++COMMIT;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++COMMIT;
++connection node_1a_galera_st_kill_slave_ddl;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++ROLLBACK;
++SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
++COUNT(*) = 2
++1
++SELECT COUNT(*) = 35 FROM t1;
++COUNT(*) = 35
++1
++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
++COUNT(*) = 0
++1
++COMMIT;
++SET AUTOCOMMIT=ON;
++connection node_1;
++SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
++COUNT(*) = 2
++1
++SELECT COUNT(*) = 35 FROM t1;
++COUNT(*) = 35
++1
++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
++COUNT(*) = 0
++1
++DROP TABLE t1;
++COMMIT;
++SET AUTOCOMMIT=ON;
++SET GLOBAL debug_dbug = $debug_orig;
diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup.result b/mysql-test/suite/galera/r/galera_ist_mariabackup.result
new file mode 100644
index 00000000000..8a7c02ab1b6
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_mariabackup.result
@@ -0,0 +1,287 @@
+connection node_1;
+connection node_2;
+Performing State Transfer on a server that has been temporarily disconnected
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Loading wsrep provider ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_disconnect_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been shut down cleanly and restarted
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_shutdown_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_kill_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff
new file mode 100644
index 00000000000..792f98b4427
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff
@@ -0,0 +1,114 @@
+--- r/galera_ist_mariabackup_innodb_flush_logs.result 2018-11-21 21:34:20.157054441 +0200
++++ r/galera_ist_mariabackup_innodb_flush_logs.reject 2018-11-22 09:16:16.824604445 +0200
+@@ -94,3 +94,111 @@
+ DROP TABLE t1;
+ COMMIT;
+ SET AUTOCOMMIT=ON;
++Performing State Transfer on a server that has been killed and restarted
++while a DDL was in progress on it
++connection node_1;
++CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++connection node_2;
++START TRANSACTION;
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++COMMIT;
++SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
++connection node_1;
++ALTER TABLE t1 ADD COLUMN f2 INTEGER;
++connection node_2;
++SET wsrep_sync_wait = 0;
++Killing server ...
++connection node_1;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++COMMIT;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++connection node_2;
++Performing --wsrep-recover ...
++connection node_2;
++Starting server ...
++Using --wsrep-start-position when starting mysqld ...
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++COMMIT;
++connection node_1;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++COMMIT;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++COMMIT;
++connection node_1a_galera_st_kill_slave_ddl;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++ROLLBACK;
++SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
++COUNT(*) = 2
++1
++SELECT COUNT(*) = 35 FROM t1;
++COUNT(*) = 35
++1
++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
++COUNT(*) = 0
++1
++COMMIT;
++SET AUTOCOMMIT=ON;
++connection node_1;
++SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
++COUNT(*) = 2
++1
++SELECT COUNT(*) = 35 FROM t1;
++COUNT(*) = 35
++1
++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
++COUNT(*) = 0
++1
++DROP TABLE t1;
++COMMIT;
++SET AUTOCOMMIT=ON;
++SET GLOBAL debug_dbug = $debug_orig;
diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs.result b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs.result
new file mode 100644
index 00000000000..7813b5a58fc
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs.result
@@ -0,0 +1,96 @@
+Performing State Transfer on a server that has been killed and restarted
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_kill_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff
index 74e6abd713f..141b1ebd25f 100644
--- a/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff
@@ -1,11 +1,12 @@
---- r/galera_ist_mysqldump.result 2018-09-11 12:38:42.027479411 +0300
-+++ r/galera_ist_mysqldump.reject 2018-09-17 10:28:44.483441364 +0300
-@@ -180,6 +180,103 @@
+--- r/galera_ist_mysqldump.result 2018-11-22 14:25:28.551554055 +0200
++++ r/galera_ist_mysqldump.reject 2018-11-22 15:46:33.119441931 +0200
+@@ -200,6 +200,114 @@
DROP TABLE t1;
COMMIT;
SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
++connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
@@ -14,6 +15,7 @@
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
++connection node_2;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
@@ -22,9 +24,12 @@
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
++connection node_1;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
++connection node_2;
+SET wsrep_sync_wait = 0;
+Killing server ...
++connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
@@ -39,6 +44,7 @@
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
@@ -46,7 +52,9 @@
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++connection node_2;
+Performing --wsrep-recover ...
++connection node_2;
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
@@ -57,6 +65,7 @@
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
++connection node_1;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
@@ -71,6 +80,7 @@
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
++connection node_1a_galera_st_kill_slave_ddl;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
@@ -88,6 +98,7 @@
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
++connection node_1;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
@@ -101,6 +112,6 @@
+COMMIT;
+SET AUTOCOMMIT=ON;
+SET GLOBAL debug_dbug = $debug_orig;
+ connection node_1;
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
DROP USER sst;
- CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff
index 8b091eb370a..819bcba7cac 100644
--- a/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff
@@ -1,5 +1,5 @@
---- galera_sst_mariabackup.result
-+++ galera_sst_mariabackup,debug.reject
+--- r/galera_sst_mariabackup.result 2018-11-21 16:50:35.766982279 +0200
++++ r/galera_sst_mariabackup.reject 2018-11-22 09:20:10.344408266 +0200
@@ -286,5 +286,113 @@
DROP TABLE t1;
COMMIT;
diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key.result b/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key.result
new file mode 100644
index 00000000000..990e0a29506
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key.result
@@ -0,0 +1,3 @@
+SELECT 1;
+1
+1
diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_table_options.result b/mysql-test/suite/galera/r/galera_sst_mariabackup_table_options.result
new file mode 100644
index 00000000000..9180ed5e421
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_table_options.result
@@ -0,0 +1,997 @@
+connection node_1;
+connection node_2;
+Performing State Transfer on a server that starts from a clean var directory
+This is accomplished by shutting down node #2 and removing its var directory before restarting it
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 CHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1;
+CREATE TABLE t3 (f1 CHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=NO;
+CREATE TABLE t4 (f1 CHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES;
+CREATE TABLE t5 (f1 CHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+CREATE TABLE t6 (f1 CHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=NO;
+CREATE TABLE t7 (f1 CHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES;
+CREATE TABLE t8 (f1 CHAR(255)) ENGINE=InnoDB ENCRYPTED=NO;
+CREATE TABLE t9 (f1 CHAR(255)) ENGINE=InnoDB ENCRYPTED=YES;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+insert into t9 values ('node1_committed_before');
+insert into t9 values ('node1_committed_before');
+insert into t9 values ('node1_committed_before');
+insert into t9 values ('node1_committed_before');
+insert into t9 values ('node1_committed_before');
+insert into t8 values ('node1_committed_before');
+insert into t8 values ('node1_committed_before');
+insert into t8 values ('node1_committed_before');
+insert into t8 values ('node1_committed_before');
+insert into t8 values ('node1_committed_before');
+insert into t7 values ('node1_committed_before');
+insert into t7 values ('node1_committed_before');
+insert into t7 values ('node1_committed_before');
+insert into t7 values ('node1_committed_before');
+insert into t7 values ('node1_committed_before');
+insert into t6 values ('node1_committed_before');
+insert into t6 values ('node1_committed_before');
+insert into t6 values ('node1_committed_before');
+insert into t6 values ('node1_committed_before');
+insert into t6 values ('node1_committed_before');
+insert into t5 values ('node1_committed_before');
+insert into t5 values ('node1_committed_before');
+insert into t5 values ('node1_committed_before');
+insert into t5 values ('node1_committed_before');
+insert into t5 values ('node1_committed_before');
+insert into t4 values ('node1_committed_before');
+insert into t4 values ('node1_committed_before');
+insert into t4 values ('node1_committed_before');
+insert into t4 values ('node1_committed_before');
+insert into t4 values ('node1_committed_before');
+insert into t3 values ('node1_committed_before');
+insert into t3 values ('node1_committed_before');
+insert into t3 values ('node1_committed_before');
+insert into t3 values ('node1_committed_before');
+insert into t3 values ('node1_committed_before');
+insert into t2 values ('node1_committed_before');
+insert into t2 values ('node1_committed_before');
+insert into t2 values ('node1_committed_before');
+insert into t2 values ('node1_committed_before');
+insert into t2 values ('node1_committed_before');
+insert into t1 values ('node1_committed_before');
+insert into t1 values ('node1_committed_before');
+insert into t1 values ('node1_committed_before');
+insert into t1 values ('node1_committed_before');
+insert into t1 values ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+insert into t9 values ('node2_committed_before');
+insert into t9 values ('node2_committed_before');
+insert into t9 values ('node2_committed_before');
+insert into t9 values ('node2_committed_before');
+insert into t9 values ('node2_committed_before');
+insert into t8 values ('node2_committed_before');
+insert into t8 values ('node2_committed_before');
+insert into t8 values ('node2_committed_before');
+insert into t8 values ('node2_committed_before');
+insert into t8 values ('node2_committed_before');
+insert into t7 values ('node2_committed_before');
+insert into t7 values ('node2_committed_before');
+insert into t7 values ('node2_committed_before');
+insert into t7 values ('node2_committed_before');
+insert into t7 values ('node2_committed_before');
+insert into t6 values ('node2_committed_before');
+insert into t6 values ('node2_committed_before');
+insert into t6 values ('node2_committed_before');
+insert into t6 values ('node2_committed_before');
+insert into t6 values ('node2_committed_before');
+insert into t5 values ('node2_committed_before');
+insert into t5 values ('node2_committed_before');
+insert into t5 values ('node2_committed_before');
+insert into t5 values ('node2_committed_before');
+insert into t5 values ('node2_committed_before');
+insert into t4 values ('node2_committed_before');
+insert into t4 values ('node2_committed_before');
+insert into t4 values ('node2_committed_before');
+insert into t4 values ('node2_committed_before');
+insert into t4 values ('node2_committed_before');
+insert into t3 values ('node2_committed_before');
+insert into t3 values ('node2_committed_before');
+insert into t3 values ('node2_committed_before');
+insert into t3 values ('node2_committed_before');
+insert into t3 values ('node2_committed_before');
+insert into t2 values ('node2_committed_before');
+insert into t2 values ('node2_committed_before');
+insert into t2 values ('node2_committed_before');
+insert into t2 values ('node2_committed_before');
+insert into t2 values ('node2_committed_before');
+insert into t1 values ('node2_committed_before');
+insert into t1 values ('node2_committed_before');
+insert into t1 values ('node2_committed_before');
+insert into t1 values ('node2_committed_before');
+insert into t1 values ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+connection node_1;
+Cleaning var directory ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+insert into t9 values ('node1_committed_during');
+insert into t9 values ('node1_committed_during');
+insert into t9 values ('node1_committed_during');
+insert into t9 values ('node1_committed_during');
+insert into t9 values ('node1_committed_during');
+insert into t8 values ('node1_committed_during');
+insert into t8 values ('node1_committed_during');
+insert into t8 values ('node1_committed_during');
+insert into t8 values ('node1_committed_during');
+insert into t8 values ('node1_committed_during');
+insert into t7 values ('node1_committed_during');
+insert into t7 values ('node1_committed_during');
+insert into t7 values ('node1_committed_during');
+insert into t7 values ('node1_committed_during');
+insert into t7 values ('node1_committed_during');
+insert into t6 values ('node1_committed_during');
+insert into t6 values ('node1_committed_during');
+insert into t6 values ('node1_committed_during');
+insert into t6 values ('node1_committed_during');
+insert into t6 values ('node1_committed_during');
+insert into t5 values ('node1_committed_during');
+insert into t5 values ('node1_committed_during');
+insert into t5 values ('node1_committed_during');
+insert into t5 values ('node1_committed_during');
+insert into t5 values ('node1_committed_during');
+insert into t4 values ('node1_committed_during');
+insert into t4 values ('node1_committed_during');
+insert into t4 values ('node1_committed_during');
+insert into t4 values ('node1_committed_during');
+insert into t4 values ('node1_committed_during');
+insert into t3 values ('node1_committed_during');
+insert into t3 values ('node1_committed_during');
+insert into t3 values ('node1_committed_during');
+insert into t3 values ('node1_committed_during');
+insert into t3 values ('node1_committed_during');
+insert into t2 values ('node1_committed_during');
+insert into t2 values ('node1_committed_during');
+insert into t2 values ('node1_committed_during');
+insert into t2 values ('node1_committed_during');
+insert into t2 values ('node1_committed_during');
+insert into t1 values ('node1_committed_during');
+insert into t1 values ('node1_committed_during');
+insert into t1 values ('node1_committed_during');
+insert into t1 values ('node1_committed_during');
+insert into t1 values ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+insert into t9 values ('node1_to_be_committed_after');
+insert into t9 values ('node1_to_be_committed_after');
+insert into t9 values ('node1_to_be_committed_after');
+insert into t9 values ('node1_to_be_committed_after');
+insert into t9 values ('node1_to_be_committed_after');
+insert into t8 values ('node1_to_be_committed_after');
+insert into t8 values ('node1_to_be_committed_after');
+insert into t8 values ('node1_to_be_committed_after');
+insert into t8 values ('node1_to_be_committed_after');
+insert into t8 values ('node1_to_be_committed_after');
+insert into t7 values ('node1_to_be_committed_after');
+insert into t7 values ('node1_to_be_committed_after');
+insert into t7 values ('node1_to_be_committed_after');
+insert into t7 values ('node1_to_be_committed_after');
+insert into t7 values ('node1_to_be_committed_after');
+insert into t6 values ('node1_to_be_committed_after');
+insert into t6 values ('node1_to_be_committed_after');
+insert into t6 values ('node1_to_be_committed_after');
+insert into t6 values ('node1_to_be_committed_after');
+insert into t6 values ('node1_to_be_committed_after');
+insert into t5 values ('node1_to_be_committed_after');
+insert into t5 values ('node1_to_be_committed_after');
+insert into t5 values ('node1_to_be_committed_after');
+insert into t5 values ('node1_to_be_committed_after');
+insert into t5 values ('node1_to_be_committed_after');
+insert into t4 values ('node1_to_be_committed_after');
+insert into t4 values ('node1_to_be_committed_after');
+insert into t4 values ('node1_to_be_committed_after');
+insert into t4 values ('node1_to_be_committed_after');
+insert into t4 values ('node1_to_be_committed_after');
+insert into t3 values ('node1_to_be_committed_after');
+insert into t3 values ('node1_to_be_committed_after');
+insert into t3 values ('node1_to_be_committed_after');
+insert into t3 values ('node1_to_be_committed_after');
+insert into t3 values ('node1_to_be_committed_after');
+insert into t2 values ('node1_to_be_committed_after');
+insert into t2 values ('node1_to_be_committed_after');
+insert into t2 values ('node1_to_be_committed_after');
+insert into t2 values ('node1_to_be_committed_after');
+insert into t2 values ('node1_to_be_committed_after');
+insert into t1 values ('node1_to_be_committed_after');
+insert into t1 values ('node1_to_be_committed_after');
+insert into t1 values ('node1_to_be_committed_after');
+insert into t1 values ('node1_to_be_committed_after');
+insert into t1 values ('node1_to_be_committed_after');
+connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+insert into t9 values ('node1_to_be_rollbacked_after');
+insert into t9 values ('node1_to_be_rollbacked_after');
+insert into t9 values ('node1_to_be_rollbacked_after');
+insert into t9 values ('node1_to_be_rollbacked_after');
+insert into t9 values ('node1_to_be_rollbacked_after');
+insert into t8 values ('node1_to_be_rollbacked_after');
+insert into t8 values ('node1_to_be_rollbacked_after');
+insert into t8 values ('node1_to_be_rollbacked_after');
+insert into t8 values ('node1_to_be_rollbacked_after');
+insert into t8 values ('node1_to_be_rollbacked_after');
+insert into t7 values ('node1_to_be_rollbacked_after');
+insert into t7 values ('node1_to_be_rollbacked_after');
+insert into t7 values ('node1_to_be_rollbacked_after');
+insert into t7 values ('node1_to_be_rollbacked_after');
+insert into t7 values ('node1_to_be_rollbacked_after');
+insert into t6 values ('node1_to_be_rollbacked_after');
+insert into t6 values ('node1_to_be_rollbacked_after');
+insert into t6 values ('node1_to_be_rollbacked_after');
+insert into t6 values ('node1_to_be_rollbacked_after');
+insert into t6 values ('node1_to_be_rollbacked_after');
+insert into t5 values ('node1_to_be_rollbacked_after');
+insert into t5 values ('node1_to_be_rollbacked_after');
+insert into t5 values ('node1_to_be_rollbacked_after');
+insert into t5 values ('node1_to_be_rollbacked_after');
+insert into t5 values ('node1_to_be_rollbacked_after');
+insert into t4 values ('node1_to_be_rollbacked_after');
+insert into t4 values ('node1_to_be_rollbacked_after');
+insert into t4 values ('node1_to_be_rollbacked_after');
+insert into t4 values ('node1_to_be_rollbacked_after');
+insert into t4 values ('node1_to_be_rollbacked_after');
+insert into t3 values ('node1_to_be_rollbacked_after');
+insert into t3 values ('node1_to_be_rollbacked_after');
+insert into t3 values ('node1_to_be_rollbacked_after');
+insert into t3 values ('node1_to_be_rollbacked_after');
+insert into t3 values ('node1_to_be_rollbacked_after');
+insert into t2 values ('node1_to_be_rollbacked_after');
+insert into t2 values ('node1_to_be_rollbacked_after');
+insert into t2 values ('node1_to_be_rollbacked_after');
+insert into t2 values ('node1_to_be_rollbacked_after');
+insert into t2 values ('node1_to_be_rollbacked_after');
+insert into t1 values ('node1_to_be_rollbacked_after');
+insert into t1 values ('node1_to_be_rollbacked_after');
+insert into t1 values ('node1_to_be_rollbacked_after');
+insert into t1 values ('node1_to_be_rollbacked_after');
+insert into t1 values ('node1_to_be_rollbacked_after');
+connection node_2;
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+COMMIT;
+connection node_1;
+insert into t9 values ('node1_to_be_committed_after');
+insert into t9 values ('node1_to_be_committed_after');
+insert into t9 values ('node1_to_be_committed_after');
+insert into t9 values ('node1_to_be_committed_after');
+insert into t9 values ('node1_to_be_committed_after');
+insert into t8 values ('node1_to_be_committed_after');
+insert into t8 values ('node1_to_be_committed_after');
+insert into t8 values ('node1_to_be_committed_after');
+insert into t8 values ('node1_to_be_committed_after');
+insert into t8 values ('node1_to_be_committed_after');
+insert into t7 values ('node1_to_be_committed_after');
+insert into t7 values ('node1_to_be_committed_after');
+insert into t7 values ('node1_to_be_committed_after');
+insert into t7 values ('node1_to_be_committed_after');
+insert into t7 values ('node1_to_be_committed_after');
+insert into t6 values ('node1_to_be_committed_after');
+insert into t6 values ('node1_to_be_committed_after');
+insert into t6 values ('node1_to_be_committed_after');
+insert into t6 values ('node1_to_be_committed_after');
+insert into t6 values ('node1_to_be_committed_after');
+insert into t5 values ('node1_to_be_committed_after');
+insert into t5 values ('node1_to_be_committed_after');
+insert into t5 values ('node1_to_be_committed_after');
+insert into t5 values ('node1_to_be_committed_after');
+insert into t5 values ('node1_to_be_committed_after');
+insert into t4 values ('node1_to_be_committed_after');
+insert into t4 values ('node1_to_be_committed_after');
+insert into t4 values ('node1_to_be_committed_after');
+insert into t4 values ('node1_to_be_committed_after');
+insert into t4 values ('node1_to_be_committed_after');
+insert into t3 values ('node1_to_be_committed_after');
+insert into t3 values ('node1_to_be_committed_after');
+insert into t3 values ('node1_to_be_committed_after');
+insert into t3 values ('node1_to_be_committed_after');
+insert into t3 values ('node1_to_be_committed_after');
+insert into t2 values ('node1_to_be_committed_after');
+insert into t2 values ('node1_to_be_committed_after');
+insert into t2 values ('node1_to_be_committed_after');
+insert into t2 values ('node1_to_be_committed_after');
+insert into t2 values ('node1_to_be_committed_after');
+insert into t1 values ('node1_to_be_committed_after');
+insert into t1 values ('node1_to_be_committed_after');
+insert into t1 values ('node1_to_be_committed_after');
+insert into t1 values ('node1_to_be_committed_after');
+insert into t1 values ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+insert into t9 values ('node1_committed_after');
+insert into t9 values ('node1_committed_after');
+insert into t9 values ('node1_committed_after');
+insert into t9 values ('node1_committed_after');
+insert into t9 values ('node1_committed_after');
+insert into t8 values ('node1_committed_after');
+insert into t8 values ('node1_committed_after');
+insert into t8 values ('node1_committed_after');
+insert into t8 values ('node1_committed_after');
+insert into t8 values ('node1_committed_after');
+insert into t7 values ('node1_committed_after');
+insert into t7 values ('node1_committed_after');
+insert into t7 values ('node1_committed_after');
+insert into t7 values ('node1_committed_after');
+insert into t7 values ('node1_committed_after');
+insert into t6 values ('node1_committed_after');
+insert into t6 values ('node1_committed_after');
+insert into t6 values ('node1_committed_after');
+insert into t6 values ('node1_committed_after');
+insert into t6 values ('node1_committed_after');
+insert into t5 values ('node1_committed_after');
+insert into t5 values ('node1_committed_after');
+insert into t5 values ('node1_committed_after');
+insert into t5 values ('node1_committed_after');
+insert into t5 values ('node1_committed_after');
+insert into t4 values ('node1_committed_after');
+insert into t4 values ('node1_committed_after');
+insert into t4 values ('node1_committed_after');
+insert into t4 values ('node1_committed_after');
+insert into t4 values ('node1_committed_after');
+insert into t3 values ('node1_committed_after');
+insert into t3 values ('node1_committed_after');
+insert into t3 values ('node1_committed_after');
+insert into t3 values ('node1_committed_after');
+insert into t3 values ('node1_committed_after');
+insert into t2 values ('node1_committed_after');
+insert into t2 values ('node1_committed_after');
+insert into t2 values ('node1_committed_after');
+insert into t2 values ('node1_committed_after');
+insert into t2 values ('node1_committed_after');
+insert into t1 values ('node1_committed_after');
+insert into t1 values ('node1_committed_after');
+insert into t1 values ('node1_committed_after');
+insert into t1 values ('node1_committed_after');
+insert into t1 values ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_clean_slave;
+ROLLBACK;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t4;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t5;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t6;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t7;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t8;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t9;
+COUNT(*)
+30
+SELECT * FROM t1;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t2;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t3;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t4;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t5;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t6;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t7;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t8;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t9;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t4;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t5;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t6;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t7;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t8;
+COUNT(*)
+30
+SELECT COUNT(*) FROM t9;
+COUNT(*)
+30
+SELECT * FROM t1;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t2;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t3;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t4;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t5;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t6;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t7;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t8;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+SELECT * FROM t9;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node1_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node2_committed_before
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_committed_during
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_to_be_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+node1_committed_after
+COMMIT;
+DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9;
+COMMIT;
+SET AUTOCOMMIT=ON;
+disconnect node_2;
+disconnect node_1;
diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff
new file mode 100644
index 00000000000..4a7db96dc22
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff
@@ -0,0 +1,106 @@
+--- r/galera_sst_mysqldump_with_key.result 2018-11-19 09:56:30.081976558 +0200
++++ r/galera_sst_mysqldump_with_key.reject 2018-11-19 10:47:41.609299365 +0200
+@@ -183,6 +183,103 @@
+ DROP TABLE t1;
+ COMMIT;
+ SET AUTOCOMMIT=ON;
++Performing State Transfer on a server that has been killed and restarted
++while a DDL was in progress on it
++CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++START TRANSACTION;
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++COMMIT;
++SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
++ALTER TABLE t1 ADD COLUMN f2 INTEGER;
++SET wsrep_sync_wait = 0;
++Killing server ...
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++COMMIT;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++Performing --wsrep-recover ...
++Starting server ...
++Using --wsrep-start-position when starting mysqld ...
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++COMMIT;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++COMMIT;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++COMMIT;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++ROLLBACK;
++SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
++COUNT(*) = 2
++1
++SELECT COUNT(*) = 35 FROM t1;
++COUNT(*) = 35
++1
++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
++COUNT(*) = 0
++1
++COMMIT;
++SET AUTOCOMMIT=ON;
++SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
++COUNT(*) = 2
++1
++SELECT COUNT(*) = 35 FROM t1;
++COUNT(*) = 35
++1
++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
++COUNT(*) = 0
++1
++DROP TABLE t1;
++COMMIT;
++SET AUTOCOMMIT=ON;
++SET GLOBAL debug_dbug = $debug_orig;
+ CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+ DROP USER sst;
+ CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
index 02dde169911..3de446fec32 100644
--- a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
@@ -204,114 +204,17 @@ COUNT(*) = 0
DROP TABLE t1;
COMMIT;
SET AUTOCOMMIT=ON;
-Performing State Transfer on a server that has been killed and restarted
-while a DDL was in progress on it
connection node_1;
-CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
-SET AUTOCOMMIT=OFF;
-START TRANSACTION;
-INSERT INTO t1 VALUES ('node1_committed_before');
-INSERT INTO t1 VALUES ('node1_committed_before');
-INSERT INTO t1 VALUES ('node1_committed_before');
-INSERT INTO t1 VALUES ('node1_committed_before');
-INSERT INTO t1 VALUES ('node1_committed_before');
connection node_2;
-START TRANSACTION;
-INSERT INTO t1 VALUES ('node2_committed_before');
-INSERT INTO t1 VALUES ('node2_committed_before');
-INSERT INTO t1 VALUES ('node2_committed_before');
-INSERT INTO t1 VALUES ('node2_committed_before');
-INSERT INTO t1 VALUES ('node2_committed_before');
-COMMIT;
-SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
connection node_1;
-ALTER TABLE t1 ADD COLUMN f2 INTEGER;
connection node_2;
-SET wsrep_sync_wait = 0;
-Killing server ...
connection node_1;
-SET AUTOCOMMIT=OFF;
-START TRANSACTION;
-INSERT INTO t1 (f1) VALUES ('node1_committed_during');
-INSERT INTO t1 (f1) VALUES ('node1_committed_during');
-INSERT INTO t1 (f1) VALUES ('node1_committed_during');
-INSERT INTO t1 (f1) VALUES ('node1_committed_during');
-INSERT INTO t1 (f1) VALUES ('node1_committed_during');
-COMMIT;
-START TRANSACTION;
-INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
-SET AUTOCOMMIT=OFF;
-START TRANSACTION;
-INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
connection node_2;
-Performing --wsrep-recover ...
connection node_2;
-Starting server ...
-Using --wsrep-start-position when starting mysqld ...
-SET AUTOCOMMIT=OFF;
-START TRANSACTION;
-INSERT INTO t1 (f1) VALUES ('node2_committed_after');
-INSERT INTO t1 (f1) VALUES ('node2_committed_after');
-INSERT INTO t1 (f1) VALUES ('node2_committed_after');
-INSERT INTO t1 (f1) VALUES ('node2_committed_after');
-INSERT INTO t1 (f1) VALUES ('node2_committed_after');
-COMMIT;
connection node_1;
-INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
-COMMIT;
-SET AUTOCOMMIT=OFF;
-START TRANSACTION;
-INSERT INTO t1 (f1) VALUES ('node1_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_committed_after');
-INSERT INTO t1 (f1) VALUES ('node1_committed_after');
-COMMIT;
connection node_1a_galera_st_kill_slave_ddl;
-INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
-INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
-ROLLBACK;
-SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
-COUNT(*) = 2
-1
-SELECT COUNT(*) = 35 FROM t1;
-COUNT(*) = 35
-1
-SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
-COUNT(*) = 0
-1
-COMMIT;
-SET AUTOCOMMIT=ON;
connection node_1;
-SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
-COUNT(*) = 2
-1
-SELECT COUNT(*) = 35 FROM t1;
-COUNT(*) = 35
-1
-SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
-COUNT(*) = 0
-1
-DROP TABLE t1;
-COMMIT;
-SET AUTOCOMMIT=ON;
-SET GLOBAL debug_dbug = $debug_orig;
connection node_1;
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
DROP USER sst;
diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff
new file mode 100644
index 00000000000..ac232020037
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff
@@ -0,0 +1,103 @@
+--- r/galera_sst_xtrabackup-v2_data_dir.result 2018-11-19 12:27:24.795221479 +0200
++++ r/galera_sst_xtrabackup-v2_data_dir.reject 2018-11-19 19:15:38.774008404 +0200
+@@ -260,3 +260,100 @@
+ DROP TABLE t1;
+ COMMIT;
+ SET AUTOCOMMIT=ON;
++Performing State Transfer on a server that has been killed and restarted
++while a DDL was in progress on it
++CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++START TRANSACTION;
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++COMMIT;
++SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
++ALTER TABLE t1 ADD COLUMN f2 INTEGER;
++SET wsrep_sync_wait = 0;
++Killing server ...
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++COMMIT;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++Performing --wsrep-recover ...
++Starting server ...
++Using --wsrep-start-position when starting mysqld ...
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++COMMIT;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++COMMIT;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++COMMIT;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++ROLLBACK;
++SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
++COUNT(*) = 2
++1
++SELECT COUNT(*) = 35 FROM t1;
++COUNT(*) = 35
++1
++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
++COUNT(*) = 0
++1
++COMMIT;
++SET AUTOCOMMIT=ON;
++SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
++COUNT(*) = 2
++1
++SELECT COUNT(*) = 35 FROM t1;
++COUNT(*) = 35
++1
++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
++COUNT(*) = 0
++1
++DROP TABLE t1;
++COMMIT;
++SET AUTOCOMMIT=ON;
++SET GLOBAL debug_dbug = $debug_orig;
diff --git a/mysql-test/suite/galera/r/galera_var_reject_queries.result b/mysql-test/suite/galera/r/galera_var_reject_queries.result
index 98380238fcb..caf98566595 100644
--- a/mysql-test/suite/galera/r/galera_var_reject_queries.result
+++ b/mysql-test/suite/galera/r/galera_var_reject_queries.result
@@ -7,7 +7,6 @@ SET GLOBAL wsrep_reject_queries = ALL;
SELECT * FROM t1;
ERROR 08S01: WSREP has not yet prepared node for application use
SET GLOBAL wsrep_reject_queries = ALL_KILL;
-ERROR HY000: Lost connection to MySQL server during query
connection node_1a;
SELECT * FROM t1;
Got one of the listed errors
diff --git a/mysql-test/suite/galera/r/partition.result b/mysql-test/suite/galera/r/partition.result
index 3835de514aa..bdf6df25589 100644
--- a/mysql-test/suite/galera/r/partition.result
+++ b/mysql-test/suite/galera/r/partition.result
@@ -119,9 +119,9 @@ SET GLOBAL wsrep_load_data_splitting = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY)
ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
connection node_2;
-SELECT COUNT(*) = 20002 FROM t1;
-COUNT(*) = 20002
-1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+20002
wsrep_last_committed_diff
1
DROP TABLE t1;
@@ -131,9 +131,9 @@ SET GLOBAL wsrep_load_data_splitting = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY)
ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
connection node_2;
-SELECT COUNT(*) = 101 FROM t1;
-COUNT(*) = 101
-1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+101
wsrep_last_committed_diff
1
DROP TABLE t1;
@@ -144,9 +144,9 @@ SET GLOBAL wsrep_load_data_splitting = OFF;
CREATE TABLE t1 (pk INT PRIMARY KEY)
ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
connection node_2;
-SELECT COUNT(*) = 20002 FROM t1;
-COUNT(*) = 20002
-1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+20002
wsrep_last_committed_diff
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm
index 233aa020a94..c3ae4d358f2 100644
--- a/mysql-test/suite/galera/suite.pm
+++ b/mysql-test/suite/galera/suite.pm
@@ -98,10 +98,6 @@ if (which(socat)) {
sub skip_combinations {
my %skip = ();
- $skip{'include/have_xtrabackup.inc'} = 'Need innobackupex'
- unless which(innobackupex);
- $skip{'include/have_xtrabackup.inc'} = 'Need socat or nc'
- unless $ENV{MTR_GALERA_TFMT};
$skip{'include/have_mariabackup.inc'} = 'Need mariabackup'
unless which(mariabackup);
$skip{'include/have_mariabackup.inc'} = 'Need ss'
diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf b/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf
new file mode 100644
index 00000000000..7e557717744
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+wsrep_sst_auth="root:"
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.test b/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.test
new file mode 100644
index 00000000000..731059dc584
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.test
@@ -0,0 +1,96 @@
+#
+# Test that autoincrement works correctly while the cluster membership
+# is changing and SST takes place.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_mariabackup.inc
+
+--connection node_1
+--let $connection_id = `SELECT CONNECTION_ID()`
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+
+# Issue an endless stream of autoincrement inserts
+
+DELIMITER |;
+CREATE PROCEDURE p1 ()
+BEGIN
+ DECLARE x INT DEFAULT 1;
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+
+ WHILE 1 DO
+ INSERT INTO t1 VALUES (DEFAULT);
+ COMMIT;
+ END WHILE;
+END|
+DELIMITER ;|
+
+--send CALL p1();
+--sleep 2
+
+--connection node_2
+--send CALL p1();
+--sleep 2
+
+# Kill and restart node #2
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--source include/kill_galera.inc
+
+--sleep 10
+--source include/start_mysqld.inc
+--sleep 25
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (DEFAULT);
+
+# Terminate the stored procedure
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+--disable_query_log
+--eval KILL CONNECTION $connection_id
+--enable_query_log
+
+INSERT INTO t1 VALUES (DEFAULT);
+
+--connection node_1
+# CR_SERVER_LOST
+--error 2013,2006
+--reap
+
+--connection node_2
+# CR_SERVER_LOST
+--error 2013,2006
+--reap
+
+--sleep 10
+
+# Confirm that the count is correct and that the cluster is intact
+
+--connection node_1a
+--let $count = `SELECT COUNT(*) FROM t1`
+
+--connection node_2a
+--disable_query_log
+--eval SELECT COUNT(*) = $count AS count_equal FROM t1
+--enable_query_log
+
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
+
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1a
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf b/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf
new file mode 100644
index 00000000000..75dff78149d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+wsrep_sst_auth=root:
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup.test b/mysql-test/suite/galera/t/galera_ist_mariabackup.test
new file mode 100644
index 00000000000..6ef4f65ccd4
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_mariabackup.test
@@ -0,0 +1,16 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_mariabackup.inc
+
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--source suite/galera/include/galera_st_disconnect_slave.inc
+--source suite/galera/include/galera_st_shutdown_slave.inc
+
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf b/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf
new file mode 100644
index 00000000000..1542376b2b8
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf
@@ -0,0 +1,14 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+wsrep_sst_auth=root:
+
+innodb_flush_log_at_trx_commit=0
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
+
diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.test b/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.test
new file mode 100644
index 00000000000..07838702deb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.test
@@ -0,0 +1,12 @@
+#
+# This test performs server kill and IST while innodb_flush_logs_on_trx_commit = 0
+# This confirms that IST can properly catch up even in the face of relaxed single-node durability
+#
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.cnf
new file mode 100644
index 00000000000..5a989ea8177
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+wsrep_sst_auth="root:"
+wsrep_debug=ON
+
+[SST]
+tkey=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem
+tcert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
+encrypt=3
+transferfmt=@ENV.MTR_GALERA_TFMT
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.test
new file mode 100644
index 00000000000..4449ea43c43
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.test
@@ -0,0 +1,14 @@
+#
+# This test checks that key and cert encryption options can be passed to mariabackup via the my.cnf file
+# Initial SST happens via mariabackup, so there is not much to do in the body of the test
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_mariabackup.inc
+
+SELECT 1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
new file mode 100644
index 00000000000..336296e9bfe
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
@@ -0,0 +1,16 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+wsrep_sst_auth="root:"
+wsrep_debug=ON
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[sst]
+transferfmt=@ENV.MTR_GALERA_TFMT
+streamfmt=xbstream
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.test
new file mode 100644
index 00000000000..267ec9ce681
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.test
@@ -0,0 +1,228 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/innodb_encrypt_tables.inc
+--source include/innodb_page_size_small.inc
+--source include/have_mariabackup.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--echo Performing State Transfer on a server that starts from a clean var directory
+--echo This is accomplished by shutting down node #2 and removing its var directory before restarting it
+
+--connection node_1
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 CHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1;
+CREATE TABLE t3 (f1 CHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=NO;
+CREATE TABLE t4 (f1 CHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES;
+CREATE TABLE t5 (f1 CHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+CREATE TABLE t6 (f1 CHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=NO;
+CREATE TABLE t7 (f1 CHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES;
+CREATE TABLE t8 (f1 CHAR(255)) ENGINE=InnoDB ENCRYPTED=NO;
+CREATE TABLE t9 (f1 CHAR(255)) ENGINE=InnoDB ENCRYPTED=YES;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+let $tables = 9;
+while ($tables)
+{
+ let $rows = 5;
+ while($rows)
+ {
+ eval insert into t$tables values ('node1_committed_before');
+ dec $rows;
+ }
+ dec $tables;
+}
+COMMIT;
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 5 FROM t7;
+--source include/wait_condition.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+let $tables = 9;
+while ($tables)
+{
+ let $rows = 5;
+ while($rows)
+ {
+ eval insert into t$tables values ('node2_committed_before');
+ dec $rows;
+ }
+ dec $tables;
+}
+COMMIT;
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+--echo Cleaning var directory ...
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+let $tables = 9;
+while ($tables)
+{
+ let $rows = 5;
+ while($rows)
+ {
+ eval insert into t$tables values ('node1_committed_during');
+ dec $rows;
+ }
+ dec $tables;
+}
+COMMIT;
+
+START TRANSACTION;
+let $tables = 9;
+while ($tables)
+{
+ let $rows = 5;
+ while($rows)
+ {
+ eval insert into t$tables values ('node1_to_be_committed_after');
+ dec $rows;
+ }
+ dec $tables;
+}
+
+--connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+let $tables = 9;
+while ($tables)
+{
+ let $rows = 5;
+ while($rows)
+ {
+ eval insert into t$tables values ('node1_to_be_rollbacked_after');
+ dec $rows;
+ }
+ dec $tables;
+}
+
+--connection node_2
+--echo Starting server ...
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+while ($tables)
+{
+ let $rows = 5;
+ while($rows)
+ {
+ eval insert into t$tables values ('node2_committed_after');
+ dec $rows;
+ }
+ dec $tables;
+}
+COMMIT;
+
+--connection node_1
+let $tables = 9;
+while ($tables)
+{
+ let $rows = 5;
+ while($rows)
+ {
+ eval insert into t$tables values ('node1_to_be_committed_after');
+ dec $rows;
+ }
+ dec $tables;
+}
+COMMIT;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+let $tables = 9;
+while ($tables)
+{
+ let $rows = 5;
+ while($rows)
+ {
+ eval insert into t$tables values ('node1_committed_after');
+ dec $rows;
+ }
+ dec $tables;
+}
+COMMIT;
+
+--connection node_1a_galera_st_clean_slave
+while ($tables)
+{
+ let $rows = 5;
+ while($rows)
+ {
+ eval insert into t$tables values ('node1_to_be_rollbacked_after');
+ dec $rows;
+ }
+ dec $tables;
+}
+ROLLBACK;
+
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t3;
+SELECT COUNT(*) FROM t4;
+SELECT COUNT(*) FROM t5;
+SELECT COUNT(*) FROM t6;
+SELECT COUNT(*) FROM t7;
+SELECT COUNT(*) FROM t8;
+SELECT COUNT(*) FROM t9;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+SELECT * FROM t4;
+SELECT * FROM t5;
+SELECT * FROM t6;
+SELECT * FROM t7;
+SELECT * FROM t8;
+SELECT * FROM t9;
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+--connection node_1
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t3;
+SELECT COUNT(*) FROM t4;
+SELECT COUNT(*) FROM t5;
+SELECT COUNT(*) FROM t6;
+SELECT COUNT(*) FROM t7;
+SELECT COUNT(*) FROM t8;
+SELECT COUNT(*) FROM t9;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+SELECT * FROM t4;
+SELECT * FROM t5;
+SELECT * FROM t6;
+SELECT * FROM t7;
+SELECT * FROM t8;
+SELECT * FROM t9;
+COMMIT;
+
+DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9;
+COMMIT;
+SET AUTOCOMMIT=ON;
+
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
+--source include/galera_end.inc
diff --git a/mysql-test/suite/galera/t/galera_var_reject_queries.test b/mysql-test/suite/galera/t/galera_var_reject_queries.test
index 6859855c35f..8b80c04e3be 100644
--- a/mysql-test/suite/galera/t/galera_var_reject_queries.test
+++ b/mysql-test/suite/galera/t/galera_var_reject_queries.test
@@ -18,8 +18,11 @@ SET GLOBAL wsrep_reject_queries = ALL;
--error ER_UNKNOWN_COM_ERROR
SELECT * FROM t1;
-# Lost connection
---error 2013
+#
+# Original behavior was lost connection,
+# but since 10.1, we allow controlling connection to remain alive
+#
+--error 0,2013
SET GLOBAL wsrep_reject_queries = ALL_KILL;
--connection node_1a
diff --git a/mysql-test/suite/galera/t/partition.test b/mysql-test/suite/galera/t/partition.test
index bb5a02411c3..0159ef8f607 100644
--- a/mysql-test/suite/galera/t/partition.test
+++ b/mysql-test/suite/galera/t/partition.test
@@ -129,7 +129,10 @@ CREATE TABLE t1 (pk INT PRIMARY KEY)
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_2
-SELECT COUNT(*) = 20002 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 20002 FROM t1;
+--source include/wait_condition.inc
+
+SELECT COUNT(*) FROM t1;
# LOAD-ing 20002 rows causes 3 commits to be registered
--disable_query_log
@@ -157,7 +160,10 @@ CREATE TABLE t1 (pk INT PRIMARY KEY)
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_2
-SELECT COUNT(*) = 101 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 101 FROM t1;
+--source include/wait_condition.inc
+
+SELECT COUNT(*) FROM t1;
# LOAD-ing 101 rows causes 1 commit to be registered
--disable_query_log
@@ -186,7 +192,9 @@ CREATE TABLE t1 (pk INT PRIMARY KEY)
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_2
-SELECT COUNT(*) = 20002 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 20002 FROM t1;
+--source include/wait_condition.inc
+SELECT COUNT(*) FROM t1;
# LOAD-ing 20002 rows causes 1 commit to be registered
--disable_query_log
diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def
index a9b9b00b40c..e640baebf7d 100644
--- a/mysql-test/suite/galera_3nodes/disabled.def
+++ b/mysql-test/suite/galera_3nodes/disabled.def
@@ -1,3 +1,4 @@
galera_slave_options_do :MDEV-8798
galera_slave_options_ignore : MDEV-8798
-
+galera_innobackupex_backup : xtrabackup is deprecated
+galera_ipv6_xtrabackup-v2 : xtrabackup is deprecated
diff --git a/mysql-test/suite/innodb/r/truncate.result b/mysql-test/suite/innodb/r/truncate.result
index 3ade1e7f8de..f389c351d70 100644
--- a/mysql-test/suite/innodb/r/truncate.result
+++ b/mysql-test/suite/innodb/r/truncate.result
@@ -6,3 +6,24 @@ connection default;
TRUNCATE TABLE t;
disconnect dml;
DROP TABLE t;
+#
+# MDEV-17816 Crash in TRUNCATE TABLE when table creation fails
+#
+CREATE TABLE t1 (c VARCHAR(1024), KEY(c)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 SET c='character';
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+TRUNCATE TABLE t1;
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes
+SELECT * FROM t1;
+c
+character
+DROP TABLE t1;
+#
+# MDEV-17831 TRUNCATE TABLE removes ROW_FORMAT=COMPRESSED
+#
+CREATE TABLE t1 (a SERIAL) ENGINE=InnoDB KEY_BLOCK_SIZE=4;
+TRUNCATE TABLE t1;
+SHOW TABLE STATUS;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
+t1 InnoDB # Compressed # # # # # # 1 # # NULL latin1_swedish_ci NULL key_block_size=4 0 N
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/truncate.test b/mysql-test/suite/innodb/t/truncate.test
index cf71ca83c4c..16a3b06a8ae 100644
--- a/mysql-test/suite/innodb/t/truncate.test
+++ b/mysql-test/suite/innodb/t/truncate.test
@@ -15,3 +15,24 @@ TRUNCATE TABLE t;
disconnect dml;
DROP TABLE t;
+
+--echo #
+--echo # MDEV-17816 Crash in TRUNCATE TABLE when table creation fails
+--echo #
+CREATE TABLE t1 (c VARCHAR(1024), KEY(c)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 SET c='character';
+# FIXME: MDEV-17833 ALTER TABLE is not enforcing prefix index size limit
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+--error ER_INDEX_COLUMN_TOO_LONG
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-17831 TRUNCATE TABLE removes ROW_FORMAT=COMPRESSED
+--echo #
+CREATE TABLE t1 (a SERIAL) ENGINE=InnoDB KEY_BLOCK_SIZE=4;
+TRUNCATE TABLE t1;
+--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
+SHOW TABLE STATUS;
+DROP TABLE t1;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 1f9cd305847..3b2e57abcf5 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2385,7 +2385,8 @@ com_multi_end:
/* wsrep BF abort in query exec phase */
mysql_mutex_lock(&thd->LOCK_thd_data);
do_end_of_statement= thd->wsrep_conflict_state != REPLAYING &&
- thd->wsrep_conflict_state != RETRY_AUTOCOMMIT;
+ thd->wsrep_conflict_state != RETRY_AUTOCOMMIT &&
+ !thd->killed;
mysql_mutex_unlock(&thd->LOCK_thd_data);
}
else
diff --git a/sql/table.cc b/sql/table.cc
index 6fed129f7e8..8630320090f 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -3958,6 +3958,7 @@ void update_create_info_from_table(HA_CREATE_INFO *create_info, TABLE *table)
create_info->table_options= share->db_create_options;
create_info->avg_row_length= share->avg_row_length;
create_info->row_type= share->row_type;
+ create_info->key_block_size= share->key_block_size;
create_info->default_table_charset= share->table_charset;
create_info->table_charset= 0;
create_info->comment= share->comment;
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index bc52bff0de9..833a39cb027 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -2262,7 +2262,7 @@ int wsrep_wait_committing_connections_close(int wait_time)
}
-void wsrep_close_client_connections(my_bool wait_to_end)
+void wsrep_close_client_connections(my_bool wait_to_end, THD *except_caller_thd)
{
/*
First signal all threads that it's time to die
@@ -2284,6 +2284,12 @@ void wsrep_close_client_connections(my_bool wait_to_end)
if (!is_client_connection(tmp))
continue;
+ if (tmp == except_caller_thd)
+ {
+ DBUG_ASSERT(is_client_connection(tmp));
+ continue;
+ }
+
if (is_replaying_connection(tmp))
{
tmp->set_killed(KILL_CONNECTION);
@@ -2295,7 +2301,16 @@ void wsrep_close_client_connections(my_bool wait_to_end)
continue;
WSREP_DEBUG("closing connection %lld", (longlong) tmp->thread_id);
- wsrep_close_thread(tmp);
+
+ /*
+ instead of wsrep_close_thread() we do now soft kill by THD::awake
+ */
+ mysql_mutex_lock(&tmp->LOCK_thd_data);
+
+ tmp->awake(KILL_CONNECTION);
+
+ mysql_mutex_unlock(&tmp->LOCK_thd_data);
+
}
mysql_mutex_unlock(&LOCK_thread_count);
@@ -2313,7 +2328,8 @@ void wsrep_close_client_connections(my_bool wait_to_end)
#ifndef __bsdi__ // Bug in BSDI kernel
if (is_client_connection(tmp) &&
!abort_replicated(tmp) &&
- !is_replaying_connection(tmp))
+ !is_replaying_connection(tmp) &&
+ tmp != except_caller_thd)
{
WSREP_INFO("killing local connection: %lld", (longlong) tmp->thread_id);
close_connection(tmp,0);
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index 819a56b9f23..b434c248347 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -160,7 +160,6 @@ extern "C" query_id_t wsrep_thd_query_id(THD *thd);
extern "C" query_id_t wsrep_thd_wsrep_last_query_id(THD *thd);
extern "C" void wsrep_thd_set_wsrep_last_query_id(THD *thd, query_id_t id);
-extern void wsrep_close_client_connections(my_bool wait_to_end);
extern int wsrep_wait_committing_connections_close(int wait_time);
extern void wsrep_close_applier(THD *thd);
extern void wsrep_wait_appliers_close(THD *thd);
@@ -308,7 +307,8 @@ void thd_binlog_trx_reset(THD * thd);
typedef void (*wsrep_thd_processor_fun)(THD *);
pthread_handler_t start_wsrep_THD(void *arg);
int wsrep_wait_committing_connections_close(int wait_time);
-void wsrep_close_client_connections(my_bool wait_to_end);
+extern void wsrep_close_client_connections(my_bool wait_to_end,
+ THD *except_caller_thd = NULL);
void wsrep_close_applier(THD *thd);
void wsrep_close_applier_threads(int count);
void wsrep_wait_appliers_close(THD *thd);
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index f8a494416e2..1471ad91a96 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -428,7 +428,8 @@ bool wsrep_reject_queries_update(sys_var *self, THD* thd, enum_var_type type)
WSREP_INFO("Rejecting client queries due to manual setting");
break;
case WSREP_REJECT_ALL_KILL:
- wsrep_close_client_connections(FALSE);
+ /* close all client connections, but this one */
+ wsrep_close_client_connections(FALSE, thd);
WSREP_INFO("Rejecting client queries and killing connections due to manual setting");
break;
default:
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 25d6e75f871..a1288642d63 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -225,7 +225,7 @@ btr_root_block_get(
}
buf_block_t* block = btr_block_get(
- page_id_t(index->table->space->id, index->page),
+ page_id_t(index->table->space_id, index->page),
page_size_t(index->table->space->flags), mode,
index, mtr);
@@ -250,9 +250,9 @@ btr_root_block_get(
const page_t* root = buf_block_get_frame(block);
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
- + root, index->table->space->id));
+ + root, index->table->space_id));
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_TOP
- + root, index->table->space->id));
+ + root, index->table->space_id));
}
#endif /* UNIV_BTR_DEBUG */
@@ -363,7 +363,7 @@ btr_root_adjust_on_import(
buf_block_t* block;
page_zip_des_t* page_zip;
dict_table_t* table = index->table;
- const page_id_t page_id(table->space->id, index->page);
+ const page_id_t page_id(table->space_id, index->page);
const page_size_t page_size(table->space->flags);
DBUG_EXECUTE_IF("ib_import_trigger_corruption_3",
@@ -405,10 +405,10 @@ btr_root_adjust_on_import(
if (err == DB_SUCCESS
&& (!btr_root_fseg_adjust_on_import(
FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
- + page, page_zip, table->space->id, &mtr)
+ + page, page_zip, table->space_id, &mtr)
|| !btr_root_fseg_adjust_on_import(
FIL_PAGE_DATA + PAGE_BTR_SEG_TOP
- + page, page_zip, table->space->id, &mtr))) {
+ + page, page_zip, table->space_id, &mtr))) {
err = DB_CORRUPTION;
}
@@ -474,7 +474,7 @@ btr_page_alloc_for_ibuf(
ut_a(node_addr.page != FIL_NULL);
new_block = buf_page_get(
- page_id_t(index->table->space->id, node_addr.page),
+ page_id_t(index->table->space_id, node_addr.page),
page_size_t(index->table->space->flags),
RW_X_LATCH, mtr);
@@ -923,11 +923,11 @@ btr_node_ptr_get_child(
mtr_t* mtr) /*!< in: mtr */
{
ut_ad(rec_offs_validate(node_ptr, index, offsets));
- ut_ad(index->table->space->id
+ ut_ad(index->table->space_id
== page_get_space_id(page_align(node_ptr)));
return btr_block_get(
- page_id_t(index->table->space->id,
+ page_id_t(index->table->space_id,
btr_node_ptr_get_child_page_no(node_ptr, offsets)),
page_size_t(index->table->space->flags),
RW_SX_LATCH, index, mtr);
@@ -1431,7 +1431,7 @@ btr_read_autoinc(dict_index_t* index)
mtr.start();
ib_uint64_t autoinc;
if (buf_block_t* block = buf_page_get(
- page_id_t(index->table->space->id, index->page),
+ page_id_t(index->table->space_id, index->page),
page_size_t(index->table->space->flags),
RW_S_LATCH, &mtr)) {
autoinc = page_get_autoinc(block->frame);
@@ -1463,7 +1463,7 @@ btr_read_autoinc_with_fallback(const dict_table_t* table, unsigned col_no)
mtr_t mtr;
mtr.start();
buf_block_t* block = buf_page_get(
- page_id_t(index->table->space->id, index->page),
+ page_id_t(index->table->space_id, index->page),
page_size_t(index->table->space->flags),
RW_S_LATCH, &mtr);
@@ -2014,7 +2014,7 @@ btr_root_raise_and_insert(
#endif /* UNIV_ZIP_DEBUG */
#ifdef UNIV_BTR_DEBUG
if (!dict_index_is_ibuf(index)) {
- ulint space = index->table->space->id;
+ ulint space = index->table->space_id;
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
+ root, space));
@@ -3932,7 +3932,7 @@ retry:
btr_search_drop_page_hash_index(block);
/* Remove the page from the level list */
- btr_level_list_remove(index->table->space->id,
+ btr_level_list_remove(index->table->space_id,
page_size, page, index, mtr);
if (dict_index_is_spatial(index)) {
@@ -4062,7 +4062,7 @@ retry:
#endif /* UNIV_BTR_DEBUG */
/* Remove the page from the level list */
- btr_level_list_remove(index->table->space->id,
+ btr_level_list_remove(index->table->space_id,
page_size, page, index, mtr);
ut_ad(btr_node_ptr_get_child_page_no(
@@ -4302,7 +4302,7 @@ btr_discard_only_page_on_level(
#ifdef UNIV_BTR_DEBUG
if (!dict_index_is_ibuf(index)) {
const page_t* root = buf_block_get_frame(block);
- const ulint space = index->table->space->id;
+ const ulint space = index->table->space_id;
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
+ root, space));
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_TOP
@@ -4410,7 +4410,7 @@ btr_discard_page(
if (left_page_no != FIL_NULL) {
merge_block = btr_block_get(
- page_id_t(index->table->space->id, left_page_no),
+ page_id_t(index->table->space_id, left_page_no),
page_size, RW_X_LATCH, index, mtr);
merge_page = buf_block_get_frame(merge_block);
@@ -4426,7 +4426,7 @@ btr_discard_page(
== btr_cur_get_rec(&parent_cursor)));
} else if (right_page_no != FIL_NULL) {
merge_block = btr_block_get(
- page_id_t(index->table->space->id, right_page_no),
+ page_id_t(index->table->space_id, right_page_no),
page_size, RW_X_LATCH, index, mtr);
merge_page = buf_block_get_frame(merge_block);
@@ -4475,7 +4475,7 @@ btr_discard_page(
}
/* Remove the page from the level list */
- btr_level_list_remove(index->table->space->id, page_size,
+ btr_level_list_remove(index->table->space_id, page_size,
page, index, mtr);
#ifdef UNIV_ZIP_DEBUG
@@ -5065,7 +5065,7 @@ btr_validate_level(
ret = false;
}
- ut_a(index->table->space->id == block->page.id.space());
+ ut_a(index->table->space_id == block->page.id.space());
ut_a(block->page.id.space() == page_get_space_id(page));
#ifdef UNIV_ZIP_DEBUG
page_zip = buf_block_get_page_zip(block);
@@ -5102,7 +5102,7 @@ btr_validate_level(
savepoint2 = mtr_set_savepoint(&mtr);
block = btr_block_get(
- page_id_t(index->table->space->id,
+ page_id_t(index->table->space_id,
left_page_no),
table_page_size,
RW_SX_LATCH, index, &mtr);
@@ -5131,7 +5131,7 @@ loop:
ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
- ut_a(block->page.id.space() == index->table->space->id);
+ ut_a(block->page.id.space() == index->table->space_id);
if (fseg_page_is_free(space, block->page.id.page_no())) {
@@ -5174,7 +5174,7 @@ loop:
savepoint = mtr_set_savepoint(&mtr);
right_block = btr_block_get(
- page_id_t(index->table->space->id, right_page_no),
+ page_id_t(index->table->space_id, right_page_no),
table_page_size,
RW_SX_LATCH, index, &mtr);
@@ -5351,13 +5351,13 @@ loop:
&mtr, savepoint, right_block);
btr_block_get(
- page_id_t(index->table->space->id,
+ page_id_t(index->table->space_id,
parent_right_page_no),
table_page_size,
RW_SX_LATCH, index, &mtr);
right_block = btr_block_get(
- page_id_t(index->table->space->id,
+ page_id_t(index->table->space_id,
right_page_no),
table_page_size,
RW_SX_LATCH, index, &mtr);
@@ -5435,14 +5435,14 @@ node_ptr_fails:
if (parent_right_page_no != FIL_NULL) {
btr_block_get(
page_id_t(
- index->table->space->id,
+ index->table->space_id,
parent_right_page_no),
table_page_size,
RW_SX_LATCH, index, &mtr);
}
} else if (parent_page_no != FIL_NULL) {
btr_block_get(
- page_id_t(index->table->space->id,
+ page_id_t(index->table->space_id,
parent_page_no),
table_page_size,
RW_SX_LATCH, index, &mtr);
@@ -5450,7 +5450,7 @@ node_ptr_fails:
}
block = btr_block_get(
- page_id_t(index->table->space->id, right_page_no),
+ page_id_t(index->table->space_id, right_page_no),
table_page_size,
RW_SX_LATCH, index, &mtr);
@@ -5596,7 +5596,7 @@ btr_can_merge_with_page(
index = btr_cur_get_index(cursor);
page = btr_cur_get_page(cursor);
- const page_id_t page_id(index->table->space->id, page_no);
+ const page_id_t page_id(index->table->space_id, page_no);
const page_size_t page_size(index->table->space->flags);
mblock = btr_block_get(page_id, page_size, RW_X_LATCH, index, mtr);
diff --git a/storage/innobase/btr/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc
index 73b4335d265..5cb07af3f66 100644
--- a/storage/innobase/btr/btr0bulk.cc
+++ b/storage/innobase/btr/btr0bulk.cc
@@ -120,7 +120,7 @@ PageBulk::init()
}
} else {
new_block = btr_block_get(
- page_id_t(m_index->table->space->id, m_page_no),
+ page_id_t(m_index->table->space_id, m_page_no),
page_size_t(m_index->table->space->flags),
RW_X_LATCH, m_index, &m_mtr);
@@ -663,7 +663,7 @@ PageBulk::latch()
if (!buf_page_optimistic_get(RW_X_LATCH, m_block, m_modify_clock,
__FILE__, __LINE__, &m_mtr)) {
m_block = buf_page_get_gen(
- page_id_t(m_index->table->space->id, m_page_no),
+ page_id_t(m_index->table->space_id, m_page_no),
page_size_t(m_index->table->space->flags),
RW_X_LATCH, m_block, BUF_GET_IF_IN_POOL,
__FILE__, __LINE__, &m_mtr, &m_err);
@@ -1015,7 +1015,7 @@ BtrBulk::finish(dberr_t err)
ut_ad(last_page_no != FIL_NULL);
last_block = btr_block_get(
- page_id_t(m_index->table->space->id, last_page_no),
+ page_id_t(m_index->table->space_id, last_page_no),
page_size_t(m_index->table->space->flags),
RW_X_LATCH, m_index, &mtr);
first_rec = page_rec_get_next(
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 9a6b97f5baf..95ebcfe4d1e 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -754,7 +754,7 @@ btr_cur_optimistic_latch_leaves(
if (left_page_no != FIL_NULL) {
cursor->left_block = btr_block_get(
- page_id_t(cursor->index->table->space->id,
+ page_id_t(cursor->index->table->space_id,
left_page_no),
page_size_t(cursor->index->table->space
->flags),
@@ -1433,7 +1433,7 @@ btr_cur_search_to_nth_level_func(
const page_size_t page_size(index->table->space->flags);
/* Start with the root page. */
- page_id_t page_id(index->table->space->id, index->page);
+ page_id_t page_id(index->table->space_id, index->page);
if (root_leaf_rw_latch == RW_X_LATCH) {
node_ptr_max_size = btr_node_ptr_max_size(index);
@@ -2541,7 +2541,7 @@ btr_cur_open_at_index_side_func(
page_cursor = btr_cur_get_page_cur(cursor);
cursor->index = index;
- page_id_t page_id(index->table->space->id, index->page);
+ page_id_t page_id(index->table->space_id, index->page);
const page_size_t page_size(index->table->space->flags);
if (root_leaf_rw_latch == RW_X_LATCH) {
@@ -2898,7 +2898,7 @@ btr_cur_open_at_rnd_pos_func(
page_cursor = btr_cur_get_page_cur(cursor);
cursor->index = index;
- page_id_t page_id(index->table->space->id, index->page);
+ page_id_t page_id(index->table->space_id, index->page);
const page_size_t page_size(index->table->space->flags);
dberr_t err = DB_SUCCESS;
@@ -7350,7 +7350,7 @@ struct btr_blob_log_check_t {
if (m_op == BTR_STORE_INSERT_BULK) {
mtr_x_lock(dict_index_get_lock(index), m_mtr);
m_pcur->btr_cur.page_cur.block = btr_block_get(
- page_id_t(index->table->space->id, page_no),
+ page_id_t(index->table->space_id, page_no),
page_size_t(index->table->space->flags),
RW_X_LATCH, index, m_mtr);
m_pcur->btr_cur.page_cur.rec
@@ -7958,6 +7958,7 @@ btr_free_externally_stored_field(
& ~((BTR_EXTERN_OWNER_FLAG
| BTR_EXTERN_INHERITED_FLAG) << 24)));
ut_ad(space_id == index->table->space->id);
+ ut_ad(space_id == index->table->space_id);
const page_size_t ext_page_size(dict_table_page_size(index->table));
const page_size_t& rec_page_size(rec == NULL
diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc
index 6f36198f129..e3c7ef8a768 100644
--- a/storage/innobase/btr/btr0defragment.cc
+++ b/storage/innobase/btr/btr0defragment.cc
@@ -166,7 +166,7 @@ btr_defragment_add_index(
mtr_start(&mtr);
// Load index rood page.
buf_block_t* block = btr_block_get(
- page_id_t(index->table->space->id, index->page),
+ page_id_t(index->table->space_id, index->page),
page_size_t(index->table->space->flags),
RW_NO_LATCH, index, &mtr);
page_t* page = NULL;
@@ -314,7 +314,7 @@ btr_defragment_save_defrag_stats_if_needed(
dict_index_t* index) /*!< in: index */
{
if (srv_defragment_stats_accuracy != 0 // stats tracking disabled
- && index->table->space->id != 0 // do not track system tables
+ && index->table->space_id != 0 // do not track system tables
&& index->stat_defrag_modified_counter
>= srv_defragment_stats_accuracy) {
dict_stats_defrag_pool_add(index);
@@ -489,7 +489,7 @@ btr_defragment_merge_pages(
from_block);
btr_search_drop_page_hash_index(from_block);
btr_level_list_remove(
- index->table->space->id,
+ index->table->space_id,
page_size, from_page, index, mtr);
btr_node_ptr_delete(index, from_block, mtr);
/* btr_blob_dbg_remove(from_page, index,
@@ -564,7 +564,7 @@ btr_defragment_n_pages(
return NULL;
}
- if (!index->table->space || !index->table->space->id) {
+ if (!index->table->space || !index->table->space_id) {
/* Ignore space 0. */
return NULL;
}
@@ -589,7 +589,7 @@ btr_defragment_n_pages(
break;
}
- blocks[i] = btr_block_get(page_id_t(index->table->space->id,
+ blocks[i] = btr_block_get(page_id_t(index->table->space_id,
page_no), page_size,
RW_X_LATCH, index, mtr);
}
diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc
index 22e997b60aa..7d8966d4109 100644
--- a/storage/innobase/btr/btr0scrub.cc
+++ b/storage/innobase/btr/btr0scrub.cc
@@ -450,14 +450,14 @@ btr_pessimistic_scrub(
mtr->release_block_at_savepoint(scrub_data->savepoint, block);
buf_block_t* get_block __attribute__((unused)) = btr_block_get(
- page_id_t(index->table->space->id, left_page_no),
+ page_id_t(index->table->space_id, left_page_no),
page_size, RW_X_LATCH, index, mtr);
/**
* Refetch block and re-initialize page
*/
block = btr_block_get(
- page_id_t(index->table->space->id, page_no),
+ page_id_t(index->table->space_id, page_no),
page_size, RW_X_LATCH, index, mtr);
page = buf_block_get_frame(block);
@@ -471,7 +471,7 @@ btr_pessimistic_scrub(
if (right_page_no != FIL_NULL) {
buf_block_t* get_block __attribute__((unused))= btr_block_get(
- page_id_t(index->table->space->id, right_page_no),
+ page_id_t(index->table->space_id, right_page_no),
page_size, RW_X_LATCH, index, mtr);
}
@@ -787,7 +787,7 @@ btr_scrub_page(
/* check that table/index still match now that they are loaded */
if (!scrub_data->current_table->space
- || scrub_data->current_table->space->id != scrub_data->space) {
+ || scrub_data->current_table->space_id != scrub_data->space) {
/* this is truncate table */
mtr_commit(mtr);
return BTR_SCRUB_SKIP_PAGE_AND_CLOSE_TABLE;
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index 8bb838187bb..37a839727ec 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -660,7 +660,7 @@ btr_search_update_hash_ref(
return;
}
- ut_ad(block->page.id.space() == index->table->space->id);
+ ut_ad(block->page.id.space() == index->table->space_id);
ut_ad(index == cursor->index);
ut_ad(!dict_index_is_ibuf(index));
@@ -1356,7 +1356,7 @@ btr_search_build_page_hash_index(
rec_offs_init(offsets_);
ut_ad(ahi_latch == btr_get_search_latch(index));
ut_ad(index);
- ut_ad(block->page.id.space() == index->table->space->id);
+ ut_ad(block->page.id.space() == index->table->space_id);
ut_a(!dict_index_is_ibuf(index));
ut_ad(page_is_leaf(block->frame));
@@ -1673,7 +1673,7 @@ void btr_search_update_hash_on_delete(btr_cur_t* cursor)
return;
}
- ut_ad(block->page.id.space() == index->table->space->id);
+ ut_ad(block->page.id.space() == index->table->space_id);
ut_a(index == cursor->index);
ut_a(block->curr_n_fields > 0 || block->curr_n_bytes > 0);
ut_a(!dict_index_is_ibuf(index));
@@ -1830,7 +1830,7 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor, rw_lock_t* ahi_latch)
return;
}
- ut_ad(block->page.id.space() == index->table->space->id);
+ ut_ad(block->page.id.space() == index->table->space_id);
btr_search_check_free_space_in_heap(index);
table = btr_get_search_table(index);
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index f19a894bc64..1540f7e53bc 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -3007,7 +3007,7 @@ err_exit:
}
if (err == DB_SUCCESS && cached && table->is_readable()) {
- if (table->space && !fil_space_get_size(table->space->id)) {
+ if (table->space && !fil_space_get_size(table->space_id)) {
table->corrupted = true;
table->file_unreadable = true;
} else if (table->supports_instant()) {
diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc
index 672be81b9dd..20ebbc136c6 100644
--- a/storage/innobase/dict/dict0stats.cc
+++ b/storage/innobase/dict/dict0stats.cc
@@ -1503,7 +1503,7 @@ dict_stats_analyze_index_below_cur(
offsets_rec = rec_get_offsets(rec, index, offsets1, false,
ULINT_UNDEFINED, &heap);
- page_id_t page_id(index->table->space->id,
+ page_id_t page_id(index->table->space_id,
btr_node_ptr_get_child_page_no(
rec, offsets_rec));
const page_size_t page_size(index->table->space->flags);
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 3e86ae267c2..df1b5ec783c 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -4859,8 +4859,8 @@ fil_mtr_rename_log(
{
ut_ad(old_table->space != fil_system.temp_space);
ut_ad(new_table->space != fil_system.temp_space);
- ut_ad(old_table->space_id == old_table->space->id);
- ut_ad(new_table->space_id == new_table->space->id);
+ ut_ad(old_table->space->id == old_table->space_id);
+ ut_ad(new_table->space->id == new_table->space_id);
/* If neither table is file-per-table,
there will be no renaming of files. */
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index a1e962bdeb7..58bfeee9278 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -1741,7 +1741,7 @@ fts_create_in_mem_aux_table(
{
dict_table_t* new_table = dict_mem_table_create(
aux_table_name, NULL, n_cols, 0, table->flags,
- table->space->id == TRX_SYS_SPACE
+ table->space_id == TRX_SYS_SPACE
? 0 : table->space->purpose == FIL_TYPE_TEMPORARY
? DICT_TF2_TEMPORARY : DICT_TF2_USE_FILE_PER_TABLE);
@@ -1770,7 +1770,7 @@ fts_create_one_common_table(
const char* fts_suffix,
mem_heap_t* heap)
{
- dict_table_t* new_table = NULL;
+ dict_table_t* new_table;
dberr_t error;
bool is_config = strcmp(fts_suffix, "CONFIG") == 0;
@@ -1823,11 +1823,13 @@ fts_create_one_common_table(
}
if (error != DB_SUCCESS) {
- trx->error_state = error;
dict_mem_table_free(new_table);
new_table = NULL;
ib::warn() << "Failed to create FTS common table "
<< fts_table_name;
+ trx->error_state = DB_SUCCESS;
+ row_drop_table_for_mysql(fts_table_name, trx, SQLCOM_DROP_DB);
+ trx->error_state = error;
}
return(new_table);
}
@@ -1968,7 +1970,7 @@ fts_create_one_index_table(
mem_heap_t* heap)
{
dict_field_t* field;
- dict_table_t* new_table = NULL;
+ dict_table_t* new_table;
char table_name[MAX_FULL_NAME_LEN];
dberr_t error;
CHARSET_INFO* charset;
@@ -2032,11 +2034,13 @@ fts_create_one_index_table(
}
if (error != DB_SUCCESS) {
- trx->error_state = error;
dict_mem_table_free(new_table);
new_table = NULL;
ib::warn() << "Failed to create FTS index table "
<< table_name;
+ trx->error_state = DB_SUCCESS;
+ row_drop_table_for_mysql(table_name, trx, SQLCOM_DROP_DB);
+ trx->error_state = error;
}
return(new_table);
diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc
index 4bd3e1c232a..226b5d07e5d 100644
--- a/storage/innobase/gis/gis0rtree.cc
+++ b/storage/innobase/gis/gis0rtree.cc
@@ -737,7 +737,7 @@ rtr_adjust_upper_level(
new_prdt.op = 0;
lock_prdt_update_parent(block, new_block, &prdt, &new_prdt,
- index->table->space->id,
+ index->table->space_id,
page_cursor->block->page.id.page_no());
mem_heap_free(heap);
@@ -1258,7 +1258,7 @@ after_insert:
/* Check any predicate locks need to be moved/copied to the
new page */
lock_prdt_update_split(new_block, &prdt, &new_prdt,
- cursor->index->table->space->id, page_no);
+ cursor->index->table->space_id, page_no);
/* Adjust the upper level. */
rtr_adjust_upper_level(cursor, flags, block, new_block,
@@ -1872,7 +1872,7 @@ rtr_estimate_n_rows_in_range(
mtr_s_lock(&index->lock, &mtr);
buf_block_t* block = btr_block_get(
- page_id_t(index->table->space->id, index->page),
+ page_id_t(index->table->space_id, index->page),
page_size_t(index->table->space->flags),
RW_S_LATCH, index, &mtr);
const page_t* page = buf_block_get_frame(block);
diff --git a/storage/innobase/gis/gis0sea.cc b/storage/innobase/gis/gis0sea.cc
index 6fcc56170d0..66a6d57d986 100644
--- a/storage/innobase/gis/gis0sea.cc
+++ b/storage/innobase/gis/gis0sea.cc
@@ -268,7 +268,7 @@ rtr_pcur_getnext_from_path(
dberr_t err = DB_SUCCESS;
block = buf_page_get_gen(
- page_id_t(index->table->space->id,
+ page_id_t(index->table->space_id,
next_rec.page_no), page_size,
rw_latch, NULL, BUF_GET, __FILE__, __LINE__, mtr, &err);
@@ -298,7 +298,7 @@ rtr_pcur_getnext_from_path(
&& mode != PAGE_CUR_RTREE_LOCATE) {
ut_ad(rtr_info->thr);
lock_place_prdt_page_lock(
- index->table->space->id,
+ index->table->space_id,
next_page_no, index,
rtr_info->thr);
}
@@ -422,7 +422,7 @@ rtr_pcur_getnext_from_path(
btr_cur_latch_leaves(
block,
- page_id_t(index->table->space->id,
+ page_id_t(index->table->space_id,
block->page.id.page_no()),
page_size, BTR_MODIFY_TREE,
btr_cur, mtr);
@@ -1360,7 +1360,7 @@ search_again:
dberr_t err = DB_SUCCESS;
block = buf_page_get_gen(
- page_id_t(index->table->space->id, page_no),
+ page_id_t(index->table->space_id, page_no),
page_size, RW_X_LATCH, NULL,
BUF_GET, __FILE__, __LINE__, mtr, &err);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 1afe451d4a8..749c82da555 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -145,8 +145,8 @@ void close_thread_tables(THD* thd);
#ifdef WITH_WSREP
#include "dict0priv.h"
-#include "ut0byte.h"
#include <mysql/service_md5.h>
+#include "wsrep_sst.h"
extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log;
@@ -3731,6 +3731,15 @@ static int innodb_init_params()
ib::info() << "For Galera, using innodb_lock_schedule_algorithm=fcfs";
innodb_lock_schedule_algorithm = INNODB_LOCK_SCHEDULE_ALGORITHM_FCFS;
}
+
+ /* Print deprecation info if xtrabackup is used for SST method */
+ if (global_system_variables.wsrep_on
+ && wsrep_sst_method
+ && (!strcmp(wsrep_sst_method, "xtrabackup")
+ || !strcmp(wsrep_sst_method, "xtrabackup-v2"))) {
+ ib::info() << "Galera SST method xtrabackup is deprecated and the "
+ " support for it may be removed in future releases.";
+ }
#endif /* WITH_WSREP */
#ifndef HAVE_LZ4
@@ -12350,9 +12359,15 @@ int create_table_info_t::create_table(bool create_fk)
error = convert_error_code_to_mysql(err, 0, NULL);
if (error) {
+ /* Drop the being-created table before rollback,
+ so that rollback can possibly rename back a table
+ that could have been renamed before
+ the failed creation. */
+ m_trx->error_state = DB_SUCCESS;
row_drop_table_for_mysql(m_table_name, m_trx,
- SQLCOM_DROP_DB);
+ SQLCOM_TRUNCATE);
trx_rollback_to_savepoint(m_trx, NULL);
+
m_trx->error_state = DB_SUCCESS;
DBUG_RETURN(error);
}
@@ -12577,14 +12592,18 @@ ha_innobase::create(
}
if ((error = info.create_table(own_trx))) {
- row_drop_table_for_mysql(norm_name, trx, SQLCOM_DROP_TABLE,
- true);
+ /* Drop the being-created table before rollback,
+ so that rollback can possibly rename back a table
+ that could have been renamed before the failed creation. */
+ trx->error_state = DB_SUCCESS;
+ row_drop_table_for_mysql(info.table_name(), trx,
+ SQLCOM_TRUNCATE, true);
trx_rollback_for_mysql(trx);
row_mysql_unlock_data_dictionary(trx);
if (own_trx) {
trx_free(trx);
- DBUG_RETURN(error);
}
+ DBUG_RETURN(error);
}
innobase_commit_low(trx);
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index 3ea6a393fa0..f005102514a 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -3369,7 +3369,7 @@ ibuf_insert_low(
ut_ad(!dict_index_is_spatial(index));
ut_ad(dtuple_check_typed(entry));
ut_ad(!no_counter || op == IBUF_OP_INSERT);
- ut_ad(page_id.space() == index->table->space->id);
+ ut_ad(page_id.space() == index->table->space_id);
ut_a(op < IBUF_OP_COUNT);
do_merge = FALSE;
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index 1accfd858be..8130f733806 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -372,9 +372,8 @@ row_create_table_for_mysql(
MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//**
-Does an index creation operation for MySQL. TODO: currently failure
-to create an index results in dropping the whole table! This is no problem
-currently as all indexes must be created at the same time as the table.
+Create an index when creating a table.
+On failure, the caller must drop the table!
@return error number or DB_SUCCESS */
dberr_t
row_create_index_for_mysql(
diff --git a/storage/innobase/include/row0row.h b/storage/innobase/include/row0row.h
index b46ca6eb3bc..8b3db8a1b64 100644
--- a/storage/innobase/include/row0row.h
+++ b/storage/innobase/include/row0row.h
@@ -418,7 +418,7 @@ row_mtr_start(mtr_t* mtr, dict_index_t* index, bool pessimistic)
{
mtr->start();
- switch (index->table->space->id) {
+ switch (index->table->space_id) {
case IBUF_SPACE_ID:
if (pessimistic
&& !(index->type & (DICT_UNIQUE | DICT_SPATIAL))) {
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 062892a8c88..51d6dedf512 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -4912,6 +4912,8 @@ lock_rec_queue_validate(
goto func_exit;
}
+ ut_ad(page_rec_is_leaf(rec));
+
if (index == NULL) {
/* Nothing we can do */
@@ -5074,11 +5076,13 @@ loop:
if (!sync_check_find(SYNC_FSP))
for (i = nth_bit; i < lock_rec_get_n_bits(lock); i++) {
- if (i == 1 || lock_rec_get_nth_bit(lock, i)) {
+ if (i == PAGE_HEAP_NO_SUPREMUM
+ || lock_rec_get_nth_bit(lock, i)) {
rec = page_find_rec_with_heap_no(block->frame, i);
ut_a(rec);
- ut_ad(page_rec_is_leaf(rec));
+ ut_ad(!lock_rec_get_nth_bit(lock, i)
+ || page_rec_is_leaf(rec));
offsets = rec_get_offsets(rec, lock->index, offsets,
true, ULINT_UNDEFINED,
&heap);
@@ -5297,7 +5301,7 @@ lock_rec_insert_check_and_lock(
{
ut_ad(block->frame == page_align(rec));
ut_ad(!dict_index_is_online_ddl(index)
- || dict_index_is_clust(index)
+ || index->is_primary()
|| (flags & BTR_CREATE_FLAG));
ut_ad(mtr->is_named_space(index->table->space));
ut_ad(page_rec_is_leaf(rec));
@@ -5308,6 +5312,7 @@ lock_rec_insert_check_and_lock(
}
ut_ad(!index->table->is_temporary());
+ ut_ad(page_is_leaf(block->frame));
dberr_t err;
lock_t* lock;
diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc
index 717f4a79507..1b6567ad9a4 100644
--- a/storage/innobase/page/page0page.cc
+++ b/storage/innobase/page/page0page.cc
@@ -235,7 +235,7 @@ page_set_autoinc(
mtr, block, MTR_MEMO_PAGE_X_FIX | MTR_MEMO_PAGE_SX_FIX));
ut_ad(index->is_primary());
ut_ad(index->page == block->page.id.page_no());
- ut_ad(index->table->space->id == block->page.id.space());
+ ut_ad(index->table->space_id == block->page.id.space());
byte* field = PAGE_HEADER + PAGE_ROOT_AUTO_INC
+ buf_block_get_frame(block);
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 893eeb56c18..f46c381fbf7 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -900,7 +900,7 @@ loop:
merge_file[t_ctx.buf_used]->offset++,
block[t_ctx.buf_used],
crypt_block[t_ctx.buf_used],
- table->space->id)) {
+ table->space_id)) {
error = DB_TEMP_FILE_WRITE_FAIL;
goto func_exit;
}
@@ -994,7 +994,7 @@ exit:
merge_file[i]->offset++,
block[i],
crypt_block[i],
- table->space->id)) {
+ table->space_id)) {
error = DB_TEMP_FILE_WRITE_FAIL;
goto func_exit;
}
@@ -1032,7 +1032,7 @@ exit:
psort_info->psort_common->dup,
merge_file[i], block[i], &tmpfd[i],
false, 0.0/* pct_progress */, 0.0/* pct_cost */,
- crypt_block[i], table->space->id);
+ crypt_block[i], table->space_id);
if (error != DB_SUCCESS) {
os_file_close(tmpfd[i]);
@@ -1702,7 +1702,7 @@ row_fts_merge_insert(
#ifdef UNIV_DEBUG
ins_ctx.aux_index_id = id;
#endif
- const ulint space = table->space->id;
+ const ulint space = table->space_id;
for (i = 0; i < fts_sort_pll_degree; i++) {
if (psort_info[i].merge_file[id]->n_rec == 0) {
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 1c8012f9b73..8fc71d698df 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -2050,7 +2050,7 @@ row_import_discard_changes(
table->file_unreadable = true;
if (table->space) {
- fil_close_tablespace(trx, table->space->id);
+ fil_close_tablespace(trx, table->space_id);
table->space = NULL;
}
}
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 3b103e48da7..1f9d4b6b8b4 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -435,7 +435,7 @@ row_log_online_op(
if (!log_tmp_block_encrypt(
buf, srv_sort_buf_size,
log->crypt_tail, byte_offset,
- index->table->space->id)) {
+ index->table->space_id)) {
log->error = DB_DECRYPTION_FAILED;
goto write_failed;
}
@@ -573,7 +573,7 @@ row_log_table_close_func(
if (!log_tmp_block_encrypt(
log->tail.block, srv_sort_buf_size,
log->crypt_tail, byte_offset,
- index->table->space->id)) {
+ index->table->space_id)) {
log->error = DB_DECRYPTION_FAILED;
goto err_exit;
}
@@ -2871,7 +2871,7 @@ all_done:
if (!log_tmp_block_decrypt(
buf, srv_sort_buf_size,
index->online_log->crypt_head,
- ofs, index->table->space->id)) {
+ ofs, index->table->space_id)) {
error = DB_DECRYPTION_FAILED;
goto func_exit;
}
@@ -3775,7 +3775,7 @@ all_done:
if (!log_tmp_block_decrypt(
buf, srv_sort_buf_size,
index->online_log->crypt_head,
- ofs, index->table->space->id)) {
+ ofs, index->table->space_id)) {
error = DB_DECRYPTION_FAILED;
goto func_exit;
}
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index cd8d0fdd465..38af0eb1931 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -2538,7 +2538,7 @@ write_buffers:
curr_progress,
pct_cost,
crypt_block,
- new_table->space->id);
+ new_table->space_id);
if (row == NULL) {
err = clust_btr_bulk->finish(
@@ -2649,7 +2649,7 @@ write_buffers:
curr_progress,
pct_cost,
crypt_block,
- new_table->space->id);
+ new_table->space_id);
err = btr_bulk.finish(err);
@@ -2683,7 +2683,7 @@ write_buffers:
if (!row_merge_write(
file->fd, file->offset++,
block, crypt_block,
- new_table->space->id)) {
+ new_table->space_id)) {
err = DB_TEMP_FILE_WRITE_FAIL;
trx->error_key_num = i;
break;
@@ -4303,7 +4303,7 @@ row_make_new_pathname(
dict_table_t* table, /*!< in: table to be renamed */
const char* new_name) /*!< in: new name */
{
- ut_ad(!is_system_tablespace(table->space->id));
+ ut_ad(!is_system_tablespace(table->space_id));
return os_file_make_new_pathname(table->space->chain.start->name,
new_name);
}
@@ -4538,7 +4538,7 @@ row_merge_write_redo(
log_ptr = mlog_open(&mtr, 11 + 8);
log_ptr = mlog_write_initial_log_record_low(
MLOG_INDEX_LOAD,
- index->table->space->id, index->page, log_ptr, &mtr);
+ index->table->space_id, index->page, log_ptr, &mtr);
mach_write_to_8(log_ptr, index->id);
mlog_close(&mtr, log_ptr + 8);
mtr.commit();
@@ -4896,7 +4896,7 @@ wait_again:
trx, &dup, &merge_files[i],
block, &tmpfd, true,
pct_progress, pct_cost,
- crypt_block, new_table->space->id,
+ crypt_block, new_table->space_id,
stage);
pct_progress += pct_cost;
@@ -4939,7 +4939,7 @@ wait_again:
merge_files[i].fd, block, NULL,
&btr_bulk,
merge_files[i].n_rec, pct_progress, pct_cost,
- crypt_block, new_table->space->id,
+ crypt_block, new_table->space_id,
stage);
error = btr_bulk.finish(error);
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 1fe1fad7858..4bfebab1468 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -2463,7 +2463,7 @@ err_exit:
/* We already have .ibd file here. it should be deleted. */
if (dict_table_is_file_per_table(table)
- && fil_delete_tablespace(table->space->id) != DB_SUCCESS) {
+ && fil_delete_tablespace(table->space_id) != DB_SUCCESS) {
ib::error() << "Cannot delete the file of table "
<< table->name;
}
@@ -2486,9 +2486,8 @@ err_exit:
}
/*********************************************************************//**
-Does an index creation operation for MySQL. TODO: currently failure
-to create an index results in dropping the whole table! This is no problem
-currently as all indexes must be created at the same time as the table.
+Create an index when creating a table.
+On failure, the caller must drop the table!
@return error number or DB_SUCCESS */
dberr_t
row_create_index_for_mysql(
@@ -2511,16 +2510,9 @@ row_create_index_for_mysql(
ulint len;
dict_table_t* table = index->table;
- trx->op_info = "creating index";
-
ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X));
ut_ad(mutex_own(&dict_sys->mutex));
-
- if (!table->is_temporary()) {
- trx_start_if_not_started_xa(trx, true);
- }
-
for (i = 0; i < index->n_def; i++) {
/* Check that prefix_len and actual length
< DICT_MAX_INDEX_COL_LEN */
@@ -2538,19 +2530,19 @@ row_create_index_for_mysql(
/* Column or prefix length exceeds maximum column length */
if (len > (ulint) DICT_MAX_FIELD_LEN_BY_FORMAT(table)) {
- err = DB_TOO_BIG_INDEX_COL;
-
dict_mem_index_free(index);
- goto error_handling;
+ return DB_TOO_BIG_INDEX_COL;
}
}
- trx_set_dict_operation(trx, TRX_DICT_OP_TABLE);
+ trx->op_info = "creating index";
/* For temp-table we avoid insertion into SYSTEM TABLES to
maintain performance and so we have separate path that directly
just updates dictonary cache. */
if (!table->is_temporary()) {
+ trx_start_if_not_started_xa(trx, true);
+ trx_set_dict_operation(trx, TRX_DICT_OP_TABLE);
/* Note that the space id where we store the index is
inherited from the table in dict_build_index_def_step()
in dict0crea.cc. */
@@ -2597,22 +2589,6 @@ row_create_index_for_mysql(
}
}
- if (err != DB_SUCCESS) {
-error_handling:
- /* We have special error handling here */
-
- trx->error_state = DB_SUCCESS;
-
- if (trx_is_started(trx)) {
- row_drop_table_for_mysql(table->name.m_name, trx,
- SQLCOM_DROP_TABLE, true);
- trx_rollback_to_savepoint(trx, NULL);
- ut_ad(!trx_is_started(trx));
- }
-
- trx->error_state = DB_SUCCESS;
- }
-
trx->op_info = "";
return(err);
@@ -3798,7 +3774,7 @@ do_drop:
&& dict_table_get_low("SYS_DATAFILES")) {
info = pars_info_create();
pars_info_add_int4_literal(info, "id",
- lint(table->space->id));
+ lint(table->space_id));
err = que_eval_sql(
info,
"PROCEDURE DROP_SPACE_PROC () IS\n"
diff --git a/storage/innobase/row/row0quiesce.cc b/storage/innobase/row/row0quiesce.cc
index d9b52484a94..d77cc1e33dc 100644
--- a/storage/innobase/row/row0quiesce.cc
+++ b/storage/innobase/row/row0quiesce.cc
@@ -141,7 +141,7 @@ row_quiesce_write_indexes(
mach_write_to_8(ptr, index->id);
ptr += sizeof(index_id_t);
- mach_write_to_4(ptr, table->space->id);
+ mach_write_to_4(ptr, table->space_id);
ptr += sizeof(ib_uint32_t);
mach_write_to_4(ptr, index->page);
@@ -525,7 +525,7 @@ row_quiesce_table_start(
}
for (ulint count = 0;
- ibuf_merge_space(table->space->id) != 0
+ ibuf_merge_space(table->space_id) != 0
&& !trx_is_interrupted(trx);
++count) {
if (!(count % 20)) {
@@ -537,7 +537,7 @@ row_quiesce_table_start(
if (!trx_is_interrupted(trx)) {
{
FlushObserver observer(table->space, trx, NULL);
- buf_LRU_flush_or_remove_pages(table->space->id,
+ buf_LRU_flush_or_remove_pages(table->space_id,
&observer);
}
@@ -637,7 +637,7 @@ row_quiesce_set_state(
ER_CANNOT_DISCARD_TEMPORARY_TABLE);
return(DB_UNSUPPORTED);
- } else if (table->space->id == TRX_SYS_SPACE) {
+ } else if (table->space_id == TRX_SYS_SPACE) {
char table_name[MAX_FULL_NAME_LEN + 1];
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index 5cfe036d89f..5e7894d3ca7 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -1131,7 +1131,7 @@ re_scan:
btr_pcur_get_page(pcur));
cur_block = buf_page_get_gen(
- page_id_t(index->table->space->id, page_no),
+ page_id_t(index->table->space_id, page_no),
page_size_t(index->table->space->flags),
RW_X_LATCH, NULL, BUF_GET,
__FILE__, __LINE__, mtr, &err);
diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc
index eedf73204a3..9a42333133d 100644
--- a/storage/innobase/row/row0uins.cc
+++ b/storage/innobase/row/row0uins.cc
@@ -413,7 +413,7 @@ static bool row_undo_ins_parse_undo_rec(undo_node_t* node, bool dict_locked)
dict_table_t* table = node->table;
ut_ad(!table->is_temporary());
ut_ad(dict_table_is_file_per_table(table)
- == !is_system_tablespace(table->space->id));
+ == !is_system_tablespace(table->space_id));
size_t len = mach_read_from_2(node->undo_rec)
+ size_t(node->undo_rec - ptr) - 2;
ptr[len] = 0;
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index 6eb8170e79f..b4f2b91881a 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -2303,7 +2303,7 @@ row_upd_sec_index_entry(
mtr.start();
- switch (index->table->space->id) {
+ switch (index->table->space_id) {
case SRV_TMP_SPACE_ID:
mtr.set_log_mode(MTR_LOG_NO_REDO);
flags = BTR_NO_LOCKING_FLAG;