Skip to content
Permalink
Browse files

Merge branch '10.2' into 10.3

  • Loading branch information...
montywi committed Sep 2, 2019
2 parents b0ff5a6 + 9cba6c5 commit a071e0e029cd7c155cff1054d9f7f8a6aa898620
Showing 671 changed files with 6,035 additions and 9,109 deletions.
@@ -160,7 +160,10 @@ fi
# Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
# UNINIT_VAR(), which is only useful for silencing spurious warnings
# of static analysis tools. We want UNINIT_VAR() to be a no-op in Valgrind.
valgrind_flags="-DHAVE_valgrind -USAFEMALLOC"
# TRASH_FREE_MEMORY is enabled so that we can find wrong memory accesses
# even when running a test without valgrind
#
valgrind_flags="-DHAVE_valgrind -USAFEMALLOC -DTRASH_FREE_MEMORY"
valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized"
valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
valgrind_configs="--with-valgrind"
@@ -208,7 +211,7 @@ fi

max_no_embedded_configs="$SSL_LIBRARY --with-plugins=max"
max_no_qc_configs="$SSL_LIBRARY --with-plugins=max --without-query-cache"
max_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server --with-libevent --without-plugin=plugin_file_key_management --with-plugin-rocksdb=dynamic"
max_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server --with-libevent --without-plugin=plugin_file_key_management --with-plugin-rocksdb=dynamic --with-plugin-test_sql_discovery=DYNAMIC"
all_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server --with-innodb_plugin --with-libevent"

#
@@ -252,6 +255,11 @@ if test `$CC -v 2>&1 | tail -1 | sed 's/ .*$//'` = 'gcc' ; then
then
debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized"
fi
if (test '(' "$GCCV1" -gt '6' ')')
then
c_warnings="$c_warnings -Wimplicit-fallthrough=2"
cxx_warnings="$cxx_warnings -Wimplicit-fallthrough=2"
fi
fi


@@ -44,12 +44,13 @@ extern unsigned int mysql_server_last_errno;
extern char mysql_server_last_error[MYSQL_ERRMSG_SIZE];
static my_bool emb_read_query_result(MYSQL *mysql);
static void emb_free_embedded_thd(MYSQL *mysql);

static bool embedded_print_errors= 0;

extern "C" void unireg_clear(int exit_code)
{
DBUG_ENTER("unireg_clear");
clean_up(!opt_help && (exit_code || !opt_bootstrap)); /* purecov: inspected */
embedded_print_errors= 0;
clean_up(!opt_help && !exit_code); /* purecov: inspected */
clean_up_mutexes();
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
DBUG_VOID_RETURN;
@@ -522,7 +523,7 @@ int init_embedded_server(int argc, char **argv, char **groups)
my_bool acl_error;

DBUG_ASSERT(mysql_embedded_init == 0);

embedded_print_errors= 1;
if (my_thread_init())
return 1;

@@ -1347,8 +1348,17 @@ int vprint_msg_to_log(enum loglevel level __attribute__((unused)),
const char *format, va_list argsi)
{
vsnprintf(mysql_server_last_error, sizeof(mysql_server_last_error),
format, argsi);
format, argsi);
mysql_server_last_errno= CR_UNKNOWN_ERROR;
if (embedded_print_errors && level == ERROR_LEVEL)
{
/* The following is for testing when someone removes the above test */
const char *tag= (level == ERROR_LEVEL ? "ERROR" :
level == WARNING_LEVEL ? "Warning" :
"Note");
fprintf(stderr,"Got %s: \"%s\" errno: %d\n",
tag, mysql_server_last_error, mysql_server_last_errno);
}
return 0;
}

@@ -2,6 +2,8 @@
--echo # mdev-539: fast build of unique/primary indexes for MyISAM/Aria
--echo #

--source include/default_charset.inc

call mtr.add_suppression("Can't find record in '.*'");

--disable_warnings
@@ -62,6 +64,6 @@ insert into customer values
alter ignore table customer add primary key (c_custkey);
show create table customer;
select * from customer where c_custkey=3;

--source include/restore_charset.inc
DROP DATABASE dbt3_s001;

@@ -1537,8 +1537,10 @@ select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 25
# Test of left join.
#

SET @save_optimizer_switch=@@optimizer_switch;
SET optimizer_switch='outer_join_with_cache=off';
SET @local_optimizer_switch=@@optimizer_switch;
set @local_join_cache_level=@@join_cache_level;
set @@join_cache_level=2;
set optimizer_switch='outer_join_with_cache=off,join_cache_hashed=off';

