Skip to content

Commit

Permalink
Merge branch '10.3' into 10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed May 13, 2022
2 parents 7f0f1ef + 5c5cd0e commit 2ab6983
Show file tree
Hide file tree
Showing 13 changed files with 256 additions and 73 deletions.
7 changes: 3 additions & 4 deletions mysql-test/include/have_log_bin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

source include/not_embedded.inc;

-- require include/have_log_bin.require
disable_query_log;
show variables like 'log_bin';
enable_query_log;
if (`select not @@log_bin`) {
skip Test requires: 'have_log_bin';
}
2 changes: 0 additions & 2 deletions mysql-test/include/have_log_bin.require

This file was deleted.

88 changes: 61 additions & 27 deletions mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
connection node_2;
connection node_1;
connection node_1;
SET GLOBAL auto_increment_offset=1;
connection node_2;
SET GLOBAL auto_increment_offset=2;
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)
i int(11) NOT NULL primary key AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 2
auto_increment_offset 1
insert into t1(i) values(null);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
select * from t1;
select * from t1 order by i;
i c
1 dummy_text
insert into t1(i) values(null), (null), (null);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
select * from t1;
select * from t1 order by i;
i c
1 dummy_text
3 dummy_text
5 dummy_text
7 dummy_text
connection node_2;
select * from t1;
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 2
auto_increment_offset 2
select * from t1 order by i;
i c
1 dummy_text
3 dummy_text
Expand All @@ -45,27 +56,34 @@ 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)
i int(11) NOT NULL primary key AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 3
auto_increment_offset 1
insert into t1(i) values(null);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
select * from t1;
select * from t1 order by i;
i c
1 dummy_text
insert into t1(i) values(null), (null), (null);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
select * from t1;
select * from t1 order by i;
i c
1 dummy_text
4 dummy_text
7 dummy_text
10 dummy_text
connection node_2;
select * from t1;
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 2
auto_increment_offset 2
select * from t1 order by i;
i c
1 dummy_text
4 dummy_text
Expand All @@ -74,6 +92,7 @@ i c
connection node_1;
SET GLOBAL wsrep_auto_increment_control='ON';
SET SESSION binlog_format='ROW';
connection node_1;
show variables like 'binlog_format';
Variable_name Value
binlog_format ROW
Expand All @@ -89,29 +108,37 @@ auto_increment_increment 3
auto_increment_offset 1
wsrep_auto_increment_control OFF
SET GLOBAL wsrep_auto_increment_control='ON';
connection node_1;
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)
i int(11) NOT NULL primary key AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 2
auto_increment_offset 1
insert into t1(i) values(null);
select * from t1;
select * from t1 order by i;
i c
1 dummy_text
insert into t1(i) values(null), (null), (null);
select * from t1;
select * from t1 order by i;
i c
1 dummy_text
3 dummy_text
5 dummy_text
7 dummy_text
connection node_2;
select * from t1;
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 2
auto_increment_offset 2
select * from t1 order by i;
i c
1 dummy_text
3 dummy_text
Expand All @@ -129,23 +156,30 @@ 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)
i int(11) NOT NULL primary key AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 3
auto_increment_offset 1
insert into t1(i) values(null);
select * from t1;
select * from t1 order by i;
i c
1 dummy_text
insert into t1(i) values(null), (null), (null);
select * from t1;
select * from t1 order by i;
i c
1 dummy_text
4 dummy_text
7 dummy_text
10 dummy_text
connection node_2;
select * from t1;
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 2
auto_increment_offset 2
select * from t1 order by i;
i c
1 dummy_text
4 dummy_text
Expand All @@ -159,13 +193,13 @@ binlog_format ROW
show variables like '%auto_increment%';
Variable_name Value
auto_increment_increment 2
auto_increment_offset 1
auto_increment_offset 2
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
auto_increment_increment 1
auto_increment_offset 2
wsrep_auto_increment_control OFF
SET GLOBAL wsrep_auto_increment_control='ON';
drop table t1;
2 changes: 2 additions & 0 deletions mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[mysqld.1]
auto_increment_offset=1
auto_increment_increment=1

[mysqld.2]
auto_increment_offset=2
auto_increment_increment=1
73 changes: 39 additions & 34 deletions mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
##

--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/force_restart.inc

--connection node_1
SET GLOBAL auto_increment_offset=1;
--connection node_2
SET GLOBAL auto_increment_offset=2;

--let $node_1=node_1
--let $node_2=node_2
Expand All @@ -30,23 +35,24 @@ call mtr.add_suppression("Unsafe statement written to the binary log");
--enable_query_log

CREATE TABLE t1 (
i int(11) NOT NULL AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text',
PRIMARY KEY (i)
i int(11) NOT NULL primary key AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

show variables like 'auto_increment%';
insert into t1(i) values(null);

select * from t1;
select * from t1 order by i;

insert into t1(i) values(null), (null), (null);

select * from t1;
select * from t1 order by i;

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
--source include/wait_condition.inc
select * from t1;
show variables like 'auto_increment%';
select * from t1 order by i;

SET GLOBAL wsrep_forced_binlog_format='none';

Expand Down Expand Up @@ -80,36 +86,31 @@ 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)
i int(11) NOT NULL primary key AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

show variables like 'auto_increment%';
insert into t1(i) values(null);

select * from t1;
select * from t1 order by i;

insert into t1(i) values(null), (null), (null);

select * from t1;
select * from t1 order by i;

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
--source include/wait_condition.inc
show variables like 'auto_increment%';

select * from t1;
select * from t1 order by i;

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

--source include/auto_increment_offset_restore.inc
--connection node_1
show variables like 'binlog_format';
show variables like '%auto_increment%';

Expand All @@ -127,7 +128,8 @@ show variables like '%auto_increment%';
##

SET GLOBAL wsrep_auto_increment_control='ON';

--source include/auto_increment_offset_restore.inc
--connection node_1
drop table t1;

##
Expand All @@ -142,24 +144,25 @@ SET GLOBAL wsrep_forced_binlog_format='ROW';
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)
i int(11) NOT NULL primary key AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

show variables like 'auto_increment%';
insert into t1(i) values(null);

select * from t1;
select * from t1 order by i;

insert into t1(i) values(null), (null), (null);

select * from t1;
select * from t1 order by i;

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
--source include/wait_condition.inc

select * from t1;
show variables like 'auto_increment%';
select * from t1 order by i;

SET GLOBAL wsrep_forced_binlog_format='none';

Expand Down Expand Up @@ -189,24 +192,25 @@ 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)
i int(11) NOT NULL primary key AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

show variables like 'auto_increment%';
insert into t1(i) values(null);

select * from t1;
select * from t1 order by i;

insert into t1(i) values(null), (null), (null);

select * from t1;
select * from t1 order by i;

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
--source include/wait_condition.inc
show variables like 'auto_increment%';

select * from t1;
select * from t1 order by i;

--connection node_1

Expand All @@ -216,6 +220,7 @@ select * from t1;
##

SET GLOBAL wsrep_auto_increment_control='ON';
--source include/auto_increment_offset_restore.inc

show variables like 'binlog_format';
show variables like '%auto_increment%';
Expand Down

0 comments on commit 2ab6983

Please sign in to comment.