Commit 447416d1 authored by Jan Lindström's avatar Jan Lindström

MDEV-8406: Test failure on encryption.innodb-page_encryption_log_encryption in P7/P8

Used wrong type for encryption_key_id and page_compression_level in
table options. Make explicit casts for calls also.
parent 93198fef
...@@ -11398,12 +11398,12 @@ ha_innobase::check_table_options( ...@@ -11398,12 +11398,12 @@ ha_innobase::check_table_options(
if (encrypt == FIL_SPACE_ENCRYPTION_ON || if (encrypt == FIL_SPACE_ENCRYPTION_ON ||
(encrypt == FIL_SPACE_ENCRYPTION_DEFAULT && srv_encrypt_tables)) { (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( push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN, thd, Sql_condition::WARN_LEVEL_WARN,
HA_WRONG_CREATE_OPTION, HA_WRONG_CREATE_OPTION,
"InnoDB: ENCRYPTION_KEY_ID %lu not available", "InnoDB: ENCRYPTION_KEY_ID %u not available",
options->encryption_key_id (uint)options->encryption_key_id
); );
return "ENCRYPTION_KEY_ID"; return "ENCRYPTION_KEY_ID";
} }
...@@ -11469,7 +11469,7 @@ ha_innobase::create( ...@@ -11469,7 +11469,7 @@ ha_innobase::create(
/* Cache table options */ /* Cache table options */
ha_table_option_struct *options= form->s->option_struct; ha_table_option_struct *options= form->s->option_struct;
fil_encryption_t encrypt = (fil_encryption_t)options->encryption; 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"); DBUG_ENTER("ha_innobase::create");
......
...@@ -60,18 +60,18 @@ struct row_prebuilt_t; ...@@ -60,18 +60,18 @@ struct row_prebuilt_t;
/** Engine specific table options are defined using this struct */ /** Engine specific table options are defined using this struct */
struct ha_table_option_struct struct ha_table_option_struct
{ {
bool page_compressed; /*!< Table is using page compression bool page_compressed; /*!< Table is using page compression
if this option is true. */ if this option is true. */
int page_compression_level; /*!< Table page compression level ulonglong page_compression_level; /*!< Table page compression level
or UNIV_UNSPECIFIED. */ 0-9. */
uint atomic_writes; /*!< Use atomic writes for this uint atomic_writes; /*!< Use atomic writes for this
table if this options is ON or table if this options is ON or
in DEFAULT if in DEFAULT if
srv_use_atomic_writes=1. srv_use_atomic_writes=1.
Atomic writes are not used if Atomic writes are not used if
value OFF.*/ value OFF.*/
uint encryption; /*!< DEFAULT, ON, OFF */ uint encryption; /*!< DEFAULT, ON, OFF */
int encryption_key_id; /*!< encryption key id*/ ulonglong encryption_key_id; /*!< encryption key id */
}; };
......
...@@ -11915,12 +11915,12 @@ ha_innobase::check_table_options( ...@@ -11915,12 +11915,12 @@ ha_innobase::check_table_options(
if (encrypt == FIL_SPACE_ENCRYPTION_ON || if (encrypt == FIL_SPACE_ENCRYPTION_ON ||
(encrypt == FIL_SPACE_ENCRYPTION_DEFAULT && srv_encrypt_tables)) { (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( push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN, thd, Sql_condition::WARN_LEVEL_WARN,
HA_WRONG_CREATE_OPTION, HA_WRONG_CREATE_OPTION,
"InnoDB: ENCRYPTION_KEY_ID %lu not available", "InnoDB: ENCRYPTION_KEY_ID %u not available",
options->encryption_key_id (uint)options->encryption_key_id
); );
return "ENCRYPTION_KEY_ID"; return "ENCRYPTION_KEY_ID";
...@@ -11987,7 +11987,7 @@ ha_innobase::create( ...@@ -11987,7 +11987,7 @@ ha_innobase::create(
/* Cache table options */ /* Cache table options */
ha_table_option_struct *options= form->s->option_struct; ha_table_option_struct *options= form->s->option_struct;
fil_encryption_t encrypt = (fil_encryption_t)options->encryption; 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"); DBUG_ENTER("ha_innobase::create");
......
...@@ -61,18 +61,18 @@ struct row_prebuilt_t; ...@@ -61,18 +61,18 @@ struct row_prebuilt_t;
/** Engine specific table options are defined using this struct */ /** Engine specific table options are defined using this struct */
struct ha_table_option_struct struct ha_table_option_struct
{ {
bool page_compressed; /*!< Table is using page compression bool page_compressed; /*!< Table is using page compression
if this option is true. */ if this option is true. */
int page_compression_level; /*!< Table page compression level ulonglong page_compression_level; /*!< Table page compression level
or UNIV_UNSPECIFIED. */ 0-9. */
uint atomic_writes; /*!< Use atomic writes for this uint atomic_writes; /*!< Use atomic writes for this
table if this options is ON or table if this options is ON or
in DEFAULT if in DEFAULT if
srv_use_atomic_writes=1. srv_use_atomic_writes=1.
Atomic writes are not used if Atomic writes are not used if
value OFF.*/ value OFF.*/
uint encryption; /*!< DEFAULT, ON, OFF */ uint encryption; /*!< DEFAULT, ON, OFF */
int encryption_key_id; /*!< encryption key id */ ulonglong encryption_key_id; /*!< encryption key id */
}; };
/** The class defining a handle to an Innodb table */ /** The class defining a handle to an Innodb table */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment