| 1 |
--source include/have_innodb.inc |
| 2 |
--source include/have_debug.inc |
| 3 |
--source include/have_debug_sync.inc |
| 4 |
--source include/count_sessions.inc |
| 5 |
|
| 6 |
|
| 7 |
CREATE TABLE t(a INT PRIMARY KEY, b INT, c INT, UNIQUE KEY `b_c` (`b`,`c`)) |
| 8 |
ENGINE=InnoDB, STATS_PERSISTENT=0; |
| 9 |
INSERT INTO t SET a = 1, c = 2; |
| 10 |
|
| 11 |
--connect con1,localhost,root |
| 12 |
BEGIN; |
| 13 |
INSERT INTO t SET a=2, c=2; |
| 14 |
|
| 15 |
--connection default |
| 16 |
BEGIN; |
| 17 |
SET DEBUG_SYNC="lock_wait_start SIGNAL select_locked"; |
| 18 |
--send SELECT * FROM t FORCE INDEX(b) FOR UPDATE |
| 19 |
|
| 20 |
--connection con1 |
| 21 |
SET DEBUG_SYNC="now WAIT_FOR select_locked"; |
| 22 |
ROLLBACK; |
| 23 |
|
| 24 |
--connection default |
| 25 |
--echo # If the bug is not fixed, and the both unique index key fields are |
| 26 |
--echo # NULL, there will be two (1, NULL, 2) rows in the result, |
| 27 |
--echo # because cursor will be restored to (NULL, 2, 1) position for |
| 28 |
--echo # secondary key instead of "supremum". |
| 29 |
--reap |
| 30 |
COMMIT; |
| 31 |
|
| 32 |
SET DEBUG_SYNC="RESET"; |
| 33 |
|
| 34 |
--disconnect con1 |
| 35 |
DROP TABLE t; |
| 36 |
--source include/wait_until_count_sessions.inc |