mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
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.
This commit is contained in:
parent
b008bc09a7
commit
6b7c6cb398
4 changed files with 19 additions and 19 deletions
|
@ -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. */
|
||||
|
||||
|
|
Loading…
Reference in a new issue