Quelle deadlock_wait_thr_race.result
Sprache: Lisp
CREATE TABLE t (a int PRIMARY KEY, b int) engine = InnoDB STATS_PERSISTENT=0;
CREATE TABLE t2 (a int PRIMARY KEY) engine = InnoDB STATS_PERSISTENT=0;
INSERT INTO t VALUES (10, 10), (20, 20), (30, 30);
INSERT INTO t2 VALUES (10), (20), (30);
BEGIN;
UPDATE t2 SET a = a + 100;
SELECT * FROM t WHERE a = 20 FOR UPDATE;
a b 2020
connect con_2,localhost,root,,; SET innodb_snapshot_isolation=OFF; SET TRANSACTION ISOLATION LEVEL READ COMMITTED; SET DEBUG_SYNC = 'lock_trx_handle_wait_enter SIGNAL upd_locked WAIT_FOR upd_cont'; SET DEBUG_SYNC = 'trx_t_release_locks_enter SIGNAL sel_cont WAIT_FOR upd_cont_2';
BEGIN;
UPDATE t SET b = 100;
connection default; SET DEBUG_SYNC="now WAIT_FOR upd_locked"; SET DEBUG_SYNC="deadlock_report_before_lock_releasing SIGNAL upd_cont WAIT_FOR sel_cont"; SET DEBUG_SYNC="lock_wait_before_suspend SIGNAL sel_before_suspend";
SELECT * FROM t WHERE a = 10 FOR UPDATE;;
connect con_3,localhost,root,,; SET DEBUG_SYNC="now WAIT_FOR sel_before_suspend"; SET DEBUG_SYNC="now SIGNAL upd_cont_2";
disconnect con_3;
connection con_2; ERROR40001: Deadlock found when trying to get lock; try restarting transaction
disconnect con_2;
connection default;
a b 1010 SET DEBUG_SYNC = 'RESET';
DROP TABLE t;
DROP TABLE t2;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.