Commit a69c4b29 authored by Yoni Fogel's avatar Yoni Fogel

Cleaned up test_txn_nested_abort[23].c

git-svn-id: file:///svn/tokudb@5733 c7de825b-a66e-492c-adef-691d508d4ae1
parent 8d8de7dd
...@@ -25,11 +25,11 @@ void test_txn_abort() { ...@@ -25,11 +25,11 @@ void test_txn_abort() {
r = env->open(env, 0, DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_PRIVATE | DB_CREATE, 0777); r = env->open(env, 0, DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_PRIVATE | DB_CREATE, 0777);
CKERR(r); CKERR(r);
DB *db = NULL;
{ {
DB_TXN *txn = 0; DB_TXN *txn = 0;
r = env->txn_begin(env, 0, &txn, 0); CKERR(r); r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
DB *db;
r = db_create(&db, env, 0); CKERR(r); r = db_create(&db, env, 0); CKERR(r);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r); r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, 0777); CKERR(r);
r = txn->commit(txn, 0); CKERR(r); r = txn->commit(txn, 0); CKERR(r);
...@@ -60,7 +60,9 @@ void test_txn_abort() { ...@@ -60,7 +60,9 @@ void test_txn_abort() {
CKERR(r); CKERR(r);
{
/* walk the db, should be empty */ /* walk the db, should be empty */
DB_TXN *txn = 0;
r = env->txn_begin(env, 0, &txn, 0); CKERR(r); r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
DBC *cursor; DBC *cursor;
r = db->cursor(db, txn, &cursor, 0); CKERR(r); r = db->cursor(db, txn, &cursor, 0); CKERR(r);
...@@ -70,6 +72,7 @@ void test_txn_abort() { ...@@ -70,6 +72,7 @@ void test_txn_abort() {
CKERR2(r, DB_NOTFOUND); CKERR2(r, DB_NOTFOUND);
r = cursor->c_close(cursor); CKERR(r); r = cursor->c_close(cursor); CKERR(r);
r = txn->commit(txn, 0); r = txn->commit(txn, 0);
}
r = db->close(db, 0); CKERR(r); r = db->close(db, 0); CKERR(r);
r = env->close(env, 0); CKERR(r); r = env->close(env, 0); CKERR(r);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment