Skip to content

Commit

Permalink
Merge 10.6 into 10.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Aug 31, 2021
2 parents 58aaa67 + 55a344f commit 2e64145
Show file tree
Hide file tree
Showing 201 changed files with 4,330 additions and 4,150 deletions.
10 changes: 10 additions & 0 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,18 @@ void free_used_memory()
}


#ifdef EMBEDDED_LIBRARY
void ha_pre_shutdown();
#endif


ATTRIBUTE_NORETURN static void cleanup_and_exit(int exit_code)
{
#ifdef EMBEDDED_LIBRARY
if (server_initialized)
ha_pre_shutdown();
#endif

free_used_memory();

/* Only call mysql_server_end if mysql_server_init has been called */
Expand Down
3 changes: 1 addition & 2 deletions mysql-test/include/default_mysqld.cnf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2007, 2013, Oracle and/or its affiliates
# Copyright (c) 2010, 2019, MariaDB Corporation
# Copyright (c) 2010, 2021, MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -54,7 +54,6 @@ loose-innodb_write_io_threads= 2
loose-innodb_read_io_threads= 2
loose-innodb_log_buffer_size= 1M
loose-innodb_log_file_size= 10M
loose-innodb-stats-persistent= OFF

slave-net-timeout=120

Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/bug39022.result
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SH
connection thread1;
# should not crash
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
Got one of the listed errors
connection thread2;
d
disconnect thread2;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/bug39022.test
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SH
connection thread1;

--echo # should not crash
--error ER_LOCK_DEADLOCK
--error ER_LOCK_DEADLOCK,ER_LOCK_WAIT_TIMEOUT
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE; #crashes

connection thread2;
Expand Down
1 change: 1 addition & 0 deletions mysql-test/main/column_compression_rpl.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--skip-innodb-stats-persistent
37 changes: 24 additions & 13 deletions mysql-test/main/create_or_replace.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
drop table if exists t1,t2,t3;
CREATE TABLE t2 (a int);
INSERT INTO t2 VALUES(1),(2),(3);
#
Expand Down Expand Up @@ -259,7 +258,8 @@ Note 1051 Unknown table 'test.t1,mysqltest2.t2'
create table test.t1 (i int) engine=myisam;
create table mysqltest2.t2 like test.t1;
lock table test.t1 write, mysqltest2.t2 write;
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
# MDL_BACKUP_DML NULL Backup lock
Expand All @@ -272,7 +272,8 @@ ERROR 42000: A table must have at least 1 column
show tables;
Tables_in_test
t2
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
# MDL_BACKUP_DML NULL Backup lock
Expand All @@ -281,14 +282,16 @@ THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock mysqltest2 t2
create or replace table mysqltest2.t2;
ERROR 42000: A table must have at least 1 column
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
create table t1 (i int);
drop table t1;
create table test.t1 (i int);
create table mysqltest2.t2 like test.t1;
lock table test.t1 write, mysqltest2.t2 write;
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
# MDL_BACKUP_DML NULL Backup lock
Expand All @@ -301,7 +304,8 @@ ERROR 42S21: Duplicate column name 'a'
show tables;
Tables_in_test
t2
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
# MDL_BACKUP_DML NULL Backup lock
Expand All @@ -310,14 +314,16 @@ THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock mysqltest2 t2
create or replace table mysqltest2.t2 (a int) select 1 as 'a', 2 as 'a';
ERROR 42S21: Duplicate column name 'a'
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
create table t1 (i int);
drop table t1;
create table test.t1 (i int) engine=innodb;
create table mysqltest2.t2 like test.t1;
lock table test.t1 write, mysqltest2.t2 write;
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2
Expand All @@ -329,7 +335,8 @@ drop table test.t1,mysqltest2.t2;
create table test.t1 (i int) engine=aria transactional=1 checksum=1;
create table mysqltest2.t2 like test.t1;
lock table test.t1 write, mysqltest2.t2 write;
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2
Expand Down Expand Up @@ -424,31 +431,35 @@ drop view t1;
#
create table t1 (a int);
lock table t1 write, t2 read;
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
# MDL_BACKUP_DML NULL Backup lock
# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test
# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1
# MDL_SHARED_READ NULL Table metadata lock test t2
create or replace table t1 (i int);
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
# MDL_BACKUP_DML NULL Backup lock
# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test
# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1
# MDL_SHARED_READ NULL Table metadata lock test t2
create or replace table t1 like t2;
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
# MDL_BACKUP_DML NULL Backup lock
# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test
# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1
# MDL_SHARED_READ NULL Table metadata lock test t2
create or replace table t1 select 1 as f1;
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_BACKUP_DDL NULL Backup lock
# MDL_BACKUP_DML NULL Backup lock
Expand Down
40 changes: 25 additions & 15 deletions mysql-test/main/create_or_replace.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

--source include/have_innodb.inc
--source include/have_metadata_lock_info.inc
--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings

#
# Create help table
Expand Down Expand Up @@ -215,18 +212,21 @@ create table mysqltest2.t2 like test.t1;
lock table test.t1 write, mysqltest2.t2 write;
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
--error ER_TABLE_MUST_HAVE_COLUMNS
create or replace table test.t1;
show tables;
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
--error ER_TABLE_MUST_HAVE_COLUMNS
create or replace table mysqltest2.t2;
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
create table t1 (i int);
drop table t1;

Expand All @@ -235,18 +235,21 @@ create table mysqltest2.t2 like test.t1;
lock table test.t1 write, mysqltest2.t2 write;
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
--error ER_DUP_FIELDNAME
create or replace table test.t1 (a int) select 1 as 'a', 2 as 'a';
show tables;
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
--error ER_DUP_FIELDNAME
create or replace table mysqltest2.t2 (a int) select 1 as 'a', 2 as 'a';
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
create table t1 (i int);
drop table t1;

Expand All @@ -255,7 +258,8 @@ create table mysqltest2.t2 like test.t1;
lock table test.t1 write, mysqltest2.t2 write;
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
unlock tables;
drop table test.t1,mysqltest2.t2;

Expand All @@ -264,7 +268,8 @@ create table mysqltest2.t2 like test.t1;
lock table test.t1 write, mysqltest2.t2 write;
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
unlock tables;
drop table t1;

Expand Down Expand Up @@ -344,19 +349,24 @@ create table t1 (a int);
lock table t1 write, t2 read;
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';

create or replace table t1 (i int);
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
create or replace table t1 like t2;
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
create or replace table t1 select 1 as f1;
--replace_column 1 #
--sorted_result
select * from information_schema.metadata_lock_info;
select * from information_schema.metadata_lock_info
where table_name not like 'innodb_%_stats';
drop table t1;
unlock tables;

Expand Down
1 change: 1 addition & 0 deletions mysql-test/main/ctype_utf8mb4_innodb-master.opt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--default-storage-engine=MyISAM
--innodb-stats-persistent=OFF
3 changes: 3 additions & 0 deletions mysql-test/main/derived_split_innodb.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SET @save_innodb_stats_persistent=@@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent=0;
#
# MDEV-16917: do not use splitting for derived with join cache
#
Expand Down Expand Up @@ -241,3 +243,4 @@ set optimizer_switch='split_materialized=default';
set use_stat_tables=default;
set optimizer_use_condition_selectivity=default;
# End of 10.3 tests
SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent;
5 changes: 5 additions & 0 deletions mysql-test/main/derived_split_innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
--source include/default_optimizer_switch.inc
--source include/have_sequence.inc

SET @save_innodb_stats_persistent=@@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent=0;

--echo #
--echo # MDEV-16917: do not use splitting for derived with join cache
--echo #
Expand Down Expand Up @@ -193,3 +196,5 @@ set use_stat_tables=default;
set optimizer_use_condition_selectivity=default;

--echo # End of 10.3 tests

SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent;
3 changes: 2 additions & 1 deletion mysql-test/main/endspace.result
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ nothing
teststring
teststring
drop table t1;
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) engine=innodb;
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) engine=innodb
stats_persistent=0;
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
check table t1;
Table Op Msg_type Msg_text
Expand Down
3 changes: 2 additions & 1 deletion mysql-test/main/endspace.test
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ drop table t1;
# Test InnoDB tables
#

