Commit ff172467 authored by Jan Lindström's avatar Jan Lindström Committed by GitHub

Merge pull request #659 from codership/MDEV-13549-fixes-for-galera_bf_abort_for_update

MDEV-13549 Fix and re-enable test galera.galera_bf_abort_for_update
parents 047abdac 9a21fd34
......@@ -33,7 +33,6 @@ galera_ist_mysqldump : MDEV-13549 Galera test failures
mysql-wsrep#31 : MDEV-13549 Galera test failures
galera_migrate : MariaDB 10.0 does not support START SLAVE USER
galera_concurrent_ctas : MDEV-13549 Galera test failures
galera_bf_abort_for_update : MDEV-13549 Galera test failures
galera_wsrep_desync_wsrep_on : MDEV-13549 Galera test failures
galera_ssl_upgrade : MDEV-13549 Galera test failures
mysql-wsrep#33 : MDEV-13549 Galera test failures
......
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 10);
BEGIN;
SELECT * FROM t1 FOR UPDATE;
f1 f2
1 10
UPDATE t1 SET f1 = 2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
wsrep_local_aborts_increment
wsrep_local_bf_aborts_diff
1
BEGIN;
SELECT * FROM t1 FOR UPDATE;
f1 f2
2 10
UPDATE t1 SET f2 = 20;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
wsrep_local_bf_aborts_diff
1
DROP TABLE t1;
......@@ -5,25 +5,52 @@
# Test a local transaction being aborted by a slave one while it is running a SELECT FOR UPDATE
#
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INT) ENGINE=InnoDB;
--connection node_2
--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1, 10);
# Test updating the PK
--connection node_1
INSERT INTO t1 VALUES (1);
--let $wsrep_local_bf_aborts_before = `SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'`
BEGIN;
SELECT * FROM t1 FOR UPDATE;
--connection node_2
UPDATE t1 SET f1 = 2;
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--let $wait_condition = SELECT COUNT(*) FROM t1 WHERE f1 = 2
--source include/wait_condition.inc
--connection node_1
--error ER_LOCK_DEADLOCK
COMMIT;
--disable_query_log
--eval SELECT variable_value - $wsrep_local_bf_aborts_before AS wsrep_local_bf_aborts_diff FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'
--enable_query_log
# Test updating non-indexed column
--connection node_1
--let $wsrep_local_bf_aborts_before = `SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'`
BEGIN;
SELECT * FROM t1 FOR UPDATE;
--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
--connection node_2
UPDATE t1 SET f2 = 20;
--connection node_1a
--let $wait_condition = SELECT COUNT(*) FROM t1 WHERE f2 = 20
--source include/wait_condition.inc
--connection node_1
--error ER_LOCK_DEADLOCK
COMMIT;
--disable_query_log
--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment;
--eval SELECT variable_value - $wsrep_local_bf_aborts_before AS wsrep_local_bf_aborts_diff FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'
--enable_query_log
DROP TABLE t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment