bdb-deadlock.result
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:1k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. drop table if exists t1,t2;
  2. create table t1 (id integer, x integer) engine=BDB;
  3. create table t2 (id integer, x integer) engine=BDB;
  4. insert into t1 values(0, 0);
  5. insert into t2 values(0, 0);
  6. set autocommit=0;
  7. update t1 set x = 1 where id = 0;
  8. set autocommit=0;
  9. update t2 set x = 1 where id = 0;
  10. select x from t1 where id = 0;
  11. select x from t2 where id = 0;
  12. ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
  13. commit;
  14. x
  15. 1
  16. commit;
  17. select * from t1;
  18. id x
  19. 0 1
  20. select * from t2;
  21. id x
  22. 0 1
  23. commit;
  24. select * from t1;
  25. id x
  26. 0 1
  27. select * from t2;
  28. id x
  29. 0 1
  30. commit;
  31. drop table t1,t2;