Commit 1ea6ac3c authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.3 into 10.4

parents 2c3014e8 08e8ad7c
...@@ -2338,5 +2338,12 @@ count(*) ...@@ -2338,5 +2338,12 @@ count(*)
2 2
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-24868 Server crashes in optimize_schema_tables_memory_usage after select from information_schema.innodb_sys_columns
#
create table t1 ( name varchar(64) character set utf8, len int);
select * from t1 where (name, len) in (select name, len from information_schema.innodb_sys_columns having len = 8);
name len
drop table t1;
#
# End of 10.3 tests # End of 10.3 tests
# #
...@@ -2045,6 +2045,14 @@ INSERT INTO t1 VALUES ('2012-12-12'),('2021-11-11'); ...@@ -2045,6 +2045,14 @@ INSERT INTO t1 VALUES ('2012-12-12'),('2021-11-11');
SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.ROUTINES) ON (t1b.a IS NULL); SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.ROUTINES) ON (t1b.a IS NULL);
SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.PROFILING) ON (t1b.a IS NULL); SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.PROFILING) ON (t1b.a IS NULL);
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-24868 Server crashes in optimize_schema_tables_memory_usage after select from information_schema.innodb_sys_columns
--echo #
create table t1 ( name varchar(64) character set utf8, len int);
select * from t1 where (name, len) in (select name, len from information_schema.innodb_sys_columns having len = 8);
drop table t1;
--echo # --echo #
--echo # End of 10.3 tests --echo # End of 10.3 tests
--echo # --echo #
...@@ -8,6 +8,8 @@ SET GLOBAL innodb_encrypt_tables = ON; ...@@ -8,6 +8,8 @@ SET GLOBAL innodb_encrypt_tables = ON;
SET GLOBAL innodb_encryption_threads = 4; 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)\""); 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; SET GLOBAL innodb_checksum_algorithm = innodb;
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_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_default_encryption_key_id=4;
SET GLOBAL innodb_checksum_algorithm=crc32; SET GLOBAL innodb_checksum_algorithm=crc32;
create table tce_crc32(a serial, b blob, index(b(10))) engine=innodb 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); ...@@ -90,6 +92,8 @@ update tpe_crc32 set b=substr(b,1);
ALTER TABLE tp_crc32 IMPORT TABLESPACE; ALTER TABLE tp_crc32 IMPORT TABLESPACE;
update tp_crc32 set b=substr(b,1); update tp_crc32 set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=innodb; SET GLOBAL innodb_checksum_algorithm=innodb;
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
ALTER TABLE tce_crc32 DISCARD TABLESPACE; ALTER TABLE tce_crc32 DISCARD TABLESPACE;
ALTER TABLE tc_crc32 DISCARD TABLESPACE; ALTER TABLE tc_crc32 DISCARD TABLESPACE;
ALTER TABLE te_crc32 DISCARD TABLESPACE; ALTER TABLE te_crc32 DISCARD TABLESPACE;
...@@ -115,6 +119,8 @@ update tpe_crc32 set b=substr(b,1); ...@@ -115,6 +119,8 @@ update tpe_crc32 set b=substr(b,1);
ALTER TABLE tp_crc32 IMPORT TABLESPACE; ALTER TABLE tp_crc32 IMPORT TABLESPACE;
update tp_crc32 set b=substr(b,1); update tp_crc32 set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=none; SET GLOBAL innodb_checksum_algorithm=none;
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
ALTER TABLE tce_crc32 DISCARD TABLESPACE; ALTER TABLE tce_crc32 DISCARD TABLESPACE;
ALTER TABLE tc_crc32 DISCARD TABLESPACE; ALTER TABLE tc_crc32 DISCARD TABLESPACE;
ALTER TABLE te_crc32 DISCARD TABLESPACE; ALTER TABLE te_crc32 DISCARD TABLESPACE;
...@@ -151,6 +157,8 @@ test.tp_crc32 check status OK ...@@ -151,6 +157,8 @@ test.tp_crc32 check status OK
DROP TABLE tce_crc32, tc_crc32, te_crc32, DROP TABLE tce_crc32, tc_crc32, te_crc32,
t_crc32, tpe_crc32, tp_crc32; t_crc32, tpe_crc32, tp_crc32;
SET GLOBAL innodb_checksum_algorithm=innodb; SET GLOBAL innodb_checksum_algorithm=innodb;
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_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 create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb
ROW_FORMAT=COMPRESSED encrypted=yes; ROW_FORMAT=COMPRESSED encrypted=yes;
create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb 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); ...@@ -231,6 +239,8 @@ update tpe_innodb set b=substr(b,1);
ALTER TABLE tp_innodb IMPORT TABLESPACE; ALTER TABLE tp_innodb IMPORT TABLESPACE;
update tp_innodb set b=substr(b,1); update tp_innodb set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=innodb; SET GLOBAL innodb_checksum_algorithm=innodb;
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
ALTER TABLE tce_innodb DISCARD TABLESPACE; ALTER TABLE tce_innodb DISCARD TABLESPACE;
ALTER TABLE tc_innodb DISCARD TABLESPACE; ALTER TABLE tc_innodb DISCARD TABLESPACE;
ALTER TABLE te_innodb DISCARD TABLESPACE; ALTER TABLE te_innodb DISCARD TABLESPACE;
...@@ -256,6 +266,8 @@ update tpe_innodb set b=substr(b,1); ...@@ -256,6 +266,8 @@ update tpe_innodb set b=substr(b,1);
ALTER TABLE tp_innodb IMPORT TABLESPACE; ALTER TABLE tp_innodb IMPORT TABLESPACE;
update tp_innodb set b=substr(b,1); update tp_innodb set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=none; SET GLOBAL innodb_checksum_algorithm=none;
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
ALTER TABLE tce_innodb DISCARD TABLESPACE; ALTER TABLE tce_innodb DISCARD TABLESPACE;
ALTER TABLE tc_innodb DISCARD TABLESPACE; ALTER TABLE tc_innodb DISCARD TABLESPACE;
ALTER TABLE te_innodb DISCARD TABLESPACE; ALTER TABLE te_innodb DISCARD TABLESPACE;
...@@ -292,6 +304,8 @@ test.tp_innodb check status OK ...@@ -292,6 +304,8 @@ test.tp_innodb check status OK
DROP TABLE tce_innodb, tc_innodb, te_innodb, DROP TABLE tce_innodb, tc_innodb, te_innodb,
t_innodb, tpe_innodb, tp_innodb; t_innodb, tpe_innodb, tp_innodb;
SET GLOBAL innodb_checksum_algorithm=none; SET GLOBAL innodb_checksum_algorithm=none;
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_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 create table tce_none(a serial, b blob, index(b(10))) engine=innodb
ROW_FORMAT=COMPRESSED encrypted=yes; ROW_FORMAT=COMPRESSED encrypted=yes;
create table tc_none(a serial, b blob, index(b(10))) engine=innodb 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); ...@@ -372,6 +386,8 @@ update tpe_none set b=substr(b,1);
ALTER TABLE tp_none IMPORT TABLESPACE; ALTER TABLE tp_none IMPORT TABLESPACE;
update tp_none set b=substr(b,1); update tp_none set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=innodb; SET GLOBAL innodb_checksum_algorithm=innodb;
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
ALTER TABLE tce_none DISCARD TABLESPACE; ALTER TABLE tce_none DISCARD TABLESPACE;
ALTER TABLE tc_none DISCARD TABLESPACE; ALTER TABLE tc_none DISCARD TABLESPACE;
ALTER TABLE te_none DISCARD TABLESPACE; ALTER TABLE te_none DISCARD TABLESPACE;
...@@ -397,6 +413,8 @@ update tpe_none set b=substr(b,1); ...@@ -397,6 +413,8 @@ update tpe_none set b=substr(b,1);
ALTER TABLE tp_none IMPORT TABLESPACE; ALTER TABLE tp_none IMPORT TABLESPACE;
update tp_none set b=substr(b,1); update tp_none set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=none; SET GLOBAL innodb_checksum_algorithm=none;
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
ALTER TABLE tce_none DISCARD TABLESPACE; ALTER TABLE tce_none DISCARD TABLESPACE;
ALTER TABLE tc_none DISCARD TABLESPACE; ALTER TABLE tc_none DISCARD TABLESPACE;
ALTER TABLE te_none DISCARD TABLESPACE; ALTER TABLE te_none DISCARD TABLESPACE;
......
...@@ -689,3 +689,19 @@ FTS_DOC_ID t ...@@ -689,3 +689,19 @@ FTS_DOC_ID t
2 foo bar 2 foo bar
3 foo 3 foo
DROP TABLE t; DROP TABLE t;
#
# MDEV-25070 SIGSEGV in fts_create_in_mem_aux_table
#
CREATE TABLE t1 (a CHAR, FULLTEXT KEY(a)) ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
ALTER TABLE t1 ADD FULLTEXT INDEX (a);
Warnings:
Warning 1814 Tablespace has been discarded for table `t1`
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(1) DEFAULT NULL,
FULLTEXT KEY `a` (`a`),
FULLTEXT KEY `a_2` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
...@@ -717,3 +717,12 @@ while ($N) ...@@ -717,3 +717,12 @@ while ($N)
} }
DROP TABLE t; DROP TABLE t;
--echo #
--echo # MDEV-25070 SIGSEGV in fts_create_in_mem_aux_table
--echo #
CREATE TABLE t1 (a CHAR, FULLTEXT KEY(a)) ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
ALTER TABLE t1 ADD FULLTEXT INDEX (a);
SHOW CREATE TABLE t1;
DROP TABLE t1;
...@@ -11,18 +11,26 @@ SELECT @@global.innodb_checksum_algorithm; ...@@ -11,18 +11,26 @@ SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm @@global.innodb_checksum_algorithm
strict_crc32 strict_crc32
SET GLOBAL innodb_checksum_algorithm = 'innodb'; SET GLOBAL innodb_checksum_algorithm = 'innodb';
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
SELECT @@global.innodb_checksum_algorithm; SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm @@global.innodb_checksum_algorithm
innodb innodb
SET GLOBAL innodb_checksum_algorithm = 'strict_innodb'; SET GLOBAL innodb_checksum_algorithm = 'strict_innodb';
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
SELECT @@global.innodb_checksum_algorithm; SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm @@global.innodb_checksum_algorithm
strict_innodb strict_innodb
SET GLOBAL innodb_checksum_algorithm = 'none'; SET GLOBAL innodb_checksum_algorithm = 'none';
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
SELECT @@global.innodb_checksum_algorithm; SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm @@global.innodb_checksum_algorithm
none none
SET GLOBAL innodb_checksum_algorithm = 'strict_none'; SET GLOBAL innodb_checksum_algorithm = 'strict_none';
Warnings:
Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
SELECT @@global.innodb_checksum_algorithm; SELECT @@global.innodb_checksum_algorithm;
@@global.innodb_checksum_algorithm @@global.innodb_checksum_algorithm
strict_none strict_none
......
...@@ -8720,14 +8720,19 @@ static bool optimize_for_get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond ...@@ -8720,14 +8720,19 @@ static bool optimize_for_get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond
bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables) bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables)
{ {
DBUG_ENTER("optimize_schema_tables_memory_usage");
List_iterator<TABLE_LIST> tli(tables); List_iterator<TABLE_LIST> tli(tables);
while (TABLE_LIST *table_list= tli++) while (TABLE_LIST *table_list= tli++)
{ {
if (!table_list->schema_table)
continue;
TABLE *table= table_list->table; TABLE *table= table_list->table;
THD *thd=table->in_use; THD *thd=table->in_use;
if (!table_list->schema_table || !thd->fill_information_schema_tables()) if (!thd->fill_information_schema_tables())
continue; continue;
if (!table->is_created()) if (!table->is_created())
...@@ -8775,10 +8780,10 @@ bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables) ...@@ -8775,10 +8780,10 @@ bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables)
// TODO switch from Aria to Memory if all blobs were optimized away? // TODO switch from Aria to Memory if all blobs were optimized away?
if (instantiate_tmp_table(table, p->keyinfo, p->start_recinfo, &p->recinfo, if (instantiate_tmp_table(table, p->keyinfo, p->start_recinfo, &p->recinfo,
table_list->select_lex->options | thd->variables.option_bits)) table_list->select_lex->options | thd->variables.option_bits))
return 1; DBUG_RETURN(1);
} }
} }
return 0; DBUG_RETURN(0);
} }
......
...@@ -1730,7 +1730,7 @@ fts_create_in_mem_aux_table( ...@@ -1730,7 +1730,7 @@ fts_create_in_mem_aux_table(
dict_table_t* new_table = dict_mem_table_create( dict_table_t* new_table = dict_mem_table_create(
aux_table_name, NULL, n_cols, 0, table->flags, aux_table_name, NULL, n_cols, 0, table->flags,
table->space_id == TRX_SYS_SPACE table->space_id == TRX_SYS_SPACE
? 0 : table->space->purpose == FIL_TYPE_TEMPORARY ? 0 : table->space_id == SRV_TMP_SPACE_ID
? DICT_TF2_TEMPORARY : DICT_TF2_USE_FILE_PER_TABLE); ? DICT_TF2_TEMPORARY : DICT_TF2_USE_FILE_PER_TABLE);
if (DICT_TF_HAS_DATA_DIR(table->flags)) { if (DICT_TF_HAS_DATA_DIR(table->flags)) {
......
...@@ -3499,6 +3499,12 @@ static int innodb_init_abort() ...@@ -3499,6 +3499,12 @@ static int innodb_init_abort()
static const char* deprecated_idle_flush_pct static const char* deprecated_idle_flush_pct
= "innodb_idle_flush_pct is DEPRECATED and has no effect."; = "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, full_crc32, strict_crc32 or strict_full_crc32"
" is UNSAFE and DEPRECATED."
" These deprecated values will be disallowed in MariaDB 10.6.";
static ulong innodb_idle_flush_pct; static ulong innodb_idle_flush_pct;
/** If applicable, emit a message that log checksums cannot be disabled. /** If applicable, emit a message that log checksums cannot be disabled.
...@@ -3527,6 +3533,23 @@ innodb_log_checksums_func_update(THD* thd, bool check) ...@@ -3527,6 +3533,23 @@ innodb_log_checksums_func_update(THD* thd, bool check)
return(check); return(check);
} }
static void innodb_checksum_algorithm_update(THD *thd, st_mysql_sys_var*,
void *, const void *save)
{
srv_checksum_algorithm= *static_cast<const ulong*>(save);
switch (srv_checksum_algorithm) {
case SRV_CHECKSUM_ALGORITHM_CRC32:
case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
case SRV_CHECKSUM_ALGORITHM_FULL_CRC32:
case SRV_CHECKSUM_ALGORITHM_STRICT_FULL_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. */ Gives the file extension of an InnoDB single-table tablespace. */
static const char* ha_innobase_exts[] = { static const char* ha_innobase_exts[] = {
...@@ -3951,9 +3974,18 @@ static int innodb_init_params() ...@@ -3951,9 +3974,18 @@ static int innodb_init_params()
if (!innobase_use_checksums) { if (!innobase_use_checksums) {
ib::warn() << "Setting innodb_checksums to OFF is DEPRECATED." ib::warn() << "Setting innodb_checksums to OFF is DEPRECATED."
" This option may be removed in future releases. You" " This option was removed in MariaDB 10.5.";
" should set innodb_checksum_algorithm=NONE instead.";
srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_NONE; srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_NONE;
} else {
switch (srv_checksum_algorithm) {
case SRV_CHECKSUM_ALGORITHM_CRC32:
case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
case SRV_CHECKSUM_ALGORITHM_FULL_CRC32:
case SRV_CHECKSUM_ALGORITHM_STRICT_FULL_CRC32:
break;
default:
ib::warn() << deprecated_innodb_checksum_algorithm;
}
} }
innodb_log_checksums = innodb_log_checksums_func_update( innodb_log_checksums = innodb_log_checksums_func_update(
...@@ -18867,7 +18899,7 @@ static MYSQL_SYSVAR_ENUM(checksum_algorithm, srv_checksum_algorithm, ...@@ -18867,7 +18899,7 @@ static MYSQL_SYSVAR_ENUM(checksum_algorithm, srv_checksum_algorithm,
" Files updated when this option is set to crc32 or strict_crc32 will" " Files updated when this option is set to crc32 or strict_crc32 will"
" not be readable by MariaDB versions older than 10.0.4;" " not be readable by MariaDB versions older than 10.0.4;"
" new files created with full_crc32 are readable by MariaDB 10.4.3+", " new files created with full_crc32 are readable by MariaDB 10.4.3+",
NULL, NULL, SRV_CHECKSUM_ALGORITHM_CRC32, NULL, innodb_checksum_algorithm_update, SRV_CHECKSUM_ALGORITHM_CRC32,
&innodb_checksum_algorithm_typelib); &innodb_checksum_algorithm_typelib);
static MYSQL_SYSVAR_BOOL(log_checksums, innodb_log_checksums, static MYSQL_SYSVAR_BOOL(log_checksums, innodb_log_checksums,
......
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