summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorRasmus Johansson <rasmus@mariadb.com>2016-10-27 23:24:44 +0300
committerRasmus Johansson <rasmus@mariadb.com>2016-11-04 13:33:37 +0200
commitbba224dd53105ca65e0b3ca304e95248363bfa24 (patch)
tree02a6e3dbf00b33d8aab1bfcd2bbf17f5d7482154 /storage
parent0c15d1a6ff0d18da946f050cfeac176387a76112 (diff)
downloadmariadb-git-bba224dd53105ca65e0b3ca304e95248363bfa24.tar.gz
Added server variable compression_default, which if 1/ON sets compression on for all new InnoDB/XtraDB tables by default by setting PAGE_COMPRESSED=1
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc8
-rw-r--r--storage/xtradb/handler/ha_innodb.cc8
2 files changed, 14 insertions, 2 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 30765ddd357..9f781c99920 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -684,6 +684,11 @@ srv_mbr_debug(const byte* data)
static void innodb_remember_check_sysvar_funcs();
mysql_var_check_func check_sysvar_enum;
+// should page compression be used by default for new tables
+static MYSQL_THDVAR_BOOL(compression_default, PLUGIN_VAR_OPCMDARG,
+ "Is compression the default for new tables",
+ NULL, NULL, FALSE);
+
static MYSQL_THDVAR_UINT(default_encryption_key_id, PLUGIN_VAR_RQCMDARG,
"Default encryption key id used for table encryption.",
NULL, NULL,
@@ -701,7 +706,7 @@ ha_create_table_option innodb_table_option_list[]=
{
/* With this option user can enable page compression feature for the
table */
- HA_TOPTION_BOOL("PAGE_COMPRESSED", page_compressed, 0),
+ HA_TOPTION_SYSVAR("PAGE_COMPRESSED", page_compressed, compression_default),
/* With this option user can set zip compression level for page
compression for this table*/
HA_TOPTION_NUMBER("PAGE_COMPRESSION_LEVEL", page_compression_level, 0, 1, 9, 1),
@@ -23810,6 +23815,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(fatal_semaphore_wait_threshold),
/* Table page compression feature */
MYSQL_SYSVAR(use_trim),
+ MYSQL_SYSVAR(compression_default),
MYSQL_SYSVAR(compression_algorithm),
MYSQL_SYSVAR(mtflush_threads),
MYSQL_SYSVAR(use_mtflush),
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 900d520d242..bd02e97b739 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -620,6 +620,11 @@ ib_cb_t innodb_api_cb[] = {
static void innodb_remember_check_sysvar_funcs();
mysql_var_check_func check_sysvar_enum;
+// should page compression be used by default for new tables
+static MYSQL_THDVAR_BOOL(compression_default, PLUGIN_VAR_OPCMDARG,
+ "Is compression the default for new tables",
+ NULL, NULL, FALSE);
+
static MYSQL_THDVAR_UINT(default_encryption_key_id, PLUGIN_VAR_RQCMDARG,
"Default encryption key id used for table encryption.",
NULL, NULL,
@@ -637,7 +642,7 @@ ha_create_table_option innodb_table_option_list[]=
{
/* With this option user can enable page compression feature for the
table */
- HA_TOPTION_BOOL("PAGE_COMPRESSED", page_compressed, 0),
+ HA_TOPTION_BOOL("PAGE_COMPRESSED", page_compressed, compression_default),
/* With this option user can set zip compression level for page
compression for this table*/
HA_TOPTION_NUMBER("PAGE_COMPRESSION_LEVEL", page_compression_level, 0, 1, 9, 1),
@@ -21433,6 +21438,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(fatal_semaphore_wait_threshold),
/* Table page compression feature */
MYSQL_SYSVAR(use_trim),
+ MYSQL_SYSVAR(compression_default),
MYSQL_SYSVAR(compression_algorithm),
MYSQL_SYSVAR(mtflush_threads),
MYSQL_SYSVAR(use_mtflush),