summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-06-11 13:00:18 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-06-11 13:00:18 +0300
commitb42dbdbccd3b939394ca9b608ad91a04235e95f1 (patch)
treee969f314963faa202fdb6f87d5aca67810844742
parent490dcfd5d74ce45cbdd6105e4295116f6a944e2b (diff)
parentcbac8f935182ecc5bb907de3ae48942467f0b8ba (diff)
downloadmariadb-git-b42dbdbccd3b939394ca9b608ad91a04235e95f1.tar.gz
Merge 10.2 into 10.3
-rw-r--r--client/CMakeLists.txt4
-rw-r--r--client/mysqldump.c4
-rw-r--r--extra/mariabackup/xtrabackup.cc6
-rw-r--r--mysql-test/lib/My/Config.pm17
-rw-r--r--mysql-test/lib/My/ConfigFactory.pm8
-rw-r--r--mysql-test/main/subselect_no_semijoin.result55
-rw-r--r--mysql-test/main/subselect_no_semijoin.test23
-rw-r--r--mysql-test/main/win.result27
-rw-r--r--mysql-test/main/win.test16
-rw-r--r--mysql-test/suite/binlog/r/flashback-largebinlog.result71
-rw-r--r--mysql-test/suite/binlog/t/flashback-largebinlog.test110
-rw-r--r--mysql-test/suite/encryption/r/compressed_import_tablespace.result39
-rw-r--r--mysql-test/suite/encryption/t/compressed_import_tablespace.opt3
-rw-r--r--mysql-test/suite/encryption/t/compressed_import_tablespace.test46
-rw-r--r--mysql-test/valgrind.supp21
-rw-r--r--mysys/CMakeLists.txt2
-rw-r--r--plugin/auth_ed25519/CMakeLists.txt4
-rw-r--r--sql/handler.h2
-rw-r--r--sql/item_windowfunc.h12
-rw-r--r--sql/mysqld.cc8
-rw-r--r--sql/sql_explain.cc5
-rw-r--r--sql/sql_explain.h1
-rw-r--r--sql/sql_select.cc1
-rw-r--r--storage/innobase/buf/buf0buf.cc4
-rw-r--r--storage/innobase/include/buf0buf.h71
-rw-r--r--storage/innobase/include/buf0types.h71
-rw-r--r--storage/innobase/include/log0recv.h4
-rw-r--r--storage/innobase/include/os0file.h8
-rw-r--r--storage/innobase/include/os0file.ic2
-rw-r--r--storage/innobase/include/row0merge.h4
-rw-r--r--storage/innobase/log/log0recv.cc6
-rw-r--r--storage/innobase/os/os0file.cc6
-rw-r--r--storage/innobase/row/row0import.cc14
-rw-r--r--storage/innobase/row/row0merge.cc6
-rw-r--r--storage/maria/ha_maria.cc7
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/slow_query_log.awk2
-rwxr-xr-xstorage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_slocket_socket.sh2
-rwxr-xr-xstorage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_table.sh2
-rwxr-xr-xstorage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data.sh2
-rwxr-xr-xstorage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_and_run.sh2
-rwxr-xr-xstorage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_slocket.sh2
-rwxr-xr-xstorage/rocksdb/mysql-test/rocksdb_hotbackup/include/remove_slocket_socket.sh2
-rwxr-xr-xstorage/rocksdb/mysql-test/rocksdb_hotbackup/include/setup_replication_gtid.sh2
-rw-r--r--tests/mysql_client_test.c30
-rw-r--r--unittest/mysys/CMakeLists.txt4
-rw-r--r--unittest/sql/CMakeLists.txt2
46 files changed, 612 insertions, 128 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 96346808a62..37087b7c6c6 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -72,10 +72,10 @@ MYSQL_ADD_EXECUTABLE(mysql_plugin mysql_plugin.c)
TARGET_LINK_LIBRARIES(mysql_plugin ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc)
-TARGET_LINK_LIBRARIES(mysqlbinlog ${CLIENT_LIB})
+TARGET_LINK_LIBRARIES(mysqlbinlog ${CLIENT_LIB} mysys_ssl)
MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc ../sql/password.c)
-TARGET_LINK_LIBRARIES(mysqladmin ${CLIENT_LIB})
+TARGET_LINK_LIBRARIES(mysqladmin ${CLIENT_LIB} mysys_ssl)
MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c)
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 55fa7459da5..10f9739d637 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -979,6 +979,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
exit(1);
}
break;
+ case (int) OPT_DEFAULT_CHARSET:
+ if (default_charset == disabled_my_option)
+ default_charset= (char *)mysql_universal_client_charset;
+ break;
}
return 0;
}
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 78df15c8af5..c06d677786c 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -5189,7 +5189,11 @@ next_file_item_1:
goto next_datadir_item;
}
- snprintf(dbpath, sizeof(dbpath)-1, "%s/%s", path, dbinfo.name);
+ snprintf(dbpath, sizeof(dbpath), "%.*s/%.*s",
+ OS_FILE_MAX_PATH/2-1,
+ path,
+ OS_FILE_MAX_PATH/2-1,
+ dbinfo.name);
os_normalize_path(dbpath);
diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm
index 12647edf0a4..ecc0830c3df 100644
--- a/mysql-test/lib/My/Config.pm
+++ b/mysql-test/lib/My/Config.pm
@@ -21,6 +21,17 @@ use strict;
use warnings;
use Carp;
+# Define all MariaDB options that the user should be able to specify
+# many times in the config file. Note that options must be written
+# using '-' instead of '_' here!
+
+my %multipart_options=
+ (
+ "plugin-load-add" => 1,
+ "optimizer-switch" => 1,
+);
+
+
sub new {
my ($class, $option_name, $option_value)= @_;
my $self= bless { name => $option_name,
@@ -327,7 +338,6 @@ sub new {
# Skip comment
next;
}
-
else {
croak "Unexpected line '$line' found in '$path'";
}
@@ -355,6 +365,11 @@ sub insert {
if ( defined $option ) {
#print "option: $option, value: $value\n";
+ my $tmp_option= $option;
+ $tmp_option =~ s/_/-/g;
+
+ # If the option is an option that one can specify many times, always add
+ $if_not_exist= 1 if ($multipart_options{$tmp_option});
# Add the option to the group
$group->insert($option, $value, $if_not_exist);
diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index cae2c8c33e5..72d7600e8df 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -311,7 +311,7 @@ sub post_check_client_groups {
$first_mysqld->name());
# Then generate [client.<suffix>] for each [mysqld.<suffix>]
- foreach my $mysqld ( $config->like('mysqld.') ) {
+ foreach my $mysqld ( $config->like('mysqld\.') ) {
$self->post_check_client_group($config,
'client'.$mysqld->after('mysqld'),
$mysqld->name())
@@ -333,7 +333,7 @@ sub post_check_embedded_group {
my $mysqld= $config->group('mysqld') or
croak "Can't run with embedded, config has no default mysqld section";
- my $first_mysqld= $config->first_like('mysqld.') or
+ my $first_mysqld= $config->first_like('mysqld\.') or
croak "Can't run with embedded, config has no mysqld";
my %no_copy = map { $_ => 1 }
@@ -372,7 +372,7 @@ sub resolve_at_variable {
}
$res .= $after;
- $config->insert($group->name(), $option->name(), $res)
+ $option->{value}= $res;
}
@@ -457,7 +457,7 @@ sub new_config {
}
$self->run_section_rules($config,
- 'mysqld.',
+ 'mysqld\.',
@mysqld_rules);
# [mysqlbinlog] need additional settings
diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result
index e58a01d1983..505d4a712e2 100644
--- a/mysql-test/main/subselect_no_semijoin.result
+++ b/mysql-test/main/subselect_no_semijoin.result
@@ -7290,5 +7290,60 @@ pk i c pk i c
1 10 foo 1 10 foo
DROP TABLE t;
# End of 10.2 tests
+#
+# MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON
+#
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (1),(5);
+CREATE TABLE t2 ( b INT ) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1);
+CREATE TABLE t3 ( c INT );
+INSERT INTO t3 VALUES (4),(5);
+SET @tmp19714=@@optimizer_switch;
+SET optimizer_switch='subquery_cache=off';
+explain format=json
+SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100
+ },
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "pseudo_bits_condition": "1 = t1.a or <in_optimizer>(1,<exists>(subquery#3))",
+ "table": {
+ "table_name": "t2",
+ "access_type": "system",
+ "rows": 1,
+ "filtered": 100
+ },
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 3,
+ "table": {
+ "table_name": "t3",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "1 = t3.c"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+SET optimizer_switch=@tmp19714;
+drop table t1,t2,t3;
set @optimizer_switch_for_subselect_test=null;
set @join_cache_level_for_subselect_test=NULL;
diff --git a/mysql-test/main/subselect_no_semijoin.test b/mysql-test/main/subselect_no_semijoin.test
index 6b82b748912..84d312c03c8 100644
--- a/mysql-test/main/subselect_no_semijoin.test
+++ b/mysql-test/main/subselect_no_semijoin.test
@@ -8,5 +8,28 @@ set @join_cache_level_for_subselect_test=@@join_cache_level;
--source subselect.test
+--echo #
+--echo # MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON
+--echo #
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (1),(5);
+
+# t2 must be MyISAM or Aria and contain 1 row
+CREATE TABLE t2 ( b INT ) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1);
+
+CREATE TABLE t3 ( c INT );
+INSERT INTO t3 VALUES (4),(5);
+
+SET @tmp19714=@@optimizer_switch;
+SET optimizer_switch='subquery_cache=off';
+
+explain format=json
+SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
+
+SET optimizer_switch=@tmp19714;
+
+drop table t1,t2,t3;
+
set @optimizer_switch_for_subselect_test=null;
set @join_cache_level_for_subselect_test=NULL;
diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result
index b872e058c6c..412bfca4bf2 100644
--- a/mysql-test/main/win.result
+++ b/mysql-test/main/win.result
@@ -3607,6 +3607,33 @@ b row_number() over (partition by sum(a)+1)
2000 1
drop table t1;
#
+# MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed when using UDF,
+# window functions and views
+#
+create table t1 (id int, n1 int);
+insert into t1 values (1,1),(2,1),(3,2),(4,4);
+explain
+select max(n1) over (partition by 'abc') from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary
+select max(n1) over (partition by 'abc') from t1;
+max(n1) over (partition by 'abc')
+4
+4
+4
+4
+explain
+select rank() over (partition by 'abc' order by 'xyz') from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary
+select rank() over (partition by 'abc' order by 'xyz') from t1;
+rank() over (partition by 'abc' order by 'xyz')
+1
+1
+1
+1
+drop table t1;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index 16e8be5eb0a..d49be4a0433 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -2326,6 +2326,22 @@ select b, row_number() over (partition by sum(a)+1) from t1 group by b;
drop table t1;
--echo #
+--echo # MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed when using UDF,
+--echo # window functions and views
+--echo #
+
+create table t1 (id int, n1 int);
+insert into t1 values (1,1),(2,1),(3,2),(4,4);
+explain
+select max(n1) over (partition by 'abc') from t1;
+select max(n1) over (partition by 'abc') from t1;
+
+explain
+select rank() over (partition by 'abc' order by 'xyz') from t1;
+select rank() over (partition by 'abc' order by 'xyz') from t1;
+drop table t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/suite/binlog/r/flashback-largebinlog.result b/mysql-test/suite/binlog/r/flashback-largebinlog.result
new file mode 100644
index 00000000000..526204f259f
--- /dev/null
+++ b/mysql-test/suite/binlog/r/flashback-largebinlog.result
@@ -0,0 +1,71 @@
+#
+# Preparatory cleanup.
+#
+drop database if exists mysqltest;
+create database mysqltest;
+use mysqltest;
+DROP TABLE IF EXISTS t1;
+#
+# We need a fixed timestamp to avoid varying results.
+#
+SET timestamp=1000000000;
+#
+# We need big packets.
+#
+# Capture initial value to reset at the end of the test
+# Now adjust max_allowed_packet
+SET @@global.max_allowed_packet= 10*1024*1024*1024;
+Warnings:
+Warning 1292 Truncated incorrect max_allowed_packet value: '10737418240'
+max_allowed_packet is a global variable.
+In order for the preceding change in max_allowed_packets' value
+to be seen and used, we must start a new connection.
+The change does not take effect with the current one.
+For simplicity, we just disconnect / reconnect connection default here.
+disconnect default;
+connect default, localhost,root,,;
+#
+# Delete all existing binary logs.
+#
+RESET MASTER;
+#
+# Create a test table.
+#
+use mysqltest;
+CREATE TABLE t1 (
+c1 LONGTEXT
+) DEFAULT CHARSET latin1;
+#
+# Show how many rows are affected by each statement.
+#
+#
+# Insert some big rows.
+#
+insert 1024MB data twice
+INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 67108864));
+affected rows: 1
+INSERT INTO t1 VALUES (REPEAT('MegaByteBlckMany', 67108864));
+affected rows: 1
+#
+# Flush all log buffers to the log file.
+#
+FLUSH LOGS;
+affected rows: 0
+#
+# Call mysqlbinlog to display the log file contents.
+# NOTE: The output of mysqlbinlog is redirected to
+# $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out
+# If you want to examine it, disable remove_file
+# at the bottom of the test script.
+#
+#
+# Cleanup.
+#
+# reset variable value to pass testcase checks
+SET @@global.max_allowed_packet = 16777216;
+affected rows: 0
+DROP TABLE t1;
+affected rows: 0
+drop database if exists mysqltest;
+affected rows: 0
+remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out
diff --git a/mysql-test/suite/binlog/t/flashback-largebinlog.test b/mysql-test/suite/binlog/t/flashback-largebinlog.test
new file mode 100644
index 00000000000..6ff58b706d3
--- /dev/null
+++ b/mysql-test/suite/binlog/t/flashback-largebinlog.test
@@ -0,0 +1,110 @@
+# mysqlbinlog_big.test
+#
+# Show that mysqlbinlog can handle big rows.
+#
+
+#
+# The *huge* output of mysqlbinlog will be redirected to
+# $MYSQLTEST_VARDIR/$mysqlbinlog_output
+#
+--let $mysqlbinlog_output= tmp/mysqlbinlog_big_1.out
+
+--source include/have_binlog_format_row.inc
+
+--source include/have_log_bin.inc
+
+# This is a big test.
+--source include/big_test.inc
+
+--echo #
+--echo # Preparatory cleanup.
+--echo #
+--disable_warnings
+drop database if exists mysqltest;
+create database mysqltest;
+use mysqltest;
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #
+--echo # We need a fixed timestamp to avoid varying results.
+--echo #
+SET timestamp=1000000000;
+
+--echo #
+--echo # We need big packets.
+--echo #
+--echo # Capture initial value to reset at the end of the test
+# use let $<var> = query_get_value as FLUSH statements
+# in the test will set @<var> values to NULL
+let $orig_max_allowed_packet =
+query_get_value(SELECT @@global.max_allowed_packet, @@global.max_allowed_packet, 1);
+
+--echo # Now adjust max_allowed_packet
+SET @@global.max_allowed_packet= 10*1024*1024*1024;
+
+--echo max_allowed_packet is a global variable.
+--echo In order for the preceding change in max_allowed_packets' value
+--echo to be seen and used, we must start a new connection.
+--echo The change does not take effect with the current one.
+--echo For simplicity, we just disconnect / reconnect connection default here.
+disconnect default;
+connect (default, localhost,root,,);
+
+--echo #
+--echo # Delete all existing binary logs.
+--echo #
+RESET MASTER;
+
+--echo #
+--echo # Create a test table.
+--echo #
+use mysqltest;
+eval CREATE TABLE t1 (
+ c1 LONGTEXT
+ ) DEFAULT CHARSET latin1;
+
+--echo #
+--echo # Show how many rows are affected by each statement.
+--echo #
+--enable_info
+
+--echo #
+--echo # Insert some big rows.
+--echo #
+
+--echo insert 1024MB data twice
+INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 67108864));
+INSERT INTO t1 VALUES (REPEAT('MegaByteBlckMany', 67108864));
+
+--echo #
+--echo # Flush all log buffers to the log file.
+--echo #
+FLUSH LOGS;
+
+--echo #
+--echo # Call mysqlbinlog to display the log file contents.
+--echo # NOTE: The output of mysqlbinlog is redirected to
+--echo # \$MYSQLTEST_VARDIR/$mysqlbinlog_output
+--echo # If you want to examine it, disable remove_file
+--echo # at the bottom of the test script.
+--echo #
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
+--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/
+--exec $MYSQL_BINLOG -B -v -v $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output
+
+--echo #
+--echo # Cleanup.
+--echo #
+--echo # reset variable value to pass testcase checks
+eval SET @@global.max_allowed_packet = $orig_max_allowed_packet;
+DROP TABLE t1;
+drop database if exists mysqltest;
+
+--echo remove_file \$MYSQLTEST_VARDIR/$mysqlbinlog_output
+#
+# NOTE: If you want to see the *huge* mysqlbinlog output, disable next line:
+#
+--remove_file $MYSQLTEST_VARDIR/$mysqlbinlog_output
+
diff --git a/mysql-test/suite/encryption/r/compressed_import_tablespace.result b/mysql-test/suite/encryption/r/compressed_import_tablespace.result
new file mode 100644
index 00000000000..63e7cf8b0c3
--- /dev/null
+++ b/mysql-test/suite/encryption/r/compressed_import_tablespace.result
@@ -0,0 +1,39 @@
+CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES;
+INSERT INTO t1 VALUES(1, repeat('Nesamani', 10));
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `a` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `ENCRYPTED`=YES
+# Wait max 10 min for key encryption threads to encrypt all spaces
+db.opt
+t1.frm
+t1.ibd
+FLUSH TABLES t1 FOR EXPORT;
+backup: t1
+db.opt
+t1.cfg
+t1.frm
+t1.ibd
+UNLOCK TABLES;
+DROP TABLE t1;
+CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES;
+ALTER TABLE t1 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `a` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `ENCRYPTED`=YES
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/t/compressed_import_tablespace.opt b/mysql-test/suite/encryption/t/compressed_import_tablespace.opt
new file mode 100644
index 00000000000..a9893ed4b29
--- /dev/null
+++ b/mysql-test/suite/encryption/t/compressed_import_tablespace.opt
@@ -0,0 +1,3 @@
+--innodb-encrypt-tables=ON
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/compressed_import_tablespace.test b/mysql-test/suite/encryption/t/compressed_import_tablespace.test
new file mode 100644
index 00000000000..b9e4913584b
--- /dev/null
+++ b/mysql-test/suite/encryption/t/compressed_import_tablespace.test
@@ -0,0 +1,46 @@
+-- source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+-- source include/not_valgrind.inc
+-- source include/not_embedded.inc
+
+let MYSQLD_DATADIR = `SELECT @@datadir`;
+--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
+CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES;
+INSERT INTO t1 VALUES(1, repeat('Nesamani', 10));
+
+SELECT COUNT(*) FROM t1;
+SHOW CREATE TABLE t1;
+
+--echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND ROTATING_OR_FLUSHING <> 0
+--source include/wait_condition.inc
+
+--source include/shutdown_mysqld.inc
+
+--source include/start_mysqld.inc
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+
+--list_files $MYSQLD_DATADIR/test
+FLUSH TABLES t1 FOR EXPORT;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1");
+EOF
+--list_files $MYSQLD_DATADIR/test
+UNLOCK TABLES;
+DROP TABLE t1;
+
+CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES;
+ALTER TABLE t1 DISCARD TABLESPACE;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
+ALTER TABLE t1 IMPORT TABLESPACE;
+
+SELECT COUNT(*) FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index e3cbf8fba84..0b0fefd9adf 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -1779,3 +1779,24 @@
fun:CRYPTO_malloc
fun:ENGINE_new
}
+
+#
+# OpenSSL 1.0.1l problems
+#
+
+{
+ OpenSSL 1.0.1l wrong jump
+ Memcheck:Cond
+ fun:bcmp
+ obj:/usr/lib64/libcrypto.so*
+ fun:FIPS_selftest
+}
+
+{
+ OpenSSL 1.0.1l wrong jump 2
+ Memcheck:Cond
+ obj:/usr/lib64/libcrypto.so*
+ fun:FIPS_mode_set
+ obj:/usr/lib64/libcrypto.so*
+}
+
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index 78fee354592..6990d1350e3 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -74,7 +74,7 @@ IF(HAVE_MLOCK)
ENDIF()
ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
-TARGET_LINK_LIBRARIES(mysys dbug strings mysys_ssl ${ZLIB_LIBRARY}
+TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}
${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_LIBRARY})
DTRACE_INSTRUMENT(mysys)
diff --git a/plugin/auth_ed25519/CMakeLists.txt b/plugin/auth_ed25519/CMakeLists.txt
index 73d8eeb208b..ff6651c528d 100644
--- a/plugin/auth_ed25519/CMakeLists.txt
+++ b/plugin/auth_ed25519/CMakeLists.txt
@@ -25,8 +25,8 @@ MYSQL_ADD_PLUGIN(auth_ed25519 server_ed25519.c ${REF10_SOURCES} MODULE_ONLY)
# client plugin and unit test ed25519-t can use the library
MYSQL_ADD_PLUGIN(client_ed25519 client_ed25519.c MODULE_ONLY
- CLIENT LINK_LIBRARIES mysys_ssl ref10 COMPONENT ClientPlugins)
+ CLIENT LINK_LIBRARIES ref10 mysys_ssl COMPONENT ClientPlugins)
IF(WITH_UNIT_TESTS)
- MY_ADD_TESTS(ed25519 LINK_LIBRARIES mysys ref10)
+ MY_ADD_TESTS(ed25519 LINK_LIBRARIES ref10 mysys_ssl)
ENDIF()
diff --git a/sql/handler.h b/sql/handler.h
index 7d3017d4a12..154fc6da9d1 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1013,7 +1013,7 @@ typedef bool (stat_print_fn)(THD *thd, const char *type, size_t type_len,
const char *file, size_t file_len,
const char *status, size_t status_len);
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
-extern st_plugin_int *hton2plugin[MAX_HA];
+extern MYSQL_PLUGIN_IMPORT st_plugin_int *hton2plugin[MAX_HA];
/* Transaction log maintains type definitions */
enum log_status
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index 9ba60c3956d..144deb18d8c 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -44,11 +44,6 @@ public:
first_check= true;
}
- void cleanup()
- {
- group_fields.empty();
- }
-
/*
Check if the current row is in a different group than the previous row
this function was called for.
@@ -86,6 +81,10 @@ public:
}
return 0;
}
+ ~Group_bound_tracker()
+ {
+ group_fields.delete_elements();
+ }
private:
List<Cached_item> group_fields;
@@ -215,7 +214,6 @@ public:
{
if (peer_tracker)
{
- peer_tracker->cleanup();
delete peer_tracker;
peer_tracker= NULL;
}
@@ -285,7 +283,6 @@ class Item_sum_dense_rank: public Item_sum_int
{
if (peer_tracker)
{
- peer_tracker->cleanup();
delete peer_tracker;
peer_tracker= NULL;
}
@@ -547,7 +544,6 @@ class Item_sum_percent_rank: public Item_sum_window_with_row_count
{
if (peer_tracker)
{
- peer_tracker->cleanup();
delete peer_tracker;
peer_tracker= NULL;
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index e8c605ce945..4b31b78fc21 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -9411,8 +9411,10 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
opt_specialflag|= SPECIAL_NO_HOST_CACHE;
break;
case (int) OPT_SKIP_RESOLVE:
- opt_skip_name_resolve= 1;
- opt_specialflag|=SPECIAL_NO_RESOLVE;
+ if ((opt_skip_name_resolve= (argument != disabled_my_option)))
+ opt_specialflag|= SPECIAL_NO_RESOLVE;
+ else
+ opt_specialflag&= ~SPECIAL_NO_RESOLVE;
break;
case (int) OPT_WANT_CORE:
test_flags |= TEST_CORE_ON_SIGNAL;
@@ -9471,6 +9473,8 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
break;
case OPT_PLUGIN_LOAD:
free_list(opt_plugin_load_list_ptr);
+ if (argument == disabled_my_option)
+ break; // Resets plugin list
/* fall through */
case OPT_PLUGIN_LOAD_ADD:
opt_plugin_load_list_ptr->push_back(new i_string(argument));
diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc
index 9531749e024..a1c1156cd27 100644
--- a/sql/sql_explain.cc
+++ b/sql/sql_explain.cc
@@ -904,6 +904,11 @@ void Explain_select::print_explain_json(Explain_query *query,
writer->add_member("outer_ref_condition");
write_item(writer, outer_ref_cond);
}
+ if (pseudo_bits_cond)
+ {
+ writer->add_member("pseudo_bits_condition");
+ write_item(writer, pseudo_bits_cond);
+ }
/* we do not print HAVING which always evaluates to TRUE */
if (having || (having_value == Item::COND_FALSE))
diff --git a/sql/sql_explain.h b/sql/sql_explain.h
index d95c4e4ad8f..7a814dfa3af 100644
--- a/sql/sql_explain.h
+++ b/sql/sql_explain.h
@@ -236,6 +236,7 @@ public:
/* Expensive constant condition */
Item *exec_const_cond;
Item *outer_ref_cond;
+ Item *pseudo_bits_cond;
/* HAVING condition */
Item *having;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 8919da0a460..1876f6067fa 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -25755,6 +25755,7 @@ int JOIN::save_explain_data_intern(Explain_query *output,
xpl_sel->exec_const_cond= exec_const_cond;
xpl_sel->outer_ref_cond= outer_ref_cond;
+ xpl_sel->pseudo_bits_cond= pseudo_bits_cond;
if (tmp_having)
xpl_sel->having= tmp_having;
else
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index a03c0083320..9182275c695 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -6097,10 +6097,12 @@ database_corrupted:
if (err == DB_PAGE_CORRUPTED
|| err == DB_DECRYPTION_FAILED) {
+ const page_id_t corrupt_page_id = bpage->id;
+
buf_corrupt_page_release(bpage, space);
if (recv_recovery_is_on()) {
- recv_recover_corrupt_page(bpage);
+ recv_recover_corrupt_page(corrupt_page_id);
}
space->release_for_io();
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index 19f46b1ce81..e7593cf482d 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -215,77 +215,6 @@ struct buf_pools_list_size_t {
};
#endif /* !UNIV_INNOCHECKSUM */
-/** Page identifier. */
-class page_id_t {
-public:
-
- /** Constructor from (space, page_no).
- @param[in] space tablespace id
- @param[in] page_no page number */
- page_id_t(ulint space, ulint page_no)
- : m_space(uint32_t(space)), m_page_no(uint32(page_no))
- {
- ut_ad(space <= 0xFFFFFFFFU);
- ut_ad(page_no <= 0xFFFFFFFFU);
- }
-
- bool operator==(const page_id_t& rhs) const
- {
- return m_space == rhs.m_space && m_page_no == rhs.m_page_no;
- }
- bool operator!=(const page_id_t& rhs) const { return !(*this == rhs); }
-
- bool operator<(const page_id_t& rhs) const
- {
- if (m_space == rhs.m_space) {
- return m_page_no < rhs.m_page_no;
- }
-
- return m_space < rhs.m_space;
- }
-
- /** Retrieve the tablespace id.
- @return tablespace id */
- uint32_t space() const { return m_space; }
-
- /** Retrieve the page number.
- @return page number */
- uint32_t page_no() const { return m_page_no; }
-
- /** Retrieve the fold value.
- @return fold value */
- ulint fold() const { return (m_space << 20) + m_space + m_page_no; }
-
- /** Reset the page number only.
- @param[in] page_no page number */
- inline void set_page_no(ulint page_no)
- {
- m_page_no = uint32_t(page_no);
-
- ut_ad(page_no <= 0xFFFFFFFFU);
- }
-
-private:
-
- /** Tablespace id. */
- uint32_t m_space;
-
- /** Page number. */
- uint32_t m_page_no;
-
- /** Declare the overloaded global operator<< as a friend of this
- class. Refer to the global declaration for further details. Print
- the given page_id_t object.
- @param[in,out] out the output stream
- @param[in] page_id the page_id_t object to be printed
- @return the output stream */
- friend
- std::ostream&
- operator<<(
- std::ostream& out,
- const page_id_t page_id);
-};
-
/** Print the given page_id_t object.
@param[in,out] out the output stream
@param[in] page_id the page_id_t object to be printed
diff --git a/storage/innobase/include/buf0types.h b/storage/innobase/include/buf0types.h
index 4cd5257928b..bc74b59f3b1 100644
--- a/storage/innobase/include/buf0types.h
+++ b/storage/innobase/include/buf0types.h
@@ -125,6 +125,77 @@ this must be equal to srv_page_size */
#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
/* @} */
+/** Page identifier. */
+class page_id_t {
+public:
+
+ /** Constructor from (space, page_no).
+ @param[in] space tablespace id
+ @param[in] page_no page number */
+ page_id_t(ulint space, ulint page_no)
+ : m_space(uint32_t(space)), m_page_no(uint32(page_no))
+ {
+ ut_ad(space <= 0xFFFFFFFFU);
+ ut_ad(page_no <= 0xFFFFFFFFU);
+ }
+
+ bool operator==(const page_id_t& rhs) const
+ {
+ return m_space == rhs.m_space && m_page_no == rhs.m_page_no;
+ }
+ bool operator!=(const page_id_t& rhs) const { return !(*this == rhs); }
+
+ bool operator<(const page_id_t& rhs) const
+ {
+ if (m_space == rhs.m_space) {
+ return m_page_no < rhs.m_page_no;
+ }
+
+ return m_space < rhs.m_space;
+ }
+
+ /** Retrieve the tablespace id.
+ @return tablespace id */
+ uint32_t space() const { return m_space; }
+
+ /** Retrieve the page number.
+ @return page number */
+ uint32_t page_no() const { return m_page_no; }
+
+ /** Retrieve the fold value.
+ @return fold value */
+ ulint fold() const { return (m_space << 20) + m_space + m_page_no; }
+
+ /** Reset the page number only.
+ @param[in] page_no page number */
+ void set_page_no(ulint page_no)
+ {
+ m_page_no = uint32_t(page_no);
+
+ ut_ad(page_no <= 0xFFFFFFFFU);
+ }
+
+private:
+
+ /** Tablespace id. */
+ uint32_t m_space;
+
+ /** Page number. */
+ uint32_t m_page_no;
+
+ /** Declare the overloaded global operator<< as a friend of this
+ class. Refer to the global declaration for further details. Print
+ the given page_id_t object.
+ @param[in,out] out the output stream
+ @param[in] page_id the page_id_t object to be printed
+ @return the output stream */
+ friend
+ std::ostream&
+ operator<<(
+ std::ostream& out,
+ const page_id_t page_id);
+};
+
#ifndef UNIV_INNOCHECKSUM
#include "ut0mutex.h"
diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
index 49eae7e9643..927e04ce04e 100644
--- a/storage/innobase/include/log0recv.h
+++ b/storage/innobase/include/log0recv.h
@@ -51,8 +51,8 @@ recv_find_max_checkpoint(ulint* max_field)
/** Reduces recv_sys->n_addrs for the corrupted page.
This function should called when srv_force_recovery > 0.
-@param[in] bpage buffer pool page */
-void recv_recover_corrupt_page(buf_page_t* bpage);
+@param[in] page_id page id of the corrupted page */
+void recv_recover_corrupt_page(page_id_t page_id);
/** Apply any buffered redo log to a page that was just read from a data file.
@param[in,out] bpage buffer pool page */
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index e65fb79e831..c896d9da6a2 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2017, MariaDB Corporation.
+Copyright (c) 2013, 2019, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted
by Percona Inc.. Those modifications are
@@ -796,9 +796,7 @@ os_file_rename
os_aio
os_file_read
os_file_read_no_error_handling
-os_file_read_no_error_handling_int_fd
os_file_write
-os_file_write_int_fd
The wrapper functions have the prefix of "innodb_". */
@@ -1174,13 +1172,9 @@ to original un-instrumented file I/O APIs */
# define os_file_read_no_error_handling(type, file, buf, offset, n, o) \
os_file_read_no_error_handling_func(type, file, buf, offset, n, o)
-# define os_file_read_no_error_handling_int_fd(type, file, buf, offset, n) \
- os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL)
# define os_file_write(type, name, file, buf, offset, n) \
os_file_write_func(type, name, file, buf, offset, n)
-# define os_file_write_int_fd(type, name, file, buf, offset, n) \
- os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n)
# define os_file_flush(file) os_file_flush_func(file)
diff --git a/storage/innobase/include/os0file.ic b/storage/innobase/include/os0file.ic
index f1b8aa67180..e01fcb41afb 100644
--- a/storage/innobase/include/os0file.ic
+++ b/storage/innobase/include/os0file.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2010, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2017, MariaDB Corporation.
+Copyright (c) 2013, 2019, 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 the Free Software
diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h
index 45366f9128a..27bd19252ac 100644
--- a/storage/innobase/include/row0merge.h
+++ b/storage/innobase/include/row0merge.h
@@ -370,7 +370,9 @@ row_merge_buf_sort(
/********************************************************************//**
Write a merge block to the file system.
-@return whether the request was completed successfully */
+@return whether the request was completed successfully
+@retval false on error
+@retval true on success */
UNIV_INTERN
bool
row_merge_write(
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 68c3e5ccc2c..898e57a5f53 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -2175,8 +2175,8 @@ skip_log:
/** Reduces recv_sys->n_addrs for the corrupted page.
This function should called when srv_force_recovery > 0.
-@param[in] bpage buffer pool page */
-void recv_recover_corrupt_page(buf_page_t* bpage)
+@param[in] page_id page id of the corrupted page */
+void recv_recover_corrupt_page(page_id_t page_id)
{
ut_ad(srv_force_recovery);
mutex_enter(&recv_sys->mutex);
@@ -2187,7 +2187,7 @@ void recv_recover_corrupt_page(buf_page_t* bpage)
}
recv_addr_t* recv_addr = recv_get_fil_addr_struct(
- bpage->id.space(), bpage->id.page_no());
+ page_id.space(), page_id.page_no());
ut_ad(recv_addr->state != RECV_WILL_NOT_READ);
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index c7a2ffddb19..744bb7bc756 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -4984,7 +4984,8 @@ Requests a synchronous write operation.
@param[out] buf buffer from which to write
@param[in] offset file offset from the start where to read
@param[in] n number of bytes to read, starting from offset
-@return DB_SUCCESS if request was successful, false if fail */
+@return error code
+@retval DB_SUCCESS if the operation succeeded */
dberr_t
os_file_write_func(
const IORequest& type,
@@ -5441,7 +5442,8 @@ Requests a synchronous positioned read operation.
@param[out] buf buffer where to read
@param[in] offset file offset from the start where to read
@param[in] n number of bytes to read, starting from offset
-@return DB_SUCCESS or error code */
+@return error code
+@retval DB_SUCCESS if the operation succeeded */
dberr_t
os_file_read_func(
const IORequest& type,
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index c4c3b95b654..c7798aa2c10 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -3416,8 +3416,12 @@ page_corrupted:
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
+ src)) {
not_encrypted:
- if (!page_compressed
- && !block->page.zip.data) {
+ if (block->page.id.page_no() == 0
+ && block->page.zip.data) {
+ block->page.zip.data = src;
+ frame_changed = true;
+ } else if (!page_compressed
+ && !block->page.zip.data) {
block->frame = src;
frame_changed = true;
} else {
@@ -3508,7 +3512,11 @@ not_encrypted:
}
if (frame_changed) {
- block->frame = dst;
+ if (block->page.zip.data) {
+ block->page.zip.data = dst;
+ } else {
+ block->frame = dst;
+ }
}
src = io_buffer + (i * size);
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 7750ec11526..42d01be732d 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2005, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2018, MariaDB Corporation.
+Copyright (c) 2014, 2019, 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 the Free Software
@@ -1115,7 +1115,9 @@ row_merge_read(
/********************************************************************//**
Write a merge block to the file system.
-@return whether the request was completed successfully */
+@return whether the request was completed successfully
+@retval false on error
+@retval true on success */
UNIV_INTERN
bool
row_merge_write(
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index a84cf485974..8a8e4e6b4f0 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -2724,9 +2724,12 @@ int ha_maria::external_lock(THD *thd, int lock_type)
}
}
} /* if transactional table */
- DBUG_RETURN(maria_lock_database(file, !table->s->tmp_table ?
+ int result = maria_lock_database(file, !table->s->tmp_table ?
lock_type : ((lock_type == F_UNLCK) ?
- F_UNLCK : F_EXTRA_LCK)));
+ F_UNLCK : F_EXTRA_LCK));
+ if (!file->s->base.born_transactional)
+ file->state= &file->s->state.state; // Restore state if clone
+ DBUG_RETURN(result);
}
int ha_maria::start_stmt(THD *thd, thr_lock_type lock_type)
diff --git a/storage/rocksdb/mysql-test/rocksdb/slow_query_log.awk b/storage/rocksdb/mysql-test/rocksdb/slow_query_log.awk
index 4617b6d9fc3..a921f47243e 100644
--- a/storage/rocksdb/mysql-test/rocksdb/slow_query_log.awk
+++ b/storage/rocksdb/mysql-test/rocksdb/slow_query_log.awk
@@ -1,5 +1,3 @@
-#!/bin/awk
-
/Query_time:/ {
results["Rows_examined:"] = "uninit";
results["RocksDB_key_skipped:"] = "uninit";
diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_slocket_socket.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_slocket_socket.sh
index 6174e5d1864..db470f527ca 100755
--- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_slocket_socket.sh
+++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_slocket_socket.sh
@@ -1,2 +1,4 @@
+#!/bin/bash
+
src_data_dir="${MYSQLTEST_VARDIR}/mysqld.1/data/"
python -c "import socket as s; sock = s.socket(s.AF_UNIX); sock.bind('${src_data_dir}/slocket')"
diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_table.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_table.sh
index a4d60dc864c..2004caca160 100755
--- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_table.sh
+++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_table.sh
@@ -1,3 +1,5 @@
+#!/bin/bash
+
set -e
COPY_LOG=$1
diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data.sh
index f3836ab75e5..80f1a5e2567 100755
--- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data.sh
+++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data.sh
@@ -1,3 +1,5 @@
+#!/bin/bash
+
set -e
# Insert 100 batches of 100 records each to a table with following schema:
diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_and_run.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_and_run.sh
index a4e4afab9d4..a8e6fc445bb 100755
--- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_and_run.sh
+++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_and_run.sh
@@ -1,3 +1,5 @@
+#!/bin/bash
+
set -e
# Initially loads a chunk of data.
diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_slocket.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_slocket.sh
index ed0b3cb5c1c..036d68662d4 100755
--- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_slocket.sh
+++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_slocket.sh
@@ -1,3 +1,5 @@
+#!/bin/bash
+
set -e
# Insert 10 batches of 10 records each to a table with following schema:
diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/remove_slocket_socket.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/remove_slocket_socket.sh
index 0c2c71aad68..9114629ba31 100755
--- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/remove_slocket_socket.sh
+++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/remove_slocket_socket.sh
@@ -1,2 +1,4 @@
+#!/bin/bash
+
src_data_dir="${MYSQLTEST_VARDIR}/mysqld.1/data/"
rm "${src_data_dir}/slocket"
diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/setup_replication_gtid.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/setup_replication_gtid.sh
index 18e1feeda96..3c95068a488 100755
--- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/setup_replication_gtid.sh
+++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/setup_replication_gtid.sh
@@ -1,3 +1,5 @@
+#!/bin/bash
+
set -e
binlog_line=($(grep -o "Last binlog file position [0-9]*, file name .*\.[0-9]*" ${MYSQLTEST_VARDIR}/log/mysqld.2.err | tail -1))
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 88e28f79789..43fe96a20f3 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -2348,6 +2348,12 @@ static void test_ps_query_cache()
"(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')");
myquery(rc);
+ rc= mysql_query(mysql,
+ "set @save_query_cache_type="
+ "@@global.query_cache_type,"
+ "@save_query_cache_size="
+ "@@global.query_cache_size");
+ myquery(rc);
rc= mysql_query(lmysql, "set global query_cache_type=ON");
myquery(rc);
rc= mysql_query(lmysql, "set local query_cache_type=ON");
@@ -2504,9 +2510,9 @@ static void test_ps_query_cache()
if (lmysql != mysql)
mysql_close(lmysql);
- rc= mysql_query(mysql, "set global query_cache_size=default");
+ rc= mysql_query(mysql, "set global query_cache_size=@save_query_cache_size");
myquery(rc);
- rc= mysql_query(mysql, "set global query_cache_type=default");
+ rc= mysql_query(mysql, "set global query_cache_type=@save_query_cache_type");
myquery(rc);
}
@@ -13441,6 +13447,12 @@ static void test_open_cursor_prepared_statement_query_cache()
return;
}
+ rc= mysql_query(mysql,
+ "set @save_query_cache_type="
+ "@@global.query_cache_type,"
+ "@save_query_cache_size="
+ "@@global.query_cache_size");
+ myquery(rc);
rc= mysql_query(mysql, "set global query_cache_type=ON");
myquery(rc);
rc= mysql_query(mysql, "set local query_cache_type=ON");
@@ -13467,9 +13479,9 @@ static void test_open_cursor_prepared_statement_query_cache()
check_execute(stmt, rc);
mysql_stmt_close(stmt);
- rc= mysql_query(mysql, "set global query_cache_type=default");
+ rc= mysql_query(mysql, "set global query_cache_type=@save_query_cache_type");
myquery(rc);
- rc= mysql_query(mysql, "set global query_cache_size=default");
+ rc= mysql_query(mysql, "set global query_cache_size=@save_query_cache_size");
myquery(rc);
}
@@ -18254,6 +18266,12 @@ static void test_bug36326()
myquery(rc);
rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)");
myquery(rc);
+ rc= mysql_query(mysql,
+ "set @save_query_cache_type="
+ "@@global.query_cache_type,"
+ "@save_query_cache_size="
+ "@@global.query_cache_size");
+ myquery(rc);
rc= mysql_query(mysql, "SET GLOBAL query_cache_type = 1");
myquery(rc);
rc= mysql_query(mysql, "SET LOCAL query_cache_type = 1");
@@ -18281,8 +18299,8 @@ static void test_bug36326()
DIE_UNLESS(rc == 1);
rc= mysql_query(mysql, "DROP TABLE t1");
myquery(rc);
- rc= mysql_query(mysql, "SET GLOBAL query_cache_size = default");
- rc= mysql_query(mysql, "SET GLOBAL query_cache_type = default");
+ rc= mysql_query(mysql, "SET GLOBAL query_cache_size = @save_query_cache_size");
+ rc= mysql_query(mysql, "SET GLOBAL query_cache_type = @save_query_cache_type");
myquery(rc);
DBUG_VOID_RETURN;
diff --git a/unittest/mysys/CMakeLists.txt b/unittest/mysys/CMakeLists.txt
index f06d63d05fb..1d97340784d 100644
--- a/unittest/mysys/CMakeLists.txt
+++ b/unittest/mysys/CMakeLists.txt
@@ -14,10 +14,10 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
MY_ADD_TESTS(bitmap base64 my_atomic my_rdtsc lf my_malloc my_getopt dynstring
- aes byte_order
+ byte_order
LINK_LIBRARIES mysys)
MY_ADD_TESTS(my_vsnprintf LINK_LIBRARIES strings mysys)
-
+MY_ADD_TESTS(aes LINK_LIBRARIES mysys mysys_ssl)
ADD_DEFINITIONS(${SSL_DEFINES})
MY_ADD_TESTS(ma_dyncol LINK_LIBRARIES mysys)
diff --git a/unittest/sql/CMakeLists.txt b/unittest/sql/CMakeLists.txt
index f63dc0b2a21..a4ba1019e49 100644
--- a/unittest/sql/CMakeLists.txt
+++ b/unittest/sql/CMakeLists.txt
@@ -31,6 +31,6 @@ TARGET_LINK_LIBRARIES(explain_filename-t sql mytap)
MY_ADD_TEST(explain_filename)
ADD_EXECUTABLE(mf_iocache-t mf_iocache-t.cc ../../sql/mf_iocache_encr.cc)
-TARGET_LINK_LIBRARIES(mf_iocache-t mysys mytap)
+TARGET_LINK_LIBRARIES(mf_iocache-t mysys mytap mysys_ssl)
ADD_DEPENDENCIES(mf_iocache-t GenError)
MY_ADD_TEST(mf_iocache)