insert into t2 (fld1, companynr) values (999999,99);

@@ -1572,7 +1574,7 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;

SET optimizer_switch=@save_optimizer_switch;
SET @@optimizer_switch=@local_optimizer_switch;

#
# Joins with forms.
@@ -1581,6 +1583,8 @@ SET optimizer_switch=@save_optimizer_switch;
select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;

SET @@join_cache_level=@local_join_cache_level;

#
# Search using 'or' with the same referens group.
# An interval search will be done first with the first table and after that
@@ -1,6 +1,7 @@
#
# Tests with the utf8mb4 character set
#
--source include/default_optimizer_switch.inc
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
@@ -1244,7 +1245,9 @@ drop table t1;
#

SET CHARACTER SET utf8mb4;
--source include/default_charset.inc
SHOW VARIABLES LIKE 'character\_set\_%';
SET @@character_set_server=@save_character_set_server;
CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
USE crashtest;
eval CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 ENGINE $engine;
@@ -0,0 +1,15 @@
# This file sets the default character set that most test expects.

# In most cases the variables should match the community server defaults.
# The values should be changed if the default character set for the server
# changes and all tests have been updated to supported the new character set

# The purpose if this file is to allow users to change these defaults
# without having to update all tests.

--disable_query_log
SET @save_character_set_server= @@character_set_server;
SET @save_collation_server= @@collation_server;
set @@character_set_server="latin1";
set @@collation_server="latin1_swedish_ci";
--enable_query_log
@@ -0,0 +1,11 @@
# Define the order that mtr will save groups in the generated my.cnf files
# The --debug-gdb option is just here to force mtr to remember the group order

[mysqld]
#debug-gdb=
[mariadb]
#debug-gdb=
[embedded]
#debug-gdb=
[server]
#debug-gdb=
@@ -15,6 +15,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA

# Use default setting for mysqld processes
!include default_group_order.cnf
!include default_mysqld.cnf
!include default_client.cnf

@@ -127,4 +127,3 @@ local-infile
# tables. Let's enable it in the [server] group, because this group
# is read after [mysqld] and [embedded]
loose-aria

@@ -0,0 +1,18 @@
# This file sets the default optimizer flags and optimizer variables that
# most test expects. In most cases the variables should match the community
# server defaults.
# The purpose if this file is to allow users to change these defaults
# without having to update all tests.

--disable_query_log
set @save_optimizer_switch=@@optimizer_switch;
set @save_join_cache_level=@@join_cache_level;

set optimizer_switch="index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on";

set optimizer_use_condition_selectivity=1;
set optimizer_search_depth=62;
set join_buffer_space_limit=2097152;
set join_cache_level=2;
set join_buffer_size=262144;
--enable_query_log
@@ -37,8 +37,13 @@

--source include/add_anonymous_users.inc

set @save_query_cache_size=@@global.query_cache_size;
set @save_sql_mode=@@global.sql_mode;
set @save_query_cache_type=@@global.query_cache_type;

set GLOBAL sql_mode="";
set LOCAL sql_mode="";

#
--disable_warnings
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
@@ -208,10 +213,10 @@ flush privileges;
drop table test.t1,mysqltest.t1,mysqltest.t2;
drop database mysqltest;

set GLOBAL query_cache_size=default;
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;

--source include/delete_anonymous_users.inc
set GLOBAL sql_mode=default;
set GLOBAL query_cache_type=default;
set GLOBAL query_cache_size=@save_query_cache_size;
set GLOBAL sql_mode=@save_sql_mode;
set GLOBAL query_cache_type=@save_query_cache_type;
@@ -0,0 +1,6 @@
# Ensure that host_cache is enabled

if (`SELECT @@skip_name_resolve != "OFF"`)
{
skip No hostname_cache;
}
@@ -0,0 +1,13 @@
# This file sets the default character set that most test expects.

# In most cases the variables should match the community server defaults.
# The values should be changed if the default character set for the server
# changes and all tests have been updated to supported the new character set

# The purpose if this file is to allow users to change these defaults
# without having to update all tests.

