~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/row0ext.h

Merge Joe, plus I updated the tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (C) 2006, 2009, Innobase Oy. All Rights Reserved.
4
 
 
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.
8
 
 
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.
12
 
 
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
16
 
 
17
 
*****************************************************************************/
18
 
 
19
 
/**************************************************//**
20
 
@file include/row0ext.h
21
 
Caching of externally stored column prefixes
22
 
 
23
 
Created September 2006 Marko Makela
24
 
*******************************************************/
25
 
 
26
 
#ifndef row0ext_h
27
 
#define row0ext_h
28
 
 
29
 
#include "univ.i"
30
 
#include "row0types.h"
31
 
#include "data0types.h"
32
 
#include "mem0mem.h"
33
 
 
34
 
/********************************************************************//**
35
 
Creates a cache of column prefixes of externally stored columns.
36
 
@return own: column prefix cache */
37
 
UNIV_INTERN
38
 
row_ext_t*
39
 
row_ext_create(
40
 
/*===========*/
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 */
54
 
 
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 */
59
 
UNIV_INLINE
60
 
const byte*
61
 
row_ext_lookup_ith(
62
 
/*===============*/
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 */
71
 
UNIV_INLINE
72
 
const byte*
73
 
row_ext_lookup(
74
 
/*===========*/
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 */
82
 
 
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 */
89
 
};
90
 
 
91
 
#ifndef UNIV_NONINL
92
 
#include "row0ext.ic"
93
 
#endif
94
 
 
95
 
#endif