Merge 10.1 into 10.2

This commit is contained in:
Marko Mäkelä 2018-08-31 13:47:48 +03:00
commit 206528f722
38 changed files with 707 additions and 713 deletions

View File

@ -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_mysqldump.1 wsrep_sst_rsync.1
wsrep_sst_xtrabackup-v2.1 wsrep_sst_xtrabackup.1 wsrep_sst_xtrabackup-v2.1 wsrep_sst_xtrabackup.1
galera_recovery.1 galera_new_cluster.1 tokuft_logdump.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(MAN8_SERVER mysqld.8)
SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1 SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1
mysqlaccess.1 mysqladmin.1 mysqlbinlog.1 mysqlcheck.1 mysqlaccess.1 mysqladmin.1 mysqlbinlog.1 mysqlcheck.1
mysqldump.1 mysqlimport.1 mysqlshow.1 mysqlslap.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_DEVEL mysql_config.1)
SET(MAN1_TEST mysql-stress-test.pl.1 mysql-test-run.pl.1 mysql_client_test.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) mysqltest_embedded.1 mysql_client_test_embedded.1 my_safe_process.1)

16
man/mariabackup.1 Normal file
View File

@ -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/

16
man/mbstream.1 Normal file
View File

@ -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/

1
man/mysql_embedded.1 Normal file
View File

@ -0,0 +1 @@
.so man1/mysql.1

View File

@ -11,6 +11,6 @@
.SH NAME .SH NAME
tokuft_logprint \- Dump the log from stdin to stdout tokuft_logprint \- Dump the log from stdin to stdout
.SH DESCRIPTION .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 .PP
For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/

View File

@ -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/

View File

@ -1,6 +1,6 @@
'\" t '\" 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 .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
@ -9,7 +9,7 @@
.\" disable justification (adjust text to left margin only) .\" disable justification (adjust text to left margin only)
.ad l .ad l
.SH NAME .SH NAME
wsrep_sst_mysqldump \- rsync-based state snapshot transfer wsrep_sst_rsync \- rsync-based state snapshot transfer
.SH DESCRIPTION .SH DESCRIPTION
Use: rsync-based state snapshot transfer\. Use: rsync-based state snapshot transfer\.
.PP .PP

16
man/wsrep_sst_rsync_wan.1 Normal file
View File

@ -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/

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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'

View File

@ -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 *

View File

@ -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;

View File

@ -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;

View File

@ -33,7 +33,7 @@ PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication
PLUGIN_LICENSE GPL PLUGIN_LICENSE GPL
LOAD_OPTION ON LOAD_OPTION ON
PLUGIN_MATURITY Stable PLUGIN_MATURITY Stable
PLUGIN_AUTH_VERSION 1.0-alpha PLUGIN_AUTH_VERSION 1.0
create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'; create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';
show grants for test1@localhost; show grants for test1@localhost;
Grants for test1@localhost Grants for test1@localhost

View File

@ -100,7 +100,7 @@ maria_declare_plugin(ed25519)
0x0100, 0x0100,
NULL, NULL,
NULL, NULL,
"1.0-alpha", "1.0",
MariaDB_PLUGIN_MATURITY_STABLE MariaDB_PLUGIN_MATURITY_STABLE
} }
maria_declare_plugin_end; maria_declare_plugin_end;

View File

@ -189,13 +189,15 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
s++; s++;
} }
from= s; from= s;
skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') || (*s == '$')); skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') ||
(*s == '$') || (*s == '\\') || (*s == '/'));
end_from= s; end_from= s;
skip(isspace(*s)); skip(isspace(*s));
if (end_from == from || *s++ != ':') goto syntax_error; if (end_from == from || *s++ != ':') goto syntax_error;
skip(isspace(*s)); skip(isspace(*s));
to= s; to= s;
skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') || (*s == '$')); skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') ||
(*s == '$'));
end_to= s; end_to= s;
if (end_to == to) goto syntax_error; if (end_to == to) goto syntax_error;

View File

