summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera/t/galera_rsu_error.test
blob: 6de7607b6ecc90cc6a7cb4b1b39ed91d36e3a9aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#
# Test DDL errors under Rolling Schema Upgrade
#

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

CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t1 VALUES (1), (1);

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
--source include/wait_condition.inc

SET SESSION wsrep_OSU_method = "RSU";
--error ER_DUP_ENTRY
ALTER TABLE t1 ADD PRIMARY KEY (f1);
SET SESSION wsrep_OSU_method = "TOI";

# The ALTER has no effect
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1';

INSERT INTO t1 VALUES (1);

--connection node_1
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 3 FROM t1;

INSERT INTO t1 VALUES (1);

--connection node_2
SELECT COUNT(3) = 4 FROM t1;

DROP TABLE t1;