| 1 |
CREATE TABLE t1 ( |
| 2 |
column1 int NOT NULL |
| 3 |
); |
| 4 |
INSERT INTO t1 VALUES (80); |
| 5 |
CREATE TABLE t2 ( |
| 6 |
column1 int DEFAULT NULL, |
| 7 |
column2 double DEFAULT NULL, |
| 8 |
column3 text, |
| 9 |
column4 double DEFAULT NULL |
| 10 |
); |
| 11 |
INSERT INTO t2 VALUES |
| 12 |
(77,76.1,'abc',NULL), |
| 13 |
(81,NULL,'abcd',86.71), |
| 14 |
(83,95.58,'abcde',67.74); |
| 15 |
CREATE TABLE t3 ( |
| 16 |
column1 int DEFAULT NULL, |
| 17 |
x text |
| 18 |
); |
| 19 |
INSERT INTO t3 VALUES |
| 20 |
(76,''), |
| 21 |
(82,''); |
| 22 |
START TRANSACTION; |
| 23 |
update t2 set column1 = 125; |
| 24 |
START TRANSACTION; |
| 25 |
SET DEBUG_SYNC = 'lock_wait_will_wait SIGNAL c0_will_wait'; |
| 26 |
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);; |
| 27 |
SET DEBUG_SYNC = 'now WAIT_FOR c0_will_wait'; |
| 28 |
update t2 set column1 = 122; |
| 29 |
update t3 set column1 = 123; |
| 30 |
commit; |
| 31 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 32 |
drop table t1; |
| 33 |
drop table t2; |
| 34 |
drop table t3; |