Advertisement
akozhomka

Untitled

Sep 22nd, 2021
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.97 KB | None | 0 0
  1. ------------------------
  2. LATEST DETECTED DEADLOCK
  3. ------------------------
  4. 2021-09-21 18:29:53 0x7f7cacdba700
  5. *** (1) TRANSACTION:
  6. TRANSACTION 83328696162, ACTIVE 12 sec starting index read
  7. mysql tables in use 10, locked 10
  8. LOCK WAIT 7 lock struct(s), heap size 1136, 4 row lock(s), undo log entries 1
  9. MySQL thread id 110531904, OS thread handle 140263243085568, query id 3999163464 localhost 127.0.0.1 yii_doc Sending data
  10. UPDATE fin.fin_in
  11. LEFT JOIN yii_doc.supplier_storage ON NEW.storage_id = yii_doc.supplier_storage.id
  12. LEFT JOIN yii_doc.supplier ON yii_doc.supplier_storage.supplierID = yii_doc.supplier.id
  13. SET
  14. fin.fin_in.kol = NEW.count,
  15. fin.fin_in.cost_price = NEW.in_price_for_1,
  16. fin.fin_in.active_product = NEW.active,
  17. fin.fin_in.postavshik = yii_doc.supplier.short_name,
  18. fin.fin_in.supplier_id = yii_doc.supplier.id,
  19. fin.fin_in.PAY_way = IF (yii_doc.supplier.payment IS NULL, "расчет", "отсрочка"),
  20. fin.fin_in.storage_id = NEW.storage_id,
  21. fin.fin_in.storage_name = IFNULL(yii_doc.supplier_storage.`name`, 'не выбран')
  22. WHERE fin.fin_in.product_id = NEW.id
  23. *** (1) WAITING FOR THIS LOCK TO BE GRANTED:
  24. RECORD LOCKS space id 64685 page no 7 n bits 232 index PRIMARY of table `yii_doc`.`supplier_storage` trx id 83328696162 lock_mode X locks rec but not gap waiting
  25. *** (2) TRANSACTION:
  26. TRANSACTION 421746628952560, ACTIVE 15 sec fetching rows, thread declared inside InnoDB 1673
  27. mysql tables in use 67, locked 67
  28. 199556 lock struct(s), heap size 22847696, 3414401 row lock(s)
  29. MySQL thread id 110531627, OS thread handle 140173452748544, query id 3999157929 localhost 127.0.0.1 yii_doc Sending data
  30. INSERT INTO ppc.recommended
  31. (SELECT
  32.     x.prices_all_id,
  33.     x.GA_ID,
  34.     x.dok_razdel_id,
  35.     x.avg_orders,
  36.     x.stars,
  37.     x.qnt,
  38.     if(x.dok_razdel_id<>y.dok_razdel_id or y.dok_razdel_id is null, @p_num3:=1, @p_num3:=@p_num3+1) product_rank,
  39.     x.razdel_avg_orders,
  40.     x.razdel_products,
  41.     x.razdel_rank
  42. FROM
  43. (SELECT *, (@p_num1:=@p_num1 + 1) AS row_num
  44. FROM
  45. (SELECT
  46.     y.prices_all_id,
  47.     GA_ID,
  48.     y.dok_razdel_id,
  49.     y.avg_orders,
  50.     if(avg( pr.star )>=4,1,0) star,
  51.     avg( pr.star ) stars,
  52.     y.kyiv_5,
  53.     y.qnt,
  54.     r.razdel_avg_orders,
  55.     r.razdel_products,
  56.     r.razdel_rank
  57. FROM
  58.     (
  59.     SELECT
  60.         prices_all_id,
  61.         GA_ID,
  62.         dok_razdel_id,
  63.         if(sum(if(isKyiv=1,avalaible,null))>5,1,null) kyiv_5,
  64.         sum( avalaible ) qnt,
  65.         avg_orders
  66.     FROM
  67.         (
  68.         SELECT
  69.             pa.id prices_all_id,
  70.             dg.GA_ID GA_ID,
  71.             max( dr.id ) dok_razdel_id,
  72.             spa.id,
  73.             ss.isKyiv,
  74.             spa.avalaible,
  75.             count(
  76.             DISTINCT
  77.             IF
  78.                 (
  79.            
  80. *** (2) HOLDS THE LOCK(S):
  81. RECORD LOCKS space id 64685 page no 7 n bits 232 index PRIMARY of table `yii_doc`.`supplier_storage` trx id 421746628952560 lock mode S locks rec but not gap
  82. *** (2) WAITING FOR THIS LOCK TO BE GRANTED:
  83. RECORD LOCKS space id 70016 page no 34725 n bits 264 index PRIMARY of table `yii_doc`.`order_product` trx id 421746628952560 lock mode S locks rec but not gap waiting
  84. *** WE ROLL BACK TRANSACTION (1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement