mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
get the cxx/tests/exceptions working. closes #377
git-svn-id: file:///svn/tokudb@2264 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
97c5f29219
commit
235843e2ac
2 changed files with 17 additions and 3 deletions
|
@ -49,16 +49,29 @@ void test_env_exceptions (void) {
|
|||
}
|
||||
{
|
||||
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;
|
||||
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, 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;
|
||||
TC(env.txn_begin(0, &txn, 0), 0);
|
||||
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
|
|||
toku_free(result);
|
||||
return ENOMEM;
|
||||
}
|
||||
memset(result->i, 0, sizeof *result->i);
|
||||
result->i->parent = stxn;
|
||||
|
||||
int r;
|
||||
|
|
Loading…
Add table
Reference in a new issue