forked from MariaDB/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '10.0-galera' into bb-10.1-serg
- Loading branch information
Showing
113 changed files
with
1,771 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ wsrep-sync-wait=7 | |
#[email protected] | ||
#[email protected] | ||
wsrep-cluster-address=gcomm:// | ||
wsrep_provider_options='repl.causal_read_timeout=PT90S;[email protected].#galera_port;gcache.size=10M' | ||
wsrep_provider_options='repl.causal_read_timeout=PT90S;[email protected].#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S' | ||
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port | ||
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' | ||
|
||
|
@@ -25,7 +25,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' | |
#[email protected] | ||
#[email protected] | ||
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' | ||
wsrep_provider_options='repl.causal_read_timeout=PT90S;[email protected].#galera_port;gcache.size=10M' | ||
wsrep_provider_options='repl.causal_read_timeout=PT90S;[email protected].#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S' | ||
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port | ||
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' | ||
|
||
|
35 changes: 35 additions & 0 deletions
35
mysql-test/suite/galera/include/auto_increment_offset_restore.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# See auto_increment_offset_restore.inc for details. | ||
|
||
if (!$node_1) | ||
{ | ||
--die ERROR IN TEST: $node_1 must be set before sourcing auto_increment_offset_save.inc | ||
} | ||
|
||
if (!$node_2) | ||
{ | ||
--die ERROR IN TEST: $node_2 must be set before sourcing auto_increment_offset_save.inc | ||
} | ||
|
||
if (!$auto_increment_offset_node_1) | ||
{ | ||
--die ERROR IN TEST: $auto_increment_offset_node_1 must be set before sourcing auto_increment_offset_save.inc | ||
} | ||
|
||
if (!$auto_increment_offset_node_2) | ||
{ | ||
--die ERROR IN TEST: $auto_increment_offset_node_2 must be set before sourcing auto_increment_offset_save.inc | ||
} | ||
|
||
# Restore original auto_increment_offset values. | ||
--disable_query_log | ||
--connection $node_1 | ||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1; | ||
--connection $node_2 | ||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2; | ||
|
||
if ($node_3) | ||
{ | ||
--connection $node_3 | ||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_3; | ||
} | ||
--enable_query_log |
37 changes: 37 additions & 0 deletions
37
mysql-test/suite/galera/include/auto_increment_offset_save.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This file can be used to save the @@global.auto_increment_offset value at | ||
# the beginning of any test that intends to restart any of the participating | ||
# nodes. This is required as the node may get auto-assigned a different | ||
# auto_increment_offset value on restart, which could cause MTR's internal | ||
# post-check to fail. auto_increment_offset_restore.inc can be used at the | ||
# end of the test to restore these saved values. | ||
|
||
# Parameters | ||
# ---------- | ||
# $node_1 | ||
# Connection handle for 1st node | ||
# $node_2 | ||
# Connection handle for 2nd node | ||
# $node_3 (optional) | ||
# Connection handle for 3rd node | ||
|
||
if (!$node_1) | ||
{ | ||
--die ERROR IN TEST: $node_1 must be set before sourcing auto_increment_offset_save.inc | ||
} | ||
|
||
if (!$node_2) | ||
{ | ||
--die ERROR IN TEST: $node_2 must be set before sourcing auto_increment_offset_save.inc | ||
} | ||
|
||
--connection $node_1 | ||
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`; | ||
--connection $node_2 | ||
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`; | ||
|
||
if ($node_3) | ||
{ | ||
--connection $node_3 | ||
let $auto_increment_offset_node_3 = `SELECT @@global.auto_increment_offset`; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
create table t1 (i int, j int, k int, primary key pk(i)) engine=innodb; | ||
insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3); | ||
create table t2 (i int, j int, k int, primary key pk(i, j, k), index idx(i, k, j)) engine=innodb; | ||
replace into t2 (i, j, k) select /*!99997 */ i, k, j from t1; | ||
DROP TABLE t1; | ||
DROP TABLE t2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; | ||
FLUSH TABLES WITH READ LOCK; | ||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; | ||
VARIABLE_VALUE = 2 | ||
1 | ||
UNLOCK TABLES; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
CREATE TABLE t1 (f1 INTEGER); | ||
LOCK TABLE t1 WRITE; | ||
value prior to RSU: | ||
SHOW STATUS LIKE 'wsrep_desync_count'; | ||
Variable_name Value | ||
wsrep_desync_count 0 | ||
SHOW VARIABLES LIKE 'wsrep_desync'; | ||
Variable_name Value | ||
wsrep_desync OFF | ||
SET SESSION wsrep_sync_wait = 0; | ||
SET SESSION wsrep_osu_method = RSU; | ||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;; | ||
SET SESSION wsrep_sync_wait = 0; | ||
SET SESSION wsrep_osu_method = RSU; | ||
ALTER TABLE t1 ADD COLUMN f3 INTEGER;; | ||
value during RSU: | ||
SHOW STATUS LIKE 'wsrep_desync_count'; | ||
Variable_name Value | ||
wsrep_desync_count 2 | ||
SHOW VARIABLES LIKE 'wsrep_desync'; | ||
Variable_name Value | ||
wsrep_desync OFF | ||
UNLOCK TABLES; | ||
value after RSU: | ||
SHOW STATUS LIKE 'wsrep_desync_count'; | ||
Variable_name Value | ||
wsrep_desync_count 0 | ||
SHOW VARIABLES LIKE 'wsrep_desync'; | ||
Variable_name Value | ||
wsrep_desync OFF | ||
SET GLOBAL wsrep_desync=0; | ||
Warnings: | ||
Warning 1231 'wsrep_desync' is already OFF. | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; | ||
SET GLOBAL wsrep_desync=0; | ||
Warnings: | ||
Warning 1231 'wsrep_desync' is already OFF. | ||
SET wsrep_OSU_method=RSU; | ||
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue'; | ||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;; | ||
SET GLOBAL wsrep_desync=1;; | ||
SET DEBUG_SYNC= 'now SIGNAL continue'; | ||
DROP TABLE t1; | ||
SET GLOBAL wsrep_desync=0; | ||
SET DEBUG_SYNC= 'RESET'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
CREATE TABLE parent1 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB; | ||
CREATE TABLE parent2 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB; | ||
CREATE TABLE child ( | ||
id INT PRIMARY KEY, | ||
parent1_id INT, | ||
parent2_id INT, | ||
FOREIGN KEY (parent1_id) REFERENCES parent1(id), | ||
FOREIGN KEY (parent1_id) REFERENCES parent2(id) | ||
) ENGINE=InnoDB; | ||
INSERT INTO parent1 VALUES (1); | ||
INSERT INTO parent2 VALUES (1); | ||
INSERT INTO child VALUES (1,1,1); | ||
INSERT INTO child VALUES (2,1,1); | ||
SET foreign_key_checks=OFF; | ||
DROP TABLE parent1; | ||
UPDATE child SET parent1_id=2 WHERE id=1; | ||
DROP TABLE child; | ||
DROP TABLE parent2; | ||
SET foreign_key_checks=ON; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE TABLE ten (f1 INTEGER); | ||
INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); | ||
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; | ||
INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; | ||
INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; | ||
SET GLOBAL wsrep_desync = TRUE; | ||
SET wsrep_on = FALSE; | ||
ALTER TABLE t1 ADD PRIMARY KEY (f1); | ||
ERROR 70100: Query execution was interrupted | ||
SET wsrep_on = TRUE; | ||
SET GLOBAL wsrep_desync = FALSE; | ||
DROP TABLE t1; | ||
DROP TABLE ten; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE TABLE rand_table (f1 FLOAT); | ||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); | ||
INSERT INTO t1 VALUES (1, 'a'); | ||
INSERT INTO t1 VALUES (2, 'a'); | ||
SET AUTOCOMMIT=ON; | ||
START TRANSACTION; | ||
UPDATE t1 SET f2 = 'b' WHERE f1 = 1; | ||
SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE; | ||
f1 f2 | ||
2 a | ||
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync'; | ||
COMMIT;; | ||
SET SESSION wsrep_sync_wait = 0; | ||
SET SESSION wsrep_on = 0; | ||
SET SESSION wsrep_on = 1; | ||
UPDATE t1 SET f2 = 'c' WHERE f1 = 2; | ||
SET GLOBAL wsrep_provider_options = 'dbug='; | ||
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync'; | ||
SELECT TIMEDIFF(SYSDATE(), NOW()) < 2; | ||
TIMEDIFF(SYSDATE(), NOW()) < 2 | ||
1 | ||
INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND()); | ||
INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND()); | ||
SELECT COUNT(DISTINCT f1) = 10 FROM rand_table; | ||
COUNT(DISTINCT f1) = 10 | ||
1 | ||
wsrep_local_replays | ||
1 | ||
DROP TABLE t1; | ||
DROP TABLE rand_table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
TRUNCATE TABLE mysql.general_log; | ||
TRUNCATE TABLE mysql.general_log; | ||
SET SESSION wsrep_osu_method=TOI; | ||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; | ||
SET SESSION wsrep_osu_method=RSU; | ||
ALTER TABLE t1 ADD COLUMN f2 INTEGER; | ||
SET SESSION wsrep_osu_method=TOI; | ||
SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%'; | ||
COUNT(*) = 2 | ||
1 | ||
SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%'; | ||
COUNT(*) = 0 | ||
1 | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
SET SESSION wsrep_sync_wait = 0; | ||
SET SESSION wsrep_on = OFF; | ||
SET SESSION wsrep_on = ON; | ||
CALL mtr.add_suppression("Failed to set packet size"); | ||
CALL mtr.add_suppression("Failed to set packet size"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
START SLAVE; | ||
SET SESSION 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 | ||
2 dummy_text | ||
3 dummy_text | ||
4 dummy_text | ||
SET SESSION auto_increment_increment=7; | ||
insert into t1(i) values(null), (null), (null); | ||
SET SESSION auto_increment_offset=5; | ||
insert into t1(i) values(null), (null), (null); | ||
select * from t1; | ||
i c | ||
1 dummy_text | ||
2 dummy_text | ||
3 dummy_text | ||
4 dummy_text | ||
8 dummy_text | ||
15 dummy_text | ||
22 dummy_text | ||
33 dummy_text | ||
40 dummy_text | ||
47 dummy_text | ||
show variables like 'binlog_format'; | ||
Variable_name Value | ||
binlog_format STATEMENT | ||
show variables like '%auto_increment%'; | ||
Variable_name Value | ||
auto_increment_increment 7 | ||
auto_increment_offset 5 | ||
wsrep_auto_increment_control ON | ||
select * from t1; | ||
i c | ||
1 dummy_text | ||
2 dummy_text | ||
3 dummy_text | ||
4 dummy_text | ||
8 dummy_text | ||
15 dummy_text | ||
22 dummy_text | ||
33 dummy_text | ||
40 dummy_text | ||
47 dummy_text | ||
show variables like 'binlog_format'; | ||
Variable_name Value | ||
binlog_format ROW | ||
show variables like 'auto_increment_increment'; | ||
Variable_name Value | ||
auto_increment_increment 2 | ||
select * from t1; | ||
i c | ||
1 dummy_text | ||
2 dummy_text | ||
3 dummy_text | ||
4 dummy_text | ||
8 dummy_text | ||
15 dummy_text | ||
22 dummy_text | ||
33 dummy_text | ||
40 dummy_text | ||
47 dummy_text | ||
show variables like 'binlog_format'; | ||
Variable_name Value | ||
binlog_format ROW | ||
show variables like 'auto_increment_increment'; | ||
Variable_name Value | ||
auto_increment_increment 2 | ||
DROP TABLE t1; | ||
STOP SLAVE; | ||
RESET SLAVE ALL; | ||
RESET MASTER; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.