MySQL 9.1.0
Source Code Documentation
|
Page Decompression interface. More...
#include <stdarg.h>
#include <sys/types.h>
#include <zlib.h>
#include "btr0btr.h"
#include "mem0mem.h"
#include "page/zipdecompress.h"
#include "page0page.h"
#include "rem0rec.h"
#include "rem0wrec.h"
Macros | |
#define | page_zip_fail(fmt_args) page_zip_fail_func fmt_args |
Wrapper for page_zip_fail_func() More... | |
Functions | |
int | page_zip_fail_func (const char *fmt,...) |
NOTE: The functions in this file should only use functions from other files in library. More... | |
static void * | page_zip_zalloc (void *opaque, uInt items, uInt size) |
Allocate memory for zlib. More... | |
static void | page_zip_free (void *opaque, void *address) |
Deallocate memory for zlib. More... | |
static void | page_zip_fields_free (dict_index_t *index) |
Deallocate the index information initialized by page_zip_fields_decode(). More... | |
void | page_zip_set_alloc (void *stream, mem_heap_t *heap) |
Configure the zlib allocator to use the given memory heap. More... | |
static bool | page_zip_dir_decode (const page_zip_des_t *page_zip, page_t *page, rec_t **recs, ulint n_dense) |
Populate the sparse page directory from the dense directory. More... | |
static dict_index_t * | page_zip_fields_decode (const byte *buf, const byte *end, ulint *trx_id_col, bool is_spatial) |
Read the index information for the compressed page. More... | |
static const byte * | page_zip_apply_log_ext (const dict_index_t *index, rec_t *rec, const ulint *offsets, ulint trx_id_col, const byte *data, const byte *end) |
Apply the modification log to a record containing externally stored columns. More... | |
static const byte * | page_zip_apply_log (const byte *data, ulint size, rec_t **recs, ulint n_dense, ulint trx_id_col, ulint heap_status, dict_index_t *index, ulint *offsets) |
Apply the modification log to an uncompressed page. More... | |
static bool | page_zip_decompress_heap_no (z_stream *d_stream, rec_t *rec, ulint &heap_status) |
Set the heap_no in a record, and skip the fixed-size record header that is not included in the d_stream. More... | |
static bool | page_zip_decompress_node_ptrs (page_zip_des_t *page_zip, z_stream *d_stream, rec_t **recs, ulint n_dense, dict_index_t *index, ulint *offsets, mem_heap_t *heap) |
Decompress the records of a node pointer page. More... | |
static bool | page_zip_decompress_sec (page_zip_des_t *page_zip, z_stream *d_stream, rec_t **recs, ulint n_dense, dict_index_t *index, ulint *offsets) |
Decompress the records of a leaf node of a secondary index. More... | |
static bool | page_zip_set_extra_bytes (const page_zip_des_t *page_zip, page_t *page, ulint info_bits) |
Initialize the REC_N_NEW_EXTRA_BYTES of each record. More... | |
static bool | page_zip_decompress_clust_ext (z_stream *d_stream, const dict_index_t *index, rec_t *rec, const ulint *offsets, ulint trx_id_col) |
Decompress a record of a leaf node of a clustered index that contains externally stored columns. More... | |
static bool | page_zip_decompress_clust (page_zip_des_t *page_zip, z_stream *d_stream, rec_t **recs, ulint n_dense, dict_index_t *index, ulint trx_id_col, ulint *offsets, mem_heap_t *heap) |
Compress the records of a leaf node of a clustered index. More... | |
bool | page_zip_decompress_low (page_zip_des_t *page_zip, page_t *page, bool all) |
Decompress a page. More... | |
Page Decompression interface.
Created June 2005 by Marko Makela
#define page_zip_fail | ( | fmt_args | ) | page_zip_fail_func fmt_args |
Wrapper for page_zip_fail_func()
fmt_args | in: printf(3) format string and arguments |
|
static |
Apply the modification log to an uncompressed page.
Do not copy the fields that are stored separately.
data | in: modification log |
size | in: maximum length of the log, in bytes |
recs | in: dense page directory, sorted by address (indexed by heap_no - PAGE_HEAP_NO_USER_LOW) |
n_dense | in: size of recs[] |
trx_id_col | in: column number of trx_id in the index, or ULINT_UNDEFINED if none |
heap_status | in: heap_no and status bits for the next record to uncompress |
index | in: index of the page |
offsets | in/out: work area for rec_get_offsets_reverse() |
|
static |
Apply the modification log to a record containing externally stored columns.
Do not copy the fields that are stored separately.
[in] | index | index |
[in,out] | rec | record |
[in] | offsets | rec_get_offsets(rec) |
[in] | trx_id_col | position of of DB_TRX_ID |
[in] | data | modification log |
[in] | end | end of modification log |
|
static |
Compress the records of a leaf node of a clustered index.
page_zip | in/out: compressed page |
d_stream | in/out: compressed page stream |
recs | in: dense page directory sorted by address |
n_dense | in: size of recs[] |
index | in: the index of the page |
trx_id_col | index of the trx_id column |
offsets | in/out: temporary offsets |
heap | in: temporary memory heap |
|
static |
Decompress a record of a leaf node of a clustered index that contains externally stored columns.
[in,out] | d_stream | compressed page stream |
[in] | index | index |
[in,out] | rec | record |
[in] | offsets | rec_get_offsets(rec) |
[in] | trx_id_col | position of of DB_TRX_ID |
|
static |
Set the heap_no in a record, and skip the fixed-size record header that is not included in the d_stream.
d_stream | in/out: compressed page stream |
rec | in/out: record |
heap_status | in/out: heap_no and status bits |
bool page_zip_decompress_low | ( | page_zip_des_t * | page_zip, |
page_t * | page, | ||
bool | all | ||
) |
Decompress a page.
NOTE: The functions in this file should only use functions from other files in library.
This function should tolerate errors on the compressed page. Instead of letting assertions fail, it will return false if an inconsistency is detected.
< dense page directory, sorted by address
page_zip | in: data, ssize; out: m_start, m_end, m_nonempty, n_blobs |
page | out: uncompressed page, may be trashed |
all | in: true=decompress the whole page; false=verify but do not copy some page header fields that should not change after page creation |
|
static |
Decompress the records of a node pointer page.
page_zip | in/out: compressed page |
d_stream | in/out: compressed page stream |
recs | in: dense page directory sorted by address |
n_dense | in: size of recs[] |
index | in: the index of the page |
offsets | in/out: temporary offsets |
heap | in: temporary memory heap |
|
static |
Decompress the records of a leaf node of a secondary index.
page_zip | in/out: compressed page |
d_stream | in/out: compressed page stream |
recs | in: dense page directory sorted by address |
n_dense | in: size of recs[] |
index | in: the index of the page |
offsets | in/out: temporary offsets |
|
static |
Populate the sparse page directory from the dense directory.
page_zip | in: dense page directory on compressed page |
page | in: compact page with valid header; out: trailer and sparse page directory filled in |
recs | out: dense page directory sorted by ascending address (and heap_no) |
n_dense | in: number of user records, and size of recs[] |
int page_zip_fail_func | ( | const char * | fmt, |
... | |||
) |
NOTE: The functions in this file should only use functions from other files in library.
The code in this file is used to make a library for external tools. Report a failure to decompress or compress.
fmt | in: printf(3) format string |
... | in: arguments corresponding to fmt |
|
static |
Read the index information for the compressed page.
[in] | buf | index information |
[in] | end | end of buf |
[in] | trx_id_col | NULL for non-leaf pages; for leaf pages, pointer to where to store the position of the trx_id column |
[in] | is_spatial | is spatial index or not |
|
static |
Deallocate the index information initialized by page_zip_fields_decode().
index | in: dummy index to be freed |
|
static |
Deallocate memory for zlib.
opaque | in: memory heap |
address | in: object to free |
void page_zip_set_alloc | ( | void * | stream, |
mem_heap_t * | heap | ||
) |
Configure the zlib allocator to use the given memory heap.
[in,out] | stream | zlib stream |
[in] | heap | Memory heap to use |
|
static |
Initialize the REC_N_NEW_EXTRA_BYTES of each record.
page_zip | in: compressed page |
page | in/out: uncompressed page |
info_bits | in: REC_INFO_MIN_REC_FLAG or 0 |
|
static |
Allocate memory for zlib.
opaque | in/out: memory heap |
items | in: number of items to allocate |
size | in: size of an item in bytes |