Commit f9c48548 authored by Jimmy Yang's avatar Jimmy Yang

Check in fix for Bug #52814 InnoDB: Use the new ha_data interfaces

rb://290, approved by Sunny
parent d11679c4
...@@ -583,13 +583,13 @@ thd_is_select( ...@@ -583,13 +583,13 @@ thd_is_select(
/************************************************************************ /************************************************************************
Obtain the InnoDB transaction of a MySQL thread. */ Obtain the InnoDB transaction of a MySQL thread. */
inline inline
trx_t*& trx_t*
thd_to_trx( thd_to_trx(
/*=======*/ /*=======*/
/* out: reference to transaction pointer */ /* out: reference to transaction pointer */
THD* thd) /* in: MySQL thread */ THD* thd) /* in: MySQL thread */
{ {
return(*(trx_t**) thd_ha_data(thd, innodb_hton_ptr)); return((trx_t*) thd_get_ha_data(thd, innodb_hton_ptr));
} }
/************************************************************************ /************************************************************************
...@@ -1164,7 +1164,7 @@ check_trx_exists( ...@@ -1164,7 +1164,7 @@ check_trx_exists(
/* out: InnoDB transaction handle */ /* out: InnoDB transaction handle */
THD* thd) /* in: user thread handle */ THD* thd) /* in: user thread handle */
{ {
trx_t*& trx = thd_to_trx(thd); trx_t* trx = thd_to_trx(thd);
ut_ad(thd == current_thd); ut_ad(thd == current_thd);
...@@ -1178,6 +1178,9 @@ check_trx_exists( ...@@ -1178,6 +1178,9 @@ check_trx_exists(
/* Update the info whether we should skip XA steps that eat /* Update the info whether we should skip XA steps that eat
CPU time */ CPU time */
trx->support_xa = THDVAR(thd, support_xa); trx->support_xa = THDVAR(thd, support_xa);
/* We have a new trx, register with the thread handle */
thd_set_ha_data(thd, innodb_hton_ptr, trx);
} else { } else {
if (trx->magic_n != TRX_MAGIC_N) { if (trx->magic_n != TRX_MAGIC_N) {
mem_analyze_corruption(trx); mem_analyze_corruption(trx);
...@@ -2482,6 +2485,9 @@ innobase_close_connection( ...@@ -2482,6 +2485,9 @@ innobase_close_connection(
innobase_rollback_trx(trx); innobase_rollback_trx(trx);
/* Release the lock in thread handler */
thd_set_ha_data(thd, hton, NULL);
thr_local_free(trx->mysql_thread_id); thr_local_free(trx->mysql_thread_id);
trx_free_for_mysql(trx); trx_free_for_mysql(trx);
......
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