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
1
/******************************************************
21
2
Caching of externally stored column prefixes
23
6
Created September 2006 Marko Makela
24
7
*******************************************************/
31
14
#include "data0types.h"
32
15
#include "mem0mem.h"
34
/********************************************************************//**
35
Creates a cache of column prefixes of externally stored columns.
36
@return own: column prefix cache */
17
/************************************************************************
18
Creates a cache of column prefixes of externally stored columns. */
41
ulint n_ext, /*!< in: number of externally stored columns */
42
const ulint* ext, /*!< in: col_no's of externally stored columns
23
/* out,own: column prefix cache */
24
ulint n_ext, /* in: number of externally stored columns */
25
const ulint* ext, /* in: col_no's of externally stored columns
43
26
in the InnoDB table object, as reported by
44
27
dict_col_get_no(); NOT relative to the records
45
28
in the clustered index */
46
const dtuple_t* tuple, /*!< in: data tuple containing the field
29
const dtuple_t* tuple, /* in: data tuple containing the field
47
30
references of the externally stored
48
31
columns; must be indexed by col_no;
49
32
the clustered index record must be
50
33
covered by a lock or a page latch
51
34
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 */
35
ulint zip_size,/* compressed page size in bytes, or 0 */
36
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 */
38
/************************************************************************
39
Looks up a column prefix of an externally stored column. */
61
42
row_ext_lookup_ith(
62
43
/*===============*/
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,
44
/* out: column prefix, or NULL if
45
the column is not stored externally,
46
or pointer to field_ref_zero
47
if the BLOB pointer is unset */
48
const row_ext_t* ext, /* in/out: column prefix cache */
49
ulint i, /* in: index of ext->ext[] */
50
ulint* len); /* out: length of prefix, in bytes,
66
51
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 */
52
/************************************************************************
53
Looks up a column prefix of an externally stored column. */
75
const row_ext_t* ext, /*!< in: column prefix cache */
76
ulint col, /*!< in: column number in the InnoDB
58
/* out: column prefix, or NULL if
59
the column is not stored externally,
60
or pointer to field_ref_zero
61
if the BLOB pointer is unset */
62
const row_ext_t* ext, /* in: column prefix cache */
63
ulint col, /* in: column number in the InnoDB
77
64
table object, as reported by
78
65
dict_col_get_no(); NOT relative to the
79
66
records in the clustered index */
80
ulint* len); /*!< out: length of prefix, in bytes,
67
ulint* len); /* out: length of prefix, in bytes,
81
68
at most REC_MAX_INDEX_COL_LEN */
83
/** Prefixes of externally stored columns */
70
/* Prefixes of externally stored columns */
84
71
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 */
72
ulint n_ext; /* number of externally stored columns */
73
const ulint* ext; /* col_no's of externally stored columns */
74
byte* buf; /* backing store of the column prefix cache */
75
ulint len[1]; /* prefix lengths; 0 if not cached */
91
78
#ifndef UNIV_NONINL