1
/******************************************************
2
Caching of externally stored column prefixes
6
Created September 2006 Marko Makela
7
*******************************************************/
10
#include "btr0types.h"
12
/************************************************************************
13
Looks up a column prefix of an externally stored column. */
18
/* out: column prefix, or NULL if
19
the column is not stored externally,
20
or pointer to field_ref_zero
21
if the BLOB pointer is unset */
22
const row_ext_t* ext, /* in/out: column prefix cache */
23
ulint i, /* in: index of ext->ext[] */
24
ulint* len) /* out: length of prefix, in bytes,
25
at most REC_MAX_INDEX_COL_LEN */
29
ut_ad(i < ext->n_ext);
33
if (UNIV_UNLIKELY(*len == 0)) {
34
/* The BLOB could not be fetched to the cache. */
35
return(field_ref_zero);
37
return(ext->buf + i * REC_MAX_INDEX_COL_LEN);
41
/************************************************************************
42
Looks up a column prefix of an externally stored column. */
47
/* out: column prefix, or NULL if
48
the column is not stored externally,
49
or pointer to field_ref_zero
50
if the BLOB pointer is unset */
51
const row_ext_t* ext, /* in: column prefix cache */
52
ulint col, /* in: column number in the InnoDB
53
table object, as reported by
54
dict_col_get_no(); NOT relative to the
55
records in the clustered index */
56
ulint* len) /* out: length of prefix, in bytes,
57
at most REC_MAX_INDEX_COL_LEN */
64
for (i = 0; i < ext->n_ext; i++) {
65
if (col == ext->ext[i]) {
66
return(row_ext_lookup_ith(ext, i, len));