| 1 |
# |
| 2 |
# Bug #34616560 -- assert failure after deadlock detection |
| 3 |
# |
| 4 |
|
| 5 |
--source include/have_debug_sync.inc |
| 6 |
|
| 7 |
CREATE TABLE t1 ( |
| 8 |
column1 int NOT NULL |
| 9 |
); |
| 10 |
|
| 11 |
INSERT INTO t1 VALUES (80); |
| 12 |
|
| 13 |
|
| 14 |
CREATE TABLE t2 ( |
| 15 |
column1 int DEFAULT NULL, |
| 16 |
column2 double DEFAULT NULL, |
| 17 |
column3 text, |
| 18 |
column4 double DEFAULT NULL |
| 19 |
); |
| 20 |
|
| 21 |
INSERT INTO t2 VALUES |
| 22 |
(77,76.1,'abc',NULL), |
| 23 |
(81,NULL,'abcd',86.71), |
| 24 |
(83,95.58,'abcde',67.74); |
| 25 |
|
| 26 |
CREATE TABLE t3 ( |
| 27 |
column1 int DEFAULT NULL, |
| 28 |
x text |
| 29 |
); |
| 30 |
|
| 31 |
INSERT INTO t3 VALUES |
| 32 |
(76,''), |
| 33 |
(82,''); |
| 34 |
|
| 35 |
--connect(c0,localhost,root,,) |
| 36 |
--connect(c1,localhost,root,,) |
| 37 |
|
| 38 |
--connection c1 |
| 39 |
START TRANSACTION; |
| 40 |
update t2 set column1 = 125; |
| 41 |
|
| 42 |
--connection c0 |
| 43 |
START TRANSACTION; |
| 44 |
SET DEBUG_SYNC = 'lock_wait_will_wait SIGNAL c0_will_wait'; |
| 45 |
--send update t3 set x = case when exists ( select ref_2.column2 as c0 from t2 as ref_2 window w_cc03ob as ( partition by ref_2.column3 order by ref_2.column4 desc)) then null else 24 end where exists (select distinct * from t1); |
| 46 |
|
| 47 |
--connection c1 |
| 48 |
SET DEBUG_SYNC = 'now WAIT_FOR c0_will_wait'; |
| 49 |
update t2 set column1 = 122; |
| 50 |
update t3 set column1 = 123; |
| 51 |
commit; |
| 52 |
|
| 53 |
# We expect a deadlock between the update on c0 and the other update to t2 on c1, |
| 54 |
# and we expect the deadlock detector to kill c0, and let c1 run. |
| 55 |
--connection c0 |
| 56 |
--error ER_LOCK_DEADLOCK |
| 57 |
--reap |
| 58 |
|
| 59 |
drop table t1; |
| 60 |
drop table t2; |
| 61 |
drop table t3; |