mirror of
https://github.com/MariaDB/server.git
synced 2025-01-25 00:04:33 +01:00
102 lines
3.6 KiB
Text
102 lines
3.6 KiB
Text
DROP TABLE IF EXISTS t1;
|
|
CREATE TABLE t1 (k INT NOT NULL, a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, PRIMARY KEY(k)) ENGINE=InnoDB;
|
|
INSERT INTO t1 (k, a, b, c) VALUES (1, 0, 0, 0);
|
|
INSERT INTO t1 (k, a, b, c) VALUES (2, 0, 0, 0);
|
|
INSERT INTO t1 (k, a, b, c) VALUES (3, 0, 0, 0);
|
|
INSERT INTO t1 (k, a, b, c) VALUES (4, 0, 0, 0);
|
|
RESET MASTER;
|
|
SET DEBUG_SYNC= 'RESET';
|
|
# Connection c1
|
|
BEGIN;
|
|
UPDATE t1 SET a=10 WHERE k=1;
|
|
SET DEBUG_SYNC="commit_after_release_LOCK_prepare_ordered SIGNAL c1_prepared WAIT_FOR c2_committing";
|
|
COMMIT;
|
|
# Connection c2
|
|
SET DEBUG_SYNC="now WAIT_FOR c1_prepared";
|
|
BEGIN;
|
|
SELECT * FROM t1 WHERE k=1 FOR UPDATE;
|
|
k a b c
|
|
1 10 0 0
|
|
UPDATE t1 SET a=20 WHERE k=1;
|
|
SET DEBUG_SYNC="now SIGNAL c2_committing";
|
|
COMMIT;
|
|
# Connection c1
|
|
BEGIN;
|
|
UPDATE t1 SET a=10 WHERE k=2;
|
|
SET DEBUG_SYNC="commit_after_release_LOCK_prepare_ordered SIGNAL c1_prepared WAIT_FOR c2_committed TIMEOUT 2";
|
|
COMMIT;
|
|
# Connection c2
|
|
SET DEBUG_SYNC="now WAIT_FOR c1_prepared";
|
|
BEGIN;
|
|
SELECT * FROM t1 WHERE k=2 FOR UPDATE;
|
|
k a b c
|
|
2 10 0 0
|
|
UPDATE t1 SET a=20 WHERE k=2;
|
|
SET DEBUG_SYNC="binlog_after_log_and_order SIGNAL c2_committed";
|
|
COMMIT;
|
|
# Connection c1
|
|
# This should warn about DEBUG_SYNC timeout
|
|
Warnings:
|
|
Warning 1639 debug sync point wait timed out
|
|
# Connection c2
|
|
SHOW BINLOG EVENTS LIMIT 2,12;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 174 Query 1 265 use `test`; UPDATE t1 SET a=10 WHERE k=1
|
|
master-bin.000001 265 Xid 1 292 COMMIT /* xid=XX */
|
|
master-bin.000001 292 Query 1 360 BEGIN
|
|
master-bin.000001 360 Query 1 451 use `test`; UPDATE t1 SET a=20 WHERE k=1
|
|
master-bin.000001 451 Xid 1 478 COMMIT /* xid=XX */
|
|
master-bin.000001 478 Query 1 546 BEGIN
|
|
master-bin.000001 546 Query 1 637 use `test`; UPDATE t1 SET a=10 WHERE k=2
|
|
master-bin.000001 637 Xid 1 664 COMMIT /* xid=XX */
|
|
master-bin.000001 664 Query 1 732 BEGIN
|
|
master-bin.000001 732 Query 1 823 use `test`; UPDATE t1 SET a=20 WHERE k=2
|
|
master-bin.000001 823 Xid 1 850 COMMIT /* xid=XX */
|
|
# Connection c1
|
|
RESET MASTER;
|
|
SET DEBUG_SYNC="commit_after_release_LOCK_prepare_ordered SIGNAL c1_prepared WAIT_FOR c2_committing";
|
|
UPDATE t1 SET a=10 WHERE k=3;
|
|
# Connection c2
|
|
SET DEBUG_SYNC="now WAIT_FOR c1_prepared";
|
|
SELECT * FROM t1 WHERE k=3 FOR UPDATE;
|
|
k a b c
|
|
3 10 0 0
|
|
SET DEBUG_SYNC="commit_after_release_LOCK_prepare_ordered SIGNAL c2_committing";
|
|
UPDATE t1 SET a=20 WHERE k=3;
|
|
# Connection c1
|
|
SET DEBUG_SYNC="commit_after_release_LOCK_prepare_ordered SIGNAL c1_prepared WAIT_FOR c2_committed TIMEOUT 2";
|
|
UPDATE t1 SET a=10 WHERE k=4;
|
|
# Connection c2
|
|
SET DEBUG_SYNC="now WAIT_FOR c1_prepared";
|
|
SELECT * FROM t1 WHERE k=4 FOR UPDATE;
|
|
k a b c
|
|
4 10 0 0
|
|
SET DEBUG_SYNC="binlog_after_log_and_order SIGNAL c2_committed";
|
|
UPDATE t1 SET a=20 WHERE k=4;
|
|
# Connection c1
|
|
# This should warn about DEBUG_SYNC timeout
|
|
Warnings:
|
|
Warning 1639 debug sync point wait timed out
|
|
# Connection c2
|
|
SHOW BINLOG EVENTS LIMIT 1,12;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 106 Query 1 174 BEGIN
|
|
master-bin.000001 174 Query 1 265 use `test`; UPDATE t1 SET a=10 WHERE k=3
|
|
master-bin.000001 265 Xid 1 292 COMMIT /* xid=XX */
|
|
master-bin.000001 292 Query 1 360 BEGIN
|
|
master-bin.000001 360 Query 1 451 use `test`; UPDATE t1 SET a=20 WHERE k=3
|
|
master-bin.000001 451 Xid 1 478 COMMIT /* xid=XX */
|
|
master-bin.000001 478 Query 1 546 BEGIN
|
|
master-bin.000001 546 Query 1 637 use `test`; UPDATE t1 SET a=10 WHERE k=4
|
|
master-bin.000001 637 Xid 1 664 COMMIT /* xid=XX */
|
|
master-bin.000001 664 Query 1 732 BEGIN
|
|
master-bin.000001 732 Query 1 823 use `test`; UPDATE t1 SET a=20 WHERE k=4
|
|
master-bin.000001 823 Xid 1 850 COMMIT /* xid=XX */
|
|
SELECT * FROM t1 ORDER BY k;
|
|
k a b c
|
|
1 20 0 0
|
|
2 20 0 0
|
|
3 20 0 0
|
|
4 20 0 0
|
|
DROP TABLE t1;
|
|
SET DEBUG_SYNC= 'RESET';
|