45 lines
1013 B
Plaintext
45 lines
1013 B
Plaintext
--source include/have_innodb.inc
|
|
--source include/count_sessions.inc
|
|
--source include/have_debug.inc
|
|
|
|
--echo #
|
|
--echo # Bug#25966845 INSERT ON DUPLICATE KEY GENERATE A DEADLOCK
|
|
--echo #
|
|
|
|
CREATE TABLE t1(f1 int primary key,
|
|
f2 int, f3 int, unique key(f2))engine=innodb;
|
|
|
|
SHOW CREATE TABLE t1;
|
|
|
|
INSERT INTO t1(f1, f2, f3) VALUES(1, 10, 100);
|
|
|
|
--echo # Connection default
|
|
BEGIN;
|
|
INSERT INTO t1 VALUES(2, 20, 300) ON DUPLICATE KEY UPDATE f3 = 500;
|
|
|
|
--echo # Connection other:
|
|
--connect (other,localhost,root,,test,,)
|
|
BEGIN;
|
|
SET DEBUG_SYNC = 'ib_after_row_insert_step SIGNAL default_commit';
|
|
--send INSERT INTO t1 VALUES(2, 10, 200) ON DUPLICATE KEY UPDATE f3 = 120
|
|
|
|
--echo # Connection default
|
|
connection default;
|
|
SET DEBUG_SYNC = 'now WAIT_FOR default_commit';
|
|
COMMIT;
|
|
|
|
--echo # Connection other
|
|
connection other;
|
|
--reap
|
|
COMMIT;
|
|
|
|
connection default;
|
|
disconnect other;
|
|
|
|
--echo # Verify Results:
|
|
SELECT * FROM t1;
|
|
|
|
SET DEBUG_SYNC ='RESET';
|
|
DROP TABLE t1;
|
|
--source include/wait_until_count_sessions.inc
|