1
/*****************************************************************************
3
Copyright (C) 2006, 2009, Innobase Oy. All Rights Reserved.
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
17
*****************************************************************************/
19
/**************************************************//**
20
@file include/row0ext.h
21
Caching of externally stored column prefixes
23
Created September 2006 Marko Makela
24
*******************************************************/
30
#include "row0types.h"
31
#include "data0types.h"
34
/********************************************************************//**
35
Creates a cache of column prefixes of externally stored columns.
36
@return own: column prefix cache */
41
ulint n_ext, /*!< in: number of externally stored columns */
42
const ulint* ext, /*!< in: col_no's of externally stored columns
43
in the InnoDB table object, as reported by
44
dict_col_get_no(); NOT relative to the records
45
in the clustered index */
46
const dtuple_t* tuple, /*!< in: data tuple containing the field
47
references of the externally stored
48
columns; must be indexed by col_no;
49
the clustered index record must be
50
covered by a lock or a page latch
51
to prevent deletion (rollback or purge). */
52
ulint zip_size,/*!< compressed page size in bytes, or 0 */
53
mem_heap_t* heap); /*!< in: heap where created */
55
/********************************************************************//**
56
Looks up a column prefix of an externally stored column.
57
@return column prefix, or NULL if the column is not stored externally,
58
or pointer to field_ref_zero if the BLOB pointer is unset */
63
const row_ext_t* ext, /*!< in/out: column prefix cache */
64
ulint i, /*!< in: index of ext->ext[] */
65
ulint* len); /*!< out: length of prefix, in bytes,
66
at most REC_MAX_INDEX_COL_LEN */
67
/********************************************************************//**
68
Looks up a column prefix of an externally stored column.
69
@return column prefix, or NULL if the column is not stored externally,
70
or pointer to field_ref_zero if the BLOB pointer is unset */
75
const row_ext_t* ext, /*!< in: column prefix cache */
76
ulint col, /*!< in: column number in the InnoDB
77
table object, as reported by
78
dict_col_get_no(); NOT relative to the
79
records in the clustered index */
80
ulint* len); /*!< out: length of prefix, in bytes,
81
at most REC_MAX_INDEX_COL_LEN */
83
/** Prefixes of externally stored columns */
84
struct row_ext_struct{
85
ulint n_ext; /*!< number of externally stored columns */
86
const ulint* ext; /*!< col_no's of externally stored columns */
87
byte* buf; /*!< backing store of the column prefix cache */
88
ulint len[1]; /*!< prefix lengths; 0 if not cached */