Skip to content

Commit 74abc32

Browse files
author
Jan Lindström
authored
Merge pull request #731 from codership/MDEV-15803
MDEV-15803 Fix and re-enable test galera_var_auto_inc_control_on
2 parents 89a7ad6 + cf333b7 commit 74abc32

File tree

3 files changed

+18
-30
lines changed

3 files changed

+18
-30
lines changed

mysql-test/suite/galera/disabled.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ galera_gcache_recover_manytrx : MDEV-13549 Galera test failures
2626
galera_ssl_upgrade : MDEV-13549 Galera test failures
2727
galera.MW-329 : wsrep_local_replays not stable
2828
galera.MW-328A : have_deadlocks test not stable
29-
galera_var_auto_inc_control_on : MDEV-15803 Test failure on galera.galera_var_auto_inc_control_on
3029
query_cache : MDEV-15805 Test failure on galera.query_cache

mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
11
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
2-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
3-
VARIABLE_VALUE
4-
2
5-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
6-
VARIABLE_VALUE
7-
0
82
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
93
@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size')
104
1
11-
SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
12-
@@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1
5+
auto_increment_offset_differ
136
1
147
INSERT INTO t1 VALUES (DEFAULT, 'node1');;
158
INSERT INTO t1 VALUES (DEFAULT, 'node2');;
16-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
17-
VARIABLE_VALUE
18-
2
19-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
20-
VARIABLE_VALUE
21-
1
229
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
2310
@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size')
2411
1
25-
SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
26-
@@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1
12+
auto_increment_offset_differ
2713
1
2814
INSERT INTO t1 VALUES (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2');;
2915
INSERT INTO t1 VALUES (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1');;

mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,21 @@
55
--source include/galera_cluster.inc
66
--source include/have_innodb.inc
77

8-
# Save original auto_increment_offset values.
9-
--let $node_1=node_1
10-
--let $node_2=node_2
11-
--source include/auto_increment_offset_save.inc
12-
138
--connection node_1
149

1510
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
1611

12+
--let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`
1713
# auto_increment_increment is equal to the number of nodes
18-
# auto_increment_offset is equal to the ID of the node
19-
20-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
21-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
2214
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
23-
SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
15+
16+
--connection node_2
17+
--disable_query_log
18+
--eval SELECT @@global.auto_increment_offset != $auto_increment_offset_node_1 AS auto_increment_offset_differ;
19+
--enable_query_log
2420

2521
# Expect no conflicts
22+
--connection node_1
2623
--send INSERT INTO t1 VALUES (DEFAULT, 'node1');
2724

2825
--connection node_2
@@ -34,12 +31,18 @@ SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_
3431
--connection node_2
3532
--reap
3633

37-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
38-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
34+
--let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`
35+
# auto_increment_increment is equal to the number of nodes
3936
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
40-
SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
37+
38+
--connection node_1
39+
--disable_query_log
40+
--eval SELECT @@global.auto_increment_offset != $auto_increment_offset_node_2 AS auto_increment_offset_differ;
41+
--enable_query_log
42+
4143

4244
# Expect no conflicts
45+
--connection node_2
4346
--send INSERT INTO t1 VALUES (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2');
4447

4548
--connection node_1

0 commit comments

Comments
 (0)