mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 03:21:53 +01:00
branches/zip: More fixes to problems found in speedc test runs.
Before the speedc test was interrupted, 121,765 B-tree pages were written. buf_flush_init_for_writing(): Do not compress other than B-tree pages outside the system tablespace. Report non-B-tree pages. page_zip_decompress(): Clear the unused heap space on the uncompressed page, so that the whole buffer for the uncompressed page will be initialized and page_zip_validate() will always succeed.
This commit is contained in:
parent
941127fd9d
commit
1a1d2cd325
2 changed files with 29 additions and 13 deletions
|
@ -479,17 +479,30 @@ buf_flush_init_for_writing(
|
|||
srv_use_checksums ?
|
||||
buf_calc_page_old_checksum(page) : BUF_NO_CHECKSUM_MAGIC);
|
||||
#if 1 /* testing */
|
||||
if (page_is_comp(page)) {
|
||||
byte zip_data[16384];
|
||||
page_zip_des_t* page_zip = &buf_block_align(page)->page_zip;
|
||||
page_zip->data = zip_data;
|
||||
page_zip->size = sizeof zip_data;
|
||||
page_zip->m_start = page_zip->m_end = 0;
|
||||
ut_a(page_zip_compress(page_zip, page));
|
||||
fprintf(stderr, "zip size==%lu+%lu\n",
|
||||
(ulong) page_zip->m_start,
|
||||
(ulong) 2 * page_dir_get_n_heap(page_zip->data));
|
||||
page_zip->data = NULL;
|
||||
if (space /* skip the system tablespace */
|
||||
&& (page_no & (UNIV_PAGE_SIZE - 1)) /* skip extent descriptors */
|
||||
&& page_is_comp(page) /* skip row_format=redundant pages */) {
|
||||
if (memcmp(page + PAGE_NEW_INFIMUM, "infimum", 8)) {
|
||||
fprintf(stderr, "page %lu:%lu: cannot compress\n",
|
||||
(ulong) space, (ulong) page_no);
|
||||
} else {
|
||||
byte zip_data[16384];
|
||||
page_zip_des_t* page_zip =
|
||||
&buf_block_align(page)->page_zip;
|
||||
page_zip->data = zip_data;
|
||||
page_zip->size = sizeof zip_data;
|
||||
page_zip->m_start = page_zip->m_end = 0;
|
||||
|
||||
ut_a(page_zip_compress(page_zip, page));
|
||||
|
||||
fprintf(stderr, "page %lu:%lu: zip size==%lu+%lu\n",
|
||||
(ulong) space, (ulong) page_no,
|
||||
(ulong) page_zip->m_start,
|
||||
(ulong) 2
|
||||
* page_dir_get_n_heap(page_zip->data));
|
||||
|
||||
page_zip->data = NULL;
|
||||
}
|
||||
}
|
||||
#endif /* testing */
|
||||
}
|
||||
|
|
|
@ -702,6 +702,11 @@ zlib_error:
|
|||
return(FALSE);
|
||||
}
|
||||
|
||||
/* Clear the unused heap space on the uncompressed page. */
|
||||
dst = page_header_get_ptr(page, PAGE_HEAP_TOP);
|
||||
memset(dst, 0, page_dir_get_nth_slot(page,
|
||||
page_dir_get_n_slots(page) - 1) - dst);
|
||||
|
||||
/* The dense directory excludes the infimum and supremum records. */
|
||||
n_dense = page_dir_get_n_heap(page) - 2;
|
||||
|
||||
|
@ -749,10 +754,8 @@ page_zip_validate(
|
|||
page_t* temp_page = buf_frame_alloc();
|
||||
ibool valid;
|
||||
|
||||
#if 0 /* disabled during testing hack in buf0flu.c */
|
||||
ut_ad(buf_block_get_page_zip(buf_block_align((byte*)page))
|
||||
== page_zip);
|
||||
#endif
|
||||
|
||||
valid = page_zip_decompress(&temp_page_zip, temp_page, NULL)
|
||||
&& !memcmp(page, temp_page,
|
||||
|
|
Loading…
Add table
Reference in a new issue