@ -107,8 +107,7 @@ else
log "WSREP: mktemp failed" log "WSREP: mktemp failed"
fi fi
parse_arguments `$print_defaults $cmdline_args --loose-verbose \ parse_arguments `$print_defaults $cmdline_args --loose-verbose --mysqld`
mariadb mariadb_safe mysqld mysqld_safe safe_mysqld galera`
# Perform wsrep position recovery if wsrep_on=1, skip otherwise. # Perform wsrep position recovery if wsrep_on=1, skip otherwise.
if [ "$wsrep_on" -eq 1 ]; then if [ "$wsrep_on" -eq 1 ]; then

View File

@ -27,6 +27,7 @@ WSREP_SST_OPT_PSWD=${WSREP_SST_OPT_PSWD:-}
WSREP_SST_OPT_DEFAULT="" WSREP_SST_OPT_DEFAULT=""
WSREP_SST_OPT_EXTRA_DEFAULT="" WSREP_SST_OPT_EXTRA_DEFAULT=""
WSREP_SST_OPT_SUFFIX_DEFAULT="" WSREP_SST_OPT_SUFFIX_DEFAULT=""
WSREP_SST_OPT_SUFFIX_VALUE=""
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
@ -76,6 +77,7 @@ case "$1" in
;; ;;
'--defaults-group-suffix') '--defaults-group-suffix')
readonly WSREP_SST_OPT_SUFFIX_DEFAULT="$1=$2" readonly WSREP_SST_OPT_SUFFIX_DEFAULT="$1=$2"
readonly WSREP_SST_OPT_SUFFIX_VALUE="$2"
shift shift
;; ;;
'--host') '--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}') 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 # use default if we haven't found a value
if [ -z $reval ]; then if [ -z "$reval" ]; then
[ -n $3 ] && reval=$3 [ -n "$3" ] && reval=$3
fi fi
echo $reval echo $reval
} }

View File

@ -154,6 +154,20 @@ else
WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; pwd -P) WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; pwd -P)
fi 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 # Old filter - include everything except selected
# FILTER=(--exclude '*.err' --exclude '*.pid' --exclude '*.sock' \ # FILTER=(--exclude '*.err' --exclude '*.pid' --exclude '*.sock' \
# --exclude '*.conf' --exclude core --exclude 'galera.*' \ # --exclude '*.conf' --exclude core --exclude 'galera.*' \
@ -162,7 +176,7 @@ fi
# New filter - exclude everything except dirs (schemas) and innodb files # New filter - exclude everything except dirs (schemas) and innodb files
FILTER="-f '- /lost+found' -f '- /.fseventsd' -f '- /.Trashes' 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 "") SSTKEY=$(parse_cnf sst tkey "")
SSTCERT=$(parse_cnf sst tcert "") SSTCERT=$(parse_cnf sst tcert "")
@ -270,6 +284,19 @@ EOF
exit $RC exit $RC
fi 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 # second, we transfer InnoDB log files
rsync ${STUNNEL:+--rsh="$STUNNEL"} \ rsync ${STUNNEL:+--rsh="$STUNNEL"} \
--owner --group --perms --links --specials \ --owner --group --perms --links --specials \
@ -370,6 +397,8 @@ $SILENT
path = $WSREP_SST_OPT_DATA path = $WSREP_SST_OPT_DATA
[$MODULE-log_dir] [$MODULE-log_dir]
path = $WSREP_LOG_DIR path = $WSREP_LOG_DIR
[$MODULE-data_dir]
path = $INNODB_DATA_HOME_DIR
EOF EOF
# rm -rf "$DATA"/ib_logfile* # we don't want old logs around # rm -rf "$DATA"/ib_logfile* # we don't want old logs around

View File

@ -1448,17 +1448,6 @@ public:
/* Hash value */ /* Hash value */
virtual void hash(ulong *nr, ulong *nr2); 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. Checks whether a string field is part of write_set.
@ -2017,11 +2006,6 @@ public:
*to= *from; *to= *from;
return from + 1; 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, virtual const uchar *unpack(uchar* to, const uchar *from,
const uchar *from_end, uint param_data) const uchar *from_end, uint param_data)
{ return unpack_int16(to, from, from_end); } { 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 { class Field_medium :public Field_integer {
@ -2100,10 +2080,6 @@ public:
{ {
return Field::pack(to, from, max_length); 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); 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); 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); } uint32 pack_length() const { return sizeof(float); }
uint row_pack_length() const { return pack_length(); } uint row_pack_length() const { return pack_length(); }
void sql_type(String &str) const; 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: private:
int do_save_field_metadata(uchar *first_byte); int do_save_field_metadata(uchar *first_byte);
}; };
@ -2304,13 +2265,6 @@ public:
uint32 pack_length() const { return sizeof(double); } uint32 pack_length() const { return sizeof(double); }
uint row_pack_length() const { return pack_length(); } uint row_pack_length() const { return pack_length(); }
void sql_type(String &str) const; 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: private:
int do_save_field_metadata(uchar *first_byte); int do_save_field_metadata(uchar *first_byte);
}; };

