mirror of
https://github.com/MariaDB/server.git
synced 2026-05-10 17:14:30 +02:00
Remove unused function rec_offs_nth_null().
rec_offs_nth_extern(): Return zero/nonzero instead of FALSE/TRUE. innobase/row/row0upd.c: Normalize the return value of rec_offs_nth_extern() to FALSE/TRUE. Avoid a repeated call to upd_ext_vec_contains().
This commit is contained in:
parent
949112c12a
commit
bcd031271f
3 changed files with 13 additions and 38 deletions
|
|
@ -303,21 +303,12 @@ rec_offs_comp(
|
|||
/* out: TRUE if compact format */
|
||||
const ulint* offsets);/* in: array returned by rec_get_offsets() */
|
||||
/**********************************************************
|
||||
Returns TRUE if the nth field of rec is SQL NULL. */
|
||||
Returns nonzero if the extern bit is set in nth field of rec. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
rec_offs_nth_null(
|
||||
/*==============*/
|
||||
/* out: TRUE if SQL NULL */
|
||||
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
||||
ulint n); /* in: nth field */
|
||||
/**********************************************************
|
||||
Returns TRUE if the extern bit is set in nth field of rec. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
ulint
|
||||
rec_offs_nth_extern(
|
||||
/*================*/
|
||||
/* out: TRUE if externally stored */
|
||||
/* out: nonzero if externally stored */
|
||||
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
||||
ulint n); /* in: nth field */
|
||||
/**********************************************************
|
||||
|
|
|
|||
|
|
@ -939,32 +939,19 @@ rec_offs_comp(
|
|||
}
|
||||
|
||||
/**********************************************************
|
||||
Returns TRUE if the nth field of rec is SQL NULL. */
|
||||
Returns nonzero if the extern bit is set in nth field of rec. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
rec_offs_nth_null(
|
||||
/*==============*/
|
||||
/* out: TRUE if SQL NULL */
|
||||
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
||||
ulint n) /* in: nth field */
|
||||
{
|
||||
ut_ad(rec_offs_validate(NULL, NULL, offsets));
|
||||
ut_ad(n < rec_offs_n_fields(offsets));
|
||||
return((rec_offs_base(offsets)[1 + n] & REC_OFFS_SQL_NULL) != 0);
|
||||
}
|
||||
/**********************************************************
|
||||
Returns TRUE if the extern bit is set in nth field of rec. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
ulint
|
||||
rec_offs_nth_extern(
|
||||
/*================*/
|
||||
/* out: TRUE if externally stored */
|
||||
/* out: nonzero if externally stored */
|
||||
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
||||
ulint n) /* in: nth field */
|
||||
{
|
||||
ut_ad(rec_offs_validate(NULL, NULL, offsets));
|
||||
ut_ad(n < rec_offs_n_fields(offsets));
|
||||
return((rec_offs_base(offsets)[1 + n] & REC_OFFS_EXTERNAL) != 0);
|
||||
return(UNIV_UNLIKELY(rec_offs_base(offsets)[1 + n]
|
||||
& REC_OFFS_EXTERNAL));
|
||||
}
|
||||
|
||||
/**********************************************************
|
||||
|
|
|
|||
|
|
@ -815,9 +815,10 @@ row_upd_build_difference_binary(
|
|||
goto skip_compare;
|
||||
}
|
||||
|
||||
extern_bit = rec_offs_nth_extern(offsets, i);
|
||||
extern_bit = upd_ext_vec_contains(ext_vec, n_ext_vec, i);
|
||||
|
||||
if (extern_bit != upd_ext_vec_contains(ext_vec, n_ext_vec, i)
|
||||
if (UNIV_UNLIKELY(extern_bit ==
|
||||
!rec_offs_nth_extern(offsets, i))
|
||||
|| !dfield_data_is_binary_equal(dfield, len, data)) {
|
||||
|
||||
upd_field = upd_get_nth_field(update, n_diff);
|
||||
|
|
@ -826,12 +827,8 @@ row_upd_build_difference_binary(
|
|||
|
||||
upd_field_set_field_no(upd_field, i, index, trx);
|
||||
|
||||
if (upd_ext_vec_contains(ext_vec, n_ext_vec, i)) {
|
||||
upd_field->extern_storage = TRUE;
|
||||
} else {
|
||||
upd_field->extern_storage = FALSE;
|
||||
}
|
||||
|
||||
upd_field->extern_storage = extern_bit;
|
||||
|
||||
n_diff++;
|
||||
}
|
||||
skip_compare:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue