diff --git a/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result index ff42e975b8d..a43676dcebe 100644 --- a/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result +++ b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result @@ -8,6 +8,8 @@ SET GLOBAL innodb_encrypt_tables = ON; SET GLOBAL innodb_encryption_threads = 4; call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_(crc32|none|innodb)\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"(innodb|none|crc32)\""); SET GLOBAL innodb_checksum_algorithm = innodb; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. SET GLOBAL innodb_default_encryption_key_id=4; SET GLOBAL innodb_checksum_algorithm=crc32; create table tce_crc32(a serial, b blob, index(b(10))) engine=innodb @@ -90,6 +92,8 @@ update tpe_crc32 set b=substr(b,1); ALTER TABLE tp_crc32 IMPORT TABLESPACE; update tp_crc32 set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=innodb; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_crc32 DISCARD TABLESPACE; ALTER TABLE tc_crc32 DISCARD TABLESPACE; ALTER TABLE te_crc32 DISCARD TABLESPACE; @@ -115,6 +119,8 @@ update tpe_crc32 set b=substr(b,1); ALTER TABLE tp_crc32 IMPORT TABLESPACE; update tp_crc32 set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=none; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_crc32 DISCARD TABLESPACE; ALTER TABLE tc_crc32 DISCARD TABLESPACE; ALTER TABLE te_crc32 DISCARD TABLESPACE; @@ -151,6 +157,8 @@ test.tp_crc32 check status OK DROP TABLE tce_crc32, tc_crc32, te_crc32, t_crc32, tpe_crc32, tp_crc32; SET GLOBAL innodb_checksum_algorithm=innodb; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb ROW_FORMAT=COMPRESSED encrypted=yes; create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb @@ -231,6 +239,8 @@ update tpe_innodb set b=substr(b,1); ALTER TABLE tp_innodb IMPORT TABLESPACE; update tp_innodb set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=innodb; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_innodb DISCARD TABLESPACE; ALTER TABLE tc_innodb DISCARD TABLESPACE; ALTER TABLE te_innodb DISCARD TABLESPACE; @@ -256,6 +266,8 @@ update tpe_innodb set b=substr(b,1); ALTER TABLE tp_innodb IMPORT TABLESPACE; update tp_innodb set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=none; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_innodb DISCARD TABLESPACE; ALTER TABLE tc_innodb DISCARD TABLESPACE; ALTER TABLE te_innodb DISCARD TABLESPACE; @@ -292,6 +304,8 @@ test.tp_innodb check status OK DROP TABLE tce_innodb, tc_innodb, te_innodb, t_innodb, tpe_innodb, tp_innodb; SET GLOBAL innodb_checksum_algorithm=none; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. create table tce_none(a serial, b blob, index(b(10))) engine=innodb ROW_FORMAT=COMPRESSED encrypted=yes; create table tc_none(a serial, b blob, index(b(10))) engine=innodb @@ -372,6 +386,8 @@ update tpe_none set b=substr(b,1); ALTER TABLE tp_none IMPORT TABLESPACE; update tp_none set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=innodb; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_none DISCARD TABLESPACE; ALTER TABLE tc_none DISCARD TABLESPACE; ALTER TABLE te_none DISCARD TABLESPACE; @@ -397,6 +413,8 @@ update tpe_none set b=substr(b,1); ALTER TABLE tp_none IMPORT TABLESPACE; update tp_none set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=none; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_none DISCARD TABLESPACE; ALTER TABLE tc_none DISCARD TABLESPACE; ALTER TABLE te_none DISCARD TABLESPACE; diff --git a/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result b/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result index 9c2e95b3c7c..912acb69ab0 100644 --- a/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result @@ -11,18 +11,26 @@ SELECT @@global.innodb_checksum_algorithm; @@global.innodb_checksum_algorithm strict_crc32 SET GLOBAL innodb_checksum_algorithm = 'innodb'; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. SELECT @@global.innodb_checksum_algorithm; @@global.innodb_checksum_algorithm innodb SET GLOBAL innodb_checksum_algorithm = 'strict_innodb'; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. SELECT @@global.innodb_checksum_algorithm; @@global.innodb_checksum_algorithm strict_innodb SET GLOBAL innodb_checksum_algorithm = 'none'; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. SELECT @@global.innodb_checksum_algorithm; @@global.innodb_checksum_algorithm none SET GLOBAL innodb_checksum_algorithm = 'strict_none'; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32 or strict_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. SELECT @@global.innodb_checksum_algorithm; @@global.innodb_checksum_algorithm strict_none diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b0b7a96116a..5074855af64 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3509,6 +3509,11 @@ static int innodb_init_abort() static const char* deprecated_idle_flush_pct = "innodb_idle_flush_pct is DEPRECATED and has no effect."; +static const char* deprecated_innodb_checksum_algorithm + = "Setting innodb_checksum_algorithm to values other than" + " crc32 or strict_crc32 is UNSAFE and DEPRECATED." + " These deprecated values will be disallowed in MariaDB 10.6."; + static ulong innodb_idle_flush_pct; /** If applicable, emit a message that log checksums cannot be disabled. @@ -3537,6 +3542,21 @@ innodb_log_checksums_func_update(THD* thd, bool check) return(check); } +static void innodb_checksum_algorithm_update(THD *thd, st_mysql_sys_var*, + void *, const void *save) +{ + srv_checksum_algorithm= *static_cast(save); + switch (srv_checksum_algorithm) { + case SRV_CHECKSUM_ALGORITHM_CRC32: + case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32: + break; + default: + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + HA_ERR_UNSUPPORTED, + deprecated_innodb_checksum_algorithm); + } +} + /****************************************************************//** Gives the file extension of an InnoDB single-table tablespace. */ static const char* ha_innobase_exts[] = { @@ -3953,9 +3973,16 @@ static int innodb_init_params() if (!innobase_use_checksums) { ib::warn() << "Setting innodb_checksums to OFF is DEPRECATED." - " This option may be removed in future releases. You" - " should set innodb_checksum_algorithm=NONE instead."; + " This option was removed in MariaDB 10.5."; srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_NONE; + } else { + switch (srv_checksum_algorithm) { + case SRV_CHECKSUM_ALGORITHM_CRC32: + case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32: + break; + default: + ib::warn() << deprecated_innodb_checksum_algorithm; + } } innodb_log_checksums = innodb_log_checksums_func_update( @@ -19111,7 +19138,7 @@ static MYSQL_SYSVAR_ENUM(checksum_algorithm, srv_checksum_algorithm, " magic number when reading;" " Files updated when this option is set to crc32 or strict_crc32 will" " not be readable by MariaDB versions older than 10.0.4", - NULL, NULL, SRV_CHECKSUM_ALGORITHM_CRC32, + NULL, innodb_checksum_algorithm_update, SRV_CHECKSUM_ALGORITHM_CRC32, &innodb_checksum_algorithm_typelib); static MYSQL_SYSVAR_BOOL(log_checksums, innodb_log_checksums,