mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-30825 innodb_compression_algorithm=0 (none) increments Innodb_num_pages_page_compression_error
fil_page_compress_low returns 0 for both innodb_compression_algorithm=0 and where there is compression errors. On the two callers to this function, don't increment the compression errors if the algorithm was none. Reviewed by: Marko Mäkelä
This commit is contained in:
@ -0,0 +1,18 @@
|
|||||||
|
#
|
||||||
|
# MDEV-30825 innodb_compression_algorithm=0 (none) increments Innodb_num_pages_page_compression_error
|
||||||
|
#
|
||||||
|
SET @save_compression_algorithm=@@GLOBAL.innodb_compression_algorithm;
|
||||||
|
SET GLOBAL innodb_compression_algorithm=0;
|
||||||
|
SELECT VARIABLE_VALUE INTO @compress_errors FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_num_pages_page_compression_error';
|
||||||
|
CREATE TABLE t (c INT) page_compressed=1 page_compression_level=4 ENGINE=InnoDB;
|
||||||
|
INSERT INTO t VALUES (1);
|
||||||
|
FLUSH TABLES t FOR EXPORT;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
SELECT VARIABLE_VALUE - @compress_errors AS NUMBER_OF_ERRORS FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_num_pages_page_compression_error';
|
||||||
|
NUMBER_OF_ERRORS
|
||||||
|
0
|
||||||
|
DROP TABLE t;
|
||||||
|
SET GLOBAL innodb_compression_algorithm=@save_compression_algorithm;
|
||||||
|
#
|
||||||
|
# End of 10.4 tests
|
||||||
|
#
|
26
mysql-test/suite/innodb/t/innodb-page_compression_none.test
Normal file
26
mysql-test/suite/innodb/t/innodb-page_compression_none.test
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
-- source include/innodb_checksum_algorithm.inc
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-30825 innodb_compression_algorithm=0 (none) increments Innodb_num_pages_page_compression_error
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
SET @save_compression_algorithm=@@GLOBAL.innodb_compression_algorithm;
|
||||||
|
SET GLOBAL innodb_compression_algorithm=0;
|
||||||
|
SELECT VARIABLE_VALUE INTO @compress_errors FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_num_pages_page_compression_error';
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE t (c INT) page_compressed=1 page_compression_level=4 ENGINE=InnoDB;
|
||||||
|
INSERT INTO t VALUES (1);
|
||||||
|
|
||||||
|
FLUSH TABLES t FOR EXPORT;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
SELECT VARIABLE_VALUE - @compress_errors AS NUMBER_OF_ERRORS FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_num_pages_page_compression_error';
|
||||||
|
|
||||||
|
DROP TABLE t;
|
||||||
|
SET GLOBAL innodb_compression_algorithm=@save_compression_algorithm;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.4 tests
|
||||||
|
--echo #
|
||||||
|
|
@ -201,6 +201,7 @@ static ulint fil_page_compress_for_full_crc32(
|
|||||||
bool encrypted)
|
bool encrypted)
|
||||||
{
|
{
|
||||||
ulint comp_level = fsp_flags_get_page_compression_level(flags);
|
ulint comp_level = fsp_flags_get_page_compression_level(flags);
|
||||||
|
ulint comp_algo = fil_space_t::get_compression_algo(flags);
|
||||||
|
|
||||||
if (comp_level == 0) {
|
if (comp_level == 0) {
|
||||||
comp_level = page_zip_level;
|
comp_level = page_zip_level;
|
||||||
@ -209,12 +210,12 @@ static ulint fil_page_compress_for_full_crc32(
|
|||||||
const ulint header_len = FIL_PAGE_COMP_ALGO;
|
const ulint header_len = FIL_PAGE_COMP_ALGO;
|
||||||
|
|
||||||
ulint write_size = fil_page_compress_low(
|
ulint write_size = fil_page_compress_low(
|
||||||
buf, out_buf, header_len,
|
buf, out_buf, header_len, comp_algo, comp_level);
|
||||||
fil_space_t::get_compression_algo(flags), comp_level);
|
|
||||||
|
|
||||||
if (write_size == 0) {
|
if (write_size == 0) {
|
||||||
fail:
|
fail:
|
||||||
srv_stats.pages_page_compression_error.inc();
|
if (comp_algo != PAGE_UNCOMPRESSED)
|
||||||
|
srv_stats.pages_page_compression_error.inc();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,7 +294,8 @@ static ulint fil_page_compress_for_non_full_crc32(
|
|||||||
header_len, comp_algo, comp_level);
|
header_len, comp_algo, comp_level);
|
||||||
|
|
||||||
if (write_size == 0) {
|
if (write_size == 0) {
|
||||||
srv_stats.pages_page_compression_error.inc();
|
if (comp_algo != PAGE_UNCOMPRESSED)
|
||||||
|
srv_stats.pages_page_compression_error.inc();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user