mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
branches/zip: page_zip_validate(): Replace buf_frame_alloc() with
ut_malloc() to avoid breaking the latching order. page_rec_check(), page_dir_slot_get_rec(): Replace buf_frame_align() with ut_align_down() to avoid assertion failures in page_zip_validate().
This commit is contained in:
parent
1ef8a89c98
commit
5ac7833038
2 changed files with 8 additions and 4 deletions
|
@ -501,7 +501,7 @@ page_rec_check(
|
|||
|
||||
ut_a(rec);
|
||||
|
||||
page = buf_frame_align(rec);
|
||||
page = ut_align_down(rec, UNIV_PAGE_SIZE);
|
||||
|
||||
ut_a(rec <= page_header_get_ptr(page, PAGE_HEAP_TOP));
|
||||
ut_a(rec >= page + PAGE_DATA);
|
||||
|
@ -518,7 +518,7 @@ page_dir_slot_get_rec(
|
|||
/* out: pointer to record */
|
||||
page_dir_slot_t* slot) /* in: directory slot */
|
||||
{
|
||||
return(buf_frame_align(slot) + mach_read_from_2(slot));
|
||||
return(ut_align_down(slot, UNIV_PAGE_SIZE) + mach_read_from_2(slot));
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
|
|
|
@ -1996,6 +1996,7 @@ page_zip_validate(
|
|||
const page_t* page) /* in: uncompressed page */
|
||||
{
|
||||
page_zip_des_t temp_page_zip = *page_zip;
|
||||
byte* temp_page_buf;
|
||||
page_t* temp_page;
|
||||
ibool valid;
|
||||
|
||||
|
@ -2016,7 +2017,10 @@ page_zip_validate(
|
|||
return(TRUE);
|
||||
}
|
||||
|
||||
temp_page = buf_frame_alloc();
|
||||
/* page_zip_decompress() expects the uncompressed page to be
|
||||
UNIV_PAGE_SIZE aligned. */
|
||||
temp_page_buf = ut_malloc(2 * UNIV_PAGE_SIZE);
|
||||
temp_page = ut_align(temp_page_buf, UNIV_PAGE_SIZE);
|
||||
|
||||
valid = page_zip_decompress(&temp_page_zip, temp_page);
|
||||
if (!valid) {
|
||||
|
@ -2052,7 +2056,7 @@ page_zip_validate(
|
|||
}
|
||||
|
||||
func_exit:
|
||||
buf_frame_free(temp_page);
|
||||
ut_free(temp_page_buf);
|
||||
return(valid);
|
||||
}
|
||||
#endif /* UNIV_ZIP_DEBUG */
|
||||
|
|
Loading…
Reference in a new issue