~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/btr0cur.ic

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
#include "btr0btr.h"
10
10
 
 
11
#ifdef UNIV_DEBUG
11
12
/*************************************************************
12
13
Returns the page cursor component of a tree cursor. */
13
14
UNIV_INLINE
14
15
page_cur_t*
15
16
btr_cur_get_page_cur(
16
17
/*=================*/
17
 
                                /* out: pointer to page cursor component */
 
18
                                        /* out: pointer to page cursor
 
19
                                        component */
 
20
        const btr_cur_t*        cursor) /* in: tree cursor */
 
21
{
 
22
        return(&((btr_cur_t*) cursor)->page_cur);
 
23
}
 
24
#endif /* UNIV_DEBUG */
 
25
/*************************************************************
 
26
Returns the buffer block on which the tree cursor is positioned. */
 
27
UNIV_INLINE
 
28
buf_block_t*
 
29
btr_cur_get_block(
 
30
/*==============*/
 
31
                                /* out: pointer to buffer block */
18
32
        btr_cur_t*      cursor) /* in: tree cursor */
19
33
{
20
 
        return(&(cursor->page_cur));
 
34
        return(page_cur_get_block(btr_cur_get_page_cur(cursor)));
21
35
}
22
36
 
23
37
/*************************************************************
33
47
}
34
48
 
35
49
/*************************************************************
 
50
Returns the compressed page on which the tree cursor is positioned. */
 
51
UNIV_INLINE
 
52
page_zip_des_t*
 
53
btr_cur_get_page_zip(
 
54
/*=================*/
 
55
                                /* out: pointer to compressed page,
 
56
                                or NULL if the page is not compressed */
 
57
        btr_cur_t*      cursor) /* in: tree cursor */
 
58
{
 
59
        return(buf_block_get_page_zip(btr_cur_get_block(cursor)));
 
60
}
 
61
 
 
62
/*************************************************************
36
63
Invalidates a tree cursor by setting record pointer to NULL. */
37
64
UNIV_INLINE
38
65
void
52
79
                                /* out: pointer to page */
53
80
        btr_cur_t*      cursor) /* in: tree cursor */
54
81
{
55
 
        return(buf_frame_align(page_cur_get_rec(&(cursor->page_cur))));
 
82
        return(page_align(page_cur_get_rec(&(cursor->page_cur))));
56
83
}
57
84
 
58
85
/*************************************************************
75
102
/*=============*/
76
103
        dict_index_t*   index,  /* in: index */
77
104
        rec_t*          rec,    /* in: record in tree */
78
 
        btr_cur_t*      cursor) /* in: cursor */
 
105
        buf_block_t*    block,  /* in: buffer block of rec */
 
106
        btr_cur_t*      cursor) /* out: cursor */
79
107
{
80
 
        page_cur_position(rec, btr_cur_get_page_cur(cursor));
 
108
        ut_ad(page_align(rec) == block->frame);
 
109
 
 
110
        page_cur_position(rec, block, btr_cur_get_page_cur(cursor));
81
111
 
82
112
        cursor->index = index;
83
113
}
95
125
{
96
126
        page_t*         page;
97
127
 
98
 
        ut_ad(mtr_memo_contains(mtr, buf_block_align(btr_cur_get_rec(cursor)),
 
128
        ut_ad(mtr_memo_contains(mtr, btr_cur_get_block(cursor),
99
129
                                MTR_MEMO_PAGE_X_FIX));
100
130
 
101
131
        page = btr_cur_get_page(cursor);
110
140
                root page. */
111
141
 
112
142
                return(dict_index_get_page(cursor->index)
113
 
                       != buf_frame_get_page_no(page));
 
143
                       != page_get_page_no(page));
114
144
        }
115
145
 
116
146
        return(FALSE);
131
161
{
132
162
        page_t*         page;
133
163
 
134
 
        ut_ad(mtr_memo_contains(mtr, buf_block_align(btr_cur_get_rec(cursor)),
 
164
        ut_ad(mtr_memo_contains(mtr, btr_cur_get_block(cursor),
135
165
                                MTR_MEMO_PAGE_X_FIX));
136
166
 
137
167
        page = btr_cur_get_page(cursor);
147
177
                compression if this is not the root page. */
148
178
 
149
179
                return(dict_index_get_page(cursor->index)
150
 
                       == buf_frame_get_page_no(page));
 
180
                       == page_get_page_no(page));
151
181
        }
152
182
 
153
183
        return(TRUE);