| 1 |
CREATE TABLE t ( |
| 2 |
id INT PRIMARY KEY |
| 3 |
) ENGINE=InnoDB; |
| 4 |
INSERT INTO t VALUES (10), (20), (30), (40), (50); |
| 5 |
# Adding debug point 'syncpoint_report_lock_collision' to @@GLOBAL.debug |
| 6 |
BEGIN; |
| 7 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 8 |
id |
| 9 |
20 |
| 10 |
BEGIN; |
| 11 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 12 |
id |
| 13 |
20 |
| 14 |
BEGIN; |
| 15 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 16 |
id |
| 17 |
20 |
| 18 |
BEGIN; |
| 19 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 20 |
id |
| 21 |
20 |
| 22 |
BEGIN; |
| 23 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 24 |
id |
| 25 |
20 |
| 26 |
BEGIN; |
| 27 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 28 |
id |
| 29 |
20 |
| 30 |
BEGIN; |
| 31 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 32 |
id |
| 33 |
20 |
| 34 |
BEGIN; |
| 35 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 36 |
id |
| 37 |
20 |
| 38 |
BEGIN; |
| 39 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 40 |
id |
| 41 |
20 |
| 42 |
BEGIN; |
| 43 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 44 |
id |
| 45 |
20 |
| 46 |
BEGIN; |
| 47 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 48 |
id |
| 49 |
20 |
| 50 |
BEGIN; |
| 51 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 52 |
id |
| 53 |
20 |
| 54 |
BEGIN; |
| 55 |
SELECT id FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR SHARE; |
| 56 |
id |
| 57 |
20 |
| 58 |
BEGIN; |
| 59 |
INSERT INTO t VALUES (60), (70), (80), (90), (100), (110), (120); |
| 60 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id = 20 FOR UPDATE; |
| 61 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 62 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 63 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 64 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 65 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 66 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 67 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 68 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 69 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 70 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 71 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 72 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 73 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 74 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 75 |
SELECT * FROM t FORCE INDEX (PRIMARY) WHERE id=100 FOR SHARE; |
| 76 |
# expect 25 more edges to be reported |
| 77 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 78 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 79 |
# expect 24 more edges to be reported |
| 80 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 81 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 82 |
# expect 23 more edges to be reported |
| 83 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 84 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 85 |
# expect 22 more edges to be reported |
| 86 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 87 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 88 |
# expect 21 more edges to be reported |
| 89 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 90 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 91 |
# expect 20 more edges to be reported |
| 92 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 93 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 94 |
# expect 19 more edges to be reported |
| 95 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 96 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 97 |
# expect 18 more edges to be reported |
| 98 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 99 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 100 |
# expect 17 more edges to be reported |
| 101 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 102 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 103 |
# expect 16 more edges to be reported |
| 104 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 105 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 106 |
# expect 15 more edges to be reported |
| 107 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 108 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 109 |
# expect 14 more edges to be reported |
| 110 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 111 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 112 |
# expect 13 more edges to be reported |
| 113 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 114 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 115 |
# expect 12 more edges to be reported |
| 116 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 117 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 118 |
# expect 11 more edges to be reported |
| 119 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 120 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 121 |
# expect 10 more edges to be reported |
| 122 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 123 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 124 |
# expect 9 more edges to be reported |
| 125 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 126 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 127 |
# expect 8 more edges to be reported |
| 128 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 129 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 130 |
# expect 7 more edges to be reported |
| 131 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 132 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 133 |
# expect 6 more edges to be reported |
| 134 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 135 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 136 |
# expect 5 more edges to be reported |
| 137 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 138 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 139 |
# expect 4 more edges to be reported |
| 140 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 141 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 142 |
# expect 3 more edges to be reported |
| 143 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 144 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 145 |
# expect 2 more edges to be reported |
| 146 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 147 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 148 |
# expect 1 more edges to be reported |
| 149 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_report_lock_collision'; |
| 150 |
SET DEBUG_SYNC = 'now SIGNAL continue_report_lock_collision'; |
| 151 |
# excpecting that connection 13 was rolled back as a deadlock victim |
| 152 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 153 |
# excpecting that connection 12 was rolled back as a deadlock victim |
| 154 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 155 |
# excpecting that connection 11 was rolled back as a deadlock victim |
| 156 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 157 |
# excpecting that connection 10 was rolled back as a deadlock victim |
| 158 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 159 |
# excpecting that connection 9 was rolled back as a deadlock victim |
| 160 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 161 |
# excpecting that connection 8 was rolled back as a deadlock victim |
| 162 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 163 |
# excpecting that connection 7 was rolled back as a deadlock victim |
| 164 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 165 |
# excpecting that connection 6 was rolled back as a deadlock victim |
| 166 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 167 |
# excpecting that connection 5 was rolled back as a deadlock victim |
| 168 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 169 |
# excpecting that connection 4 was rolled back as a deadlock victim |
| 170 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 171 |
# excpecting that connection 3 was rolled back as a deadlock victim |
| 172 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 173 |
# excpecting that connection 2 was rolled back as a deadlock victim |
| 174 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 175 |
# excpecting that connection 1 was rolled back as a deadlock victim |
| 176 |
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
| 177 |
id |
| 178 |
20 |
| 179 |
ROLLBACK; |
| 180 |
# Removing debug point 'syncpoint_report_lock_collision' from @@GLOBAL.debug |
| 181 |
DROP TABLE t; |