1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-12 08:01:43 +03:00

branches/zip: Try to reorganize the page when compression fails.

page_zip_compress_write_log(): Make static.

page_zip_compress(): Add optional parameter mtr for redo logging.

page_zip_reorganize(): Low-level counterpart of btr_page_reorganize().

page_zip_copy(): Add debug assertions about mtr_memo_contains.

page_cur_insert_rec_low(): Try page_zip_reorganize() and seek to the
new position of insert_rec if it succeeds.

page_copy_rec_list_end(), page_copy_rec_list_start():
Try page_zip_reorganize().

page_move_rec_list_end(): Remove bogus comment.
This commit is contained in:
marko
2006-05-16 14:17:43 +00:00
parent 2779bdc7ff
commit 168fa020f3
6 changed files with 206 additions and 120 deletions

View File

@@ -39,8 +39,9 @@ page_zip_compress(
page_zip_des_t* page_zip,/* in: size; out: data, n_blobs,
m_start, m_end */
const page_t* page, /* in: uncompressed page */
dict_index_t* index) /* in: index of the B-tree node */
__attribute__((warn_unused_result, nonnull));
dict_index_t* index, /* in: index of the B-tree node */
mtr_t* mtr) /* in: mini-transaction, or NULL */
__attribute__((warn_unused_result, nonnull(1,2,3)));
/**************************************************************************
Decompress a page. This function should tolerate errors on the compressed
@@ -268,6 +269,23 @@ page_zip_write_header(
__attribute__((nonnull(1,2)));
/**************************************************************************
Reorganize and compress a page. This is a low-level operation for
compressed pages, to be used when page_zip_compress() fails.
The function btr_page_reorganize() should be preferred whenever possible. */
ibool
page_zip_reorganize(
/*================*/
/* out: TRUE on success, FALSE on failure;
page and page_zip will be left intact
on failure. */
page_zip_des_t* page_zip,/* in: size; out: data, n_blobs,
m_start, m_end */
page_t* page, /* in/out: uncompressed page */
dict_index_t* index, /* in: index of the B-tree node */
mtr_t* mtr) /* in: mini-transaction */
__attribute__((warn_unused_result, nonnull));
/**************************************************************************
Copy a page byte for byte, except for the file page header and trailer. */
void
@@ -281,18 +299,6 @@ page_zip_copy(
mtr_t* mtr) /* in: mini-transaction */
__attribute__((nonnull(1,2,3,4)));
/**************************************************************************
Write a log record of compressing an index page. */
void
page_zip_compress_write_log(
/*========================*/
const page_zip_des_t* page_zip,/* in: compressed page */
const page_t* page, /* in: uncompressed page */
dict_index_t* index, /* in: index of the B-tree node */
mtr_t* mtr) /* in: mini-transaction */
__attribute__((nonnull));
/**************************************************************************
Parses a log record of compressing an index page. */