diff options
-rw-r--r-- | include/maria.h | 4 | ||||
-rw-r--r-- | include/my_base.h | 6 | ||||
-rw-r--r-- | mysql-test/r/maria.result | 1 | ||||
-rw-r--r-- | sql/handler.h | 2 | ||||
-rw-r--r-- | storage/maria/ha_maria.cc | 8 | ||||
-rw-r--r-- | storage/maria/ma_static.c | 2 |
6 files changed, 15 insertions, 8 deletions
diff --git a/include/maria.h b/include/maria.h index 8baacfc9c13..6e9ae4d8391 100644 --- a/include/maria.h +++ b/include/maria.h @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* This file should be included when using maria_funktions */ +/* This file should be included when using maria functions */ #ifndef _maria_h #define _maria_h @@ -250,7 +250,7 @@ typedef struct st_maria_columndef /* column information */ extern ulong maria_block_size, maria_checkpoint_frequency; extern ulong maria_concurrent_insert; -extern my_bool maria_flush, maria_single_user; +extern my_bool maria_flush, maria_single_user, maria_page_checksums; extern my_bool maria_delay_key_write; extern my_off_t maria_max_temp_length; extern ulong maria_bulk_insert_tree_size, maria_data_pointer_size; diff --git a/include/my_base.h b/include/my_base.h index 7dfdbe97ba3..2cd259426c2 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -296,8 +296,10 @@ enum ha_base_keytype { #define HA_OPTION_RELIES_ON_SQL_LAYER 512 #define HA_OPTION_NULL_FIELDS 1024 #define HA_OPTION_PAGE_CHECKSUM 2048 -#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */ -#define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */ +#define HA_OPTION_TEMP_COMPRESS_RECORD (1L << 15) /* set by isamchk */ +#define HA_OPTION_READ_ONLY_DATA (1L << 16) /* Set by isamchk */ +#define HA_OPTION_NO_CHECKSUM (1L << 17) +#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18) /* Bits in flag to create() */ diff --git a/mysql-test/r/maria.result b/mysql-test/r/maria.result index 16cde49c1c6..8c462d6206c 100644 --- a/mysql-test/r/maria.result +++ b/mysql-test/r/maria.result @@ -2052,6 +2052,7 @@ maria_checkpoint_interval 30 maria_log_file_size 4294959104 maria_log_purge_type immediate maria_max_sort_file_size 9223372036853727232 +maria_page_checksum ON maria_pagecache_age_threshold 300 maria_pagecache_buffer_size 8384512 maria_pagecache_division_limit 100 diff --git a/sql/handler.h b/sql/handler.h index d2ff337f6f5..edc4ca6e15e 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -237,8 +237,6 @@ #define HA_LEX_CREATE_TMP_TABLE 1 #define HA_LEX_CREATE_IF_NOT_EXISTS 2 #define HA_LEX_CREATE_TABLE_LIKE 4 -#define HA_OPTION_NO_CHECKSUM (1L << 17) -#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18) #define HA_MAX_REC_LENGTH 65535 /* Table caching type */ diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 58d2a837b40..cd13f19d646 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -124,6 +124,10 @@ static MYSQL_SYSVAR_ULONG(checkpoint_interval, checkpoint_interval, " 0 means 'no automatic checkpoints'.", NULL, update_checkpoint_interval, 30, 0, UINT_MAX, 1); +static MYSQL_SYSVAR_BOOL(page_checksum, maria_page_checksums, 0, + "Maintain page checksums (can be overridden per table " + "with PAGE_CHECKSUM clause in CREATE TABLE)", 0, 0, 1); + static MYSQL_SYSVAR_ULONG(log_file_size, log_file_size, PLUGIN_VAR_RQCMDARG, "Limit for transaction log size", @@ -2263,7 +2267,8 @@ int ha_maria::create(const char *name, register TABLE *table_arg, create_flags|= HA_CREATE_CHECKSUM; if (options & HA_OPTION_DELAY_KEY_WRITE) create_flags|= HA_CREATE_DELAY_KEY_WRITE; - if (ha_create_info->page_checksum != HA_CHOICE_NO) + if ((ha_create_info->page_checksum == HA_CHOICE_UNDEF && maria_page_checksums) || + ha_create_info->page_checksum == HA_CHOICE_YES) create_flags|= HA_CREATE_PAGE_CHECKSUM; /* TODO: Check that the following fn_format is really needed */ @@ -2669,6 +2674,7 @@ my_bool ha_maria::register_query_cache_table(THD *thd, char *table_name, static struct st_mysql_sys_var* system_variables[]= { MYSQL_SYSVAR(block_size), MYSQL_SYSVAR(checkpoint_interval), + MYSQL_SYSVAR(page_checksum), MYSQL_SYSVAR(log_file_size), MYSQL_SYSVAR(log_purge_type), MYSQL_SYSVAR(max_sort_file_size), diff --git a/storage/maria/ma_static.c b/storage/maria/ma_static.c index 20c5c999a8f..33f6e9f9fbe 100644 --- a/storage/maria/ma_static.c +++ b/storage/maria/ma_static.c @@ -33,7 +33,7 @@ uchar maria_uuid[MY_UUID_SIZE]; uint maria_quick_table_bits=9; ulong maria_block_size= MARIA_KEY_BLOCK_LENGTH; my_bool maria_flush= 0, maria_single_user= 0; -my_bool maria_delay_key_write= 0; +my_bool maria_delay_key_write= 0, maria_page_checksums= 1; #if defined(THREAD) && !defined(DONT_USE_RW_LOCKS) ulong maria_concurrent_insert= 2; #else |