| 1 |
# |
| 2 |
# Test --wsrep_log_conflicts=ON |
| 3 |
# |
| 4 |
|
| 5 |
--source include/galera_cluster.inc |
| 6 |
--source include/have_innodb.inc |
| 7 |
|
| 8 |
CREATE TABLE t1 ( |
| 9 |
f1 VARCHAR(255) PRIMARY KEY |
| 10 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 11 |
|
| 12 |
INSERT INTO t1 VALUES ('abc'); |
| 13 |
|
| 14 |
--connection node_2 |
| 15 |
SELECT f1 = 'abc' FROM t1; |
| 16 |
|
| 17 |
# |
| 18 |
# Provoke a conflict |
| 19 |
# |
| 20 |
|
| 21 |
--connection node_1 |
| 22 |
SET AUTOCOMMIT=OFF; |
| 23 |
START TRANSACTION; |
| 24 |
UPDATE t1 SET f1 = 'klm'; |
| 25 |
|
| 26 |
--connection node_2 |
| 27 |
SET AUTOCOMMIT=OFF; |
| 28 |
START TRANSACTION; |
| 29 |
UPDATE t1 SET f1 = 'xyz'; |
| 30 |
|
| 31 |
--connection node_1 |
| 32 |
COMMIT; |
| 33 |
|
| 34 |
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 |
| 35 |
--connection node_2a |
| 36 |
--let $wait_condition = SELECT f1 = 'klm' FROM t1; |
| 37 |
--source include/wait_condition.inc |
| 38 |
|
| 39 |
--connection node_2 |
| 40 |
--error ER_LOCK_DEADLOCK |
| 41 |
COMMIT; |
| 42 |
|
| 43 |
# |
| 44 |
# We can not really check the log output very much because it is quite variable |
| 45 |
# |
| 46 |
|
| 47 |
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err |
| 48 |
--let $assert_only_after = CURRENT_TEST |
| 49 |
|
| 50 |
--let $assert_text = cluster conflict due to high priority abort for threads |
| 51 |
--let $assert_select = cluster conflict due to high priority abort for threads |
| 52 |
--let $assert_match = cluster conflict due to high priority abort for threads |
| 53 |
--source include/assert_grep.inc |
| 54 |
|
| 55 |
DROP TABLE t1; |