Commit 6b7c6cb3 authored by marko's avatar marko

branches/zip: Minor cleanup.

trx_t: Change the type of error_info from void* to const dict_index_t*.

trx_get_error_info(): Add const qualifier to trx_t*.  Make this an
inline function.
parent b008bc09
......@@ -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)
......
......@@ -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
......
......@@ -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);
}
......@@ -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. */
......
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