mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
3435e8a515
innodb_autoinc_lock_mode = 2 innodb_buffer_pool_dump_at_shutdown = ON innodb_buffer_pool_dump_pct = 25 innodb_buffer_pool_load_at_startup = ON innodb_checksum_algorithm = CRC32 innodb_file_format = Barracuda innodb_large_prefix = ON innodb_log_compressed_pages = ON innodb_purge_threads = 4 innodb_strict_mode = ON binlog_annotate_row_events = ON binlog_format = MIXED binlog-row-event-max-size = 8192 group_concat_max_len = 1M lock_wait_timeout = 86400 log_slow_admin_statements = ON log_slow_slave_statements = ON log_warnings = 2 max_allowed_packet = 16M replicate_annotate_row_events = ON slave_net_timeout = 60 sync_binlog = 1 aria_recover = BACKUP,QUICK myisam_recover_options = BACKUP,QUICK
24 lines
1.1 KiB
Text
24 lines
1.1 KiB
Text
connection default;
|
|
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
|
|
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
|
|
COMMIT;
|
|
SET AUTOCOMMIT = 0;
|
|
CREATE TEMPORARY TABLE t1_tmp ( b INT );
|
|
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
|
|
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
|
|
connect user2,localhost,root,,,$MASTER_MYPORT,$MASTER_MYSOCK;
|
|
SET AUTOCOMMIT = 0;
|
|
CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
|
|
INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
|
|
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
|
|
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
|
|
connection default;
|
|
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
|
|
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
|
connection user2;
|
|
Reap the server message for connection user2 UPDATE t1 ...
|
|
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
|
|
connection default;
|
|
disconnect user2;
|
|
DROP TABLE t1;
|
|
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
|