diff options
author | Susan LoVerso <sue@wiredtiger.com> | 2014-07-31 14:22:38 -0400 |
---|---|---|
committer | Susan LoVerso <sue@wiredtiger.com> | 2014-07-31 14:22:38 -0400 |
commit | 865811705171e4b9a4cc6d4fa88aa39dbaa4fc4c (patch) | |
tree | 1d532ae3a2886ee37bc303a88d7a0d34e7b5ffd4 /examples | |
parent | bf16bb16bfa07c31771642ab92fd22653470361a (diff) | |
download | mongo-865811705171e4b9a4cc6d4fa88aa39dbaa4fc4c.tar.gz |
Remove use of prev_txnid from examples.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/c/ex_log.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/c/ex_log.c b/examples/c/ex_log.c index c0daac268d2..76f5c37c91e 100644 --- a/examples/c/ex_log.c +++ b/examples/c/ex_log.c @@ -114,7 +114,7 @@ walk_log(WT_SESSION *session) WT_LSN lsn, lsnsave; WT_ITEM logrec_key, logrec_value; WT_SESSION *session2; - uint64_t prev_txnid, txnid; + uint64_t txnid; uint32_t fileid, opcount, optype, rectype; int first, i, in_txn, ret; @@ -125,7 +125,7 @@ walk_log(WT_SESSION *session) ret = session2->open_cursor(session2, uri, NULL, "raw=true", &cursor2); i = 0; in_txn = 0; - prev_txnid = txnid = 0; + txnid = 0; memset(&lsnsave, 0, sizeof(lsnsave)); while ((ret = cursor->next(cursor)) == 0) { /*! [log cursor get_key] */ @@ -149,7 +149,7 @@ walk_log(WT_SESSION *session) * If we are in a transaction and this is a new one, end * the previous one. */ - if (in_txn && prev_txnid != txnid) { + if (in_txn && (opcount == 0 || opcount == 1)) { ret = session2->commit_transaction(session2, NULL); in_txn = 0; } @@ -166,7 +166,6 @@ walk_log(WT_SESSION *session) NULL); in_txn = 1; } - prev_txnid = txnid; cursor2->set_key(cursor2, &logrec_key); cursor2->set_value(cursor2, &logrec_value); ret = cursor2->insert(cursor2); |