View File

@ -2853,15 +2853,9 @@ compute_next_insert_id(ulonglong nr,struct system_variables *variables)
nr= nr + 1; // optimization of the formula below nr= nr + 1; // optimization of the formula below
else else
{ {
/*
Calculating the number of complete auto_increment_increment extents:
*/
nr= (((nr+ variables->auto_increment_increment - nr= (((nr+ variables->auto_increment_increment -
variables->auto_increment_offset)) / variables->auto_increment_offset)) /
(ulonglong) variables->auto_increment_increment); (ulonglong) variables->auto_increment_increment);
/*
Adding an offset to the auto_increment_increment extent boundary:
*/
nr= (nr* (ulonglong) variables->auto_increment_increment + nr= (nr* (ulonglong) variables->auto_increment_increment +
variables->auto_increment_offset); variables->auto_increment_offset);
} }
@ -2917,14 +2911,8 @@ prev_insert_id(ulonglong nr, struct system_variables *variables)
} }
if (variables->auto_increment_increment == 1) if (variables->auto_increment_increment == 1)
return nr; // optimization of the formula below return nr; // optimization of the formula below
/*
Calculating the number of complete auto_increment_increment extents:
*/
nr= (((nr - variables->auto_increment_offset)) / nr= (((nr - variables->auto_increment_offset)) /
(ulonglong) variables->auto_increment_increment); (ulonglong) variables->auto_increment_increment);
/*
Adding an offset to the auto_increment_increment extent boundary:
*/
return (nr * (ulonglong) variables->auto_increment_increment + return (nr * (ulonglong) variables->auto_increment_increment +
variables->auto_increment_offset); variables->auto_increment_offset);
} }
@ -3147,23 +3135,10 @@ int handler::update_auto_increment()
if (unlikely(tmp)) // Out of range value in store if (unlikely(tmp)) // Out of range value in store
{ {
/* /*
first test if the query was aborted due to strict mode constraints It's better to return an error here than getting a confusing
'duplicate key error' later.
*/ */
if (thd->killed == KILL_BAD_DATA || result= HA_ERR_AUTOINC_ERANGE;
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).
*/
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();
} }
if (append) if (append)
{ {

View File

@ -4319,20 +4319,6 @@ static int init_common_variables()
DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname, DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
server_version, SYSTEM_TYPE,MACHINE_TYPE)); 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 #ifdef HAVE_LINUX_LARGE_PAGES
/* Initialize large page size */ /* Initialize large page size */
if (opt_large_pages) if (opt_large_pages)

View File

@ -569,17 +569,6 @@ typedef struct system_variables
ha_rows max_join_size; ha_rows max_join_size;
ha_rows expensive_subquery_limit; ha_rows expensive_subquery_limit;
ulong auto_increment_increment, auto_increment_offset; 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; uint eq_range_index_dive_limit;
ulong lock_wait_timeout; ulong lock_wait_timeout;
ulong join_cache_level; ulong join_cache_level;

View File

