Commit 98d2ca10 authored by marko's avatar marko

branches/zip: row_ext_lookup_ith(): New function, sliced from

row_ext_lookup().
parent 5de8acee
...@@ -29,6 +29,20 @@ row_ext_create( ...@@ -29,6 +29,20 @@ row_ext_create(
Looks up a column prefix of an externally stored column. */ Looks up a column prefix of an externally stored column. */
UNIV_INLINE UNIV_INLINE
byte* 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( row_ext_lookup(
/*===========*/ /*===========*/
/* out: column prefix, or NULL if /* out: column prefix, or NULL if
......
...@@ -54,25 +54,22 @@ row_ext_create( ...@@ -54,25 +54,22 @@ row_ext_create(
Looks up a column prefix of an externally stored column. */ Looks up a column prefix of an externally stored column. */
UNIV_INLINE UNIV_INLINE
byte* byte*
row_ext_lookup( row_ext_lookup_ith(
/*===========*/ /*===============*/
/* out: column prefix, or NULL if /* out: column prefix, or NULL if
the column is not stored externally */ the column is not stored externally */
row_ext_t* ext, /* in/out: column prefix cache */ row_ext_t* ext, /* in/out: column prefix cache */
ulint col, /* in: column number */ ulint i, /* in: index of ext->ext[] */
const byte* field, /* in: locally stored part of the column */ const byte* field, /* in: locally stored part of the column */
ulint f_len, /* in: length of field, in bytes */ ulint f_len, /* in: length of field, in bytes */
ulint* len) /* out: length of prefix, in bytes, ulint* len) /* out: length of prefix, in bytes,
at most REC_MAX_INDEX_COL_LEN */ at most REC_MAX_INDEX_COL_LEN */
{ {
ulint i;
ut_ad(ext); ut_ad(ext);
ut_ad(field); ut_ad(field);
ut_ad(len); ut_ad(len);
ut_ad(i < ext->n_ext);
for (i = 0; i < ext->n_ext; i++) {
if (col == ext->ext[i]) {
/* Return from the cache if found */ /* Return from the cache if found */
if (ext->len[i]) { if (ext->len[i]) {
*len = ext->len[i]; *len = ext->len[i];
...@@ -82,6 +79,32 @@ row_ext_lookup( ...@@ -82,6 +79,32 @@ row_ext_lookup(
/* Update the cache */ /* Update the cache */
return(row_ext_lookup_low(ext, i, field, f_len, len)); return(row_ext_lookup_low(ext, i, field, f_len, len));
}
/************************************************************************
Looks up a column prefix of an externally stored column. */
UNIV_INLINE
byte*
row_ext_lookup(
/*===========*/
/* out: column prefix, or NULL if
the column is not stored externally */
row_ext_t* ext, /* in/out: column prefix cache */
ulint col, /* in: column number */
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 */
{
ulint i;
ut_ad(ext);
ut_ad(field);
ut_ad(len);
for (i = 0; i < ext->n_ext; i++) {
if (col == ext->ext[i]) {
return(row_ext_lookup_ith(ext, i, field, f_len, len));
} }
} }
......
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