--disable_query_log
SET @@character_set_server=@save_character_set_server;
SET @@collation_server=@save_collation_server;
--enable_query_log
@@ -1,5 +1,6 @@
drop table if exists t1,t2;
drop database if exists mysqltest;
set @save_max_allowed_packet=@@global.max_allowed_packet;
create table t1 (
col1 int not null auto_increment primary key,
col2 varchar(30) not null,
@@ -1463,7 +1464,7 @@ disconnect con1;
connection default;
DROP TABLE t1, t2, t3;
SET SQL_MODE=default;
SET GLOBAL max_allowed_packet=default;
SET GLOBAL max_allowed_packet=@save_max_allowed_packet;
CREATE TABLE t1 (
id INT(11) NOT NULL,
x_param INT(11) DEFAULT NULL,
@@ -6,6 +6,7 @@
drop table if exists t1,t2;
drop database if exists mysqltest;
--enable_warnings
set @save_max_allowed_packet=@@global.max_allowed_packet;

create table t1 (
col1 int not null auto_increment primary key,
@@ -1340,7 +1341,7 @@ SELECT LENGTH(my_t3_fld1) FROM t3;
DROP TABLE t1, t2, t3;

SET SQL_MODE=default;
SET GLOBAL max_allowed_packet=default;
SET GLOBAL max_allowed_packet=@save_max_allowed_packet;

#
# Test of ALTER TABLE IF [NOT] EXISTS
@@ -13,6 +13,8 @@
# before calling mi_state_info_write
#

--source include/default_optimizer_switch.inc

create table t1 (a bigint);
lock tables t1 write;
insert into t1 values(0);
@@ -5,6 +5,8 @@
drop table if exists t0,t1,t2,t3;
--enable_warnings

--source include/default_optimizer_switch.inc

create table t0 (a int);
INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);

@@ -1,3 +1,4 @@
set join_cache_level=2;
drop table if exists t0,t1,t2,t3;
create table t0 (a int) engine=myisam;
INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -1,6 +1,10 @@
#
# Tests for "ANALYZE $statement" feature
#

# Fix that analyze delete with join doesn't add extra WHERE clause.
set join_cache_level=2;

--disable_warnings
drop table if exists t0,t1,t2,t3;
--enable_warnings
@@ -1,5 +1,6 @@

--source include/have_innodb.inc
--source include/default_optimizer_switch.inc

create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -1,4 +1,4 @@
################################################################################
###############################################################################
# The test ensures that permission checks are applied correctly to
# ANALYZE INSERT/REPLACE/UPDATE/DELETE/SELECT (I/R/U/D/S further in the test)
# when it's executed on a table or on a view.
@@ -18,7 +18,8 @@
# Search for 'MDEV' to find all of them.
################################################################################

-- source include/not_embedded.inc
--source include/not_embedded.inc
--source include/default_optimizer_switch.inc

# Save the initial number of concurrent sessions
--source include/count_sessions.inc
@@ -44,6 +45,7 @@ INSERT INTO privtest_db.t2 VALUES (1,'foo'), (2,'bar'), (3,'qux');
GRANT SELECT ON privtest_db.t2 TO 'privtest'@'localhost';

connect(con1,localhost,privtest,,privtest_db);
--source include/default_optimizer_switch.inc

--echo
--echo #########################################################################
@@ -3,7 +3,8 @@ drop table t1;
drop table t1;
ERROR 42S02: Unknown table 'test.t1'
set @my_max_allowed_packet= @@max_allowed_packet;
set global max_allowed_packet=64*@@max_allowed_packet;
set @@global.max_allowed_packet= greatest(1073741824, @@max_allowed_packet);
set @max_allowed_packed=@@global.max_allowed_packet;
set global max_allowed_packet=@my_max_allowed_packet;
drop table t1;
End of 5.1 tests
@@ -33,10 +33,11 @@ drop table t1;
remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql;

#
# Bootstrap with a query larger than 2*thd->net.max_packet
# Bootstrap with a large thd->net.max_packet
#
set @my_max_allowed_packet= @@max_allowed_packet;
set global max_allowed_packet=64*@@max_allowed_packet;
set @@global.max_allowed_packet= greatest(1073741824, @@max_allowed_packet);
set @max_allowed_packed=@@global.max_allowed_packet;
--disable_query_log
create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b;
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1;
@@ -2,6 +2,9 @@
--echo # Bug#13633383 63183: SMALL SORT_BUFFER_SIZE CRASH IN MERGE_BUFFERS
--echo #

# Avoid warnings from join_buffer
--source include/default_optimizer_switch.inc

CREATE TABLE t1 (
`a` int(11) DEFAULT NULL,
`col432` bit(8) DEFAULT NULL,

0 comments on commit a071e0e

Please sign in to comment.
You can’t perform that action at this time.