diff --git a/handler/ha_innodb.cc b/handler/ha_innodb.cc index 17e56a94ee2..9270b1b0961 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -5938,12 +5938,12 @@ ha_innobase::info( } if (flag & HA_STATUS_ERRKEY) { - dict_index_t* err_index; + const dict_index_t* err_index; ut_a(prebuilt->trx); ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N); - err_index = (dict_index_t*)trx_get_error_info(prebuilt->trx); + err_index = trx_get_error_info(prebuilt->trx); if (err_index) { errkey = (unsigned int) diff --git a/include/trx0trx.h b/include/trx0trx.h index 4c24e47a4a0..3163a7ed39e 100644 --- a/include/trx0trx.h +++ b/include/trx0trx.h @@ -79,12 +79,12 @@ trx_set_detailed_error_from_file( FILE* file); /* in: file to read message from */ /******************************************************************** Retrieves the error_info field from a trx. */ - -void* +UNIV_INLINE +const dict_index_t* trx_get_error_info( /*===============*/ - /* out: the error info */ - trx_t* trx); /* in: trx object */ + /* out: the error info */ + const trx_t* trx); /* in: trx object */ /******************************************************************** Creates and initializes a transaction object. */ @@ -587,7 +587,7 @@ struct trx_struct{ doing the transaction is allowed to set this field: this is NOT protected by the kernel mutex */ - void* error_info; /* if the error number indicates a + const dict_index_t*error_info; /* if the error number indicates a duplicate key error, a pointer to the problematic index is stored here */ ulint error_key_num; /* if the index creation fails to a diff --git a/include/trx0trx.ic b/include/trx0trx.ic index d562db233e9..4463a14764e 100644 --- a/include/trx0trx.ic +++ b/include/trx0trx.ic @@ -96,3 +96,15 @@ trx_new_rec_locks_contain( return(trx->new_rec_locks[0] == index || trx->new_rec_locks[1] == index); } + +/******************************************************************** +Retrieves the error_info field from a trx. */ +UNIV_INLINE +const dict_index_t* +trx_get_error_info( +/*===============*/ + /* out: the error info */ + const trx_t* trx) /* in: trx object */ +{ + return(trx->error_info); +} diff --git a/trx/trx0trx.c b/trx/trx0trx.c index 58bdf7a681e..062fcfe984a 100644 --- a/trx/trx0trx.c +++ b/trx/trx0trx.c @@ -60,18 +60,6 @@ trx_set_detailed_error_from_file( sizeof(trx->detailed_error)); } -/******************************************************************** -Retrieves the error_info field from a trx. */ - -void* -trx_get_error_info( -/*===============*/ - /* out: the error info */ - trx_t* trx) /* in: trx object */ -{ - return(trx->error_info); -} - /******************************************************************** Creates and initializes a transaction object. */