mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 22:34:18 +01:00
branches/zip: row_ext_lookup_ith(): New function, sliced from
row_ext_lookup().
This commit is contained in:
parent
685f665b06
commit
06b6f54447
2 changed files with 46 additions and 9 deletions
|
@ -29,6 +29,20 @@ row_ext_create(
|
|||
Looks up a column prefix of an externally stored column. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
row_ext_lookup_ith(
|
||||
/*===============*/
|
||||
/* out: column prefix, or NULL if
|
||||
the column is not stored externally */
|
||||
row_ext_t* ext, /* in/out: column prefix cache */
|
||||
ulint i, /* in: ith element of ext */
|
||||
const byte* field, /* in: locally stored part of the column */
|
||||
ulint f_len, /* in: length of field, in bytes */
|
||||
ulint* len); /* out: length of prefix, in bytes,
|
||||
at most REC_MAX_INDEX_COL_LEN */
|
||||
/************************************************************************
|
||||
Looks up a column prefix of an externally stored column. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
row_ext_lookup(
|
||||
/*===========*/
|
||||
/* out: column prefix, or NULL if
|
||||
|
|
|
@ -50,6 +50,37 @@ row_ext_create(
|
|||
return(ret);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Looks up a column prefix of an externally stored column. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
row_ext_lookup_ith(
|
||||
/*===============*/
|
||||
/* out: column prefix, or NULL if
|
||||
the column is not stored externally */
|
||||
row_ext_t* ext, /* in/out: column prefix cache */
|
||||
ulint i, /* in: index of ext->ext[] */
|
||||
const byte* field, /* in: locally stored part of the column */
|
||||
ulint f_len, /* in: length of field, in bytes */
|
||||
ulint* len) /* out: length of prefix, in bytes,
|
||||
at most REC_MAX_INDEX_COL_LEN */
|
||||
{
|
||||
ut_ad(ext);
|
||||
ut_ad(field);
|
||||
ut_ad(len);
|
||||
ut_ad(i < ext->n_ext);
|
||||
|
||||
/* Return from the cache if found */
|
||||
if (ext->len[i]) {
|
||||
*len = ext->len[i];
|
||||
ut_ad(*len > f_len);
|
||||
return(ext->buf + i * REC_MAX_INDEX_COL_LEN);
|
||||
}
|
||||
|
||||
/* Update the cache */
|
||||
return(row_ext_lookup_low(ext, i, field, f_len, len));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Looks up a column prefix of an externally stored column. */
|
||||
UNIV_INLINE
|
||||
|
@ -73,15 +104,7 @@ row_ext_lookup(
|
|||
|
||||
for (i = 0; i < ext->n_ext; i++) {
|
||||
if (col == ext->ext[i]) {
|
||||
/* Return from the cache if found */
|
||||
if (ext->len[i]) {
|
||||
*len = ext->len[i];
|
||||
ut_ad(*len > f_len);
|
||||
return(ext->buf + i * REC_MAX_INDEX_COL_LEN);
|
||||
}
|
||||
|
||||
/* Update the cache */
|
||||
return(row_ext_lookup_low(ext, i, field, f_len, len));
|
||||
return(row_ext_lookup_ith(ext, i, field, f_len, len));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue