Commit 235843e2 authored by Rich Prohaska's avatar Rich Prohaska

get the cxx/tests/exceptions working. closes #377

git-svn-id: file:///svn/tokudb@2264 c7de825b-a66e-492c-adef-691d508d4ae1
parent 97c5f292
...@@ -49,16 +49,29 @@ void test_env_exceptions (void) { ...@@ -49,16 +49,29 @@ void test_env_exceptions (void) {
} }
{ {
DbEnv env(0); DbEnv env(0);
TC(env.open(".", DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE | DB_INIT_LOG, 0777), 0); TC(env.open(".", DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE | DB_INIT_LOG, 0777), 0);
DbTxn *txn;
TC(env.txn_begin(0, &txn, 0), EINVAL); // not configured for transactions
}
{
DbEnv env(0);
TC(env.open(".", DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE | DB_INIT_LOG | DB_INIT_TXN, 0777), 0);
DbTxn *txn; DbTxn *txn;
TC(env.txn_begin(0, &txn, 0), 0); TC(env.txn_begin(0, &txn, 0), 0);
TC(txn->commit(0), 0); TC(txn->commit(0), 0);
delete txn; delete txn;
} }
{ {
DbEnv env(0); DbEnv env(0);
TC(env.open(".", DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE | DB_INIT_LOG, 0777), 0); TC(env.open(".", DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN, 0777), 0);
DbTxn *txn;
TC(env.txn_begin(0, &txn, 0), 0);
TC(txn->commit(0), 0);
delete txn;
}
{
DbEnv env(0);
TC(env.open(".", DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE | DB_INIT_LOG | DB_INIT_TXN, 0777), 0);
DbTxn *txn; DbTxn *txn;
TC(env.txn_begin(0, &txn, 0), 0); TC(env.txn_begin(0, &txn, 0), 0);
TC(txn->commit(-1), EINVAL); TC(txn->commit(-1), EINVAL);
......
...@@ -889,6 +889,7 @@ static int toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t f ...@@ -889,6 +889,7 @@ static int toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t f
toku_free(result); toku_free(result);
return ENOMEM; return ENOMEM;
} }
memset(result->i, 0, sizeof *result->i);
result->i->parent = stxn; result->i->parent = stxn;
int r; int 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