status.awk
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:0k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. # $Id: status.awk,v 10.2 1999/11/21 18:01:43 bostic Exp $
  2. #
  3. # Read through db_printlog output and list all the transactions encountered
  4. # and whether they commited or aborted.
  5. #
  6. # 1 = started
  7. # 2 = commited
  8. BEGIN {
  9. cur_txn = 0
  10. }
  11. /^[/{
  12. if (status[$5] == 0) {
  13. status[$5] = 1;
  14. txns[cur_txn] = $5;
  15. cur_txn++;
  16. }
  17. }
  18. /txn_regop/ {
  19. status[$5] = 2
  20. }
  21. END {
  22. for (i = 0; i < cur_txn; i++) {
  23. printf("%st%sn",
  24.     txns[i], status[txns[i]] == 1 ? "ABORT" : "COMMIT");
  25. }
  26. }