Commit 0ea474c6 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2267], get rid of trx->iso_level, makes life easier

git-svn-id: file:///svn/mysql/tokudb-engine/src@16941 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5f87b259
...@@ -955,7 +955,6 @@ int create_tokudb_trx_data_instance(tokudb_trx_data** out_trx) { ...@@ -955,7 +955,6 @@ int create_tokudb_trx_data_instance(tokudb_trx_data** out_trx) {
error = ENOMEM; error = ENOMEM;
goto cleanup; goto cleanup;
} }
trx->iso_level = hatoku_iso_not_set;
*out_trx = trx; *out_trx = trx;
error = 0; error = 0;
...@@ -4843,10 +4842,6 @@ int ha_tokudb::create_txn(THD* thd, tokudb_trx_data* trx) { ...@@ -4843,10 +4842,6 @@ int ha_tokudb::create_txn(THD* thd, tokudb_trx_data* trx) {
(thd_sql_command(thd) != SQLCOM_ALTER_TABLE)) { (thd_sql_command(thd) != SQLCOM_ALTER_TABLE)) {
/* QQQ We have to start a master transaction */ /* QQQ We have to start a master transaction */
DBUG_PRINT("trans", ("starting transaction all: options: 0x%lx", (ulong) thd->options)); DBUG_PRINT("trans", ("starting transaction all: options: 0x%lx", (ulong) thd->options));
//
// set the isolation level for the tranaction
//
trx->iso_level = toku_iso_level;
if ((error = db_env->txn_begin(db_env, NULL, &trx->all, toku_iso_to_txn_flag(toku_iso_level)))) { if ((error = db_env->txn_begin(db_env, NULL, &trx->all, toku_iso_to_txn_flag(toku_iso_level)))) {
trx->tokudb_lock_count--; // We didn't get the lock trx->tokudb_lock_count--; // We didn't get the lock
goto cleanup; goto cleanup;
...@@ -4864,11 +4859,11 @@ int ha_tokudb::create_txn(THD* thd, tokudb_trx_data* trx) { ...@@ -4864,11 +4859,11 @@ int ha_tokudb::create_txn(THD* thd, tokudb_trx_data* trx) {
} }
} }
u_int32_t txn_begin_flags; u_int32_t txn_begin_flags;
if (trx->iso_level == hatoku_iso_not_set) { if (trx->all == NULL) {
txn_begin_flags = toku_iso_to_txn_flag(toku_iso_level); txn_begin_flags = toku_iso_to_txn_flag(toku_iso_level);
} }
else { else {
txn_begin_flags = toku_iso_to_txn_flag(trx->iso_level); txn_begin_flags = DB_INHERIT_ISOLATION;
} }
if ((error = db_env->txn_begin(db_env, trx->sp_level, &trx->stmt, txn_begin_flags))) { if ((error = db_env->txn_begin(db_env, trx->sp_level, &trx->stmt, txn_begin_flags))) {
/* We leave the possible master transaction open */ /* We leave the possible master transaction open */
......
...@@ -97,7 +97,6 @@ typedef struct st_tokudb_trx_data { ...@@ -97,7 +97,6 @@ typedef struct st_tokudb_trx_data {
DB_TXN *stmt; DB_TXN *stmt;
DB_TXN *sp_level; DB_TXN *sp_level;
uint tokudb_lock_count; uint tokudb_lock_count;
HA_TOKU_ISO_LEVEL iso_level;
tokudb_stmt_progress stmt_progress; tokudb_stmt_progress stmt_progress;
bool checkpoint_lock_taken; bool checkpoint_lock_taken;
} tokudb_trx_data; } tokudb_trx_data;
......
...@@ -450,9 +450,6 @@ static int tokudb_commit(handlerton * hton, THD * thd, bool all) { ...@@ -450,9 +450,6 @@ static int tokudb_commit(handlerton * hton, THD * thd, bool all) {
else if (tokudb_debug & TOKUDB_DEBUG_TXN) { else if (tokudb_debug & TOKUDB_DEBUG_TXN) {
TOKUDB_TRACE("commit0\n"); TOKUDB_TRACE("commit0\n");
} }
if (all) {
trx->iso_level = hatoku_iso_not_set;
}
reset_stmt_progress(&trx->stmt_progress); reset_stmt_progress(&trx->stmt_progress);
TOKUDB_DBUG_RETURN(0); TOKUDB_DBUG_RETURN(0);
} }
...@@ -477,9 +474,6 @@ static int tokudb_rollback(handlerton * hton, THD * thd, bool all) { ...@@ -477,9 +474,6 @@ static int tokudb_rollback(handlerton * hton, THD * thd, bool all) {
TOKUDB_TRACE("abort0\n"); TOKUDB_TRACE("abort0\n");
} }
} }
if (all) {
trx->iso_level = hatoku_iso_not_set;
}
reset_stmt_progress(&trx->stmt_progress); reset_stmt_progress(&trx->stmt_progress);
TOKUDB_DBUG_RETURN(0); TOKUDB_DBUG_RETURN(0);
} }
......
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