You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
862 B

  1. set global innodb_lock_wait_timeout=42;
  2. select @@innodb_lock_wait_timeout;
  3. @@innodb_lock_wait_timeout
  4. 42
  5. set innodb_lock_wait_timeout=1;
  6. select @@innodb_lock_wait_timeout;
  7. @@innodb_lock_wait_timeout
  8. 1
  9. select @@innodb_lock_wait_timeout;
  10. @@innodb_lock_wait_timeout
  11. 42
  12. set global innodb_lock_wait_timeout=347;
  13. select @@innodb_lock_wait_timeout;
  14. @@innodb_lock_wait_timeout
  15. 42
  16. set innodb_lock_wait_timeout=1;
  17. select @@innodb_lock_wait_timeout;
  18. @@innodb_lock_wait_timeout
  19. 1
  20. select @@innodb_lock_wait_timeout;
  21. @@innodb_lock_wait_timeout
  22. 347
  23. create table t1(a int primary key)engine=innodb;
  24. begin;
  25. insert into t1 values(1),(2),(3);
  26. select * from t1 for update;
  27. commit;
  28. a
  29. 1
  30. 2
  31. 3
  32. begin;
  33. insert into t1 values(4);
  34. select * from t1 for update;
  35. commit;
  36. ERROR HY000: Lock wait timeout exceeded; try restarting transaction
  37. drop table t1;
  38. set global innodb_lock_wait_timeout=50;