create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) engine=innodb;
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) engine=innodb
stats_persistent=0;
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
check table t1;
select * from t1 where text1='teststring' or text1 like 'teststring_%';
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/main/fast_prefix_index_fetch_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set global innodb_prefix_index_cluster_optimization = ON;
show variables like 'innodb_prefix_index_cluster_optimization';
Variable_name Value
innodb_prefix_index_cluster_optimization ON
SET @save_innodb_stats_persistent=@@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent = OFF;
# Create a table with a large varchar field that we index the prefix
# of and ensure we only trigger cluster lookups when we expect it.
create table prefixinno (
Expand Down Expand Up @@ -455,3 +457,4 @@ blog_id
1
DROP TABLE wp_blogs;
SET GLOBAL innodb_prefix_index_cluster_optimization = @save_opt;
SET GLOBAL innodb_stats_persistent = @save_innodb_stats_persistent;
4 changes: 4 additions & 0 deletions mysql-test/main/fast_prefix_index_fetch_innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ SET @save_opt= @@GLOBAL.innodb_prefix_index_cluster_optimization;
set global innodb_prefix_index_cluster_optimization = ON;
show variables like 'innodb_prefix_index_cluster_optimization';

SET @save_innodb_stats_persistent=@@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent = OFF;

--echo # Create a table with a large varchar field that we index the prefix
--echo # of and ensure we only trigger cluster lookups when we expect it.
create table prefixinno (
Expand Down Expand Up @@ -717,3 +720,4 @@ AND path IN ( '/fondsinvesteringer/', '/' );
DROP TABLE wp_blogs;

SET GLOBAL innodb_prefix_index_cluster_optimization = @save_opt;
SET GLOBAL innodb_stats_persistent = @save_innodb_stats_persistent;
3 changes: 3 additions & 0 deletions mysql-test/main/index_merge_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ SET DEFAULT_STORAGE_ENGINE = InnoDB;
set @optimizer_switch_save= @@optimizer_switch;
set optimizer_switch='index_merge_sort_intersection=off';
set optimizer_switch='rowid_filter=off';
SET @save_stats_persistent=@@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent=0;
#---------------- Index merge test 2 -------------------------------------------
create table t1
(
Expand Down Expand Up @@ -835,3 +837,4 @@ a b c
DROP TABLE t1;
SET sort_buffer_size= @save_sort_buffer_size;
disconnect disable_purge;
SET GLOBAL innodb_stats_persistent=@save_stats_persistent;
4 changes: 4 additions & 0 deletions mysql-test/main/index_merge_innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ set @optimizer_switch_save= @@optimizer_switch;
set optimizer_switch='index_merge_sort_intersection=off';
set optimizer_switch='rowid_filter=off';

SET @save_stats_persistent=@@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent=0;

# The first two tests are disabled because of non deterministic explain output.
# If include/index_merge1.inc can be enabled for InnoDB and all other
# storage engines, please remove the subtest for Bug#21277 from
Expand Down Expand Up @@ -222,3 +225,4 @@ DROP TABLE t1;
SET sort_buffer_size= @save_sort_buffer_size;

disconnect disable_purge;
SET GLOBAL innodb_stats_persistent=@save_stats_persistent;
Loading

0 comments on commit 2e64145

Please sign in to comment.