From cf1091960bd4253ec508e7cc3a865ed054af8abe Mon Sep 17 00:00:00 2001 From: "Brian Fraser fraserb@gmail.com" <> Date: Wed, 30 May 2012 13:03:17 -0300 Subject: [PATCH] Move the sample for 903443 into it's own file --- t/pt-deadlock-logger/bugs.t | 56 +-------------------- t/pt-deadlock-logger/samples/bug_903443.txt | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 55 deletions(-) create mode 100644 t/pt-deadlock-logger/samples/bug_903443.txt diff --git a/t/pt-deadlock-logger/bugs.t b/t/pt-deadlock-logger/bugs.t index 2d53987c..4ee463a9 100644 --- a/t/pt-deadlock-logger/bugs.t +++ b/t/pt-deadlock-logger/bugs.t @@ -20,61 +20,7 @@ require "$trunk/bin/pt-deadlock-logger"; # pt-deadlock-logger crashes on MySQL 5.5 # ############################################################################# -my $innodb_status_sample = <<'EOS'; -===================================== -070915 15:34:37 INNODB MONITOR OUTPUT -===================================== -Per second averages calculated from the last 24 seconds ------------------------- -LATEST DETECTED DEADLOCK ------------------------- -111212 22:52:42 -*** (1) TRANSACTION: -TRANSACTION 3405, ACTIVE 161 sec starting index read -mysql tables in use 1, locked 1 -LOCK WAIT 3 lock struct(s), heap size 376, 3 row lock(s), undo log entries 2 -MySQL thread id 19, OS thread handle 0x7fac301e4700, query id 180 localhost root Updating -update a set movie_id=96 where id =2 -*** (1) WAITING FOR THIS LOCK TO BE GRANTED: -RECORD LOCKS space id 0 page no 307 n bits 72 index `PRIMARY` of table `test`.`a` trx id 3405 lock_mode X locks rec but not gap waiting -Record lock, heap no 3 PHYSICAL RECORD: n_fields 6; compact format; info bits 0 - 0: len 4; hex 80000002; asc ;; - 1: len 6; hex 000000003404; asc 4 ;; - 2: len 7; hex 040000163b2515; asc ;% ;; - 3: len 4; hex 80000063; asc c;; - 4: len 1; hex 01; asc ;; - 5: len 8; hex 8000124a7c1acb8c; asc J| ;; - -*** (2) TRANSACTION: -TRANSACTION 3404, ACTIVE 1026 sec starting index read -mysql tables in use 1, locked 1 -3 lock struct(s), heap size 376, 2 row lock(s), undo log entries 1 -MySQL thread id 18, OS thread handle 0x7fac30225700, query id 181 localhost root Updating -update a set movie_id=98 where id =4 -*** (2) HOLDS THE LOCK(S): -RECORD LOCKS space id 0 page no 307 n bits 72 index `PRIMARY` of table `test`.`a` trx id 3404 lock_mode X locks rec but not gap -Record lock, heap no 3 PHYSICAL RECORD: n_fields 6; compact format; info bits 0 - 0: len 4; hex 80000002; asc ;; - 1: len 6; hex 000000003404; asc 4 ;; - 2: len 7; hex 040000163b2515; asc ;% ;; - 3: len 4; hex 80000063; asc c;; - 4: len 1; hex 01; asc ;; - 5: len 8; hex 8000124a7c1acb8c; asc J| ;; - -*** (2) WAITING FOR THIS LOCK TO BE GRANTED: -RECORD LOCKS space id 0 page no 307 n bits 72 index `PRIMARY` of table `test`.`a` trx id 3404 lock_mode X locks rec but not gap waiting -Record lock, heap no 5 PHYSICAL RECORD: n_fields 6; compact format; info bits 0 - 0: len 4; hex 80000004; asc ;; - 1: len 6; hex 000000003405; asc 4 ;; - 2: len 7; hex 0500000e7017e8; asc p ;; - 3: len 4; hex 80000062; asc b;; - 4: len 1; hex 01; asc ;; - 5: len 8; hex 8000124a7c1acbb6; asc J| ;; - -*** WE ROLL BACK TRANSACTION (2) -END OF INNODB MONITOR OUTPUT -============================ -EOS +my $innodb_status_sample = load_file("t/pt-deadlock-logger/samples/bug_903443.txt"); is_deeply( pt_deadlock_logger::parse_deadlocks($innodb_status_sample), diff --git a/t/pt-deadlock-logger/samples/bug_903443.txt b/t/pt-deadlock-logger/samples/bug_903443.txt new file mode 100644 index 00000000..8b4c0d23 --- /dev/null +++ b/t/pt-deadlock-logger/samples/bug_903443.txt @@ -0,0 +1,53 @@ +===================================== +070915 15:34:37 INNODB MONITOR OUTPUT +===================================== +Per second averages calculated from the last 24 seconds +------------------------ +LATEST DETECTED DEADLOCK +------------------------ +111212 22:52:42 +*** (1) TRANSACTION: +TRANSACTION 3405, ACTIVE 161 sec starting index read +mysql tables in use 1, locked 1 +LOCK WAIT 3 lock struct(s), heap size 376, 3 row lock(s), undo log entries 2 +MySQL thread id 19, OS thread handle 0x7fac301e4700, query id 180 localhost root Updating +update a set movie_id=96 where id =2 +*** (1) WAITING FOR THIS LOCK TO BE GRANTED: +RECORD LOCKS space id 0 page no 307 n bits 72 index `PRIMARY` of table `test`.`a` trx id 3405 lock_mode X locks rec but not gap waiting +Record lock, heap no 3 PHYSICAL RECORD: n_fields 6; compact format; info bits 0 + 0: len 4; hex 80000002; asc ;; + 1: len 6; hex 000000003404; asc 4 ;; + 2: len 7; hex 040000163b2515; asc ;% ;; + 3: len 4; hex 80000063; asc c;; + 4: len 1; hex 01; asc ;; + 5: len 8; hex 8000124a7c1acb8c; asc J| ;; + +*** (2) TRANSACTION: +TRANSACTION 3404, ACTIVE 1026 sec starting index read +mysql tables in use 1, locked 1 +3 lock struct(s), heap size 376, 2 row lock(s), undo log entries 1 +MySQL thread id 18, OS thread handle 0x7fac30225700, query id 181 localhost root Updating +update a set movie_id=98 where id =4 +*** (2) HOLDS THE LOCK(S): +RECORD LOCKS space id 0 page no 307 n bits 72 index `PRIMARY` of table `test`.`a` trx id 3404 lock_mode X locks rec but not gap +Record lock, heap no 3 PHYSICAL RECORD: n_fields 6; compact format; info bits 0 + 0: len 4; hex 80000002; asc ;; + 1: len 6; hex 000000003404; asc 4 ;; + 2: len 7; hex 040000163b2515; asc ;% ;; + 3: len 4; hex 80000063; asc c;; + 4: len 1; hex 01; asc ;; + 5: len 8; hex 8000124a7c1acb8c; asc J| ;; + +*** (2) WAITING FOR THIS LOCK TO BE GRANTED: +RECORD LOCKS space id 0 page no 307 n bits 72 index `PRIMARY` of table `test`.`a` trx id 3404 lock_mode X locks rec but not gap waiting +Record lock, heap no 5 PHYSICAL RECORD: n_fields 6; compact format; info bits 0 + 0: len 4; hex 80000004; asc ;; + 1: len 6; hex 000000003405; asc 4 ;; + 2: len 7; hex 0500000e7017e8; asc p ;; + 3: len 4; hex 80000062; asc b;; + 4: len 1; hex 01; asc ;; + 5: len 8; hex 8000124a7c1acbb6; asc J| ;; + +*** WE ROLL BACK TRANSACTION (2) +END OF INNODB MONITOR OUTPUT +============================