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., 59 Temple
15
Place, Suite 330, Boston, MA 02111-1307 USA
17
*****************************************************************************/
19
/******************************************************
20
Caching of externally stored column prefixes
22
Created September 2006 Marko Makela
23
*******************************************************/
29
#include "row0types.h"
30
#include "data0types.h"
33
/************************************************************************
34
Creates a cache of column prefixes of externally stored columns. */
39
/* out,own: column prefix cache */
40
ulint n_ext, /* in: number of externally stored columns */
41
const ulint* ext, /* in: col_no's of externally stored columns
42
in the InnoDB table object, as reported by
43
dict_col_get_no(); NOT relative to the records
44
in the clustered index */
45
const dtuple_t* tuple, /* in: data tuple containing the field
46
references of the externally stored
47
columns; must be indexed by col_no;
48
the clustered index record must be
49
covered by a lock or a page latch
50
to prevent deletion (rollback or purge). */
51
ulint zip_size,/* compressed page size in bytes, or 0 */
52
mem_heap_t* heap); /* in: heap where created */
54
/************************************************************************
55
Looks up a column prefix of an externally stored column. */
60
/* out: column prefix, or NULL if
61
the column is not stored externally,
62
or pointer to field_ref_zero
63
if the BLOB pointer is unset */
64
const row_ext_t* ext, /* in/out: column prefix cache */
65
ulint i, /* in: index of ext->ext[] */
66
ulint* len); /* out: length of prefix, in bytes,
67
at most REC_MAX_INDEX_COL_LEN */
68
/************************************************************************
69
Looks up a column prefix of an externally stored column. */
74
/* out: column prefix, or NULL if
75
the column is not stored externally,
76
or pointer to field_ref_zero
77
if the BLOB pointer is unset */
78
const row_ext_t* ext, /* in: column prefix cache */
79
ulint col, /* in: column number in the InnoDB
80
table object, as reported by
81
dict_col_get_no(); NOT relative to the
82
records in the clustered index */
83
ulint* len); /* out: length of prefix, in bytes,
84
at most REC_MAX_INDEX_COL_LEN */
86
/* Prefixes of externally stored columns */
87
struct row_ext_struct{
88
ulint n_ext; /* number of externally stored columns */
89
const ulint* ext; /* col_no's of externally stored columns */
90
byte* buf; /* backing store of the column prefix cache */
91
ulint len[1]; /* prefix lengths; 0 if not cached */