From c556b9d8176107ba892ac218dd72e35d53e0c4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Fri, 7 Mar 2014 08:20:43 +0200 Subject: [PATCH] Changed so that innodb_compress_index pages means that if true also index pages are compressed if false index pages are not compressed. Fixed small output error when page_compression_level was incorrectly given. --- storage/innobase/handler/ha_innodb.cc | 6 +++--- storage/innobase/os/os0file.cc | 8 +++----- storage/innobase/srv/srv0srv.cc | 2 +- storage/xtradb/handler/ha_innodb.cc | 6 +++--- storage/xtradb/os/os0file.cc | 8 +++----- storage/xtradb/srv/srv0srv.cc | 2 +- 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index a65937d94906b..1273a25a5f5b6 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -9907,7 +9907,7 @@ ha_innobase::check_table_options( HA_WRONG_CREATE_OPTION, "InnoDB: invalid PAGE_COMPRESSION_LEVEL = %lu." " Valid values are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", - create_info->key_block_size); + options->page_compression_level); return "PAGE_COMPRESSION_LEVEL"; } } @@ -16795,8 +16795,8 @@ static MYSQL_SYSVAR_LONG(trim_pct, srv_trim_pct, static MYSQL_SYSVAR_BOOL(compress_index_pages, srv_page_compress_index_pages, PLUGIN_VAR_OPCMDARG, - "Use page compression for only index pages. Default TRUE.", - NULL, NULL, TRUE); + "Use page compression also for index pages. Default FALSE.", + NULL, NULL, FALSE); static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim, PLUGIN_VAR_OPCMDARG, diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 376aa244bc98b..0093dd8e26656 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -4464,14 +4464,12 @@ os_aio_array_reserve_slot( slot->page_compression = page_compression; /* If the space is page compressed and this is write operation - and if either only index pages compression is disabled or - page is index page and only index pages compression is enabled then - we compress the page */ + and either index compression is enabled or page is not a index + page then we compress the page */ if (message1 && type == OS_FILE_WRITE && page_compression && - (srv_page_compress_index_pages == false || - (srv_page_compress_index_pages == true && fil_page_is_index_page(slot->buf)))) { + (srv_page_compress_index_pages == true || !fil_page_is_index_page(slot->buf))) { ulint real_len = len; byte* tmp = NULL; diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 11e6ffd31d314..dcef4a03b7651 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -148,7 +148,7 @@ UNIV_INTERN my_bool srv_use_native_aio = TRUE; /* If this flag is TRUE, then we will use page compression only for index pages */ -UNIV_INTERN my_bool srv_page_compress_index_pages = TRUE; +UNIV_INTERN my_bool srv_page_compress_index_pages = FALSE; UNIV_INTERN long srv_trim_pct = 100; /* If this flag is TRUE, then we will use fallocate(PUCH_HOLE) to the pages */ diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 046fdfa45a99c..fc92cc828f720 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -10420,7 +10420,7 @@ ha_innobase::check_table_options( HA_WRONG_CREATE_OPTION, "InnoDB: invalid PAGE_COMPRESSION_LEVEL = %lu." " Valid values are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", - create_info->key_block_size); + options->page_compression_level); return "PAGE_COMPRESSION_LEVEL"; } } @@ -17949,8 +17949,8 @@ static MYSQL_SYSVAR_UINT(compression_level, page_zip_level, static MYSQL_SYSVAR_BOOL(compress_index_pages, srv_page_compress_index_pages, PLUGIN_VAR_OPCMDARG, - "Use page compression for only index pages. Default TRUE.", - NULL, NULL, TRUE); + "Use page compression also for index pages. Default FALSE.", + NULL, NULL, FALSE); static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim, PLUGIN_VAR_OPCMDARG, diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index 38be419e2adf0..525310025da01 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -4580,14 +4580,12 @@ os_aio_array_reserve_slot( slot->page_compression = page_compression; /* If the space is page compressed and this is write operation - and if either only index pages compression is disabled or - page is index page and only index pages compression is enabled then - we compress the page */ + and either index compression is enabled or page is not a index + page then we compress the page */ if (message1 && type == OS_FILE_WRITE && page_compression && - (srv_page_compress_index_pages == false || - (srv_page_compress_index_pages == true && fil_page_is_index_page(slot->buf)))) { + (srv_page_compress_index_pages == true || !fil_page_is_index_page(slot->buf))) { ulint real_len = len; byte* tmp = NULL; diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc index 5706c354adac2..f1ee459efd795 100644 --- a/storage/xtradb/srv/srv0srv.cc +++ b/storage/xtradb/srv/srv0srv.cc @@ -163,7 +163,7 @@ UNIV_INTERN my_bool srv_use_native_aio = TRUE; /* If this flag is TRUE, then we will use page compression only for index pages */ -UNIV_INTERN my_bool srv_page_compress_index_pages = TRUE; +UNIV_INTERN my_bool srv_page_compress_index_pages = FALSE; UNIV_INTERN long srv_trim_pct = 100; /* Default compression level if page compression is used and no compression level is set for the table*/