@ -347,56 +347,13 @@ static Sys_var_long Sys_pfs_connect_attrs_size(
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ #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( static Sys_var_ulong Sys_auto_increment_increment(
"auto_increment_increment", "auto_increment_increment",
"Auto-increment columns are incremented by this", "Auto-increment columns are incremented by this",
SESSION_VAR(auto_increment_increment), SESSION_VAR(auto_increment_increment),
CMD_LINE(OPT_ARG), CMD_LINE(OPT_ARG),
VALID_RANGE(1, 65535), DEFAULT(1), BLOCK_SIZE(1), 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); 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( static Sys_var_ulong Sys_auto_increment_offset(
"auto_increment_offset", "auto_increment_offset",
@ -405,12 +362,7 @@ static Sys_var_ulong Sys_auto_increment_offset(
SESSION_VAR(auto_increment_offset), SESSION_VAR(auto_increment_offset),
CMD_LINE(OPT_ARG), CMD_LINE(OPT_ARG),
VALID_RANGE(1, 65535), DEFAULT(1), BLOCK_SIZE(1), 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); NO_MUTEX_GUARD, IN_BINLOG);
#endif /* WITH_WSREP */
static Sys_var_mybool Sys_automatic_sp_privileges( static Sys_var_mybool Sys_automatic_sp_privileges(
"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), SESSION_VAR(wsrep_retry_autocommit), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, 10000), DEFAULT(1), BLOCK_SIZE(1)); 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( static Sys_var_mybool Sys_wsrep_auto_increment_control(
"wsrep_auto_increment_control", "To automatically control the " "wsrep_auto_increment_control", "To automatically control the "
"assignment of autoincrement variables", "assignment of autoincrement variables",
GLOBAL_VAR(wsrep_auto_increment_control), GLOBAL_VAR(wsrep_auto_increment_control),
CMD_LINE(OPT_ARG), DEFAULT(TRUE), CMD_LINE(OPT_ARG), DEFAULT(TRUE));
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(update_wsrep_auto_increment_control));
static Sys_var_mybool Sys_wsrep_drupal_282555_workaround( static Sys_var_mybool Sys_wsrep_drupal_282555_workaround(
"wsrep_drupal_282555_workaround", "Enable a workaround to handle the " "wsrep_drupal_282555_workaround", "Enable a workaround to handle the "

View File

@ -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_query_id(THD *thd);
extern "C" query_id_t wsrep_thd_wsrep_last_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_set_wsrep_last_query_id(THD *thd, query_id_t id);
extern "C" void wsrep_set_data_home_dir(const char *data_dir);
extern "C" void wsrep_thd_auto_increment_variables(THD*,
unsigned long long *offset,
unsigned long long *increment);
extern void wsrep_close_client_connections(my_bool wait_to_end); extern void wsrep_close_client_connections(my_bool wait_to_end);
extern int wsrep_wait_committing_connections_close(int wait_time); extern int wsrep_wait_committing_connections_close(int wait_time);

View File

@ -59,6 +59,13 @@ bool wsrep_sst_method_update (sys_var *self, THD* thd, enum_var_type type)
return 0; 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() 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(); 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, static ssize_t sst_prepare_other (const char* method,
const char* sst_auth, const char* sst_auth,
const char* addr_in, const char* addr_in,
@ -657,6 +687,16 @@ static ssize_t sst_prepare_other (const char* method,
return ret; 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; pthread_t tmp;
sst_thread_arg arg(cmd_str(), env()); sst_thread_arg arg(cmd_str(), env());
mysql_mutex_lock (&arg.lock); 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; 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)) if (!strcmp (WSREP_SST_MYSQLDUMP, method))
{ {
ret = sst_donate_mysqldump(data, &current_gtid->uuid, uuid_str, ret = sst_donate_mysqldump(data, &current_gtid->uuid, uuid_str,

View File

@ -677,25 +677,3 @@ bool wsrep_thd_has_explicit_locks(THD *thd)
assert(thd); assert(thd);
return thd->mdl_context.has_explicit_locks(); 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;
}
}

View File

@ -3959,6 +3959,12 @@ innobase_init(
srv_data_home = innobase_data_home_dir srv_data_home = innobase_data_home_dir
? innobase_data_home_dir : default_path; ? 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 -------------------------*/ /*--------------- Shared tablespaces -------------------------*/
@ -8233,7 +8239,8 @@ ha_innobase::write_row(
/* We need the upper limit of the col type to check for /* We need the upper limit of the col type to check for
whether we update the table autoinc counter or not. */ 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.*/ /* Get the value that MySQL attempted to store in the table.*/
auto_inc = table->next_number_field->val_uint(); auto_inc = table->next_number_field->val_uint();
@ -8308,30 +8315,14 @@ set_max_autoinc:
/* This should filter out the negative /* This should filter out the negative
values set explicitly by the user. */ values set explicitly by the user. */
if (auto_inc <= col_max_value) { if (auto_inc <= col_max_value) {
ut_a(m_prebuilt->autoinc_increment > 0);
ulonglong offset; ulonglong offset;
ulonglong increment; ulonglong increment;
dberr_t err; 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; offset = m_prebuilt->autoinc_offset;
increment = m_prebuilt->autoinc_increment; increment = m_prebuilt->autoinc_increment;
#ifdef WITH_WSREP
}
#endif /* WITH_WSREP */
auto_inc = innobase_next_autoinc( auto_inc = innobase_next_autoinc(
auto_inc, auto_inc,
@ -9011,27 +9002,12 @@ ha_innobase::update_row(
/* A value for an AUTO_INCREMENT column /* A value for an AUTO_INCREMENT column
was specified in the UPDATE statement. */ 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 = innobase_next_autoinc(
autoinc, 1, increment, offset, autoinc, 1,
table->found_next_number_field->get_max_int_value()); 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); error = innobase_set_max_autoinc(autoinc);
@ -16820,14 +16796,14 @@ ha_innobase::get_auto_increment(
increment, increment,
thd_get_thread_id(m_user_thd), thd_get_thread_id(m_user_thd),
current, autoinc); current, autoinc);
if (!wsrep_on(m_user_thd)) { if (!wsrep_on(m_user_thd)) {
current = innobase_next_autoinc( current = autoinc
autoinc - m_prebuilt->autoinc_increment;
- m_prebuilt->autoinc_increment,
1, increment, offset, col_max_value);
} }
current = innobase_next_autoinc(
current, 1, increment, offset, col_max_value);
dict_table_autoinc_initialize( dict_table_autoinc_initialize(
m_prebuilt->table, current); m_prebuilt->table, current);

View File

@ -1471,6 +1471,7 @@ int ha_maria::repair(THD * thd, HA_CHECK_OPT *check_opt)
while ((error= repair(thd, param, 0)) && param->retry_repair) while ((error= repair(thd, param, 0)) && param->retry_repair)
{ {
param->retry_repair= 0; param->retry_repair= 0;
file->state->records= start_records;
if (test_all_bits(param->testflag, if (test_all_bits(param->testflag,
(uint) (T_RETRY_WITHOUT_QUICK | T_QUICK))) (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 ha_maria::enable_indexes(uint mode)
{ {
int error; int error;
ha_rows start_rows= file->state->records;
DBUG_PRINT("info", ("ha_maria::enable_indexes mode: %d", mode)); 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)) 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); DBUG_ASSERT(thd->killed != 0);
/* Repairing by sort failed. Now try standard repair method. */ /* Repairing by sort failed. Now try standard repair method. */
param->testflag &= ~T_REP_BY_SORT; param->testflag &= ~T_REP_BY_SORT;
file->state->records= start_rows;
error= (repair(thd, param, 0) != HA_ADMIN_OK); error= (repair(thd, param, 0) != HA_ADMIN_OK);
/* /*
If the standard repair succeeded, clear all error messages which If the standard repair succeeded, clear all error messages which

View File

@ -98,7 +98,7 @@ int maria_commit(MARIA_HA *info)
if (!info->s->now_transactional) if (!info->s->now_transactional)
return 0; return 0;
trn= info->trn; trn= info->trn;
info->trn= 0; /* checked in maria_close() */ _ma_reset_trn_for_table(info);
return ma_commit(trn); return ma_commit(trn);
} }

View File

@ -56,6 +56,10 @@ int maria_status(MARIA_HA *info, register MARIA_INFO *x, uint flag)
} }
if (flag & HA_STATUS_VARIABLE) if (flag & HA_STATUS_VARIABLE)
{ {
/* 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->records = info->state->records;
x->deleted = share->state.state.del; x->deleted = share->state.state.del;
x->delete_length = share->state.state.empty; x->delete_length = share->state.state.empty;

View File

@ -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 info->state may point to a state that was deleted by
_ma_trnman_end_trans_hook() _ma_trnman_end_trans_hook()
*/ */
share->state.common= *info->state; share->state.no_logging= *info->state;
info->state= &share->state.common; info->state= &share->state.no_logging;
info->switched_transactional= TRUE; 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_copy_nontrans_state_information(info);
_ma_reset_history(info->s); _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) if (flush_pages)
{ {
/* Ensure that recover is not executing any redo before this */ /* Ensure that recover is not executing any redo before this */

View File

@ -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", fprintf(stderr, "Aria table '%s' is not fixed because of errors\n",
filename); filename);
return(-1); DBUG_RETURN(-1);
} }
recreate=1; recreate=1;
if (!(param->testflag & T_REP_ANY)) 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; param->total_deleted+=info->state->del;
descript(param, info, filename); descript(param, info, filename);
maria_close(info); /* Should always succeed */ maria_close(info); /* Should always succeed */
return(0); DBUG_RETURN(0);
} }
if (!stopwords_inited++) if (!stopwords_inited++)

View File

@ -149,6 +149,8 @@ typedef struct st_maria_state_info
MARIA_STATUS_INFO state; MARIA_STATUS_INFO state;
/* maria_ha->state points here for crash-safe but not versioned tables */ /* maria_ha->state points here for crash-safe but not versioned tables */
MARIA_STATUS_INFO common; 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 */ ha_rows split; /* number of split blocks */
my_off_t dellink; /* Link to next removed block */ my_off_t dellink; /* Link to next removed block */
pgcache_page_no_t first_bitmap_with_space; pgcache_page_no_t first_bitmap_with_space;

View File

@ -8951,25 +8951,8 @@ set_max_autoinc:
ulonglong increment; ulonglong increment;
dberr_t err; 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; offset = prebuilt->autoinc_offset;
increment = prebuilt->autoinc_increment; increment = prebuilt->autoinc_increment;
#ifdef WITH_WSREP
}
#endif /* WITH_WSREP */
auto_inc = innobase_next_autoinc( auto_inc = innobase_next_autoinc(
auto_inc, auto_inc,
@ -9482,32 +9465,16 @@ ha_innobase::update_row(
/* We need the upper limit of the col type to check for /* We need the upper limit of the col type to check for
whether we update the table autoinc counter or not. */ whether we update the table autoinc counter or not. */
col_max_value = col_max_value = innobase_get_int_col_max_value(
table->next_number_field->get_max_int_value(); table->next_number_field);
if (auto_inc <= col_max_value && auto_inc != 0) { if (auto_inc <= col_max_value && auto_inc != 0) {
ulonglong offset; ulonglong offset;
ulonglong increment; 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; offset = prebuilt->autoinc_offset;
increment = prebuilt->autoinc_increment; increment = prebuilt->autoinc_increment;
#ifdef WITH_WSREP
}
#endif /* WITH_WSREP */
auto_inc = innobase_next_autoinc( auto_inc = innobase_next_autoinc(
auto_inc, 1, increment, offset, col_max_value); auto_inc, 1, increment, offset, col_max_value);
@ -16738,13 +16705,13 @@ ha_innobase::get_auto_increment(
increment, increment,
thd_get_thread_id(ha_thd()), thd_get_thread_id(ha_thd()),
current, autoinc); current, autoinc);
if (!wsrep_on(ha_thd()))
if (!wsrep_on(ha_thd())) { {
current = autoinc - prebuilt->autoinc_increment; current = autoinc - prebuilt->autoinc_increment;
}
current = innobase_next_autoinc( current = innobase_next_autoinc(
current, 1, increment, offset, col_max_value); current, 1, increment, offset, col_max_value);
}
dict_table_autoinc_initialize(prebuilt->table, current); dict_table_autoinc_initialize(prebuilt->table, current);

View File

@ -4233,7 +4233,8 @@ row_drop_table_for_mysql(
hold the InnoDB dictionary lock, we will drop any hold the InnoDB dictionary lock, we will drop any
adaptive hash index entries upfront. */ adaptive hash index entries upfront. */
while (buf_LRU_drop_page_hash_for_tablespace(table)) { 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) { || srv_shutdown_state != SRV_SHUTDOWN_NONE) {
err = DB_INTERRUPTED; err = DB_INTERRUPTED;
goto funct_exit; goto funct_exit;