diff options
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/fil/fil0crypt.cc | 2 | ||||
-rw-r--r-- | storage/innobase/fil/fil0pagecompress.cc | 10 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 12 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.h | 24 | ||||
-rw-r--r-- | storage/myisam/myisamdef.h | 2 | ||||
-rw-r--r-- | storage/xtradb/fil/fil0crypt.cc | 2 | ||||
-rw-r--r-- | storage/xtradb/fil/fil0pagecompress.cc | 10 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 12 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.h | 24 |
9 files changed, 53 insertions, 45 deletions
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 324c78e9c7c..d5b942a652b 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -2049,7 +2049,7 @@ fil_crypt_complete_rotate_space( fil_space_crypt_t *crypt_data = fil_space_get_crypt_data(space); /* Space might already be dropped */ - if (crypt_data || !crypt_data->inited) { + if (crypt_data != NULL && crypt_data->inited) { mutex_enter(&crypt_data->mutex); /** diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index e508d4733db..ff8541a40a5 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -355,12 +355,16 @@ fil_compress_page( write_size+=header_len; + if (block_size <= 0) { + block_size = 512; + } + + ut_ad(write_size > 0 && block_size > 0); + /* Actual write needs to be alligned on block size */ if (write_size % block_size) { size_t tmp = write_size; -#ifdef UNIV_DEBUG - ut_a(block_size > 0); -#endif + write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size); #ifdef UNIV_DEBUG ut_a(write_size > 0 && ((write_size % block_size) == 0)); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b9b8ecd4916..a01fd8e59ce 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -11398,12 +11398,12 @@ ha_innobase::check_table_options( if (encrypt == FIL_SPACE_ENCRYPTION_ON || (encrypt == FIL_SPACE_ENCRYPTION_DEFAULT && srv_encrypt_tables)) { - if (!encryption_key_id_exists(options->encryption_key_id)) { + if (!encryption_key_id_exists((unsigned int)options->encryption_key_id)) { push_warning_printf( thd, Sql_condition::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, - "InnoDB: ENCRYPTION_KEY_ID %lu not available", - options->encryption_key_id + "InnoDB: ENCRYPTION_KEY_ID %u not available", + (uint)options->encryption_key_id ); return "ENCRYPTION_KEY_ID"; } @@ -11469,7 +11469,7 @@ ha_innobase::create( /* Cache table options */ ha_table_option_struct *options= form->s->option_struct; fil_encryption_t encrypt = (fil_encryption_t)options->encryption; - ulint key_id = options->encryption_key_id; + uint key_id = (uint)options->encryption_key_id; DBUG_ENTER("ha_innobase::create"); @@ -17897,7 +17897,7 @@ innodb_encrypt_tables_update( const void* save) /*!< in: immediate result from check function */ { - fil_crypt_set_encrypt_tables(*static_cast<const uint*>(save)); + fil_crypt_set_encrypt_tables(*static_cast<const ulong*>(save)); } static SHOW_VAR innodb_status_variables_export[]= { @@ -20140,7 +20140,7 @@ innodb_encrypt_tables_validate( if (check_sysvar_enum(thd, var, save, value)) return 1; - long encrypt_tables = *(long*)save; + ulong encrypt_tables = *(ulong*)save; if (encrypt_tables && !encryption_key_id_exists(FIL_DEFAULT_ENCRYPTION_KEY)) { diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index b613053a992..4f4a0b2f999 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -60,18 +60,18 @@ struct row_prebuilt_t; /** Engine specific table options are defined using this struct */ struct ha_table_option_struct { - bool page_compressed; /*!< Table is using page compression - if this option is true. */ - int page_compression_level; /*!< Table page compression level - or UNIV_UNSPECIFIED. */ - uint atomic_writes; /*!< Use atomic writes for this - table if this options is ON or - in DEFAULT if - srv_use_atomic_writes=1. - Atomic writes are not used if - value OFF.*/ - uint encryption; /*!< DEFAULT, ON, OFF */ - int encryption_key_id; /*!< encryption key id*/ + bool page_compressed; /*!< Table is using page compression + if this option is true. */ + ulonglong page_compression_level; /*!< Table page compression level + 0-9. */ + uint atomic_writes; /*!< Use atomic writes for this + table if this options is ON or + in DEFAULT if + srv_use_atomic_writes=1. + Atomic writes are not used if + value OFF.*/ + uint encryption; /*!< DEFAULT, ON, OFF */ + ulonglong encryption_key_id; /*!< encryption key id */ }; diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index 8ca052af4ac..8b48119390a 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -394,7 +394,7 @@ struct st_myisam_info #define PACK_TYPE_SELECTED 1 /* Bits in field->pack_type */ #define PACK_TYPE_SPACE_FIELDS 2 #define PACK_TYPE_ZERO_FILL 4 -#define MI_FOUND_WRONG_KEY 32738 /* Impossible value from ha_key_cmp */ +#define MI_FOUND_WRONG_KEY 0x7FFFFFFF /* Impossible value from ha_key_cmp */ #define MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH/MI_MIN_KEY_BLOCK_LENGTH) #define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer,block_size) (((((key_length)+(data_pointer)+(key_pointer))*4+(key_pointer)+2)/(block_size)+1)*(block_size)) diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index 98a6d0dbf29..a60e55f3de6 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -2049,7 +2049,7 @@ fil_crypt_complete_rotate_space( fil_space_crypt_t *crypt_data = fil_space_get_crypt_data(space); /* Space might already be dropped */ - if (crypt_data || !crypt_data->inited) { + if (crypt_data != NULL && crypt_data->inited) { mutex_enter(&crypt_data->mutex); /** diff --git a/storage/xtradb/fil/fil0pagecompress.cc b/storage/xtradb/fil/fil0pagecompress.cc index e508d4733db..ff8541a40a5 100644 --- a/storage/xtradb/fil/fil0pagecompress.cc +++ b/storage/xtradb/fil/fil0pagecompress.cc @@ -355,12 +355,16 @@ fil_compress_page( write_size+=header_len; + if (block_size <= 0) { + block_size = 512; + } + + ut_ad(write_size > 0 && block_size > 0); + /* Actual write needs to be alligned on block size */ if (write_size % block_size) { size_t tmp = write_size; -#ifdef UNIV_DEBUG - ut_a(block_size > 0); -#endif + write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size); #ifdef UNIV_DEBUG ut_a(write_size > 0 && ((write_size % block_size) == 0)); diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 8ec276dcbc3..b9674f75684 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -11915,12 +11915,12 @@ ha_innobase::check_table_options( if (encrypt == FIL_SPACE_ENCRYPTION_ON || (encrypt == FIL_SPACE_ENCRYPTION_DEFAULT && srv_encrypt_tables)) { - if (!encryption_key_id_exists(options->encryption_key_id)) { + if (!encryption_key_id_exists((unsigned int)options->encryption_key_id)) { push_warning_printf( thd, Sql_condition::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, - "InnoDB: ENCRYPTION_KEY_ID %lu not available", - options->encryption_key_id + "InnoDB: ENCRYPTION_KEY_ID %u not available", + (uint)options->encryption_key_id ); return "ENCRYPTION_KEY_ID"; @@ -11987,7 +11987,7 @@ ha_innobase::create( /* Cache table options */ ha_table_option_struct *options= form->s->option_struct; fil_encryption_t encrypt = (fil_encryption_t)options->encryption; - ulint key_id = options->encryption_key_id; + uint key_id = (uint)options->encryption_key_id; DBUG_ENTER("ha_innobase::create"); @@ -18823,7 +18823,7 @@ innodb_encrypt_tables_update( const void* save) /*!< in: immediate result from check function */ { - fil_crypt_set_encrypt_tables(*static_cast<const uint*>(save)); + fil_crypt_set_encrypt_tables(*static_cast<const ulong*>(save)); } static SHOW_VAR innodb_status_variables_export[]= { @@ -21370,7 +21370,7 @@ innodb_encrypt_tables_validate( if (check_sysvar_enum(thd, var, save, value)) return 1; - long encrypt_tables = *(long*)save; + ulong encrypt_tables = *(ulong*)save; if (encrypt_tables && !encryption_key_id_exists(FIL_DEFAULT_ENCRYPTION_KEY)) { diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h index aadd2fc5bb8..2027a593140 100644 --- a/storage/xtradb/handler/ha_innodb.h +++ b/storage/xtradb/handler/ha_innodb.h @@ -61,18 +61,18 @@ struct row_prebuilt_t; /** Engine specific table options are defined using this struct */ struct ha_table_option_struct { - bool page_compressed; /*!< Table is using page compression - if this option is true. */ - int page_compression_level; /*!< Table page compression level - or UNIV_UNSPECIFIED. */ - uint atomic_writes; /*!< Use atomic writes for this - table if this options is ON or - in DEFAULT if - srv_use_atomic_writes=1. - Atomic writes are not used if - value OFF.*/ - uint encryption; /*!< DEFAULT, ON, OFF */ - int encryption_key_id; /*!< encryption key id */ + bool page_compressed; /*!< Table is using page compression + if this option is true. */ + ulonglong page_compression_level; /*!< Table page compression level + 0-9. */ + uint atomic_writes; /*!< Use atomic writes for this + table if this options is ON or + in DEFAULT if + srv_use_atomic_writes=1. + Atomic writes are not used if + value OFF.*/ + uint encryption; /*!< DEFAULT, ON, OFF */ + ulonglong encryption_key_id; /*!< encryption key id */ }; /** The class defining a handle to an Innodb table */ |