Commit 3f3e058f authored by Rich Prohaska's avatar Rich Prohaska

DB-762 create tokudb trx when needed in tokudb::start_stmt

parent 588ff21f
drop table if exists t1,t2;
create table t1 (x int) engine=innodb;
lock table t1 read;
create temporary table t2 (x int) engine=tokudb;
insert into t2 values (1);
unlock tables;
drop table t1, t2;
# test for DB-762 and DB-767
source include/have_tokudb.inc;
source include/have_innodb.inc;
disable_warnings;
drop table if exists t1,t2;
enable_warnings;
create table t1 (x int) engine=innodb;
lock table t1 read;
create temporary table t2 (x int) engine=tokudb;
insert into t2 values (1);
unlock tables;
drop table t1, t2;
......@@ -6227,7 +6227,11 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) {
int error = 0;
tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton);
DBUG_ASSERT(trx);
if (!trx) {
error = create_tokudb_trx_data_instance(&trx);
if (error) { goto cleanup; }
thd_set_ha_data(thd, tokudb_hton, trx);
}
/*
note that trx->stmt may have been already initialized as start_stmt()
......
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