~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2008-10-28 08:36:02 UTC
  • mfrom: (520.4.13 merge-innodb-plugin)
  • Revision ID: brian@tangent.org-20081028083602-0p3zzlhlxr5q2sqo
Merging Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************
 
2
Caching of externally stored column prefixes
 
3
 
 
4
(c) 2006 Innobase Oy
 
5
 
 
6
Created September 2006 Marko Makela
 
7
*******************************************************/
 
8
 
 
9
#ifndef row0ext_h
 
10
#define row0ext_h
 
11
 
 
12
#include "univ.i"
 
13
#include "row0types.h"
 
14
#include "data0types.h"
 
15
#include "mem0mem.h"
 
16
 
 
17
/************************************************************************
 
18
Creates a cache of column prefixes of externally stored columns. */
 
19
UNIV_INTERN
 
20
row_ext_t*
 
21
row_ext_create(
 
22
/*===========*/
 
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
 
26
                                in the InnoDB table object, as reported by
 
27
                                dict_col_get_no(); NOT relative to the records
 
28
                                in the clustered index */
 
29
        const dtuple_t* tuple,  /* in: data tuple containing the field
 
30
                                references of the externally stored
 
31
                                columns; must be indexed by col_no;
 
32
                                the clustered index record must be
 
33
                                covered by a lock or a page latch
 
34
                                to prevent deletion (rollback or purge). */
 
35
        ulint           zip_size,/* compressed page size in bytes, or 0 */
 
36
        mem_heap_t*     heap);  /* in: heap where created */
 
37
 
 
38
/************************************************************************
 
39
Looks up a column prefix of an externally stored column. */
 
40
UNIV_INLINE
 
41
const byte*
 
42
row_ext_lookup_ith(
 
43
/*===============*/
 
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,
 
51
                                        at most REC_MAX_INDEX_COL_LEN */
 
52
/************************************************************************
 
53
Looks up a column prefix of an externally stored column. */
 
54
UNIV_INLINE
 
55
const byte*
 
56
row_ext_lookup(
 
57
/*===========*/
 
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
 
64
                                        table object, as reported by
 
65
                                        dict_col_get_no(); NOT relative to the
 
66
                                        records in the clustered index */
 
67
        ulint*                  len);   /* out: length of prefix, in bytes,
 
68
                                        at most REC_MAX_INDEX_COL_LEN */
 
69
 
 
70
/* Prefixes of externally stored columns */
 
71
struct row_ext_struct{
 
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 */
 
76
};
 
77
 
 
78
#ifndef UNIV_NONINL
 
79
#include "row0ext.ic"
 
80
#endif
 
81
 
 
82
#endif