~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Removing global errbuff and cleaning up two remaining instances that referenced it.

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., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
 
16
 
 
17
*****************************************************************************/
 
18
 
 
19
/******************************************************
 
20
Caching of externally stored column prefixes
 
21
 
 
22
Created September 2006 Marko Makela
 
23
*******************************************************/
 
24
 
 
25
#ifndef row0ext_h
 
26
#define row0ext_h
 
27
 
 
28
#include "univ.i"
 
29
#include "row0types.h"
 
30
#include "data0types.h"
 
31
#include "mem0mem.h"
 
32
 
 
33
/************************************************************************
 
34
Creates a cache of column prefixes of externally stored columns. */
 
35
UNIV_INTERN
 
36
row_ext_t*
 
37
row_ext_create(
 
38
/*===========*/
 
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 */
 
53
 
 
54
/************************************************************************
 
55
Looks up a column prefix of an externally stored column. */
 
56
UNIV_INLINE
 
57
const byte*
 
58
row_ext_lookup_ith(
 
59
/*===============*/
 
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. */
 
70
UNIV_INLINE
 
71
const byte*
 
72
row_ext_lookup(
 
73
/*===========*/
 
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 */
 
85
 
 
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 */
 
92
};
 
93
 
 
94
#ifndef UNIV_NONINL
 
95
#include "row0ext.ic"
 
96
#endif
 
97
 
 
98
#endif