| 1 |
--source include/galera_cluster.inc |
| 2 |
--source include/have_innodb.inc |
| 3 |
|
| 4 |
--echo # |
| 5 |
--echo # MDEV-8598 : Failed MySQL DDL commands and Galera replication |
| 6 |
--echo # |
| 7 |
--echo # On node 1 |
| 8 |
--connection node_1 |
| 9 |
USE test; |
| 10 |
--disable_warnings |
| 11 |
DROP TABLE IF EXISTS t1, t2; |
| 12 |
--enable_warnings |
| 13 |
|
| 14 |
CREATE TABLE t1(i INT) ENGINE=INNODB; |
| 15 |
INSERT INTO t1 VALUE(1); |
| 16 |
SELECT * FROM t1; |
| 17 |
|
| 18 |
--echo # Create a new user 'foo' with limited privileges |
| 19 |
CREATE USER foo@localhost; |
| 20 |
GRANT SELECT on test.* TO foo@localhost; |
| 21 |
|
| 22 |
--echo # Open connection to the 1st node using 'test_user1' user. |
| 23 |
--let $port_1= \$NODE_MYPORT_1 |
| 24 |
--connect(foo_node_1,localhost,foo,,test,$port_1,) |
| 25 |
|
| 26 |
--connection foo_node_1 |
| 27 |
SELECT * FROM t1; |
| 28 |
--echo # Following RENAME should not replicate to other node. |
| 29 |
--error ER_TABLEACCESS_DENIED_ERROR |
| 30 |
RENAME TABLE t1 TO t2; |
| 31 |
|
| 32 |
--echo # On node 2 |
| 33 |
--connection node_2 |
| 34 |
USE test; |
| 35 |
SELECT * FROM t1; |
| 36 |
|
| 37 |
--echo # On node_1 |
| 38 |
--connection node_1 |
| 39 |
RENAME TABLE t1 TO t2; |
| 40 |
SHOW TABLES; |
| 41 |
|
| 42 |
--echo # On node 2 |
| 43 |
--connection node_2 |
| 44 |
USE test; |
| 45 |
SELECT * FROM t2; |
| 46 |
|
| 47 |
# Cleanup |
| 48 |
--connection node_1 |
| 49 |
DROP USER foo@localhost; |
| 50 |
DROP TABLE t2; |
| 51 |
|
| 52 |
--echo # End of tests |