summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-04-27 13:35:57 +0300
committerunknown <marko@hundin.mysql.fi>2005-04-27 13:35:57 +0300
commitbcd031271fbfc22e662337386e529185fd434fc5 (patch)
treeb7c37137f44ddb2f9ffb1b6a250581c0970db0d4 /innobase
parent949112c12a2a74555c5049aa8b82cee87660cbb5 (diff)
downloadmariadb-git-bcd031271fbfc22e662337386e529185fd434fc5.tar.gz
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().
Diffstat (limited to 'innobase')
-rw-r--r--innobase/include/rem0rec.h15
-rw-r--r--innobase/include/rem0rec.ic23
-rw-r--r--innobase/row/row0upd.c13
3 files changed, 13 insertions, 38 deletions
diff --git a/innobase/include/rem0rec.h b/innobase/include/rem0rec.h
index bfb43847e39..0e9ab49f363 100644
--- a/innobase/include/rem0rec.h
+++ b/innobase/include/rem0rec.h
@@ -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 */
/**********************************************************
diff --git a/innobase/include/rem0rec.ic b/innobase/include/rem0rec.ic
index 3ada4100bd0..d60fb3b9eda 100644
--- a/innobase/include/rem0rec.ic
+++ b/innobase/include/rem0rec.ic
@@ -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));
}
/**********************************************************
diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c
index c0aa285d7e5..cf2b8db5d32 100644
--- a/innobase/row/row0upd.c
+++ b/innobase/row/row0upd.c
@@ -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: