drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
page0zip.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 2005, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/**************************************************/
25
26#pragma once
27#ifndef page0zip_h
28#define page0zip_h
29
30#ifdef UNIV_MATERIALIZE
31# undef UNIV_INLINE
32# define UNIV_INLINE
33#endif
34
35#include "mtr0types.h"
36#include "page0types.h"
37#include "buf0types.h"
38#include "dict0types.h"
39#include "trx0types.h"
40#include "mem0mem.h"
41
42/**********************************************************************/
45UNIV_INLINE
46ulint
48/*==============*/
49 const page_zip_des_t* page_zip)
50 __attribute__((nonnull, pure));
51/**********************************************************************/
53UNIV_INLINE
54void
56/*==============*/
57 page_zip_des_t* page_zip,
58 ulint size);
59
60#ifndef UNIV_HOTBACKUP
61/**********************************************************************/
64UNIV_INLINE
65ibool
67/*===================*/
68 ulint rec_size,
69 ulint comp,
70 ulint n_fields,
72 ulint zip_size)
73 __attribute__((const));
74
75/**********************************************************************/
78UNIV_INTERN
79ulint
81/*================*/
82 ulint n_fields,
83 ulint zip_size)
84 __attribute__((const));
85#endif /* !UNIV_HOTBACKUP */
86
87/**********************************************************************/
89UNIV_INLINE
90void
92/*==============*/
93 page_zip_des_t* page_zip);
95
96/**********************************************************************/
98UNIV_INTERN
99void
101/*===============*/
102 void* stream,
103 mem_heap_t* heap);
104
105/**********************************************************************/
109UNIV_INTERN
110ibool
112/*==============*/
113 page_zip_des_t* page_zip,
115 const page_t* page,
116 dict_index_t* index,
117 mtr_t* mtr)
118 __attribute__((nonnull(1,2,3)));
119
120/**********************************************************************/
125UNIV_INTERN
126ibool
128/*================*/
129 page_zip_des_t* page_zip,
131 page_t* page,
132 ibool all)
136 __attribute__((nonnull(1,2)));
137
138#ifdef UNIV_DEBUG
139/**********************************************************************/
142UNIV_INLINE
143ibool
144page_zip_simple_validate(
145/*=====================*/
146 const page_zip_des_t* page_zip);
148#endif /* UNIV_DEBUG */
149
150#ifdef UNIV_ZIP_DEBUG
151/**********************************************************************/
154UNIV_INTERN
155ibool
156page_zip_validate_low(
157/*==================*/
158 const page_zip_des_t* page_zip,
159 const page_t* page,
160 ibool sloppy)
162 __attribute__((nonnull));
163/**********************************************************************/
165UNIV_INTERN
166ibool
167page_zip_validate(
168/*==============*/
169 const page_zip_des_t* page_zip,
170 const page_t* page)
171 __attribute__((nonnull));
172#endif /* UNIV_ZIP_DEBUG */
173
174/**********************************************************************/
178UNIV_INLINE
179lint
181/*==================*/
182 const page_zip_des_t* page_zip,
183 ibool is_clust)
184 __attribute__((nonnull, pure));
185
186/**********************************************************************/
189UNIV_INLINE
190ibool
192/*===============*/
193 const page_zip_des_t* page_zip,
194 ibool is_clust,
195 ulint length,
196 ulint create)
198 __attribute__((nonnull, pure));
199
200/**********************************************************************/
203UNIV_INLINE
204void
206/*==================*/
207 page_zip_des_t* page_zip,
208 const byte* str,
209 ulint length,
210 mtr_t* mtr)
211 __attribute__((nonnull(1,2)));
212
213/**********************************************************************/
216UNIV_INTERN
217void
219/*===============*/
220 page_zip_des_t* page_zip,
221 const byte* rec,
222 dict_index_t* index,
223 const ulint* offsets,
224 ulint create)
225 __attribute__((nonnull));
226
227/***********************************************************/
230UNIV_INTERN
231byte*
233/*==========================*/
234 byte* ptr,
235 byte* end_ptr,
236 page_t* page,
237 page_zip_des_t* page_zip);
238
239/**********************************************************************/
242UNIV_INTERN
243void
245/*====================*/
246 page_zip_des_t* page_zip,
247 const byte* rec,
249 dict_index_t* index,
250 const ulint* offsets,
251 ulint n,
252 mtr_t* mtr)
254 __attribute__((nonnull(1,2,3,4)));
255
256/***********************************************************/
259UNIV_INTERN
260byte*
262/*==========================*/
263 byte* ptr,
264 byte* end_ptr,
265 page_t* page,
266 page_zip_des_t* page_zip);
267
268/**********************************************************************/
270UNIV_INTERN
271void
273/*====================*/
274 page_zip_des_t* page_zip,
275 byte* rec,
276 ulint size,
277 ulint ptr,
278 mtr_t* mtr)
279 __attribute__((nonnull(1,2)));
280
281/**********************************************************************/
283UNIV_INTERN
284void
286/*===============================*/
287 page_zip_des_t* page_zip,
288 byte* rec,
289 const ulint* offsets,
290 ulint trx_id_col,
291 trx_id_t trx_id,
292 roll_ptr_t roll_ptr)
293 __attribute__((nonnull));
294
295
296/**********************************************************************/
298UNIV_INTERN
299void
301/*================*/
302 page_zip_des_t* page_zip,
303 const byte* prev_rec,
304 const byte* free_rec,
306 byte* rec);
307
308UNIV_INTERN
309byte*
311/*========================*/
312 byte* ptr,
313 byte* end_ptr,
314 page_t* page,
315 page_zip_des_t* page_zip);
316
317
318/**********************************************************************/
329UNIV_INTERN
330ibool
332/*================*/
333 buf_block_t* block,
337 dict_index_t* index,
338 mtr_t* mtr)
339 __attribute__((nonnull));
340#ifndef UNIV_HOTBACKUP
341/**********************************************************************/
346UNIV_INTERN
347void
349/*===============*/
350 page_zip_des_t* page_zip,
353 page_t* page,
354 const page_zip_des_t* src_zip,
355 const page_t* src,
356 dict_index_t* index,
357 mtr_t* mtr)
358 __attribute__((nonnull));
359#endif /* !UNIV_HOTBACKUP */
360
361/**********************************************************************/
364UNIV_INTERN
365byte*
367/*====================*/
368 byte* ptr,
369 byte* end_ptr,
370 page_t* page,
371 page_zip_des_t* page_zip)
372 __attribute__((nonnull(1,2)));
373
374/**********************************************************************/
377UNIV_INTERN
378ulint
380/*===================*/
381 const void* data,
382 ulint size)
383 __attribute__((nonnull));
384
385#ifndef UNIV_HOTBACKUP
390# define PAGE_ZIP_MATCH(ptr, page_zip) \
391 (buf_frame_get_page_zip(ptr) == (page_zip))
392#else /* !UNIV_HOTBACKUP */
397# define PAGE_ZIP_MATCH(ptr, page_zip) \
398 (page_align(ptr) + UNIV_PAGE_SIZE == (page_zip)->data)
399#endif /* !UNIV_HOTBACKUP */
400
401#ifdef UNIV_MATERIALIZE
402# undef UNIV_INLINE
403# define UNIV_INLINE UNIV_INLINE_ORIGINAL
404#endif
405
406#ifndef UNIV_NONINL
407# include "page0zip.ic"
408#endif
409
410#endif /* page0zip_h */
struct buf_block_struct buf_block_t
Definition buf0types.h:33
struct page_zip_des_struct page_zip_des_t
Definition page0types.h:44
#define page_t
Definition page0types.h:35
UNIV_INTERN byte * page_zip_parse_write_blob_ptr(byte *ptr, byte *end_ptr, page_t *page, page_zip_des_t *page_zip)
Definition page0zip.cc:3561
UNIV_INTERN byte * page_zip_parse_write_header(byte *ptr, byte *end_ptr, page_t *page, page_zip_des_t *page_zip)
Definition page0zip.cc:4306
UNIV_INTERN void page_zip_copy_recs(page_zip_des_t *page_zip, page_t *page, const page_zip_des_t *src_zip, const page_t *src, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull))
Definition page0zip.cc:4496
UNIV_INLINE void page_zip_write_header(page_zip_des_t *page_zip, const byte *str, ulint length, mtr_t *mtr) __attribute__((nonnull(1
UNIV_INTERN void UNIV_INTERN byte * page_zip_parse_write_node_ptr(byte *ptr, byte *end_ptr, page_t *page, page_zip_des_t *page_zip)
Definition page0zip.cc:3704
UNIV_INTERN ulint page_zip_empty_size(ulint n_fields, ulint zip_size) __attribute__((const))
UNIV_INTERN ibool UNIV_INTERN ibool UNIV_INLINE lint page_zip_max_ins_size(const page_zip_des_t *page_zip, ibool is_clust) __attribute__((nonnull
UNIV_INLINE void page_zip_des_init(page_zip_des_t *page_zip)
UNIV_INLINE void page_zip_set_size(page_zip_des_t *page_zip, ulint size)
UNIV_INTERN ibool page_zip_compress(page_zip_des_t *page_zip, const page_t *page, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull(1
UNIV_INTERN byte * page_zip_parse_compress(byte *ptr, byte *end_ptr, page_t *page, page_zip_des_t *page_zip) __attribute__((nonnull(1
UNIV_INTERN ibool page_zip_reorganize(buf_block_t *block, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull))
Definition page0zip.cc:4409
UNIV_INTERN void page_zip_write_node_ptr(page_zip_des_t *page_zip, byte *rec, ulint size, ulint ptr, mtr_t *mtr) __attribute__((nonnull(1
UNIV_INLINE ibool page_zip_rec_needs_ext(ulint rec_size, ulint comp, ulint n_fields, ulint zip_size) __attribute__((const))
UNIV_INTERN void page_zip_set_alloc(void *stream, mem_heap_t *heap)
Definition page0zip.cc:674
UNIV_INTERN void page_zip_write_blob_ptr(page_zip_des_t *page_zip, const byte *rec, dict_index_t *index, const ulint *offsets, ulint n, mtr_t *mtr) __attribute__((nonnull(1
UNIV_INTERN void page_zip_dir_insert(page_zip_des_t *page_zip, const byte *prev_rec, const byte *free_rec, byte *rec)
Definition page0zip.cc:4073
UNIV_INTERN void UNIV_INTERN void page_zip_write_trx_id_and_roll_ptr(page_zip_des_t *page_zip, byte *rec, const ulint *offsets, ulint trx_id_col, trx_id_t trx_id, roll_ptr_t roll_ptr) __attribute__((nonnull))
Definition page0zip.cc:3847
UNIV_INLINE ulint page_zip_get_size(const page_zip_des_t *page_zip) __attribute__((nonnull
UNIV_INLINE void UNIV_INTERN void page_zip_write_rec(page_zip_des_t *page_zip, const byte *rec, dict_index_t *index, const ulint *offsets, ulint create) __attribute__((nonnull))
Definition page0zip.cc:3373
UNIV_INTERN ibool UNIV_INTERN ibool page_zip_decompress(page_zip_des_t *page_zip, page_t *page, ibool all) __attribute__((nonnull(1
UNIV_INLINE ibool page_zip_available(const page_zip_des_t *page_zip, ibool is_clust, ulint length, ulint create) __attribute__((nonnull
UNIV_INTERN byte UNIV_INTERN ulint page_zip_calc_checksum(const void *data, ulint size) __attribute__((nonnull))
Definition page0zip.cc:4650
ib_id_t trx_id_t
Definition trx0types.h:85
ib_id_t roll_ptr_t
Definition trx0types.h:87