summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-08-31 13:47:48 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-08-31 15:10:02 +0300
commit206528f722799b04708c60a71b59d75bd32bdeb3 (patch)
treed59cf6cdc943a797bc9ef901865da3566c27d93a
parentb245023fe0bc6fa0bd6e2dfa9352b30b71d0d27d (diff)
parentf693170c75a1f39f3f06aca683fe4a1998785008 (diff)
downloadmariadb-git-206528f722799b04708c60a71b59d75bd32bdeb3.tar.gz
Merge 10.1 into 10.2
-rw-r--r--man/CMakeLists.txt6
-rw-r--r--man/mariabackup.116
-rw-r--r--man/mbstream.116
-rw-r--r--man/mysql_embedded.11
-rw-r--r--man/tokuft_logprint.1 (renamed from man/tokuft_logdump.1)2
-rw-r--r--man/wsrep_sst_mariabackup.116
-rw-r--r--man/wsrep_sst_rsync.14
-rw-r--r--man/wsrep_sst_rsync_wan.116
-rw-r--r--mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result161
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync_data_dir.result396
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test223
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf11
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_data_dir.test16
-rw-r--r--mysql-test/suite/maria/concurrent.result33
-rw-r--r--mysql-test/suite/maria/concurrent.test28
-rw-r--r--mysql-test/suite/plugins/r/auth_ed25519.result2
-rw-r--r--plugin/auth_ed25519/server_ed25519.c2
-rw-r--r--plugin/auth_pam/mapper/pam_user_map.c6
-rw-r--r--scripts/galera_recovery.sh3
-rw-r--r--scripts/wsrep_sst_common.sh6
-rw-r--r--scripts/wsrep_sst_rsync.sh31
-rw-r--r--sql/field.h46
-rw-r--r--sql/handler.cc31
-rw-r--r--sql/mysqld.cc14
-rw-r--r--sql/sql_class.h11
-rw-r--r--sql/sys_vars.cc93
-rw-r--r--sql/wsrep_mysqld.h5
-rw-r--r--sql/wsrep_sst.cc50
-rw-r--r--sql/wsrep_thd.cc22
-rw-r--r--storage/innobase/handler/ha_innodb.cc68
-rw-r--r--storage/maria/ha_maria.cc3
-rw-r--r--storage/maria/ma_commit.c2
-rw-r--r--storage/maria/ma_info.c6
-rw-r--r--storage/maria/ma_recovery.c8
-rw-r--r--storage/maria/maria_chk.c4
-rw-r--r--storage/maria/maria_def.h2
-rw-r--r--storage/xtradb/handler/ha_innodb.cc57
-rw-r--r--storage/xtradb/row/row0mysql.cc3
38 files changed, 707 insertions, 713 deletions
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index 0a4843979f4..00d9c51abda 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -27,12 +27,14 @@ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1
wsrep_sst_mysqldump.1 wsrep_sst_rsync.1
wsrep_sst_xtrabackup-v2.1 wsrep_sst_xtrabackup.1
galera_recovery.1 galera_new_cluster.1 tokuft_logdump.1
- mysql_ldb.1)
+ mysql_ldb.1
+ wsrep_sst_mariabackup.1 mbstream.1 mariabackup.1
+ wsrep_sst_rsync_wan.1)
SET(MAN8_SERVER mysqld.8)
SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1
mysqlaccess.1 mysqladmin.1 mysqlbinlog.1 mysqlcheck.1
mysqldump.1 mysqlimport.1 mysqlshow.1 mysqlslap.1
- mysql_plugin.1)
+ mysql_plugin.1 mysql_embedded.1)
SET(MAN1_DEVEL mysql_config.1)
SET(MAN1_TEST mysql-stress-test.pl.1 mysql-test-run.pl.1 mysql_client_test.1
mysqltest_embedded.1 mysql_client_test_embedded.1 my_safe_process.1)
diff --git a/man/mariabackup.1 b/man/mariabackup.1
new file mode 100644
index 00000000000..628c9cf74fa
--- /dev/null
+++ b/man/mariabackup.1
@@ -0,0 +1,16 @@
+'\" t
+.\"
+.TH "\FBMARIABACKUP\FR" "1" "9 August 2018" "MariaDB 10\&.1" "MariaDB Database System"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH NAME
+mariabackup \- Backup tool
+.SH DESCRIPTION
+Use \fBmariabackup \-\-help\fR for details on usage\.
+.PP
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/man/mbstream.1 b/man/mbstream.1
new file mode 100644
index 00000000000..2aba73fe400
--- /dev/null
+++ b/man/mbstream.1
@@ -0,0 +1,16 @@
+'\" t
+.\"
+.TH "\FBMBSTREAM\FR" "1" "9 August 2018" "MariaDB 10\&.1" "MariaDB Database System"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH NAME
+mbstream \- Serialize/deserialize files in the XBSTREAM format
+.SH DESCRIPTION
+Use \fBmbstream \-\-help\fR for details on usage\.
+.PP
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/man/mysql_embedded.1 b/man/mysql_embedded.1
new file mode 100644
index 00000000000..735c4e05ae0
--- /dev/null
+++ b/man/mysql_embedded.1
@@ -0,0 +1 @@
+.so man1/mysql.1
diff --git a/man/tokuft_logdump.1 b/man/tokuft_logprint.1
index f6cf08080f7..bc3b85a55d6 100644
--- a/man/tokuft_logdump.1
+++ b/man/tokuft_logprint.1
@@ -11,6 +11,6 @@
.SH NAME
tokuft_logprint \- Dump the log from stdin to stdout
.SH DESCRIPTION
-Use: Dump the log from stdin to stdout\.
+Use: Dump the log from stdin to stdout\. Use \fBtokuft_logprint \-\-help\fR for details on usage\.
.PP
For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/man/wsrep_sst_mariabackup.1 b/man/wsrep_sst_mariabackup.1
new file mode 100644
index 00000000000..34ae4b6f82e
--- /dev/null
+++ b/man/wsrep_sst_mariabackup.1
@@ -0,0 +1,16 @@
+'\" t
+.\"
+.TH "\FBWSREP_SST_MARIABACKUP\FR" "1" "8 August 2018" "MariaDB 10\&.1" "MariaDB Database System"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH NAME
+wsrep_sst_mariabackup \- mariabackup\-based state snapshot transfer
+.SH DESCRIPTION
+Use: mariabackup-based state snapshot transfer\.
+.PP
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/man/wsrep_sst_rsync.1 b/man/wsrep_sst_rsync.1
index aa0a492d7c3..aa30a609a34 100644
--- a/man/wsrep_sst_rsync.1
+++ b/man/wsrep_sst_rsync.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBWSREP_SST_RSYNC\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBWSREP_SST_RSYNC\FR" "1" "9 August 2018" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -9,7 +9,7 @@
.\" disable justification (adjust text to left margin only)
.ad l
.SH NAME
-wsrep_sst_mysqldump \- rsync-based state snapshot transfer
+wsrep_sst_rsync \- rsync-based state snapshot transfer
.SH DESCRIPTION
Use: rsync-based state snapshot transfer\.
.PP
diff --git a/man/wsrep_sst_rsync_wan.1 b/man/wsrep_sst_rsync_wan.1
new file mode 100644
index 00000000000..6d465d554a8
--- /dev/null
+++ b/man/wsrep_sst_rsync_wan.1
@@ -0,0 +1,16 @@
+'\" t
+.\"
+.TH "\FBWSREP_SST_RSYNC_WAN\FR" "1" "9 August 2018" "MariaDB 10\&.1" "MariaDB Database System"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH NAME
+wsrep_sst_rsync_wan \- rsync_wan (rsync with delta transfers)\-based state snapshot transfer
+.SH DESCRIPTION
+Use: rsync_wan\-based state snapshot transfer\.
+.PP
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result b/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result
deleted file mode 100644
index 78b40228eb0..00000000000
--- a/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result
+++ /dev/null
@@ -1,161 +0,0 @@
-connection node_1;
-connection node_2;
-connection node_2;
-SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
-connection node_1;
-SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
-CREATE TABLE t1 (
-i int(11) NOT NULL AUTO_INCREMENT,
-c char(32) DEFAULT 'dummy_text',
-PRIMARY KEY (i)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-insert into t1(i) values(null);
-select * from t1;
-i c
-1 dummy_text
-insert into t1(i) values(null), (null), (null);
-select * from t1;
-i c
-1 dummy_text
-3 dummy_text
-5 dummy_text
-7 dummy_text
-connection node_2;
-select * from t1;
-i c
-1 dummy_text
-3 dummy_text
-5 dummy_text
-7 dummy_text
-SET GLOBAL wsrep_forced_binlog_format='none';
-connection node_1;
-SET GLOBAL wsrep_forced_binlog_format='none';
-drop table t1;
-SET SESSION binlog_format='STATEMENT';
-show variables like 'binlog_format';
-Variable_name Value
-binlog_format STATEMENT
-SET GLOBAL wsrep_auto_increment_control='OFF';
-SET SESSION auto_increment_increment = 3;
-SET SESSION auto_increment_offset = 1;
-CREATE TABLE t1 (
-i int(11) NOT NULL AUTO_INCREMENT,
-c char(32) DEFAULT 'dummy_text',
-PRIMARY KEY (i)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-insert into t1(i) values(null);
-select * from t1;
-i c
-1 dummy_text
-insert into t1(i) values(null), (null), (null);
-select * from t1;
-i c
-1 dummy_text
-4 dummy_text
-7 dummy_text
-10 dummy_text
-connection node_2;
-select * from t1;
-i c
-1 dummy_text
-4 dummy_text
-7 dummy_text
-10 dummy_text
-connection node_1;
-SET GLOBAL wsrep_auto_increment_control='ON';
-SET SESSION binlog_format='ROW';
-show variables like 'binlog_format';
-Variable_name Value
-binlog_format ROW
-show variables like '%auto_increment%';
-Variable_name Value
-auto_increment_increment 2
-auto_increment_offset 1
-wsrep_auto_increment_control ON
-SET GLOBAL wsrep_auto_increment_control='OFF';
-show variables like '%auto_increment%';
-Variable_name Value
-auto_increment_increment 3
-auto_increment_offset 1
-wsrep_auto_increment_control OFF
-SET GLOBAL wsrep_auto_increment_control='ON';
-drop table t1;
-connection node_2;
-SET GLOBAL wsrep_forced_binlog_format='ROW';
-connection node_1;
-SET GLOBAL wsrep_forced_binlog_format='ROW';
-CREATE TABLE t1 (
-i int(11) NOT NULL AUTO_INCREMENT,
-c char(32) DEFAULT 'dummy_text',
-PRIMARY KEY (i)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-insert into t1(i) values(null);
-select * from t1;
-i c
-1 dummy_text
-insert into t1(i) values(null), (null), (null);
-select * from t1;
-i c
-1 dummy_text
-3 dummy_text
-5 dummy_text
-7 dummy_text
-connection node_2;
-select * from t1;
-i c
-1 dummy_text
-3 dummy_text
-5 dummy_text
-7 dummy_text
-SET GLOBAL wsrep_forced_binlog_format='none';
-connection node_1;
-SET GLOBAL wsrep_forced_binlog_format='none';
-drop table t1;
-SET SESSION binlog_format='ROW';
-show variables like 'binlog_format';
-Variable_name Value
-binlog_format ROW
-SET GLOBAL wsrep_auto_increment_control='OFF';
-SET SESSION auto_increment_increment = 3;
-SET SESSION auto_increment_offset = 1;
-CREATE TABLE t1 (
-i int(11) NOT NULL AUTO_INCREMENT,
-c char(32) DEFAULT 'dummy_text',
-PRIMARY KEY (i)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-insert into t1(i) values(null);
-select * from t1;
-i c
-1 dummy_text
-insert into t1(i) values(null), (null), (null);
-select * from t1;
-i c
-1 dummy_text
-4 dummy_text
-7 dummy_text
-10 dummy_text
-connection node_2;
-select * from t1;
-i c
-1 dummy_text
-4 dummy_text
-7 dummy_text
-10 dummy_text
-connection node_1;
-SET GLOBAL wsrep_auto_increment_control='ON';
-show variables like 'binlog_format';
-Variable_name Value
-binlog_format ROW
-show variables like '%auto_increment%';
-Variable_name Value
-auto_increment_increment 2
-auto_increment_offset 1
-wsrep_auto_increment_control ON
-SET GLOBAL wsrep_auto_increment_control='OFF';
-show variables like '%auto_increment%';
-Variable_name Value
-auto_increment_increment 3
-auto_increment_offset 1
-wsrep_auto_increment_control OFF
-SET GLOBAL wsrep_auto_increment_control='ON';
-drop table t1;
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_data_dir.result b/mysql-test/suite/galera/r/galera_sst_rsync_data_dir.result
new file mode 100644
index 00000000000..d5c6a11f61f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_rsync_data_dir.result
@@ -0,0 +1,396 @@
+connection node_1;
+connection node_2;
+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 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;
+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;
+Cleaning var directory ...
+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_clean_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_clean_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;
+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/t/galera_binlog_stmt_autoinc.test b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test
deleted file mode 100644
index aab4fea9f2e..00000000000
--- a/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test
+++ /dev/null
@@ -1,223 +0,0 @@
-##
-## Tests the auto-increment with binlog in STATEMENT mode.
-##
-
---source include/galera_cluster.inc
---source include/have_innodb.inc
-
---let $node_1=node_1
---let $node_2=node_2
---source include/auto_increment_offset_save.inc
-
-##
-## Verify the correct operation of the auto-increment when the binlog
-## format artificially set to the 'STATEMENT' (although this mode is
-## not recommended in the current version):
-##
-
---connection node_2
-SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
-
---connection node_1
-SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
-
-CREATE TABLE t1 (
- i int(11) NOT NULL AUTO_INCREMENT,
- c char(32) DEFAULT 'dummy_text',
- PRIMARY KEY (i)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-insert into t1(i) values(null);
-
-select * from t1;
-
-insert into t1(i) values(null), (null), (null);
-
-select * from t1;
-
---connection node_2
-
-select * from t1;
-
-SET GLOBAL wsrep_forced_binlog_format='none';
-
---connection node_1
-
-SET GLOBAL wsrep_forced_binlog_format='none';
-
-drop table t1;
-
-##
-## Check the operation when the automatic control over the auto-increment
-## settings is switched off, that is, when we use the increment step and
-## the offset specified by the user. In the current session, the binlog
-## format is set to 'STATEMENT'. It is important that the values of the
-## auto-increment options does not changed on other node - it allows us
-## to check the correct transmission of the auto-increment options to
-## other nodes:
-##
-
---disable_warnings
-SET SESSION binlog_format='STATEMENT';
---enable_warnings
-
-show variables like 'binlog_format';
-
-SET GLOBAL wsrep_auto_increment_control='OFF';
-
-SET SESSION auto_increment_increment = 3;
-SET SESSION auto_increment_offset = 1;
-
-CREATE TABLE t1 (
- i int(11) NOT NULL AUTO_INCREMENT,
- c char(32) DEFAULT 'dummy_text',
- PRIMARY KEY (i)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-insert into t1(i) values(null);
-
-select * from t1;
-
-insert into t1(i) values(null), (null), (null);
-
-select * from t1;
-
---connection node_2
-
-select * from t1;
-
---connection node_1
-
-##
-## Verify the return to automatic calculation of the step
-## and offset of the auto-increment:
-##
-
-SET GLOBAL wsrep_auto_increment_control='ON';
-
-SET SESSION binlog_format='ROW';
-
-show variables like 'binlog_format';
-show variables like '%auto_increment%';
-
-##
-## Verify the recovery of original user-defined values after
-## stopping the automatic control over auto-increment:
-##
-
-SET GLOBAL wsrep_auto_increment_control='OFF';
-
-show variables like '%auto_increment%';
-
-##
-## Restore original options and drop test table:
-##
-
-SET GLOBAL wsrep_auto_increment_control='ON';
-
-drop table t1;
-
-##
-## Verify the correct operation of the auto-increment when the binlog
-## format set to the 'ROW':
-##
-
---connection node_2
-SET GLOBAL wsrep_forced_binlog_format='ROW';
-
---connection node_1
-SET GLOBAL wsrep_forced_binlog_format='ROW';
-
-CREATE TABLE t1 (
- i int(11) NOT NULL AUTO_INCREMENT,
- c char(32) DEFAULT 'dummy_text',
- PRIMARY KEY (i)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-insert into t1(i) values(null);
-
-select * from t1;
-
-insert into t1(i) values(null), (null), (null);
-
-select * from t1;
-
---connection node_2
-
-select * from t1;
-
-SET GLOBAL wsrep_forced_binlog_format='none';
-
---connection node_1
-
-SET GLOBAL wsrep_forced_binlog_format='none';
-
-drop table t1;
-
-##
-## Check the operation when the automatic control over the auto-increment
-## settings is switched off, that is, when we use the increment step and
-## the offset specified by the user. In the current session, the binlog
-## format is set to 'ROW'. It is important that the values of the
-## auto-increment options does not changed on other node - it allows us
-## to check the correct transmission of the auto-increment options to
-## other nodes:
-##
-
-SET SESSION binlog_format='ROW';
-
-show variables like 'binlog_format';
-
-SET GLOBAL wsrep_auto_increment_control='OFF';
-
-SET SESSION auto_increment_increment = 3;
-SET SESSION auto_increment_offset = 1;
-
-CREATE TABLE t1 (
- i int(11) NOT NULL AUTO_INCREMENT,
- c char(32) DEFAULT 'dummy_text',
- PRIMARY KEY (i)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-insert into t1(i) values(null);
-
-select * from t1;
-
-insert into t1(i) values(null), (null), (null);
-
-select * from t1;
-
---connection node_2
-
-select * from t1;
-
---connection node_1
-
-##
-## Verify the return to automatic calculation of the step
-## and offset of the auto-increment:
-##
-
-SET GLOBAL wsrep_auto_increment_control='ON';
-
-show variables like 'binlog_format';
-show variables like '%auto_increment%';
-
-##
-## Verify the recovery of original user-defined values after
-## stopping the automatic control over auto-increment:
-##
-
-SET GLOBAL wsrep_auto_increment_control='OFF';
-
-show variables like '%auto_increment%';
-
-##
-## Restore original options and drop test table:
-##
-
-SET GLOBAL wsrep_auto_increment_control='ON';
-
-drop table t1;
-
---source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf
new file mode 100644
index 00000000000..afe9796a11a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf
@@ -0,0 +1,11 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld.2]
+innodb_data_home_dir=@ENV.MYSQL_TMP_DIR/rsync_test_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_sst_rsync_data_dir.test b/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.test
new file mode 100644
index 00000000000..68aa1068f75
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.test
@@ -0,0 +1,16 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--source suite/galera/include/galera_st_shutdown_slave.inc
+--source suite/galera/include/galera_st_clean_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
+
+# cleanup temporary database files:
+--remove_files_wildcard $MYSQL_TMP_DIR/rsync_test_2 *
diff --git a/mysql-test/suite/maria/concurrent.result b/mysql-test/suite/maria/concurrent.result
new file mode 100644
index 00000000000..caea6fd1fb9
--- /dev/null
+++ b/mysql-test/suite/maria/concurrent.result
@@ -0,0 +1,33 @@
+CREATE TABLE t1 (a INT, b CHAR(12), c INT, FULLTEXT KEY(b), KEY (c)) ENGINE=Aria;
+CREATE TABLE t2 (a INT, b CHAR(12), c INT) ENGINE=Aria;
+INSERT INTO t2 VALUES (1,'foo',8), (2,'bar',9);
+connect con1,localhost,root,,test;
+INSERT INTO t1 SELECT * FROM t2;
+connection default;
+select 1;
+1
+1
+select 1;
+1
+1
+select 1;
+1
+1
+select 1;
+1
+1
+select 1;
+1
+1
+select 1;
+1
+1
+select 1;
+1
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 FROM non_existing_table2 );
+ERROR 42S02: Table 'test.non_existing_table2' doesn't exist
+connection con1;
+disconnect con1;
+connection default;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/maria/concurrent.test b/mysql-test/suite/maria/concurrent.test
new file mode 100644
index 00000000000..42adb082d40
--- /dev/null
+++ b/mysql-test/suite/maria/concurrent.test
@@ -0,0 +1,28 @@
+#
+# MDEV-15797 Assertion `thd->killed != 0' failed in ha_maria::enable_indexes
+#
+
+CREATE TABLE t1 (a INT, b CHAR(12), c INT, FULLTEXT KEY(b), KEY (c)) ENGINE=Aria;
+CREATE TABLE t2 (a INT, b CHAR(12), c INT) ENGINE=Aria;
+INSERT INTO t2 VALUES (1,'foo',8), (2,'bar',9);
+
+--connect (con1,localhost,root,,test)
+--send
+ INSERT INTO t1 SELECT * FROM t2;
+--connection default
+select 1;
+select 1;
+select 1;
+select 1;
+select 1;
+select 1;
+select 1;
+--error ER_NO_SUCH_TABLE
+SELECT * FROM t1 WHERE a = ( SELECT 1 FROM non_existing_table2 );
+--connection con1
+--reap
+
+# Cleanup
+--disconnect con1
+--connection default
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result
index ee9320bbc6c..4785bef3ef7 100644
--- a/mysql-test/suite/plugins/r/auth_ed25519.result
+++ b/mysql-test/suite/plugins/r/auth_ed25519.result
@@ -33,7 +33,7 @@ PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication
PLUGIN_LICENSE GPL
LOAD_OPTION ON
PLUGIN_MATURITY Stable
-PLUGIN_AUTH_VERSION 1.0-alpha
+PLUGIN_AUTH_VERSION 1.0
create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';
show grants for test1@localhost;
Grants for test1@localhost
diff --git a/plugin/auth_ed25519/server_ed25519.c b/plugin/auth_ed25519/server_ed25519.c
index 8870c271b18..23b4e7389c7 100644
--- a/plugin/auth_ed25519/server_ed25519.c
+++ b/plugin/auth_ed25519/server_ed25519.c
@@ -100,7 +100,7 @@ maria_declare_plugin(ed25519)
0x0100,
NULL,
NULL,
- "1.0-alpha",
+ "1.0",
MariaDB_PLUGIN_MATURITY_STABLE
}
maria_declare_plugin_end;
diff --git a/plugin/auth_pam/mapper/pam_user_map.c b/plugin/auth_pam/mapper/pam_user_map.c
index c03ea12be74..e1d11acabb9 100644
--- a/plugin/auth_pam/mapper/pam_user_map.c
+++ b/plugin/auth_pam/mapper/pam_user_map.c
@@ -189,13 +189,15 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
s++;
}
from= s;
- skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') || (*s == '$'));
+ skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') ||
+ (*s == '$') || (*s == '\\') || (*s == '/'));
end_from= s;
skip(isspace(*s));
if (end_from == from || *s++ != ':') goto syntax_error;
skip(isspace(*s));
to= s;
- skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') || (*s == '$'));
+ skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') ||
+ (*s == '$'));
end_to= s;
if (end_to == to) goto syntax_error;
diff --git a/scripts/galera_recovery.sh b/scripts/galera_recovery.sh
index 09de6721762..c58f3d8f6b9 100644
--- a/scripts/galera_recovery.sh
+++ b/scripts/galera_recovery.sh
@@ -107,8 +107,7 @@ else
log "WSREP: mktemp failed"
fi
-parse_arguments `$print_defaults $cmdline_args --loose-verbose \
- mariadb mariadb_safe mysqld mysqld_safe safe_mysqld galera`
+parse_arguments `$print_defaults $cmdline_args --loose-verbose --mysqld`
# Perform wsrep position recovery if wsrep_on=1, skip otherwise.
if [ "$wsrep_on" -eq 1 ]; then
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index 3367f3e244e..20b63ff036a 100644
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -27,6 +27,7 @@ WSREP_SST_OPT_PSWD=${WSREP_SST_OPT_PSWD:-}
WSREP_SST_OPT_DEFAULT=""
WSREP_SST_OPT_EXTRA_DEFAULT=""
WSREP_SST_OPT_SUFFIX_DEFAULT=""
+WSREP_SST_OPT_SUFFIX_VALUE=""
while [ $# -gt 0 ]; do
case "$1" in
@@ -76,6 +77,7 @@ case "$1" in
;;
'--defaults-group-suffix')
readonly WSREP_SST_OPT_SUFFIX_DEFAULT="$1=$2"
+ readonly WSREP_SST_OPT_SUFFIX_VALUE="$2"
shift
;;
'--host')
@@ -274,8 +276,8 @@ parse_cnf()
reval=$($MY_PRINT_DEFAULTS "${group}" | awk -v var="${var}" 'BEGIN { OFS=FS="=" } { gsub(/_/,"-",$1); if ( $1=="--"var) lastval=substr($0,length($1)+2) } END { print lastval}')
# use default if we haven't found a value
- if [ -z $reval ]; then
- [ -n $3 ] && reval=$3
+ if [ -z "$reval" ]; then
+ [ -n "$3" ] && reval=$3
fi
echo $reval
}
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index 44625a549e3..17f000324c8 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -154,6 +154,20 @@ else
WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; pwd -P)
fi
+INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:-""}
+# if INNODB_DATA_HOME_DIR env. variable is not set, try to get it from my.cnf
+if [ -z "$INNODB_DATA_HOME_DIR" ]; then
+ INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '')
+fi
+
+if [ -n "$INNODB_DATA_HOME_DIR" ]; then
+ # handle both relative and absolute paths
+ INNODB_DATA_HOME_DIR=$(cd $WSREP_SST_OPT_DATA; mkdir -p "$INNODB_DATA_HOME_DIR"; cd $INNODB_DATA_HOME_DIR; pwd -P)
+else
+ # default to datadir
+ INNODB_DATA_HOME_DIR=$(cd $WSREP_SST_OPT_DATA; pwd -P)
+fi
+
# Old filter - include everything except selected
# FILTER=(--exclude '*.err' --exclude '*.pid' --exclude '*.sock' \
# --exclude '*.conf' --exclude core --exclude 'galera.*' \
@@ -162,7 +176,7 @@ fi
# New filter - exclude everything except dirs (schemas) and innodb files
FILTER="-f '- /lost+found' -f '- /.fseventsd' -f '- /.Trashes'
- -f '+ /wsrep_sst_binlog.tar' -f '+ /ib_lru_dump' -f '+ /ibdata*' -f '+ /*/' -f '- /*'"
+ -f '+ /wsrep_sst_binlog.tar' -f '- $INNODB_DATA_HOME_DIR/ib_lru_dump' -f '- $INNODB_DATA_HOME_DIR/ibdata*' -f '+ /*/' -f '- /*'"
SSTKEY=$(parse_cnf sst tkey "")
SSTCERT=$(parse_cnf sst tcert "")
@@ -270,6 +284,19 @@ EOF
exit $RC
fi
+ # Transfer InnoDB data files
+ rsync ${STUNNEL:+--rsh="$STUNNEL"} \
+ --owner --group --perms --links --specials \
+ --ignore-times --inplace --dirs --delete --quiet \
+ $WHOLE_FILE_OPT -f '+ /ibdata*' -f '+ /ib_lru_dump' \
+ -f '- **' "$INNODB_DATA_HOME_DIR/" \
+ rsync://$WSREP_SST_OPT_ADDR-data_dir >&2 || RC=$?
+
+ if [ $RC -ne 0 ]; then
+ wsrep_log_error "rsync innodb_data_home_dir returned code $RC:"
+ exit 255 # unknown error
+ fi
+
# second, we transfer InnoDB log files
rsync ${STUNNEL:+--rsh="$STUNNEL"} \
--owner --group --perms --links --specials \
@@ -370,6 +397,8 @@ $SILENT
path = $WSREP_SST_OPT_DATA
[$MODULE-log_dir]
path = $WSREP_LOG_DIR
+[$MODULE-data_dir]
+ path = $INNODB_DATA_HOME_DIR
EOF
# rm -rf "$DATA"/ib_logfile* # we don't want old logs around
diff --git a/sql/field.h b/sql/field.h
index ae6adec07e8..22c276478b6 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1448,17 +1448,6 @@ public:
/* Hash value */
virtual void hash(ulong *nr, ulong *nr2);
- /**
- Get the upper limit of the MySQL integral and floating-point type.
-
- @return maximum allowed value for the field
- */
- virtual ulonglong get_max_int_value() const
- {
- DBUG_ASSERT(false);
- return 0ULL;
- }
-
/**
Checks whether a string field is part of write_set.
@@ -2017,11 +2006,6 @@ public:
*to= *from;
return from + 1;
}
-
- virtual ulonglong get_max_int_value() const
- {
- return unsigned_flag ? 0xFFULL : 0x7FULL;
- }
};
@@ -2063,10 +2047,6 @@ public:
virtual const uchar *unpack(uchar* to, const uchar *from,
const uchar *from_end, uint param_data)
{ return unpack_int16(to, from, from_end); }
- virtual ulonglong get_max_int_value() const
- {
- return unsigned_flag ? 0xFFFFULL : 0x7FFFULL;
- }
};
class Field_medium :public Field_integer {
@@ -2100,10 +2080,6 @@ public:
{
return Field::pack(to, from, max_length);
}
- virtual ulonglong get_max_int_value() const
- {
- return unsigned_flag ? 0xFFFFFFULL : 0x7FFFFFULL;
- }
};
@@ -2149,10 +2125,6 @@ public:
{
return unpack_int32(to, from, from_end);
}
- virtual ulonglong get_max_int_value() const
- {
- return unsigned_flag ? 0xFFFFFFFFULL : 0x7FFFFFFFULL;
- }
};
@@ -2202,10 +2174,6 @@ public:
{
return unpack_int64(to, from, from_end);
}
- virtual ulonglong get_max_int_value() const
- {
- return unsigned_flag ? 0xFFFFFFFFFFFFFFFFULL : 0x7FFFFFFFFFFFFFFFULL;
- }
};
@@ -2245,13 +2213,6 @@ public:
uint32 pack_length() const { return sizeof(float); }
uint row_pack_length() const { return pack_length(); }
void sql_type(String &str) const;
- virtual ulonglong get_max_int_value() const
- {
- /*
- We use the maximum as per IEEE754-2008 standard, 2^24
- */
- return 0x1000000ULL;
- }
private:
int do_save_field_metadata(uchar *first_byte);
};
@@ -2304,13 +2265,6 @@ public:
uint32 pack_length() const { return sizeof(double); }
uint row_pack_length() const { return pack_length(); }
void sql_type(String &str) const;
- virtual ulonglong get_max_int_value() const
- {
- /*
- We use the maximum as per IEEE754-2008 standard, 2^53
- */
- return 0x20000000000000ULL;
- }
private:
int do_save_field_metadata(uchar *first_byte);
};
diff --git a/sql/handler.cc b/sql/handler.cc
index 2fadef3044f..36babb96415 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -2853,15 +2853,9 @@ compute_next_insert_id(ulonglong nr,struct system_variables *variables)
nr= nr + 1; // optimization of the formula below
else
{
- /*
- Calculating the number of complete auto_increment_increment extents:
- */
nr= (((nr+ variables->auto_increment_increment -
variables->auto_increment_offset)) /
(ulonglong) variables->auto_increment_increment);
- /*
- Adding an offset to the auto_increment_increment extent boundary:
- */
nr= (nr* (ulonglong) variables->auto_increment_increment +
variables->auto_increment_offset);
}
@@ -2917,14 +2911,8 @@ prev_insert_id(ulonglong nr, struct system_variables *variables)
}
if (variables->auto_increment_increment == 1)
return nr; // optimization of the formula below
- /*
- Calculating the number of complete auto_increment_increment extents:
- */
nr= (((nr - variables->auto_increment_offset)) /
(ulonglong) variables->auto_increment_increment);
- /*
- Adding an offset to the auto_increment_increment extent boundary:
- */
return (nr * (ulonglong) variables->auto_increment_increment +
variables->auto_increment_offset);
}
@@ -3147,23 +3135,10 @@ int handler::update_auto_increment()
if (unlikely(tmp)) // Out of range value in store
{
/*
- first test if the query was aborted due to strict mode constraints
- */
- if (thd->killed == KILL_BAD_DATA ||
- nr > table->next_number_field->get_max_int_value())
- DBUG_RETURN(HA_ERR_AUTOINC_ERANGE);
-
- /*
- field refused this value (overflow) and truncated it, use the result of
- the truncation (which is going to be inserted); however we try to
- decrease it to honour auto_increment_* variables.
- That will shift the left bound of the reserved interval, we don't
- bother shifting the right bound (anyway any other value from this
- interval will cause a duplicate key).
+ It's better to return an error here than getting a confusing
+ 'duplicate key error' later.
*/
- nr= prev_insert_id(table->next_number_field->val_int(), variables);
- if (unlikely(table->next_number_field->store((longlong) nr, TRUE)))
- nr= table->next_number_field->val_int();
+ result= HA_ERR_AUTOINC_ERANGE;
}
if (append)
{
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1c45d07beed..dee7ac56833 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4319,20 +4319,6 @@ static int init_common_variables()
DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
server_version, SYSTEM_TYPE,MACHINE_TYPE));
-#ifdef WITH_WSREP
- /*
- We need to initialize auxiliary variables, that will be
- further keep the original values of auto-increment options
- as they set by the user. These variables used to restore
- user-defined values of the auto-increment options after
- setting of the wsrep_auto_increment_control to 'OFF'.
- */
- global_system_variables.saved_auto_increment_increment=
- global_system_variables.auto_increment_increment;
- global_system_variables.saved_auto_increment_offset=
- global_system_variables.auto_increment_offset;
-#endif /* WITH_WSREP */
-
#ifdef HAVE_LINUX_LARGE_PAGES
/* Initialize large page size */
if (opt_large_pages)
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 9a10083a998..4888b38bc30 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -569,17 +569,6 @@ typedef struct system_variables
ha_rows max_join_size;
ha_rows expensive_subquery_limit;
ulong auto_increment_increment, auto_increment_offset;
-#ifdef WITH_WSREP
- /*
- Variables with stored values of the auto_increment_increment
- and auto_increment_offset options that are will be needed when
- wsrep_auto_increment_control will be set to 'OFF', because the
- setting it to 'ON' leads to overwriting of the original values
- (which are set by the user) by calculated values (which are
- based on the cluster's size):
- */
- ulong saved_auto_increment_increment, saved_auto_increment_offset;
-#endif /* WITH_WSREP */
uint eq_range_index_dive_limit;
ulong lock_wait_timeout;
ulong join_cache_level;
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 5541efbcead..391772d1191 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -347,56 +347,13 @@ static Sys_var_long Sys_pfs_connect_attrs_size(
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
-#ifdef WITH_WSREP
-
-/*
- We need to keep the original values set by the user, as they will
- be lost if wsrep_auto_increment_control set to 'ON':
-*/
-static bool update_auto_increment_increment (sys_var *self, THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.saved_auto_increment_increment=
- global_system_variables.auto_increment_increment;
- else
- thd->variables.saved_auto_increment_increment=
- thd->variables.auto_increment_increment;
- return false;
-}
-
-#endif /* WITH_WSREP */
-
static Sys_var_ulong Sys_auto_increment_increment(
"auto_increment_increment",
"Auto-increment columns are incremented by this",
SESSION_VAR(auto_increment_increment),
CMD_LINE(OPT_ARG),
VALID_RANGE(1, 65535), DEFAULT(1), BLOCK_SIZE(1),
-#ifdef WITH_WSREP
- NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
- ON_UPDATE(update_auto_increment_increment));
-#else
NO_MUTEX_GUARD, IN_BINLOG);
-#endif /* WITH_WSREP */
-
-#ifdef WITH_WSREP
-
-/*
- We need to keep the original values set by the user, as they will
- be lost if wsrep_auto_increment_control set to 'ON':
-*/
-static bool update_auto_increment_offset (sys_var *self, THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.saved_auto_increment_offset=
- global_system_variables.auto_increment_offset;
- else
- thd->variables.saved_auto_increment_offset=
- thd->variables.auto_increment_offset;
- return false;
-}
-
-#endif /* WITH_WSREP */
static Sys_var_ulong Sys_auto_increment_offset(
"auto_increment_offset",
@@ -405,12 +362,7 @@ static Sys_var_ulong Sys_auto_increment_offset(
SESSION_VAR(auto_increment_offset),
CMD_LINE(OPT_ARG),
VALID_RANGE(1, 65535), DEFAULT(1), BLOCK_SIZE(1),
-#ifdef WITH_WSREP
- NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
- ON_UPDATE(update_auto_increment_offset));
-#else
NO_MUTEX_GUARD, IN_BINLOG);
-#endif /* WITH_WSREP */
static Sys_var_mybool Sys_automatic_sp_privileges(
"automatic_sp_privileges",
@@ -5024,54 +4976,11 @@ static Sys_var_ulong Sys_wsrep_retry_autocommit(
SESSION_VAR(wsrep_retry_autocommit), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, 10000), DEFAULT(1), BLOCK_SIZE(1));
-static bool update_wsrep_auto_increment_control (sys_var *self, THD *thd, enum_var_type type)
-{
- if (wsrep_auto_increment_control)
- {
- /*
- The variables that control auto increment shall be calculated
- automaticaly based on the size of the cluster. This usually done
- within the wsrep_view_handler_cb callback. However, if the user
- manually sets the value of wsrep_auto_increment_control to 'ON',
- then we should to re-calculate these variables again (because
- these values may be required before wsrep_view_handler_cb will
- be re-invoked, which is rarely invoked if the cluster stays in
- the stable state):
- */
- global_system_variables.auto_increment_increment=
- wsrep_cluster_size ? wsrep_cluster_size : 1;
- global_system_variables.auto_increment_offset=
- wsrep_local_index >= 0 ? wsrep_local_index + 1 : 1;
- thd->variables.auto_increment_increment=
- global_system_variables.auto_increment_increment;
- thd->variables.auto_increment_offset=
- global_system_variables.auto_increment_offset;
- }
- else
- {
- /*
- We must restore the last values of the variables that
- are explicitly specified by the user:
- */
- global_system_variables.auto_increment_increment=
- global_system_variables.saved_auto_increment_increment;
- global_system_variables.auto_increment_offset=
- global_system_variables.saved_auto_increment_offset;
- thd->variables.auto_increment_increment=
- thd->variables.saved_auto_increment_increment;
- thd->variables.auto_increment_offset=
- thd->variables.saved_auto_increment_offset;
- }
- return false;
-}
-
static Sys_var_mybool Sys_wsrep_auto_increment_control(
"wsrep_auto_increment_control", "To automatically control the "
"assignment of autoincrement variables",
GLOBAL_VAR(wsrep_auto_increment_control),
- CMD_LINE(OPT_ARG), DEFAULT(TRUE),
- NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
- ON_UPDATE(update_wsrep_auto_increment_control));
+ CMD_LINE(OPT_ARG), DEFAULT(TRUE));
static Sys_var_mybool Sys_wsrep_drupal_282555_workaround(
"wsrep_drupal_282555_workaround", "Enable a workaround to handle the "
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index b8143e92ccb..c2169b56077 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -159,10 +159,7 @@ extern "C" time_t wsrep_thd_query_start(THD *thd);
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 "C" void wsrep_thd_auto_increment_variables(THD*,
- unsigned long long *offset,
- unsigned long long *increment);
+extern "C" void wsrep_set_data_home_dir(const char *data_dir);
extern void wsrep_close_client_connections(my_bool wait_to_end);
extern int wsrep_wait_committing_connections_close(int wait_time);
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index f4fe6af8d9f..908c0c56685 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -59,6 +59,13 @@ bool wsrep_sst_method_update (sys_var *self, THD* thd, enum_var_type type)
return 0;
}
+static const char* data_home_dir = NULL;
+
+extern "C"
+void wsrep_set_data_home_dir(const char *data_dir)
+{
+ data_home_dir= (data_dir && *data_dir) ? data_dir : NULL;
+}
static void make_wsrep_defaults_file()
{
@@ -596,6 +603,29 @@ static int sst_append_auth_env(wsp::env& env, const char* sst_auth)
return -env.error();
}
+#define DATA_HOME_DIR_ENV "INNODB_DATA_HOME_DIR"
+
+static int sst_append_data_dir(wsp::env& env, const char* data_dir)
+{
+ int const data_dir_size= strlen(DATA_HOME_DIR_ENV) + 1 /* = */
+ + (data_dir ? strlen(data_dir) : 0) + 1 /* \0 */;
+
+ wsp::string data_dir_str(data_dir_size); // for automatic cleanup on return
+ if (!data_dir_str()) return -ENOMEM;
+
+ int ret= snprintf(data_dir_str(), data_dir_size, "%s=%s",
+ DATA_HOME_DIR_ENV, data_dir ? data_dir : "");
+
+ if (ret < 0 || ret >= data_dir_size)
+ {
+ WSREP_ERROR("sst_append_data_dir(): snprintf() failed: %d", ret);
+ return (ret < 0 ? ret : -EMSGSIZE);
+ }
+
+ env.append(data_dir_str());
+ return -env.error();
+}
+
static ssize_t sst_prepare_other (const char* method,
const char* sst_auth,
const char* addr_in,
@@ -657,6 +687,16 @@ static ssize_t sst_prepare_other (const char* method,
return ret;
}
+ if (data_home_dir)
+ {
+ if ((ret= sst_append_data_dir(env, data_home_dir)))
+ {
+ WSREP_ERROR("sst_prepare_other(): appending data "
+ "directory failed: %d", ret);
+ return ret;
+ }
+ }
+
pthread_t tmp;
sst_thread_arg arg(cmd_str(), env());
mysql_mutex_lock (&arg.lock);
@@ -1348,6 +1388,16 @@ wsrep_cb_status_t wsrep_sst_donate_cb (void* app_ctx, void* recv_ctx,
return WSREP_CB_FAILURE;
}
+ if (data_home_dir)
+ {
+ if ((ret= sst_append_data_dir(env, data_home_dir)))
+ {
+ WSREP_ERROR("wsrep_sst_donate_cb(): appending data "
+ "directory failed: %d", ret);
+ return WSREP_CB_FAILURE;
+ }
+ }
+
if (!strcmp (WSREP_SST_MYSQLDUMP, method))
{
ret = sst_donate_mysqldump(data, &current_gtid->uuid, uuid_str,
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index 1621559bb8a..15eed2e10e6 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -677,25 +677,3 @@ bool wsrep_thd_has_explicit_locks(THD *thd)
assert(thd);
return thd->mdl_context.has_explicit_locks();
}
-
-/*
- Get auto increment variables for THD. Use global settings for
- applier threads.
- */
-extern "C"
-void wsrep_thd_auto_increment_variables(THD* thd,
- unsigned long long* offset,
- unsigned long long* increment)
-{
- if (thd->wsrep_exec_mode == REPL_RECV &&
- thd->wsrep_conflict_state != REPLAYING)
- {
- *offset= global_system_variables.auto_increment_offset;
- *increment= global_system_variables.auto_increment_increment;
- }
- else
- {
- *offset= thd->variables.auto_increment_offset;
- *increment= thd->variables.auto_increment_increment;
- }
-}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 35e091e0f11..638ae0dd4c4 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -3959,6 +3959,12 @@ innobase_init(
srv_data_home = innobase_data_home_dir
? innobase_data_home_dir : default_path;
+#ifdef WITH_WSREP
+ /* If we use the wsrep API, then we need to tell the server
+ the path to the data files (for passing it to the SST scripts): */
+ wsrep_set_data_home_dir(srv_data_home);
+#endif /* WITH_WSREP */
+
/*--------------- Shared tablespaces -------------------------*/
@@ -8233,7 +8239,8 @@ ha_innobase::write_row(
/* We need the upper limit of the col type to check for
whether we update the table autoinc counter or not. */
- col_max_value = table->next_number_field->get_max_int_value();
+ col_max_value = innobase_get_int_col_max_value(
+ table->next_number_field);
/* Get the value that MySQL attempted to store in the table.*/
auto_inc = table->next_number_field->val_uint();
@@ -8308,30 +8315,14 @@ set_max_autoinc:
/* This should filter out the negative
values set explicitly by the user. */
if (auto_inc <= col_max_value) {
+ ut_a(m_prebuilt->autoinc_increment > 0);
+
ulonglong offset;
ulonglong increment;
dberr_t err;
-#ifdef WITH_WSREP
- /* Applier threads which are
- processing ROW events and don't go
- through server level autoinc
- processing, therefore m_prebuilt
- autoinc values don't get
- properly assigned. Fetch values from
- server side. */
- if (wsrep_on(m_user_thd) &&
- wsrep_thd_exec_mode(m_user_thd) == REPL_RECV) {
- wsrep_thd_auto_increment_variables(m_user_thd, &offset, &increment);
- } else {
-#endif /* WITH_WSREP */
- ut_a(m_prebuilt->autoinc_increment > 0);
-
- offset = m_prebuilt->autoinc_offset;
- increment = m_prebuilt->autoinc_increment;
-#ifdef WITH_WSREP
- }
-#endif /* WITH_WSREP */
+ offset = m_prebuilt->autoinc_offset;
+ increment = m_prebuilt->autoinc_increment;
auto_inc = innobase_next_autoinc(
auto_inc,
@@ -9011,27 +9002,12 @@ ha_innobase::update_row(
/* A value for an AUTO_INCREMENT column
was specified in the UPDATE statement. */
- ulonglong offset, increment;
-#ifdef WITH_WSREP
- /* Applier threads which are processing ROW events and
- don't go through server level autoinc processing,
- therefore m_prebuilt autoinc values don't get properly
- assigned. Fetch values from server side. */
- if (wsrep_on(m_user_thd)
- && wsrep_thd_exec_mode(m_user_thd) == REPL_RECV) {
- wsrep_thd_auto_increment_variables(
- m_user_thd, &offset, &increment);
- } else {
-#endif /* WITH_WSREP */
- offset = m_prebuilt->autoinc_offset;
- increment = m_prebuilt->autoinc_increment;
-#ifdef WITH_WSREP
- }
-#endif /* WITH_WSREP */
-
autoinc = innobase_next_autoinc(
- autoinc, 1, increment, offset,
- table->found_next_number_field->get_max_int_value());
+ autoinc, 1,
+ m_prebuilt->autoinc_increment,
+ m_prebuilt->autoinc_offset,
+ innobase_get_int_col_max_value(
+ table->found_next_number_field));
error = innobase_set_max_autoinc(autoinc);
@@ -16820,14 +16796,14 @@ ha_innobase::get_auto_increment(
increment,
thd_get_thread_id(m_user_thd),
current, autoinc);
-
if (!wsrep_on(m_user_thd)) {
- current = innobase_next_autoinc(
- autoinc
- - m_prebuilt->autoinc_increment,
- 1, increment, offset, col_max_value);
+ current = autoinc
+ - m_prebuilt->autoinc_increment;
}
+ current = innobase_next_autoinc(
+ current, 1, increment, offset, col_max_value);
+
dict_table_autoinc_initialize(
m_prebuilt->table, current);
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 96e6d62189f..324b3f3b15e 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -1471,6 +1471,7 @@ int ha_maria::repair(THD * thd, HA_CHECK_OPT *check_opt)
while ((error= repair(thd, param, 0)) && param->retry_repair)
{
param->retry_repair= 0;
+ file->state->records= start_records;
if (test_all_bits(param->testflag,
(uint) (T_RETRY_WITHOUT_QUICK | T_QUICK)))
{
@@ -1975,6 +1976,7 @@ int ha_maria::disable_indexes(uint mode)
int ha_maria::enable_indexes(uint mode)
{
int error;
+ ha_rows start_rows= file->state->records;
DBUG_PRINT("info", ("ha_maria::enable_indexes mode: %d", mode));
if (maria_is_all_keys_active(file->s->state.key_map, file->s->base.keys))
{
@@ -2037,6 +2039,7 @@ int ha_maria::enable_indexes(uint mode)
DBUG_ASSERT(thd->killed != 0);
/* Repairing by sort failed. Now try standard repair method. */
param->testflag &= ~T_REP_BY_SORT;
+ file->state->records= start_rows;
error= (repair(thd, param, 0) != HA_ADMIN_OK);
/*
If the standard repair succeeded, clear all error messages which
diff --git a/storage/maria/ma_commit.c b/storage/maria/ma_commit.c
index 0ae3868dbf6..3850af8246c 100644
--- a/storage/maria/ma_commit.c
+++ b/storage/maria/ma_commit.c
@@ -98,7 +98,7 @@ int maria_commit(MARIA_HA *info)
if (!info->s->now_transactional)
return 0;
trn= info->trn;
- info->trn= 0; /* checked in maria_close() */
+ _ma_reset_trn_for_table(info);
return ma_commit(trn);
}
diff --git a/storage/maria/ma_info.c b/storage/maria/ma_info.c
index 1189594fd2b..da44da123d2 100644
--- a/storage/maria/ma_info.c
+++ b/storage/maria/ma_info.c
@@ -56,7 +56,11 @@ int maria_status(MARIA_HA *info, register MARIA_INFO *x, uint flag)
}
if (flag & HA_STATUS_VARIABLE)
{
- x->records = info->state->records;
+ /* If table is locked, give versioned number otherwise last commited */
+ if (info->lock_type == F_UNLCK)
+ x->records = share->state.state.records;
+ else
+ x->records = info->state->records;
x->deleted = share->state.state.del;
x->delete_length = share->state.state.empty;
x->data_file_length = share->state.state.data_file_length;
diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c
index d9f2f6e77d2..6b1911bf903 100644
--- a/storage/maria/ma_recovery.c
+++ b/storage/maria/ma_recovery.c
@@ -3551,8 +3551,8 @@ void _ma_tmp_disable_logging_for_table(MARIA_HA *info,
info->state may point to a state that was deleted by
_ma_trnman_end_trans_hook()
*/
- share->state.common= *info->state;
- info->state= &share->state.common;
+ share->state.no_logging= *info->state;
+ info->state= &share->state.no_logging;
info->switched_transactional= TRUE;
/*
@@ -3608,6 +3608,10 @@ my_bool _ma_reenable_logging_for_table(MARIA_HA *info, my_bool flush_pages)
_ma_copy_nontrans_state_information(info);
_ma_reset_history(info->s);
+ /* Reset state to point to state.common, as on open() */
+ info->state= &share->state.common;
+ *info->state= share->state.state;
+
if (flush_pages)
{
/* Ensure that recover is not executing any redo before this */
diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c
index bff6a87dc61..d36b0012372 100644
--- a/storage/maria/maria_chk.c
+++ b/storage/maria/maria_chk.c
@@ -1128,7 +1128,7 @@ static int maria_chk(HA_CHECK *param, char *filename)
{
fprintf(stderr, "Aria table '%s' is not fixed because of errors\n",
filename);
- return(-1);
+ DBUG_RETURN(-1);
}
recreate=1;
if (!(param->testflag & T_REP_ANY))
@@ -1150,7 +1150,7 @@ static int maria_chk(HA_CHECK *param, char *filename)
param->total_deleted+=info->state->del;
descript(param, info, filename);
maria_close(info); /* Should always succeed */
- return(0);
+ DBUG_RETURN(0);
}
if (!stopwords_inited++)
diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h
index 2bd7ee9e427..c6b1d313c90 100644
--- a/storage/maria/maria_def.h
+++ b/storage/maria/maria_def.h
@@ -149,6 +149,8 @@ typedef struct st_maria_state_info
MARIA_STATUS_INFO state;
/* maria_ha->state points here for crash-safe but not versioned tables */
MARIA_STATUS_INFO common;
+ /* State for a versioned table that is temporary non versioned */
+ MARIA_STATUS_INFO no_logging;
ha_rows split; /* number of split blocks */
my_off_t dellink; /* Link to next removed block */
pgcache_page_no_t first_bitmap_with_space;
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index c34f832d5f6..988b10522a4 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -8951,25 +8951,8 @@ set_max_autoinc:
ulonglong increment;
dberr_t err;
-#ifdef WITH_WSREP
- /* Applier threads which are
- processing ROW events and don't go
- through server level autoinc
- processing, therefore m_prebuilt
- autoinc values don't get
- properly assigned. Fetch values from
- server side. */
- if (wsrep_on(current_thd) &&
- wsrep_thd_exec_mode(current_thd) == REPL_RECV) {
- wsrep_thd_auto_increment_variables(current_thd, &offset, &increment);
- } else {
-#endif /* WITH_WSREP */
- ut_a(prebuilt->autoinc_increment > 0);
- offset = prebuilt->autoinc_offset;
- increment = prebuilt->autoinc_increment;
-#ifdef WITH_WSREP
- }
-#endif /* WITH_WSREP */
+ offset = prebuilt->autoinc_offset;
+ increment = prebuilt->autoinc_increment;
auto_inc = innobase_next_autoinc(
auto_inc,
@@ -9482,32 +9465,16 @@ ha_innobase::update_row(
/* We need the upper limit of the col type to check for
whether we update the table autoinc counter or not. */
- col_max_value =
- table->next_number_field->get_max_int_value();
+ col_max_value = innobase_get_int_col_max_value(
+ table->next_number_field);
if (auto_inc <= col_max_value && auto_inc != 0) {
ulonglong offset;
ulonglong increment;
-#ifdef WITH_WSREP
- /* Applier threads which are processing
- ROW events and don't go through server
- level autoinc processing, therefore
- m_prebuilt autoinc values don't get
- properly assigned. Fetch values from
- server side. */
- if (wsrep_on(current_thd) &&
- wsrep_thd_exec_mode(current_thd) == REPL_RECV) {
- wsrep_thd_auto_increment_variables(
- current_thd, &offset, &increment);
- } else {
-#endif /* WITH_WSREP */
- offset = prebuilt->autoinc_offset;
- increment = prebuilt->autoinc_increment;
-#ifdef WITH_WSREP
- }
-#endif /* WITH_WSREP */
+ offset = prebuilt->autoinc_offset;
+ increment = prebuilt->autoinc_increment;
auto_inc = innobase_next_autoinc(
auto_inc, 1, increment, offset, col_max_value);
@@ -16738,14 +16705,14 @@ ha_innobase::get_auto_increment(
increment,
thd_get_thread_id(ha_thd()),
current, autoinc);
-
- if (!wsrep_on(ha_thd())) {
- current = autoinc - prebuilt->autoinc_increment;
-
- current = innobase_next_autoinc(
- current, 1, increment, offset, col_max_value);
+ if (!wsrep_on(ha_thd()))
+ {
+ current = autoinc - prebuilt->autoinc_increment;
}
+ current = innobase_next_autoinc(
+ current, 1, increment, offset, col_max_value);
+
dict_table_autoinc_initialize(prebuilt->table, current);
*first_value = current;
diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc
index c9684d49167..e4a6cd39699 100644
--- a/storage/xtradb/row/row0mysql.cc
+++ b/storage/xtradb/row/row0mysql.cc
@@ -4233,7 +4233,8 @@ row_drop_table_for_mysql(
hold the InnoDB dictionary lock, we will drop any
adaptive hash index entries upfront. */
while (buf_LRU_drop_page_hash_for_tablespace(table)) {
- if (trx_is_interrupted(trx)
+ if ((!dict_table_is_temporary(table)
+ && trx_is_interrupted(trx))
|| srv_shutdown_state != SRV_SHUTDOWN_NONE) {
err = DB_INTERRUPTED;
goto funct_exit;