Commit 13240984 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4876], small change to toku_txn_begin relating to input flags

git-svn-id: file:///svn/toku/tokudb@44110 c7de825b-a66e-492c-adef-691d508d4ae1
parent 205f8c4c
...@@ -374,40 +374,37 @@ toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t flags) { ...@@ -374,40 +374,37 @@ toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t flags) {
} }
flags &= ~iso_flags; flags &= ~iso_flags;
if (stxn) { switch (iso_flags) {
child_isolation = db_txn_struct_i(stxn)->iso; case (DB_INHERIT_ISOLATION):
} if (stxn) {
else { child_isolation = db_txn_struct_i(stxn)->iso;
switch (iso_flags) { }
case (DB_INHERIT_ISOLATION): else {
if (stxn) { return toku_ydb_do_error(
child_isolation = db_txn_struct_i(stxn)->iso; env,
} EINVAL,
else { "Cannot set DB_INHERIT_ISOLATION when no parent exists\n"
return toku_ydb_do_error( );
env, }
EINVAL, break;
"Cannot set DB_INHERIT_ISOLATION when no parent exists\n" case (DB_READ_COMMITTED):
); child_isolation = TOKU_ISO_READ_COMMITTED;
} break;
break; case (DB_READ_UNCOMMITTED):
case (DB_READ_COMMITTED): child_isolation = TOKU_ISO_READ_UNCOMMITTED;
child_isolation = TOKU_ISO_READ_COMMITTED; break;
break; case (DB_TXN_SNAPSHOT):
case (DB_READ_UNCOMMITTED): child_isolation = TOKU_ISO_SNAPSHOT;
child_isolation = TOKU_ISO_READ_UNCOMMITTED; break;
break; case (DB_SERIALIZABLE):
case (DB_TXN_SNAPSHOT): child_isolation = TOKU_ISO_SERIALIZABLE;
child_isolation = TOKU_ISO_SNAPSHOT; break;
break; case (0):
case (DB_SERIALIZABLE): child_isolation = stxn ? db_txn_struct_i(stxn)->iso : TOKU_ISO_SERIALIZABLE;
case (0): break;
child_isolation = TOKU_ISO_SERIALIZABLE; default:
break; assert(FALSE); // error path is above, so this should not happen
default: break;
assert(FALSE); // error path is above, so this should not happen
break;
}
} }
if (stxn && child_isolation != db_txn_struct_i(stxn)->iso) { if (stxn && child_isolation != db_txn_struct_i(stxn)->iso) {
return toku_ydb_do_error( return toku_ydb_do_error(
......
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