Commit f7f740d6 authored by Rich Prohaska's avatar Rich Prohaska

Tokutek/mysql56#5 optimize read only transactions

parent b5af450b
......@@ -6168,7 +6168,13 @@ int ha_tokudb::create_txn(THD* thd, tokudb_trx_data* trx) {
(thd_sql_command(thd) != SQLCOM_ALTER_TABLE)) {
/* QQQ We have to start a master transaction */
// DBUG_PRINT("trans", ("starting transaction all "));
if ((error = txn_begin(db_env, NULL, &trx->all, toku_iso_to_txn_flag(toku_iso_level), thd))) {
uint32_t txn_begin_flags = toku_iso_to_txn_flag(toku_iso_level);
#if 50614 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
if (thd_tx_is_read_only(thd)) {
txn_begin_flags |= DB_TXN_READ_ONLY;
}
#endif
if ((error = txn_begin(db_env, NULL, &trx->all, txn_begin_flags, thd))) {
trx->tokudb_lock_count--; // We didn't get the lock
goto cleanup;
}
......
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