Debian Codegraph @

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

raw
1 #
2 # Test that a two-node cluster has distinct values for wsrep_local_index for its nodes
3 #
4
5 --source include/galera_cluster.inc
6 --source include/have_innodb.inc
7
8 --connection node_1
9 CREATE TABLE wsrep_local_indexes (wsrep_local_index INTEGER);
10 INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
11
12 --connection node_2
13 INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
14
15 --connection node_1
16 SELECT COUNT(*) = 2 FROM wsrep_local_indexes;
17 SELECT COUNT(DISTINCT wsrep_local_index) = 2 FROM wsrep_local_indexes;
18 SELECT COUNT(*) = 0 FROM wsrep_local_indexes WHERE wsrep_local_index NOT IN (0, 1);
19
20 DROP TABLE wsrep_local_indexes;