status.awk
Upload User: tsgydb
Upload Date: 2007-04-14
Package Size: 10674k
Code Size: 0k
Category:

MySQL

Development Platform:

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. }