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