Commit 5d37f4ba authored by heikki's avatar heikki

Fix Bug #20493 : we must prepare prebuilt->trx to point to the trx of this thd before using it

parent f185d666
...@@ -6980,10 +6980,11 @@ ha_innobase::innobase_read_and_init_auto_inc( ...@@ -6980,10 +6980,11 @@ ha_innobase::innobase_read_and_init_auto_inc(
int error; int error;
ut_a(prebuilt); ut_a(prebuilt);
ut_a(prebuilt->trx ==
(trx_t*) current_thd->ha_data[innobase_hton.slot]);
ut_a(prebuilt->table); ut_a(prebuilt->table);
/* Prepare prebuilt->trx in the table handle */
update_thd(current_thd);
if (prebuilt->trx->conc_state == TRX_NOT_STARTED) { if (prebuilt->trx->conc_state == TRX_NOT_STARTED) {
trx_was_not_started = TRUE; trx_was_not_started = TRUE;
} }
...@@ -7118,6 +7119,9 @@ void ha_innobase::get_auto_increment( ...@@ -7118,6 +7119,9 @@ void ha_innobase::get_auto_increment(
longlong nr; longlong nr;
int error; int error;
/* Prepare prebuilt->trx in the table handle */
update_thd(current_thd);
error = innobase_read_and_init_auto_inc(&nr); error = innobase_read_and_init_auto_inc(&nr);
if (error) { if (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