Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. CREATE TABLE `extend_0` (
  2. `id` bigint(20) NOT NULL,
  3. `code` varchar(30) NOT NULL,
  4. `data_key` varchar(50) NOT NULL,
  5. `data_value` varchar(200) NOT NULL,
  6. `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  7. `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  8. `yn` tinyint(3) NOT NULL DEFAULT '1',
  9. PRIMARY KEY (`id`,`create_time`),
  10. UNIQUE KEY `idx_unq_code_data_key` (`code`,`data_key`,`create_time`) USING BTREE,
  11. KEY `idx_code` (`code`) USING BTREE
  12. ) ENGINE=InnoDB;
  13.  
  14. DELETE FROM extend_0 WHERE code = '00226915986' AND yn = 1;
  15.  
  16. INSERT INTO extend_0 (id, code, data_key, data_value, create_time) VALUES (1133296779049299970, '00226915986', 'consignWare', 'food', '2019-05-28 16:59:42.418'), (1133296779049299971, '00226915986', 'productType', '0001,0006', '2019-05-28 16:59:42.418');
  17.  
  18. ------------------------------------------------------------------------------
  19. 2019-05-30 14:48:07 0x7fbb7872c700
  20. *** (1) TRANSACTION:
  21. TRANSACTION 125554670, ACTIVE 0 sec starting index read
  22. mysql tables in use 1, locked 1
  23. LOCK WAIT 2 lock struct(s), heap size 1136, 1 row lock(s)
  24. MySQL thread id 5148727, OS thread handle 140443189679872, query id 6111057236 192.168.162.16 waybill updating
  25. DELETE FROM extend_0 WHERE code = '00226915986' AND yn = 1
  26. *** (1) WAITING FOR THIS LOCK TO BE GRANTED:
  27. RECORD LOCKS space id 77 page no 3145 n bits 360 index idx_unq_code_data_key of table `waybill_0`.`extend_0` trx id 125554670 lock_mode X waiting
  28. Record lock, heap no 285 PHYSICAL RECORD: n_fields 4; compact format; info bits 32
  29. 0: len 15; hex 4a4456433030323236393135393836; asc 00226915986;;
  30. 1: len 11; hex 636f6e7369676e57617265; asc consignWare;;
  31. 2: len 4; hex 5cecf87e; asc ~;;
  32. 3: len 8; hex 911d8ce2e1ddf000; asc ;;
  33.  
  34. *** (2) TRANSACTION:
  35. TRANSACTION 125554668, ACTIVE 0 sec inserting
  36. mysql tables in use 1, locked 1
  37. 5 lock struct(s), heap size 1136, 6 row lock(s), undo log entries 3
  38. MySQL thread id 5148728, OS thread handle 140443156399872, query id 6111057237 192.168.162.16 waybill update
  39. INSERT INTO extend_0 (id, code, data_key, data_value, create_time) VALUES (i-1, '00226915986', 'consignWare', 'food', '2019-05-28 16:59:42.418'), (i, '00226915986', 'productType', '0001,0006', '2019-05-28 16:59:42.418')
  40. *** (2) HOLDS THE LOCK(S):
  41. RECORD LOCKS space id 77 page no 3145 n bits 360 index idx_unq_code_data_key of table `waybill_0`.`extend_0` trx id 125554668 lock_mode X
  42. Record lock, heap no 285 PHYSICAL RECORD: n_fields 4; compact format; info bits 32
  43. 0: len 15; hex 4a4456433030323236393135393836; asc 00226915986;;
  44. 1: len 11; hex 636f6e7369676e57617265; asc consignWare;;
  45. 2: len 4; hex 5cecf87e; asc ~;;
  46. 3: len 8; hex 911d8ce2e1ddf000; asc ;;
  47.  
  48. Record lock, heap no 287 PHYSICAL RECORD: n_fields 4; compact format; info bits 32
  49. 0: len 15; hex 4a4456433030323236393135393836; asc 00226915986;;
  50. 1: len 11; hex 70726f6475637454797065; asc productType;;
  51. 2: len 4; hex 5cecf87e; asc ~;;
  52. 3: len 8; hex 911d8ce2e1ddf020; asc ;;
  53.  
  54. *** (2) WAITING FOR THIS LOCK TO BE GRANTED:
  55. RECORD LOCKS space id 77 page no 3145 n bits 360 index idx_unq_waybill_code_data_key of table `waybill_0`.`extend_0` trx id 125554668 lock_mode X locks gap before rec insert intention waiting
  56. Record lock, heap no 285 PHYSICAL RECORD: n_fields 4; compact format; info bits 32
  57. 0: len 15; hex 4a4456433030323236393135393836; asc JDVC00226915986;;
  58. 1: len 11; hex 636f6e7369676e57617265; asc consignWare;;
  59. 2: len 4; hex 5cecf87e; asc ~;;
  60. 3: len 8; hex 911d8ce2e1ddf000; asc ;;
  61.  
  62. *** WE ROLL BACK TRANSACTION (1)
  63. ------------------------------------------------------------------------------
  64.  
  65. step1: tx1 begin; delete.....;
  66. step2: tx2 begin; delete.....;
  67. step3: tx1 insert....;
  68. step4: tx2 insert....;
  69. step5: tx1 commit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement