mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
MDEV-23463 fil_page_decompress() debug check wastes 128KiB of stack
fil_page_decompress(): Remove a rather useless debug check.
We should have test coverage for reading page_compressed pages
from files, either due to buffer pool page eviction or due to
server restarts.
A similar check was removed from fil_space_encrypt() in
commit 0b36c27e0c
(MDEV-20307).
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (C) 2013, 2018, MariaDB Corporation.
|
Copyright (C) 2013, 2020, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
the terms of the GNU General Public License as published by the Free Software
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -243,24 +243,12 @@ success:
|
|||||||
/* Set up the actual payload lenght */
|
/* Set up the actual payload lenght */
|
||||||
mach_write_to_2(out_buf+FIL_PAGE_DATA, write_size);
|
mach_write_to_2(out_buf+FIL_PAGE_DATA, write_size);
|
||||||
|
|
||||||
#ifdef UNIV_DEBUG
|
|
||||||
/* Verify */
|
|
||||||
ut_ad(fil_page_is_compressed(out_buf) || fil_page_is_compressed_encrypted(out_buf));
|
ut_ad(fil_page_is_compressed(out_buf) || fil_page_is_compressed_encrypted(out_buf));
|
||||||
ut_ad(mach_read_from_4(out_buf+FIL_PAGE_SPACE_OR_CHKSUM) == BUF_NO_CHECKSUM_MAGIC);
|
ut_ad(mach_read_from_4(out_buf+FIL_PAGE_SPACE_OR_CHKSUM) == BUF_NO_CHECKSUM_MAGIC);
|
||||||
ut_ad(mach_read_from_2(out_buf+FIL_PAGE_DATA) == write_size);
|
ut_ad(mach_read_from_2(out_buf+FIL_PAGE_DATA) == write_size);
|
||||||
ut_ad(mach_read_from_8(out_buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION) == (ulint)comp_method ||
|
ut_ad(mach_read_from_8(out_buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION) == (ulint)comp_method ||
|
||||||
mach_read_from_2(out_buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE) == (ulint)comp_method);
|
mach_read_from_2(out_buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE) == (ulint)comp_method);
|
||||||
|
|
||||||
/* Verify that page can be decompressed */
|
|
||||||
{
|
|
||||||
page_t tmp_buf[UNIV_PAGE_SIZE_MAX];
|
|
||||||
page_t page[UNIV_PAGE_SIZE_MAX];
|
|
||||||
memcpy(page, out_buf, srv_page_size);
|
|
||||||
ut_ad(fil_page_decompress(tmp_buf, page));
|
|
||||||
ut_ad(!buf_page_is_corrupted(false, page, 0, NULL));
|
|
||||||
}
|
|
||||||
#endif /* UNIV_DEBUG */
|
|
||||||
|
|
||||||
write_size+=header_len;
|
write_size+=header_len;
|
||||||
|
|
||||||
if (block_size <= 0) {
|
if (block_size <= 0) {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (C) 2013, 2018, MariaDB Corporation.
|
Copyright (C) 2013, 2020, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
the terms of the GNU General Public License as published by the Free Software
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -243,24 +243,12 @@ success:
|
|||||||
/* Set up the actual payload lenght */
|
/* Set up the actual payload lenght */
|
||||||
mach_write_to_2(out_buf+FIL_PAGE_DATA, write_size);
|
mach_write_to_2(out_buf+FIL_PAGE_DATA, write_size);
|
||||||
|
|
||||||
#ifdef UNIV_DEBUG
|
|
||||||
/* Verify */
|
|
||||||
ut_ad(fil_page_is_compressed(out_buf) || fil_page_is_compressed_encrypted(out_buf));
|
ut_ad(fil_page_is_compressed(out_buf) || fil_page_is_compressed_encrypted(out_buf));
|
||||||
ut_ad(mach_read_from_4(out_buf+FIL_PAGE_SPACE_OR_CHKSUM) == BUF_NO_CHECKSUM_MAGIC);
|
ut_ad(mach_read_from_4(out_buf+FIL_PAGE_SPACE_OR_CHKSUM) == BUF_NO_CHECKSUM_MAGIC);
|
||||||
ut_ad(mach_read_from_2(out_buf+FIL_PAGE_DATA) == write_size);
|
ut_ad(mach_read_from_2(out_buf+FIL_PAGE_DATA) == write_size);
|
||||||
ut_ad(mach_read_from_8(out_buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION) == (ulint)comp_method ||
|
ut_ad(mach_read_from_8(out_buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION) == (ulint)comp_method ||
|
||||||
mach_read_from_2(out_buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE) == (ulint)comp_method);
|
mach_read_from_2(out_buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE) == (ulint)comp_method);
|
||||||
|
|
||||||
/* Verify that page can be decompressed */
|
|
||||||
{
|
|
||||||
page_t tmp_buf[UNIV_PAGE_SIZE_MAX];
|
|
||||||
page_t page[UNIV_PAGE_SIZE_MAX];
|
|
||||||
memcpy(page, out_buf, srv_page_size);
|
|
||||||
ut_ad(fil_page_decompress(tmp_buf, page));
|
|
||||||
ut_ad(!buf_page_is_corrupted(false, page, 0, NULL));
|
|
||||||
}
|
|
||||||
#endif /* UNIV_DEBUG */
|
|
||||||
|
|
||||||
write_size+=header_len;
|
write_size+=header_len;
|
||||||
|
|
||||||
if (block_size <= 0) {
|
if (block_size <= 0) {
|
||||||
|
Reference in New Issue
Block a user