Skip to content

Commit a5b0a32

Browse files
committed
Merge branch '10.0-galera' into 10.1
2 parents 09307c4 + f533b2b commit a5b0a32

File tree

16 files changed

+566
-54
lines changed

16 files changed

+566
-54
lines changed

mysql-test/include/check-warnings.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
# Don't write these queries to binlog
1212
set SQL_LOG_BIN=0;
1313

14+
# Do not replicate updates to other galera nodes
15+
--error 0,1193
16+
set WSREP_ON=0;
17+
1418
# Turn off any debug crashes, allow the variable to be
1519
# non existent in release builds
1620
--error 0,1193

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

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,121 @@ pk i
2020
SELECT * FROM t1;
2121
pk i
2222
DROP TABLE t1;
23+
#
24+
# MDEV#7501 : alter table exchange partition is not replicated in
25+
# galera cluster
26+
#
27+
28+
# On node_1
29+
CREATE TABLE test.t1 (
30+
i INT UNSIGNED NOT NULL AUTO_INCREMENT,
31+
PRIMARY KEY (i)
32+
) ENGINE=INNODB
33+
PARTITION BY RANGE (i)
34+
(PARTITION p1 VALUES LESS THAN (10) ENGINE = INNODB,
35+
PARTITION p2 VALUES LESS THAN (20) ENGINE = INNODB,
36+
PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = INNODB);
37+
INSERT INTO test.t1 (i) VALUE (9),(19);
38+
CREATE TABLE test.p1 LIKE test.t1;
39+
ALTER TABLE test.p1 REMOVE PARTITIONING;
40+
ALTER TABLE test.t1 EXCHANGE PARTITION p1 WITH TABLE test.p1;
41+
SELECT * FROM test.t1;
42+
i
43+
19
44+
SELECT * FROM test.p1;
45+
i
46+
9
47+
48+
# On node_2
49+
SHOW CREATE TABLE t1;
50+
Table Create Table
51+
t1 CREATE TABLE `t1` (
52+
`i` int(10) unsigned NOT NULL AUTO_INCREMENT,
53+
PRIMARY KEY (`i`)
54+
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1
55+
/*!50100 PARTITION BY RANGE (i)
56+
(PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB,
57+
PARTITION p2 VALUES LESS THAN (20) ENGINE = InnoDB,
58+
PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
59+
SHOW CREATE TABLE p1;
60+
Table Create Table
61+
p1 CREATE TABLE `p1` (
62+
`i` int(10) unsigned NOT NULL AUTO_INCREMENT,
63+
PRIMARY KEY (`i`)
64+
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
65+
SELECT * FROM test.t1;
66+
i
67+
19
68+
SELECT * FROM test.p1;
69+
i
70+
9
71+
72+
# On node_1
73+
ALTER TABLE t1 TRUNCATE PARTITION p2;
74+
SELECT * FROM test.t1;
75+
i
76+
77+
# On node_2
78+
SELECT * FROM test.t1;
79+
i
80+
81+
# On node_1
82+
ALTER TABLE t1 DROP PARTITION p2;
83+
SHOW CREATE TABLE t1;
84+
Table Create Table
85+
t1 CREATE TABLE `t1` (
86+
`i` int(10) unsigned NOT NULL AUTO_INCREMENT,
87+
PRIMARY KEY (`i`)
88+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
89+
/*!50100 PARTITION BY RANGE (i)
90+
(PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB,
91+
PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
92+
93+
# On node_2
94+
SHOW CREATE TABLE t1;
95+
Table Create Table
96+
t1 CREATE TABLE `t1` (
97+
`i` int(10) unsigned NOT NULL AUTO_INCREMENT,
98+
PRIMARY KEY (`i`)
99+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
100+
/*!50100 PARTITION BY RANGE (i)
101+
(PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB,
102+
PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
103+
DROP TABLE t1, p1;
104+
#
105+
# MDEV-5146: Bulk loads into partitioned table not working
106+
#
107+
# Case 1: wsrep_load_data_splitting = ON & LOAD DATA with 20002
108+
# entries.
109+
SET GLOBAL wsrep_load_data_splitting = ON;
110+
CREATE TABLE t1 (pk INT PRIMARY KEY)
111+
ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
112+
SELECT COUNT(*) = 20002 FROM t1;
113+
COUNT(*) = 20002
114+
1
115+
wsrep_last_committed_diff
116+
1
117+
DROP TABLE t1;
118+
# Case 2: wsrep_load_data_splitting = ON & LOAD DATA with 101 entries.
119+
SET GLOBAL wsrep_load_data_splitting = ON;
120+
CREATE TABLE t1 (pk INT PRIMARY KEY)
121+
ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
122+
SELECT COUNT(*) = 101 FROM t1;
123+
COUNT(*) = 101
124+
1
125+
wsrep_last_committed_diff
126+
1
127+
DROP TABLE t1;
128+
# Case 3: wsrep_load_data_splitting = OFF & LOAD DATA with 20002
129+
# entries.
130+
SET GLOBAL wsrep_load_data_splitting = OFF;
131+
CREATE TABLE t1 (pk INT PRIMARY KEY)
132+
ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
133+
SELECT COUNT(*) = 20002 FROM t1;
134+
COUNT(*) = 20002
135+
1
136+
wsrep_last_committed_diff
137+
1
138+
DROP TABLE t1;
139+
SET GLOBAL wsrep_load_data_splitting = 1;;
23140
# End of test
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# MDEV-8598 : Failed MySQL DDL commands and Galera replication
3+
#
4+
# On node 1
5+
USE test;
6+
DROP TABLE IF EXISTS t1, t2;
7+
CREATE TABLE t1(i INT) ENGINE=INNODB;
8+
INSERT INTO t1 VALUE(1);
9+
SELECT * FROM t1;
10+
i
11+
1
12+
# Create a new user 'foo' with limited privileges
13+
GRANT SELECT on test.* TO foo@localhost;
14+
# Open connection to the 1st node using 'test_user1' user.
15+
SELECT * FROM t1;
16+
i
17+
1
18+
# Following RENAME should not replicate to other node.
19+
RENAME TABLE t1 TO t2;
20+
ERROR 42000: DROP, ALTER command denied to user 'foo'@'localhost' for table 't1'
21+
# On node 2
22+
USE test;
23+
SELECT * FROM t1;
24+
i
25+
1
26+
# On node_1
27+
RENAME TABLE t1 TO t2;
28+
SHOW TABLES;
29+
Tables_in_test
30+
t2
31+
# On node 2
32+
USE test;
33+
SELECT * FROM t2;
34+
i
35+
1
36+
DROP USER foo@localhost;
37+
DROP TABLE t2;
38+
# End of tests

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,49 @@
44
USE test;
55
CREATE DEFINER=CURRENT_USER VIEW v1 AS SELECT 1;
66
DROP VIEW v1;
7+
#
8+
# MDEV-8464 : ALTER VIEW not replicated in some cases
9+
#
10+
# On node_1
11+
USE test;
12+
CREATE TABLE t1(i INT) ENGINE=INNODB;
13+
CREATE DEFINER=CURRENT_USER VIEW v1 AS SELECT * FROM t1;
14+
CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t1;
15+
CREATE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t1;
16+
CREATE ALGORITHM=UNDEFINED DEFINER=CURRENT_USER VIEW v4 AS SELECT * FROM t1;
17+
# On node_2
18+
USE test;
19+
SHOW CREATE VIEW v1;
20+
View Create View character_set_client collation_connection
21+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
22+
SHOW CREATE VIEW v2;
23+
View Create View character_set_client collation_connection
24+
v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
25+
SHOW CREATE VIEW v3;
26+
View Create View character_set_client collation_connection
27+
v3 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
28+
SHOW CREATE VIEW v4;
29+
View Create View character_set_client collation_connection
30+
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
31+
# On node_1
32+
ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
33+
ALTER ALGORITHM=UNDEFINED VIEW v2 AS SELECT * FROM t1;
34+
ALTER DEFINER=CURRENT_USER VIEW v3 AS SELECT * FROM t1;
35+
ALTER ALGORITHM=TEMPTABLE DEFINER=CURRENT_USER VIEW v4 AS SELECT * FROM t1;
36+
# On node_2
37+
SHOW CREATE VIEW v1;
38+
View Create View character_set_client collation_connection
39+
v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
40+
SHOW CREATE VIEW v2;
41+
View Create View character_set_client collation_connection
42+
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
43+
SHOW CREATE VIEW v3;
44+
View Create View character_set_client collation_connection
45+
v3 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
46+
SHOW CREATE VIEW v4;
47+
View Create View character_set_client collation_connection
48+
v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
49+
# Cleanup
50+
DROP VIEW v1, v2, v3, v4;
51+
DROP TABLE t1;
752
# End of tests

mysql-test/suite/galera/suite.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ push @::global_suppressions,
3333
qr(WSREP: last inactive check more than .* skipping check),
3434
qr(WSREP: SQL statement was ineffective),
3535
qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.),
36-
qr|WSREP: access file\(gvwstate.dat\) failed\(No such file or directory\)|,
36+
qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|,
3737
qr(WSREP: Quorum: No node with complete state),
3838
qr(WSREP: Initial position was provided by configuration or SST, avoiding override),
3939
qr|WSREP: discarding established \(time wait\) .*|,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
3030
exit(0);
3131
EOF
3232

33-
--error ER_UNKNOWN_COM_ERROR,ER_LOCK_WAIT_TIMEOUT
33+
--error ER_UNKNOWN_COM_ERROR,ER_LOCK_WAIT_TIMEOUT,ER_LOCK_DEADLOCK
3434
INSERT INTO t1 VALUES (1);
3535

3636
--echo Resuming node_2 ...

0 commit comments

Comments
 (0)