summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBUILD/SETUP.sh2
-rwxr-xr-xBUILD/compile-pentium64-ubsan29
-rw-r--r--client/mysqltest.cc2
-rw-r--r--cmake/configure.pl10
-rw-r--r--debian/additions/innotop/innotop1
-rw-r--r--extra/my_print_defaults.c2
-rw-r--r--include/byte_order_generic.h8
-rw-r--r--include/byte_order_generic_x86.h1
-rw-r--r--include/json_lib.h1
-rw-r--r--include/my_byteorder.h4
-rw-r--r--include/my_compare.h4
-rw-r--r--include/myisampack.h10
m---------libmariadb0
-rw-r--r--libmysqld/libmysql.c2
-rw-r--r--man/mysqlbinlog.121
-rw-r--r--mysql-test/include/not_asan.inc2
-rw-r--r--mysql-test/include/not_ubsan.inc8
-rw-r--r--mysql-test/main/alter_table.result17
-rw-r--r--mysql-test/main/alter_table.test12
-rw-r--r--mysql-test/main/connect_debug.result4
-rw-r--r--mysql-test/main/crash_commit_before.result2
-rw-r--r--mysql-test/main/delayed.result2
-rw-r--r--mysql-test/main/join_outer.result103
-rw-r--r--mysql-test/main/join_outer.test122
-rw-r--r--mysql-test/main/join_outer_jcl6.result103
-rw-r--r--mysql-test/main/myisam_crash_before_flush_keys.result2
-rw-r--r--mysql-test/main/mysql.result10
-rw-r--r--mysql-test/main/mysql_upgrade.result2
-rw-r--r--mysql-test/main/mysqld--help.test1
-rw-r--r--mysql-test/main/sp.test2
-rw-r--r--mysql-test/main/ssl.test2
-rw-r--r--mysql-test/main/ssl_crl.test2
-rw-r--r--mysql-test/main/ssl_timeout.result2
-rw-r--r--mysql-test/main/subselect_exists2in.result18
-rw-r--r--mysql-test/main/subselect_exists2in.test23
-rwxr-xr-xmysql-test/mysql-test-run.pl7
-rw-r--r--mysql-test/std_data/galera_certs/INFORMATION2
-rw-r--r--mysql-test/std_data/galera_certs/galera.1.crt25
-rw-r--r--mysql-test/std_data/galera_certs/galera.1.csr16
-rw-r--r--mysql-test/std_data/galera_certs/galera.1.key27
-rw-r--r--mysql-test/std_data/galera_certs/galera.2.crt25
-rw-r--r--mysql-test/std_data/galera_certs/galera.2.csr16
-rw-r--r--mysql-test/std_data/galera_certs/galera.2.key27
-rw-r--r--mysql-test/std_data/galera_certs/galera.root.crt32
-rw-r--r--mysql-test/std_data/galera_certs/galera.root.key54
-rw-r--r--mysql-test/std_data/galera_certs/galera.root.srl1
-rw-r--r--mysql-test/suite/binlog/r/binlog_empty_xa_prepared.result79
-rw-r--r--mysql-test/suite/binlog/r/binlog_index.result12
-rw-r--r--mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result1
-rw-r--r--mysql-test/suite/binlog/t/binlog_empty_xa_prepared.test47
-rw-r--r--mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test1
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_index.result12
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sync.result4
-rw-r--r--mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result14
-rw-r--r--mysql-test/suite/galera/r/galera_var_wsrep_on_off.result57
-rw-r--r--mysql-test/suite/galera/t/galera_var_wsrep_on_off.test78
-rw-r--r--mysql-test/suite/galera_3nodes/disabled.def4
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ssl_reload.result15
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf10
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ssl_reload.test67
-rw-r--r--mysql-test/suite/galera_3nodes_sr/r/GCF-832.result2
-rw-r--r--mysql-test/suite/galera_sr/r/galera_sr_cc_master.result2
-rw-r--r--mysql-test/suite/innodb/r/alter_crash.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-tempfile.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-blob.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522-debug.result8
-rw-r--r--mysql-test/suite/innodb/r/redo_log_during_checkpoint.result4
-rw-r--r--mysql-test/suite/innodb/r/temporary_table.result96
-rw-r--r--mysql-test/suite/innodb/t/temporary_table.test107
-rw-r--r--mysql-test/suite/innodb_fts/r/sync.result2
-rw-r--r--mysql-test/suite/innodb_gis/r/rollback.result2
-rw-r--r--mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result4
-rw-r--r--mysql-test/suite/maria/bulk_insert_crash.result2
-rw-r--r--mysql-test/suite/maria/maria-gis-recovery.result4
-rw-r--r--mysql-test/suite/maria/maria-recovery-big.result2
-rw-r--r--mysql-test/suite/maria/maria-recovery-bitmap.result4
-rw-r--r--mysql-test/suite/maria/maria-recovery-rtree-ft.result12
-rw-r--r--mysql-test/suite/maria/maria-recovery.result20
-rw-r--r--mysql-test/suite/maria/maria-recovery2.result10
-rw-r--r--mysql-test/suite/maria/maria-recovery3.result8
-rw-r--r--mysql-test/suite/parts/r/debug_fail_myisam.result62
-rw-r--r--mysql-test/suite/parts/r/debug_innodb_crash.result62
-rw-r--r--mysql-test/suite/parts/r/debug_myisam_crash.result62
-rw-r--r--mysql-test/suite/parts/r/partition_debug.result18
-rw-r--r--mysql-test/suite/parts/r/partition_debug_innodb.result18
-rw-r--r--mysql-test/suite/plugins/t/multiauth.test1
-rw-r--r--mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_sync.result4
-rw-r--r--mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test2
-rw-r--r--mysql-test/suite/sys_vars/inc/sysvars_server.inc3
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result3
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result3
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_on_without_provider.result5
-rw-r--r--mysql-test/suite/sys_vars/t/thread_stack_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test9
-rw-r--r--mysql-test/suite/versioning/r/alter.result17
-rw-r--r--mysql-test/suite/versioning/t/alter.test23
-rw-r--r--mysql-test/suite/wsrep/disabled.def1
-rw-r--r--mysql-test/suite/wsrep/r/wsrep_on_basic.result (renamed from mysql-test/suite/sys_vars/r/wsrep_on_basic.result)4
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_on_basic.opt1
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_on_basic.test (renamed from mysql-test/suite/sys_vars/t/wsrep_on_basic.test)2
-rw-r--r--mysys/ma_dyncol.c6
-rw-r--r--mysys/mf_iocache.c2
-rw-r--r--plugin/auth_ed25519/CMakeLists.txt4
-rw-r--r--sql/compat56.h4
-rw-r--r--sql/events.cc12
-rw-r--r--sql/field.h8
-rw-r--r--sql/gcalc_tools.h6
-rw-r--r--sql/ha_partition.cc1
-rw-r--r--sql/item.cc18
-rw-r--r--sql/item_buff.cc4
-rw-r--r--sql/item_cmpfunc.cc10
-rw-r--r--sql/item_func.cc62
-rw-r--r--sql/item_jsonfunc.cc5
-rw-r--r--sql/item_strfunc.cc16
-rw-r--r--sql/item_strfunc.h9
-rw-r--r--sql/item_subselect.cc36
-rw-r--r--sql/item_sum.cc6
-rw-r--r--sql/item_timefunc.cc23
-rw-r--r--sql/log.cc29
-rw-r--r--sql/mf_iocache.cc2
-rw-r--r--sql/opt_split.cc2
-rw-r--r--sql/opt_subselect.cc12
-rw-r--r--sql/partition_element.h3
-rw-r--r--sql/service_wsrep.cc18
-rw-r--r--sql/signal_handler.cc6
-rw-r--r--sql/sql_acl.cc126
-rw-r--r--sql/sql_base.cc14
-rw-r--r--sql/sql_class.cc2
-rw-r--r--sql/sql_class.h4
-rw-r--r--sql/sql_derived.cc23
-rw-r--r--sql/sql_lex.cc1
-rw-r--r--sql/sql_parse.cc4
-rw-r--r--sql/sql_partition.cc2
-rw-r--r--sql/sql_reload.cc8
-rw-r--r--sql/sql_select.cc47
-rw-r--r--sql/sql_select.h97
-rw-r--r--sql/sql_sequence.cc4
-rw-r--r--sql/sql_sequence.h4
-rw-r--r--sql/sql_show.cc3
-rw-r--r--sql/sql_table.cc14
-rw-r--r--sql/sql_test.cc9
-rw-r--r--sql/sql_type_int.h14
-rw-r--r--sql/strfunc.cc16
-rw-r--r--sql/sys_vars.cc22
-rw-r--r--sql/temporary_tables.cc16
-rw-r--r--sql/wsrep_mysqld.cc26
-rw-r--r--sql/wsrep_mysqld.h1
-rw-r--r--sql/wsrep_trans_observer.h10
-rw-r--r--sql/wsrep_var.cc59
-rw-r--r--storage/archive/ha_archive.cc15
-rw-r--r--storage/archive/ha_archive.h14
-rw-r--r--storage/connect/colblk.h2
-rw-r--r--storage/connect/connect.cc6
-rw-r--r--storage/connect/filamvct.cpp3
-rw-r--r--storage/connect/ha_connect.cc13
-rw-r--r--storage/connect/tabutil.cpp2
-rw-r--r--storage/innobase/btr/btr0cur.cc13
-rw-r--r--storage/innobase/handler/ha_innodb.cc6
-rw-r--r--storage/innobase/handler/ha_innodb.h2
-rw-r--r--storage/innobase/include/page0page.ic4
-rw-r--r--storage/innobase/include/trx0sys.h1
-rw-r--r--storage/innobase/include/ut0ut.h2
-rw-r--r--storage/innobase/pars/pars0pars.cc1
-rw-r--r--storage/innobase/rem/rem0rec.cc10
-rw-r--r--storage/innobase/row/row0ins.cc7
-rw-r--r--storage/innobase/row/row0uins.cc3
-rw-r--r--storage/innobase/row/row0umod.cc3
-rw-r--r--storage/innobase/row/row0undo.cc2
-rw-r--r--storage/mroonga/lib/mrn_multiple_column_key_codec.cpp3
-rw-r--r--storage/mroonga/vendor/groonga/lib/alloc.c14
-rw-r--r--storage/mroonga/vendor/groonga/lib/db.c2
-rw-r--r--storage/mroonga/vendor/groonga/lib/pat.c4
-rw-r--r--storage/mroonga/vendor/groonga/lib/proc/proc_select.c3
-rw-r--r--storage/mroonga/vendor/groonga/lib/str.c5
-rw-r--r--storage/myisam/myisampack.c15
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/add_index_inplace_crash.result4
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/allow_to_start_after_corruption.result4
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/autoinc_debug.result8
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test2
-rw-r--r--strings/ctype-simple.c5
-rw-r--r--strings/ctype-uca.c7
-rw-r--r--strings/json_lib.c1
-rw-r--r--tests/mysql_client_test.c8
187 files changed, 2115 insertions, 690 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 0fd3ee7597a..041749784ce 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -141,7 +141,7 @@ elif [ "x$warning_mode" = "xmaintainer" ]; then
debug_extra_cflags="-g3"
else
# Both C and C++ warnings
- warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized -Wno-strict-aliasing"
+ warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized -Wno-strict-aliasing -Wimplicit-fallthrough=2 -Wformat-security -Wvla"
# For more warnings, uncomment the following line
# warnings="$warnings -Wshadow"
diff --git a/BUILD/compile-pentium64-ubsan b/BUILD/compile-pentium64-ubsan
new file mode 100755
index 00000000000..bf56d84283f
--- /dev/null
+++ b/BUILD/compile-pentium64-ubsan
@@ -0,0 +1,29 @@
+#! /bin/sh
+# Copyright (c) 2018, 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 Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+# Compilation with UBSAN, The Undefined Behavior Sanitizer
+# We have to use -Wno-uninitialized and -Wno-unitialized we get a lot of false
+# positive warnings for this when compiling with -fsanitize=undefined.
+# We also have to compile without Spider as linking with Spider library does
+# not work. (errno: 11, undefined symbol: _ZTI12ha_partition)
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized"
+extra_configs="$pentium_configs $debug_configs -DWITH_UBSAN=ON -DMYSQL_MAINTAINER_MODE=NO --without-spider --without-tokudb"
+
+. "$path/FINISH.sh"
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 73436e5165a..a7dc04b5f54 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -10954,7 +10954,7 @@ int get_next_bit(REP_SET *set,uint lastpos)
start=set->bits+ ((lastpos+1) / WORD_BIT);
end=set->bits + set->size_of_bits;
- bits=start[0] & ~((1 << ((lastpos+1) % WORD_BIT)) -1);
+ bits=start[0] & ~((1U << ((lastpos+1) % WORD_BIT)) -1);
while (! bits && ++start < end)
bits=start[0];
diff --git a/cmake/configure.pl b/cmake/configure.pl
index c296c5ba4b8..4085110b6fa 100644
--- a/cmake/configure.pl
+++ b/cmake/configure.pl
@@ -93,6 +93,11 @@ foreach my $option (@ARGV)
{
$option = substr($option, 2);
}
+ elsif (substr ($option, 0, 2) eq "-D")
+ {
+ # Must be cmake config option
+ $option = substr($option, 1);
+ }
else
{
# This must be environment variable
@@ -119,6 +124,11 @@ foreach my $option (@ARGV)
$just_print=1;
next;
}
+ if ($option =~ /D.*=/)
+ {
+ $cmakeargs = $cmakeargs." -".$option;
+ next;
+ }
if($option =~ /with-plugins=/)
{
my @plugins= split(/,/, substr($option,13));
diff --git a/debian/additions/innotop/innotop b/debian/additions/innotop/innotop
index 19229a57a82..dce494efeb1 100644
--- a/debian/additions/innotop/innotop
+++ b/debian/additions/innotop/innotop
@@ -4153,6 +4153,7 @@ my $nonfatal_errs = join('|',
'Access denied',
'AutoCommit',
'Lost connection to MySQL server',
+ 'Lost connection to server',
'Too many connections',
);
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index a8c8050cb1d..1dec667949f 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -93,7 +93,7 @@ static void usage()
{
version();
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
- puts("Prints all arguments that is give to some program using the default files");
+ puts("Displays the options from option groups of option files, which is useful to see which options a particular tool will use");
printf("Usage: %s [OPTIONS] [groups]\n", my_progname);
my_print_help(my_long_options);
my_print_default_files(config_file);
diff --git a/include/byte_order_generic.h b/include/byte_order_generic.h
index 8381941b9b9..d2b729a241d 100644
--- a/include/byte_order_generic.h
+++ b/include/byte_order_generic.h
@@ -28,10 +28,10 @@
(((uint32) (uchar) (A)[2]) << 16) |\
(((uint32) (uchar) (A)[1]) << 8) | \
((uint32) (uchar) (A)[0])))
-#define sint4korr(A) (int32) (((int32) ((uchar) (A)[0])) |\
- (((int32) ((uchar) (A)[1]) << 8)) |\
- (((int32) ((uchar) (A)[2]) << 16)) |\
- (((int32) ((int16) (A)[3]) << 24)))
+#define sint4korr(A) (int32) (((uint32) ((uchar) (A)[0])) |\
+ (((uint32) ((uchar) (A)[1]) << 8)) |\
+ (((uint32) ((uchar) (A)[2]) << 16)) |\
+ (((uint32) ((uchar) (A)[3]) << 24)))
#define sint8korr(A) (longlong) uint8korr(A)
#define uint2korr(A) (uint16) (((uint16) ((uchar) (A)[0])) |\
((uint16) ((uchar) (A)[1]) << 8))
diff --git a/include/byte_order_generic_x86.h b/include/byte_order_generic_x86.h
index 72e00be8c2c..c47564478c6 100644
--- a/include/byte_order_generic_x86.h
+++ b/include/byte_order_generic_x86.h
@@ -17,6 +17,7 @@
/*
Optimized function-like macros for the x86 architecture (_WIN32 included).
*/
+
#define sint2korr(A) (*((const int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \
diff --git a/include/json_lib.h b/include/json_lib.h
index b6add6d13a3..bb649928eaa 100644
--- a/include/json_lib.h
+++ b/include/json_lib.h
@@ -172,6 +172,7 @@ enum json_states {
enum json_value_types
{
+ JSON_VALUE_UNINITALIZED=0,
JSON_VALUE_OBJECT=1,
JSON_VALUE_ARRAY=2,
JSON_VALUE_STRING=3,
diff --git a/include/my_byteorder.h b/include/my_byteorder.h
index c302781d9fc..abdf19a3632 100644
--- a/include/my_byteorder.h
+++ b/include/my_byteorder.h
@@ -31,10 +31,10 @@
format (low byte first). There are 'korr' (assume 'corrector') variants
for integer types, but 'get' (assume 'getter') for floating point types.
*/
-#if defined(__i386__) || defined(_WIN32)
+#if (defined(__i386__) || defined(_WIN32)) && !defined(WITH_UBSAN)
#define MY_BYTE_ORDER_ARCH_OPTIMIZED
#include "byte_order_generic_x86.h"
-#elif defined(__x86_64__)
+#elif defined(__x86_64__) && !defined(WITH_UBSAN)
#include "byte_order_generic_x86_64.h"
#else
#include "byte_order_generic.h"
diff --git a/include/my_compare.h b/include/my_compare.h
index e9c0513d11c..f936bbe6b0c 100644
--- a/include/my_compare.h
+++ b/include/my_compare.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2011, Oracle and/or its affiliates.
- Copyright (c) 1991, 2020, MariaDB Corporation.
+ Copyright (c) 1991, 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
@@ -95,7 +95,7 @@ static inline uchar get_rec_bits(const uchar *ptr, uchar ofs, uint len)
{
uint16 val= ptr[0];
if (ofs + len > 8)
- val|= (uint16)((uint16)(ptr[1]) << 8);
+ val|= (uint16)(((uint) ptr[1]) << 8);
return (uchar) ((val >> ofs) & ((1 << len) - 1));
}
diff --git a/include/myisampack.h b/include/myisampack.h
index 6bfe1958fbc..f3c5fe7114a 100644
--- a/include/myisampack.h
+++ b/include/myisampack.h
@@ -30,7 +30,7 @@
#define mi_uint1korr(A) ((uint8)(*A))
#define mi_sint2korr(A) ((int16) (((int16) (((const uchar*) (A))[1])) |\
- ((int16) ((int16) ((const char*) (A))[0]) << 8)))
+ ((int16) ((uint16) ((const uchar*) (A))[0]) << 8)))
#define mi_sint3korr(A) ((int32) (((((const uchar*) (A))[0]) & 128) ? \
(((uint32) 255L << 24) | \
(((uint32) ((const uchar*) (A))[0]) << 16) |\
@@ -39,10 +39,10 @@
(((uint32) ((const uchar*) (A))[0]) << 16) |\
(((uint32) ((const uchar*) (A))[1]) << 8) | \
((uint32) ((const uchar*) (A))[2])))
-#define mi_sint4korr(A) ((int32) (((int32) (((const uchar*) (A))[3])) |\
- ((int32) (((const uchar*) (A))[2]) << 8) |\
- ((int32) (((const uchar*) (A))[1]) << 16) |\
- ((int32) ((int16) ((const char*) (A))[0]) << 24)))
+#define mi_sint4korr(A) ((int32) (((uint32) (((const uchar*) (A))[3])) |\
+ ((uint32) (((const uchar*) (A))[2]) << 8) |\
+ ((uint32) (((const uchar*) (A))[1]) << 16) |\
+ ((uint32) (((const uchar*) (A))[0]) << 24)))
#define mi_sint8korr(A) ((longlong) mi_uint8korr(A))
#define mi_uint2korr(A) ((uint16) (((uint16) (((const uchar*) (A))[1])) |\
((uint16) (((const uchar*) (A))[0]) << 8)))
diff --git a/libmariadb b/libmariadb
-Subproject b6f8883d9687936a50a7ed79bd9e5af2340efcc
+Subproject 03d983b287f8a1fe855cb5ed479a3f7ab4f922a
diff --git a/libmysqld/libmysql.c b/libmysqld/libmysql.c
index 9a17b9b4f09..e131a92b01e 100644
--- a/libmysqld/libmysql.c
+++ b/libmysqld/libmysql.c
@@ -512,7 +512,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
if (my_net_write(net, (uchar*) buf, readcount))
{
DBUG_PRINT("error",
- ("Lost connection to MySQL server during LOAD DATA of local file"));
+ ("Lost connection to server during LOAD DATA of local file"));
set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
goto err;
}
diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1
index 60b52e3e0fb..c2fa339c075 100644
--- a/man/mysqlbinlog.1
+++ b/man/mysqlbinlog.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLBINLOG\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMYSQLBINLOG\FR" "1" "14 April 2021" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -1091,6 +1091,23 @@ This option is useful for point\-in\-time recovery\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlbinlog: table option
+.\" table option: mysqlbinlog
+\fB\-\-table\fR,
+\fB\-T\fR
+.sp
+List entries for just this table (local log only)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+
.\" mysqlbinlog: to-last-log option
.\" to-last-log option: mysqlbinlog
\fB\-\-to\-last\-log\fR,
@@ -2107,7 +2124,7 @@ option can be used to prevent this header from being written\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2020 MariaDB Foundation
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2021 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
diff --git a/mysql-test/include/not_asan.inc b/mysql-test/include/not_asan.inc
index 91f39b80150..9fc86a8525a 100644
--- a/mysql-test/include/not_asan.inc
+++ b/mysql-test/include/not_asan.inc
@@ -2,7 +2,7 @@
# be overcome. In normal cases one should fix the bug server/test case or in
# the worst case add a (temporary?) suppression in asan.supp or lsan.supp
-if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer'`)
+if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value="ASAN"`)
{
--skip Can't be run with ASan
}
diff --git a/mysql-test/include/not_ubsan.inc b/mysql-test/include/not_ubsan.inc
new file mode 100644
index 00000000000..809f505507e
--- /dev/null
+++ b/mysql-test/include/not_ubsan.inc
@@ -0,0 +1,8 @@
+# This file should only be used with test that finds bugs in ASan that can not
+# be overcome. In normal cases one should fix the bug server/test case or in
+# the worst case add a (temporary?) suppression in asan.supp or lsan.supp
+
+if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value="UBSAN"`)
+{
+--skip Can't be run with UBSAN
+}
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index a5f70d61def..48db24d24b2 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -2532,6 +2532,23 @@ ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1);
ERROR HY000: Function or expression 'select ...' cannot be used in the DEFAULT clause of `k1`
DROP TABLE t1,t2;
#
+# MDEV-25403 ALTER TABLE wrongly checks for field's default value if AFTER is used
+#
+create table t1(t int, d date not null);
+insert into t1 values (1,'2001-1-1');
+set sql_mode = "no_zero_date";
+alter table t1 change d d date not null after t, add i int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t` int(11) DEFAULT NULL,
+ `d` date NOT NULL,
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t1 add x date not null;
+ERROR 22007: Incorrect date value: '0000-00-00' for column `test`.`t1`.`x` at row 1
+drop table t1;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index 5fd1358e9a9..e65a4edf13e 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -2051,6 +2051,18 @@ ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1);
DROP TABLE t1,t2;
--echo #
+--echo # MDEV-25403 ALTER TABLE wrongly checks for field's default value if AFTER is used
+--echo #
+create table t1(t int, d date not null);
+insert into t1 values (1,'2001-1-1');
+set sql_mode = "no_zero_date";
+alter table t1 change d d date not null after t, add i int;
+show create table t1;
+--error ER_TRUNCATED_WRONG_VALUE
+alter table t1 add x date not null;
+drop table t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/connect_debug.result b/mysql-test/main/connect_debug.result
index cc3da50ec6b..2adafc2c4a9 100644
--- a/mysql-test/main/connect_debug.result
+++ b/mysql-test/main/connect_debug.result
@@ -11,10 +11,10 @@ drop user bad;
set global debug_dbug='+d,increase_srv_handshake_scramble_len';
connect(localhost,root,,test,MASTER_MYPORT,MYSQL_TMP_DIR/mysqld.1.sock);
connect con1,localhost,root;
-ERROR HY000: received malformed packet
+ERROR HY000: Received malformed packet
set global debug_dbug=@old_dbug;
set global debug_dbug='+d,poison_srv_handshake_scramble_len';
connect(localhost,root,,test,MASTER_MYPORT,MYSQL_TMP_DIR/mysqld.1.sock);
connect con2,localhost,root;
-ERROR HY000: received malformed packet
+ERROR HY000: Received malformed packet
set global debug_dbug=@old_dbug;
diff --git a/mysql-test/main/crash_commit_before.result b/mysql-test/main/crash_commit_before.result
index 22d39e1ddbd..55fea1909f0 100644
--- a/mysql-test/main/crash_commit_before.result
+++ b/mysql-test/main/crash_commit_before.result
@@ -3,7 +3,7 @@ START TRANSACTION;
insert into t1 values(9);
SET GLOBAL debug_dbug="d,crash_commit_before";
COMMIT;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/main/delayed.result b/mysql-test/main/delayed.result
index ec36e3af46d..55f5ff6eb28 100644
--- a/mysql-test/main/delayed.result
+++ b/mysql-test/main/delayed.result
@@ -494,7 +494,7 @@ create table t1 (a int, b int) engine=myisam;
insert into t1 values (1,1);
SET debug_dbug="d,crash_shutdown";
shutdown;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
call mtr.add_suppression(" marked as crashed and should be repaired");
call mtr.add_suppression("Checking table");
insert delayed into t1 values (2,2);
diff --git a/mysql-test/main/join_outer.result b/mysql-test/main/join_outer.result
index e882973043e..fcffeb6d161 100644
--- a/mysql-test/main/join_outer.result
+++ b/mysql-test/main/join_outer.result
@@ -2687,6 +2687,77 @@ id timestamp modifiedBy id REV REVTYPE profile_id id REV person_id id REV
DROP TABLE t1,t2,t3,t4;
# end of 10.1 tests
#
+# MDEV-25362: name resolution for subqueries in ON expressions
+#
+create table t1 (a int, b int);
+create table t2 (c int, d int);
+create table t3 (e int, f int);
+create table t4 (g int, h int);
+explain
+select *
+from
+t1 left join
+(t2
+join
+t3 on
+(t3.f=t1.a)
+) on (t2.c=t1.a );
+ERROR 42S22: Unknown column 't1.a' in 'on clause'
+explain
+select *
+from
+t1 left join
+(t2
+join
+t3 on
+(t3.f=(select max(g) from t4 where t4.h=t1.a))
+) on (t2.c=t1.a );
+ERROR 42S22: Unknown column 't1.a' in 'where clause'
+drop table t1,t2,t3,t4;
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2 (b int);
+insert into t2 values (1),(2);
+create table t3 (c int);
+insert into t3 values (1),(2);
+select * from ( select * from t1 left join t2
+on b in (select x from t3 as sq1)
+) as sq2;
+ERROR 42S22: Unknown column 'x' in 'field list'
+drop table t1,t2,t3;
+# end of 10.2 tests
+#
+# MDEV-22866: Crash in join optimizer with constant outer join nest
+#
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (3),(4);
+CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM;
+CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (5),(6);
+CREATE TABLE t5 (e INT) ENGINE=MyISAM;
+INSERT INTO t5 VALUES (7),(8);
+CREATE TABLE t6 (f INT) ENGINE=MyISAM;
+INSERT INTO t6 VALUES (9),(10);
+SELECT *
+FROM
+t1
+LEFT JOIN (
+t2 LEFT JOIN (
+t3 JOIN
+t4 ON t3.c = t4.d and t3.c >2 and t3.c<0
+) ON t2.b >= t4.d
+) ON t1.a <= t2.b
+LEFT JOIN t5 ON t2.b = t5.e
+LEFT JOIN t6 ON t3.c = t6.f;
+a b c d e f
+1 3 NULL NULL NULL NULL
+1 4 NULL NULL NULL NULL
+2 3 NULL NULL NULL NULL
+2 4 NULL NULL NULL NULL
+drop table t1,t2,t3,t4,t5,t6;
+#
# MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins
#
create table t1(a int);
@@ -2754,35 +2825,5 @@ WHERE t3.pk IN (2);
1
drop view v4;
drop table t1,t2,t3,t4;
+# end of 10.3 tests
SET optimizer_switch=@org_optimizer_switch;
-#
-# MDEV-22866: Crash in join optimizer with constant outer join nest
-#
-CREATE TABLE t1 (a INT) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1),(2);
-CREATE TABLE t2 (b INT) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (3),(4);
-CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM;
-CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM;
-INSERT INTO t4 VALUES (5),(6);
-CREATE TABLE t5 (e INT) ENGINE=MyISAM;
-INSERT INTO t5 VALUES (7),(8);
-CREATE TABLE t6 (f INT) ENGINE=MyISAM;
-INSERT INTO t6 VALUES (9),(10);
-SELECT *
-FROM
-t1
-LEFT JOIN (
-t2 LEFT JOIN (
-t3 JOIN
-t4 ON t3.c = t4.d and t3.c >2 and t3.c<0
-) ON t2.b >= t4.d
-) ON t1.a <= t2.b
-LEFT JOIN t5 ON t2.b = t5.e
-LEFT JOIN t6 ON t3.c = t6.f;
-a b c d e f
-1 3 NULL NULL NULL NULL
-2 3 NULL NULL NULL NULL
-1 4 NULL NULL NULL NULL
-2 4 NULL NULL NULL NULL
-drop table t1,t2,t3,t4,t5,t6;
diff --git a/mysql-test/main/join_outer.test b/mysql-test/main/join_outer.test
index f835d8af5a8..82c7b265b56 100644
--- a/mysql-test/main/join_outer.test
+++ b/mysql-test/main/join_outer.test
@@ -2192,6 +2192,91 @@ DROP TABLE t1,t2,t3,t4;
--echo # end of 10.1 tests
--echo #
+--echo # MDEV-25362: name resolution for subqueries in ON expressions
+--echo #
+
+create table t1 (a int, b int);
+create table t2 (c int, d int);
+create table t3 (e int, f int);
+create table t4 (g int, h int);
+
+--error ER_BAD_FIELD_ERROR
+explain
+select *
+from
+ t1 left join
+ (t2
+ join
+ t3 on
+ (t3.f=t1.a)
+ ) on (t2.c=t1.a );
+
+# This must produce an error:
+--error ER_BAD_FIELD_ERROR
+explain
+select *
+from
+ t1 left join
+ (t2
+ join
+ t3 on
+ (t3.f=(select max(g) from t4 where t4.h=t1.a))
+ ) on (t2.c=t1.a );
+
+drop table t1,t2,t3,t4;
+
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2 (b int);
+insert into t2 values (1),(2);
+create table t3 (c int);
+insert into t3 values (1),(2);
+
+--error ER_BAD_FIELD_ERROR
+select * from ( select * from t1 left join t2
+ on b in (select x from t3 as sq1)
+ ) as sq2;
+
+drop table t1,t2,t3;
+
+--echo # end of 10.2 tests
+
+--echo #
+--echo # MDEV-22866: Crash in join optimizer with constant outer join nest
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (3),(4);
+
+CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM;
+
+CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (5),(6);
+
+CREATE TABLE t5 (e INT) ENGINE=MyISAM;
+INSERT INTO t5 VALUES (7),(8);
+
+CREATE TABLE t6 (f INT) ENGINE=MyISAM;
+INSERT INTO t6 VALUES (9),(10);
+
+SELECT *
+FROM
+ t1
+ LEFT JOIN (
+ t2 LEFT JOIN (
+ t3 JOIN
+ t4 ON t3.c = t4.d and t3.c >2 and t3.c<0
+ ) ON t2.b >= t4.d
+ ) ON t1.a <= t2.b
+ LEFT JOIN t5 ON t2.b = t5.e
+ LEFT JOIN t6 ON t3.c = t6.f;
+
+drop table t1,t2,t3,t4,t5,t6;
+
+--echo #
--echo # MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins
--echo #
create table t1(a int);
@@ -2251,39 +2336,6 @@ WHERE t3.pk IN (2);
drop view v4;
drop table t1,t2,t3,t4;
-SET optimizer_switch=@org_optimizer_switch;
-
---echo #
---echo # MDEV-22866: Crash in join optimizer with constant outer join nest
---echo #
-
-CREATE TABLE t1 (a INT) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1),(2);
+--echo # end of 10.3 tests
-CREATE TABLE t2 (b INT) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (3),(4);
-
-CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM;
-
-CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM;
-INSERT INTO t4 VALUES (5),(6);
-
-CREATE TABLE t5 (e INT) ENGINE=MyISAM;
-INSERT INTO t5 VALUES (7),(8);
-
-CREATE TABLE t6 (f INT) ENGINE=MyISAM;
-INSERT INTO t6 VALUES (9),(10);
-
-SELECT *
-FROM
- t1
- LEFT JOIN (
- t2 LEFT JOIN (
- t3 JOIN
- t4 ON t3.c = t4.d and t3.c >2 and t3.c<0
- ) ON t2.b >= t4.d
- ) ON t1.a <= t2.b
- LEFT JOIN t5 ON t2.b = t5.e
- LEFT JOIN t6 ON t3.c = t6.f;
-
-drop table t1,t2,t3,t4,t5,t6;
+SET optimizer_switch=@org_optimizer_switch;
diff --git a/mysql-test/main/join_outer_jcl6.result b/mysql-test/main/join_outer_jcl6.result
index 9cbfa5d0fe5..721989c3368 100644
--- a/mysql-test/main/join_outer_jcl6.result
+++ b/mysql-test/main/join_outer_jcl6.result
@@ -2694,6 +2694,77 @@ id timestamp modifiedBy id REV REVTYPE profile_id id REV person_id id REV
DROP TABLE t1,t2,t3,t4;
# end of 10.1 tests
#
+# MDEV-25362: name resolution for subqueries in ON expressions
+#
+create table t1 (a int, b int);
+create table t2 (c int, d int);
+create table t3 (e int, f int);
+create table t4 (g int, h int);
+explain
+select *
+from
+t1 left join
+(t2
+join
+t3 on
+(t3.f=t1.a)
+) on (t2.c=t1.a );
+ERROR 42S22: Unknown column 't1.a' in 'on clause'
+explain
+select *
+from
+t1 left join
+(t2
+join
+t3 on
+(t3.f=(select max(g) from t4 where t4.h=t1.a))
+) on (t2.c=t1.a );
+ERROR 42S22: Unknown column 't1.a' in 'where clause'
+drop table t1,t2,t3,t4;
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2 (b int);
+insert into t2 values (1),(2);
+create table t3 (c int);
+insert into t3 values (1),(2);
+select * from ( select * from t1 left join t2
+on b in (select x from t3 as sq1)
+) as sq2;
+ERROR 42S22: Unknown column 'x' in 'field list'
+drop table t1,t2,t3;
+# end of 10.2 tests
+#
+# MDEV-22866: Crash in join optimizer with constant outer join nest
+#
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (3),(4);
+CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM;
+CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (5),(6);
+CREATE TABLE t5 (e INT) ENGINE=MyISAM;
+INSERT INTO t5 VALUES (7),(8);
+CREATE TABLE t6 (f INT) ENGINE=MyISAM;
+INSERT INTO t6 VALUES (9),(10);
+SELECT *
+FROM
+t1
+LEFT JOIN (
+t2 LEFT JOIN (
+t3 JOIN
+t4 ON t3.c = t4.d and t3.c >2 and t3.c<0
+) ON t2.b >= t4.d
+) ON t1.a <= t2.b
+LEFT JOIN t5 ON t2.b = t5.e
+LEFT JOIN t6 ON t3.c = t6.f;
+a b c d e f
+1 3 NULL NULL NULL NULL
+2 3 NULL NULL NULL NULL
+1 4 NULL NULL NULL NULL
+2 4 NULL NULL NULL NULL
+drop table t1,t2,t3,t4,t5,t6;
+#
# MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins
#
create table t1(a int);
@@ -2761,35 +2832,5 @@ WHERE t3.pk IN (2);
1
drop view v4;
drop table t1,t2,t3,t4;
+# end of 10.3 tests
SET optimizer_switch=@org_optimizer_switch;
-#
-# MDEV-22866: Crash in join optimizer with constant outer join nest
-#
-CREATE TABLE t1 (a INT) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1),(2);
-CREATE TABLE t2 (b INT) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (3),(4);
-CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM;
-CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM;
-INSERT INTO t4 VALUES (5),(6);
-CREATE TABLE t5 (e INT) ENGINE=MyISAM;
-INSERT INTO t5 VALUES (7),(8);
-CREATE TABLE t6 (f INT) ENGINE=MyISAM;
-INSERT INTO t6 VALUES (9),(10);
-SELECT *
-FROM
-t1
-LEFT JOIN (
-t2 LEFT JOIN (
-t3 JOIN
-t4 ON t3.c = t4.d and t3.c >2 and t3.c<0
-) ON t2.b >= t4.d
-) ON t1.a <= t2.b
-LEFT JOIN t5 ON t2.b = t5.e
-LEFT JOIN t6 ON t3.c = t6.f;
-a b c d e f
-1 3 NULL NULL NULL NULL
-2 3 NULL NULL NULL NULL
-1 4 NULL NULL NULL NULL
-2 4 NULL NULL NULL NULL
-drop table t1,t2,t3,t4,t5,t6;
diff --git a/mysql-test/main/myisam_crash_before_flush_keys.result b/mysql-test/main/myisam_crash_before_flush_keys.result
index 7d929ffb644..fca8134be16 100644
--- a/mysql-test/main/myisam_crash_before_flush_keys.result
+++ b/mysql-test/main/myisam_crash_before_flush_keys.result
@@ -17,7 +17,7 @@ SET SESSION debug_dbug="d,crash_before_flush_keys";
# Write file to make mysql-test-run.pl expect crash
# Run the crashing query
FLUSH TABLE t1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# Write file to make mysql-test-run.pl start the server
# Turn on reconnect
# Call script that will poll the server waiting for
diff --git a/mysql-test/main/mysql.result b/mysql-test/main/mysql.result
index ec2760ce8a7..ef5332e2142 100644
--- a/mysql-test/main/mysql.result
+++ b/mysql-test/main/mysql.result
@@ -172,14 +172,14 @@ ERROR 1049 (42000) at line 1: Unknown database 'invalid'
ERROR 1049 (42000) at line 1: Unknown database 'invalid'
Test connect with dbname + hostname
Test connect with dbname + _invalid_ hostname
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
+ERROR 2005 (HY000) at line 1: Unknown server host 'invalid_hostname' (errno)
+ERROR 2005 (HY000) at line 1: Unknown server host 'invalid_hostname' (errno)
The commands reported in the bug report
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyril has found a bug :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno)
+ERROR 2005 (HY000) at line 1: Unknown server host 'cyril has found a bug :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno)
Too long dbname
ERROR 1102 (42000) at line 1: Incorrect database name 'test_really_long_dbnamexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...'
Too long hostname
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyrils_superlonghostnameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno)
+ERROR 2005 (HY000) at line 1: Unknown server host 'cyrils_superlonghostnameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno)
1
1
ERROR at line 1: DELIMITER cannot contain a backslash character
@@ -208,7 +208,7 @@ COUNT (*)
1
COUNT (*)
1
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
+ERROR 2005 (HY000) at line 1: Unknown server host 'invalid_hostname' (errno)
End of 5.0 tests
WARNING: --server-arg option not supported in this configuration.
*************************** 1. row ***************************
diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result
index a85068df421..3a4ac9089a2 100644
--- a/mysql-test/main/mysql_upgrade.result
+++ b/mysql-test/main/mysql_upgrade.result
@@ -455,7 +455,7 @@ Version check failed. Got the following error when calling the 'mysql' command l
ERROR 1045 (28000): Access denied for user 'mysqltest1'@'localhost' (using password: YES)
FATAL ERROR: Upgrade failed
Run mysql_upgrade with a non existing server socket
-mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
+mysqlcheck: Got error: 2005: Unknown server host 'not_existing_host' (errno) when trying to connect
FATAL ERROR: Upgrade failed
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
Phase 1/7: Checking and upgrading mysql database
diff --git a/mysql-test/main/mysqld--help.test b/mysql-test/main/mysqld--help.test
index f7eb038a6f3..4405b198951 100644
--- a/mysql-test/main/mysqld--help.test
+++ b/mysql-test/main/mysqld--help.test
@@ -3,6 +3,7 @@
#
--source include/not_embedded.inc
--source include/not_asan.inc
+--source include/not_ubsan.inc
--source include/have_perfschema.inc
--source include/have_profiling.inc
--source include/platform.inc
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index 7a7378e4e34..f263cfb17cc 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -3258,7 +3258,7 @@ call bug7013()|
drop procedure bug7013|
#
-# BUG#7743: 'Lost connection to MySQL server during query' on Stored Procedure
+# BUG#7743: 'Lost connection to server during query' on Stored Procedure
#
--disable_warnings
drop table if exists t4|
diff --git a/mysql-test/main/ssl.test b/mysql-test/main/ssl.test
index 45c903d43d2..82ada27ffd4 100644
--- a/mysql-test/main/ssl.test
+++ b/mysql-test/main/ssl.test
@@ -26,7 +26,7 @@ SHOW STATUS LIKE 'Ssl_server_not_after';
SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
#
-# MDEV-7697 Client reports ERROR 2006 (MySQL server has gone away) or ERROR 2013 (Lost connection to MySQL server during query) while executing AES* functions under SSL
+# MDEV-7697 Client reports ERROR 2006 (MySQL server has gone away) or ERROR 2013 (Lost connection to server during query) while executing AES* functions under SSL
#
select aes_decrypt('MySQL','adf');
select 'still connected?';
diff --git a/mysql-test/main/ssl_crl.test b/mysql-test/main/ssl_crl.test
index e79f8ff32c2..23bae038d54 100644
--- a/mysql-test/main/ssl_crl.test
+++ b/mysql-test/main/ssl_crl.test
@@ -8,6 +8,6 @@
--echo # try logging in with a certificate in the server's --ssl-crl : should fail
# OpenSSL 1.1.1a correctly rejects the certificate, but the error message is different
---replace_regex /ERROR 2013 \(HY000\): Lost connection to MySQL server at '.*', system error: [0-9]+/ERROR 2026 (HY000): SSL connection error: sslv3 alert certificate revoked/
+--replace_regex /ERROR 2013 \(HY000\): Lost connection to server at '.*', system error: [0-9]+/ERROR 2026 (HY000): SSL connection error: sslv3 alert certificate revoked/
--error 1
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_version'" 2>&1
diff --git a/mysql-test/main/ssl_timeout.result b/mysql-test/main/ssl_timeout.result
index 3c94a9927da..e0d1dbed69f 100644
--- a/mysql-test/main/ssl_timeout.result
+++ b/mysql-test/main/ssl_timeout.result
@@ -5,6 +5,6 @@ SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS
have_ssl
1
SELECT SLEEP(600);
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
connection default;
disconnect ssl_con;
diff --git a/mysql-test/main/subselect_exists2in.result b/mysql-test/main/subselect_exists2in.result
index e8ef7081b09..6ff518b5a29 100644
--- a/mysql-test/main/subselect_exists2in.result
+++ b/mysql-test/main/subselect_exists2in.result
@@ -1102,4 +1102,22 @@ U5.`storage_target_id` = V0.`id`
);
id
drop table t1,t2,t3;
+#
+# MDEV-25407: EXISTS subquery with correlation in ON expression crashes
+#
+create table t10(a int primary key);
+insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t11(a int primary key);
+insert into t11 select a.a + b.a* 10 + c.a * 100 from t10 a, t10 b, t10 c;
+create table t1 (a int, b int);
+insert into t1 select a,a from t10;
+create table t2 (a int, b int);
+insert into t2 select a,a from t11;
+create table t3 as select * from t2;
+explain select * from t1 where exists (select t2.a from t2 left join t3 on (t3.b=t1.b) where t2.a=t1.a);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 10
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1000 Using where; Start temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 1000 Using where; End temporary; Using join buffer (incremental, BNL join)
+drop table t1, t2, t3, t10, t11;
set optimizer_switch=default;
diff --git a/mysql-test/main/subselect_exists2in.test b/mysql-test/main/subselect_exists2in.test
index e27ce57038b..e70d643138b 100644
--- a/mysql-test/main/subselect_exists2in.test
+++ b/mysql-test/main/subselect_exists2in.test
@@ -941,5 +941,28 @@ WHERE (
drop table t1,t2,t3;
+--echo #
+--echo # MDEV-25407: EXISTS subquery with correlation in ON expression crashes
+--echo #
+create table t10(a int primary key);
+insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t11(a int primary key);
+insert into t11 select a.a + b.a* 10 + c.a * 100 from t10 a, t10 b, t10 c;
+
+create table t1 (a int, b int);
+insert into t1 select a,a from t10;
+
+create table t2 (a int, b int);
+insert into t2 select a,a from t11;
+
+create table t3 as select * from t2;
+
+
+explain select * from t1 where exists (select t2.a from t2 left join t3 on (t3.b=t1.b) where t2.a=t1.a);
+
+drop table t1, t2, t3, t10, t11;
+
+
#restore defaults
set optimizer_switch=default;
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 7569dd7b053..0fda782abca 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1757,7 +1757,6 @@ sub collect_mysqld_features {
}
-
sub collect_mysqld_features_from_running_server ()
{
my $mysql= mtr_exe_exists("$path_client_bindir/mysql");
@@ -4424,6 +4423,12 @@ sub extract_warning_lines ($$) {
qr/Detected table cache mutex contention at instance .* waits. Additional table cache instance cannot be activated: consider raising table_open_cache_instances. Number of active instances/,
qr/WSREP: Failed to guess base node address/,
qr/WSREP: Guessing address for incoming client/,
+
+ # for UBSAN
+ qr/decimal\.c.*: runtime error: signed integer overflow/,
+ # Disable test for UBSAN on dynamically loaded objects
+ qr/runtime error: member call.*object.*'Handler_share'/,
+ qr/sql_type\.cc.* runtime error: member call.*object.* 'Type_collection'/,
);
my $matched_lines= [];
diff --git a/mysql-test/std_data/galera_certs/INFORMATION b/mysql-test/std_data/galera_certs/INFORMATION
new file mode 100644
index 00000000000..439ba394e09
--- /dev/null
+++ b/mysql-test/std_data/galera_certs/INFORMATION
@@ -0,0 +1,2 @@
+WSREP certificates signed with root certificate.
+Password used is `galera`.
diff --git a/mysql-test/std_data/galera_certs/galera.1.crt b/mysql-test/std_data/galera_certs/galera.1.crt
new file mode 100644
index 00000000000..c1c1818a88c
--- /dev/null
+++ b/mysql-test/std_data/galera_certs/galera.1.crt
@@ -0,0 +1,25 @@
+-----BEGIN CERTIFICATE-----
+MIIEODCCAiACFG1AlRipIFaH2nn79vsiU6s8yxqwMA0GCSqGSIb3DQEBCwUAMFox
+CzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVsc2lu
+a2kxDzANBgNVBAoMBkdhbGVyYTEUMBIGA1UEAwwLZ2FsZXJhLnJvb3QwHhcNMjEw
+MjA0MTMxOTU3WhcNMzAxMTA0MTMxOTU3WjBXMQswCQYDVQQGEwJGaTERMA8GA1UE
+CAwISGVsc2lua2kxETAPBgNVBAcMCEhlbHNpbmtpMQ8wDQYDVQQKDAZHYWxlcmEx
+ETAPBgNVBAMMCGdhbGVyYS4xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
+AQEAq1/qI8oopqwSG6TWLSzMOpm5iXilzQ5bM0E440ZVrdPo/OZvAb99yofMFJi9
+uD1zUigHA+PXoJhm0HYTt5VsymByYwKCT8aYC6Sm6a2H82uuS7Ze8JUBdl4ymZCe
+f56fYmh3EVu0Kf+rk9uCQGouzwrDNuS+MWxsV+lxVoAA08F19yJdvxehBNlGopqc
+Sw6NNa9SISCqjg32oR2RuFzkifV/olPHGl1FSzyzJ/zO2CQYjzT8W+UA/EtnFFCo
+XVJzOKHIbzTNKmj/kkX6esBZ7ItmAdGaTlIV6A/OR/wcKxzZBopd9wFSm42x+Dxk
+eMPKS7OFhaOypl/PHo1LsSrzKwIDAQABMA0GCSqGSIb3DQEBCwUAA4ICAQApP88p
+5jaa26DhqBonGMBwgbnGzzXqrDlE6GX8Z5TffgOQjg7ZmMzdnS50iW5Jj9PcG3PL
+VpdxtKnyV/3qKJ40WpRvnUMcghyRB74h44y09Qh013uSpFR4ST7As1kAsRKYU7YP
+gc7Bc+rc3fjCOxqwRBIg/mosFCmW7UoogpeGNhuXFgl7ED3pjszAOjbLDxUkaQTj
+vbS9nWvtzE68STBdVTct91OIJPY2hNno8trwYqchQOG7wPOH/V+HzQ3jeLdE8AKw
+/PouspuE5RJmU9zcRzlKBKUsmjl+zD6nkyEzkfRO/JoDhBB0ReHsxaR+SU42K78n
+2H/qGjfhIcWsQVyIaRGqRTPZ6AhRX/04n8RTLHHkG/CLsgBcZnaOvVhraItUAEzC
+AQtD9vvF5uyzdmj0uu2TZNHJnbx+NXoNGJOJI2qUISLSdrVkS6qAHIdavypxDZZg
+4o5NZz+Jyc7Zq61LxLemKfD0isVsY91610A/1JwCy+Li99Mvng8gAJoP2NX/Cvmv
+i0QowP5uRRSL6YmiqRByer9yveSlxR03FvLeFSdftln3eEIyS9/kU74oJ+rOXPus
+fuB2ZNFHjmX7iXj3zf1kkpNCc03eaLY6P3+h2Opnqitz/XAT/eSWQ1huMKGm78ih
+C3Cd/yrwiA+AfxhYMJHl6CTpEWcJnqZQbPBjug==
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/galera_certs/galera.1.csr b/mysql-test/std_data/galera_certs/galera.1.csr
new file mode 100644
index 00000000000..f0c396836f0
--- /dev/null
+++ b/mysql-test/std_data/galera_certs/galera.1.csr
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIICnDCCAYQCAQAwVzELMAkGA1UEBhMCRmkxETAPBgNVBAgMCEhlbHNpbmtpMREw
+DwYDVQQHDAhIZWxzaW5raTEPMA0GA1UECgwGR2FsZXJhMREwDwYDVQQDDAhnYWxl
+cmEuMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKtf6iPKKKasEhuk
+1i0szDqZuYl4pc0OWzNBOONGVa3T6PzmbwG/fcqHzBSYvbg9c1IoBwPj16CYZtB2
+E7eVbMpgcmMCgk/GmAukpumth/Nrrku2XvCVAXZeMpmQnn+en2JodxFbtCn/q5Pb
+gkBqLs8KwzbkvjFsbFfpcVaAANPBdfciXb8XoQTZRqKanEsOjTWvUiEgqo4N9qEd
+kbhc5In1f6JTxxpdRUs8syf8ztgkGI80/FvlAPxLZxRQqF1SczihyG80zSpo/5JF
++nrAWeyLZgHRmk5SFegPzkf8HCsc2QaKXfcBUpuNsfg8ZHjDykuzhYWjsqZfzx6N
+S7Eq8ysCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQCUyo7S6TThiPiTRbMMu9Pu
+/YAK7mcxF3zG5rMzcf4fgaJAuUfE1Ct4y9eJ0k4gPevt37J2AhyTei6yS2ivESie
+exc/kztendR1PQmnRlICWa3ErXC1ZBJAVjaOx/S+Ttq5Tp4Bd/X2gvUb5JT+9Xbi
+NtxlnISh9cjO9BP7nfsCAbjqBhYT1hmYMlCDkTgHOPRpBQDQlRZ7e5jXDyzHaKzq
+yMfX0jo934oq2lkrV68q/9vmW0SrUU0X9GVDVRo8+4wTb1/dHQOcDaFO1LrsklaQ
+MqJkffv0tJB249+JkXHMzOZbfUTFn6jVJvMrSAQmOCIgXpswk0qmMM6ipEQkAlKW
+-----END CERTIFICATE REQUEST-----
diff --git a/mysql-test/std_data/galera_certs/galera.1.key b/mysql-test/std_data/galera_certs/galera.1.key
new file mode 100644
index 00000000000..adcd6a396a1
--- /dev/null
+++ b/mysql-test/std_data/galera_certs/galera.1.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAq1/qI8oopqwSG6TWLSzMOpm5iXilzQ5bM0E440ZVrdPo/OZv
+Ab99yofMFJi9uD1zUigHA+PXoJhm0HYTt5VsymByYwKCT8aYC6Sm6a2H82uuS7Ze
+8JUBdl4ymZCef56fYmh3EVu0Kf+rk9uCQGouzwrDNuS+MWxsV+lxVoAA08F19yJd
+vxehBNlGopqcSw6NNa9SISCqjg32oR2RuFzkifV/olPHGl1FSzyzJ/zO2CQYjzT8
+W+UA/EtnFFCoXVJzOKHIbzTNKmj/kkX6esBZ7ItmAdGaTlIV6A/OR/wcKxzZBopd
+9wFSm42x+DxkeMPKS7OFhaOypl/PHo1LsSrzKwIDAQABAoIBABrfppLIL8m7L/e/
+yIo6/SevVYX2MmHOf4SxFJ+nNuZUVbPa2st2YN5ynxEXxqBumnfmqPr2LqkTXQQR
+kBP4zZ+KskVObmreJJem0TnRqYEFgMaEqaymYR1TtjGYmRJAKJRA93L0Y3M2kYxV
+Hr7FJ+P1txkTk7OiYfcDN2+uEPMjoIwPTZYqcpw8UggF3zMZosBH3tf4yk/+5Q52
+MilRRjmoOFJSs9617OdgLoXEwQ4sAvg9UecrNR/octMnBUXKq5vWT+L9ub0fxATV
+8U+GUiv2gBnHGikbsqfV/7hZZy+R1V6b/hFrpTlTHXhKpM56ownT85tcI2WNVVOR
+FkDFXDECgYEA1gkIXzQ1O4wuxEBZCwH3hpzT2qCDou/yA91pQN6sekdxJffz8VJs
+5MUmr53vBTD3j57l+iPfa1yApNYEeQDXmiervdLjC0ep3FqyK8qS/J9x86K2E9Bt
+R8ElYGEsYoT93pzM7txPEZo3awgHAqmlPQ9mhujBpsR9xBjYi1IrGDkCgYEAzPmj
+ezryhMqFosh9OK5tirjGw3T28p+ywIl7wS5/Le32HV6sGsva3UpZhb67SkpCDbpF
+ihDV7KHFQqOvZBNSFc8gPvBgFlv4k5IzbU2q1/nO/TzgSnp1sAwlZv4shsiLz7sv
+x2ZhR8gPfO7cTS4281rdlhUuAMe79W2FRwm9/oMCgYEAkPSjH9864i5pie5On97g
+JeHWtS2amWJKFQYB/7YPN+1kmyNXqit5pmJDdhLPS0PDlhg2hvd+m7aVRY3Qj6bb
+XgLaFIBb1krdpmgiXPggHklaIngjOj4hlMQhrSmCpuKNERQ+0tKQFkrMl4djQBFm
+4HiqplnCtVBEIOf22Dx5BTkCgYAQssmhsWSucr0+TKz+4B7mbTUsGSxBCceLLega
+DcqomDkznVHSAQd8faEbZzVk0PXenm0p2UNEOs2SJzmTootOYYhT+EsrpyRyCTgN
+UIV5gM1fDgWLq7xIskSdxlkkRdQ2AR7cVLfaHC8+00q5MumhG6bvohwUTjE+xkRU
+TDPhNwKBgQDKmYS+6sUiUim69J1dP/DNCs4fabbOi/uKaAk0HdN1abnxgRROzrPI
+0BsD84XrG8/e0JhRiKG3Doq18ejNjfWsuyliHPCoJrTIj4IUq7bFvVbdOD6BQHNw
+VzHa3UImlF1LthRqRMV5As+GOF0pRCHeXyihi6KBDEZBG/SKaCp9rw==
+-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/galera_certs/galera.2.crt b/mysql-test/std_data/galera_certs/galera.2.crt
new file mode 100644
index 00000000000..2d7ebb2d533
--- /dev/null
+++ b/mysql-test/std_data/galera_certs/galera.2.crt
@@ -0,0 +1,25 @@
+-----BEGIN CERTIFICATE-----
+MIIEODCCAiACFG1AlRipIFaH2nn79vsiU6s8yxqxMA0GCSqGSIb3DQEBCwUAMFox
+CzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVsc2lu
+a2kxDzANBgNVBAoMBkdhbGVyYTEUMBIGA1UEAwwLZ2FsZXJhLnJvb3QwHhcNMjEw
+MjA0MTMyMTMzWhcNMzAxMTA0MTMyMTMzWjBXMQswCQYDVQQGEwJGSTERMA8GA1UE
+CAwISGVsc2lua2kxETAPBgNVBAcMCEhlbHNpbmtpMQ8wDQYDVQQKDAZHYWxlcmEx
+ETAPBgNVBAMMCGdhbGVyYS4yMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
+AQEAq0DluHNB6VlRjMlQVhnABzB+wTAsC4DBQBAy/AzCPdEg67pZj1j1UKNitdfO
+/FLn6DCLoFhw/z5gFUpev3JzgHcbguOlf3AQA4p9zZn/R/g8fGJtUHolkYXT+V+j
++xUQ8dzdjelu6Xd0kpN9wigtKO4PUd3fzZ7QKen68zQPNEf+KFbSj/Dhk2iokt3N
+entl3MpLGJ+FsxPQwm7bagRdn66x7zAeRu4DifYh3i7lWkC+xE+bnB82BrzBHcMh
+N6uqdnKSdj078hRj/gcSJFMlOSaWCWoZdHQ7+3gp/bCi/dGywNxOgbsmuHznlUpE
+ELbhv6G0m6LzzB1NW7HFctyrNwIDAQABMA0GCSqGSIb3DQEBCwUAA4ICAQAwtXxJ
+8ZQw1jZKUo0TP1D17Jdu36x2Tl8YwB+WMGdEvQSuKAnUEL/k4zOB5WI1VlNbJFAF
+dgsbHXjYrVCbDEpmN15sYXZ4J2NfGTmHAz38gB+r2LDlWj/+5L+VK+hkwGdbcaPX
+cDxm5M66ZbTvCFfozlHRh68/vGKhLnT0Iof3DekP7vaPUlfUUZGFh75vxUW8TM/S
+Ii4Tdo5D/gV4J/fUX2VKMKrJIYKcUxk48AFT0acCfzs9Uc5f4YYJ0vMrtGeVR0gl
+QLavAk3OW7IVY7trVrb0+qKfVuaxFli2hZN58ug/fpSN4wEMP31UxZ8WihG3xJ4x
+9ona+VR023ltpJerLWgHZyvH/HR8QnrQpPJ7y+2XLdI01gIQpYDwHsBBa8EkGjvG
+ra5YB07xOxxR4Wfr7/7gZzMvBkRr0wG/96iAfIB/ILYRJX+93gyqaVHS4RZRRQxe
+fsOpYOy5wMfPIjQQ4/Zd35NH+Y/dQcYqV+GdbbardXtNbT0tqLQesT3boBpsTxA9
+fkA9RayzTKHGojTv8p/FHh6yusfwa9MMdNsbkikM0YoAOTQwrBe7S9sm17Z6HxWr
+A7QqZGxAzAqI6aRRoro6z0KLNjuuiJysCSBqHB3yvPn6bV84UEUreoXFIHINkF/L
+B9S5zL+uYnA3X/ozdSmayNpipA3uYqqhUVSG9g==
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/galera_certs/galera.2.csr b/mysql-test/std_data/galera_certs/galera.2.csr
new file mode 100644
index 00000000000..0fba110b92a
--- /dev/null
+++ b/mysql-test/std_data/galera_certs/galera.2.csr
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIICnDCCAYQCAQAwVzELMAkGA1UEBhMCRkkxETAPBgNVBAgMCEhlbHNpbmtpMREw
+DwYDVQQHDAhIZWxzaW5raTEPMA0GA1UECgwGR2FsZXJhMREwDwYDVQQDDAhnYWxl
+cmEuMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKtA5bhzQelZUYzJ
+UFYZwAcwfsEwLAuAwUAQMvwMwj3RIOu6WY9Y9VCjYrXXzvxS5+gwi6BYcP8+YBVK
+Xr9yc4B3G4LjpX9wEAOKfc2Z/0f4PHxibVB6JZGF0/lfo/sVEPHc3Y3pbul3dJKT
+fcIoLSjuD1Hd382e0Cnp+vM0DzRH/ihW0o/w4ZNoqJLdzXp7ZdzKSxifhbMT0MJu
+22oEXZ+use8wHkbuA4n2Id4u5VpAvsRPm5wfNga8wR3DITerqnZyknY9O/IUY/4H
+EiRTJTkmlglqGXR0O/t4Kf2wov3RssDcToG7Jrh855VKRBC24b+htJui88wdTVux
+xXLcqzcCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQB1Je87IIfWW4YTvf1evm4/
+ICxImyQ4T5m3IOPrv9dV/DdxIoNSEfeudjyOmdeXchV5XxlGD2a6JDW4Pmf/gMlU
+5E6ySf4yvI/heDM05GdG623Nye41hCAqh9AIBOvhZEFlQ8/eDZFBXT9nZ4PFUshv
+7v1KlMNKHq5E3Y2eet3d0wDzE0CYJfkc0yoYX/y1IGVM2Td7/YmsSTz8Xm1OvIfx
+hbLzbnYIv4OLfSda/ntFxUy32c8jRxusbbrL4NKE5+eO5Sro1JR/rxRW9DIarp02
+8fzUyf1WhYIGtP/N3ZiZ4jqCsRyj0QmuwIohk33pKtb0APIA+qy8a13QSLUCPuHf
+-----END CERTIFICATE REQUEST-----
diff --git a/mysql-test/std_data/galera_certs/galera.2.key b/mysql-test/std_data/galera_certs/galera.2.key
new file mode 100644
index 00000000000..5b9bf3d0eac
--- /dev/null
+++ b/mysql-test/std_data/galera_certs/galera.2.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAq0DluHNB6VlRjMlQVhnABzB+wTAsC4DBQBAy/AzCPdEg67pZ
+j1j1UKNitdfO/FLn6DCLoFhw/z5gFUpev3JzgHcbguOlf3AQA4p9zZn/R/g8fGJt
+UHolkYXT+V+j+xUQ8dzdjelu6Xd0kpN9wigtKO4PUd3fzZ7QKen68zQPNEf+KFbS
+j/Dhk2iokt3Nentl3MpLGJ+FsxPQwm7bagRdn66x7zAeRu4DifYh3i7lWkC+xE+b
+nB82BrzBHcMhN6uqdnKSdj078hRj/gcSJFMlOSaWCWoZdHQ7+3gp/bCi/dGywNxO
+gbsmuHznlUpEELbhv6G0m6LzzB1NW7HFctyrNwIDAQABAoIBAQCAnv9qJ3bLkgAD
+43dpE3H8dFnfMxUBlrSOLxx73gFNeHJnWdDGLyQganZK6UlWjdYLt9pGleZYbjqw
+AulilM1XIR4SknPMYRhF8JBICW+IWFLlgO9lUDhDMeZhF4oLnGjbnuzwFvDsfIGb
+TRdY6d/xK8tpy2C6CJuDv25xlxoMQwJvSIViJd1qyCe4x3PDBvZ3TKMiWXfUGoSg
+75Yee6dIryCoWGACTjdiNdJpo99EIMJT8HIGQeBBJuIvSTsAgXMugDlnvUkq98LX
+XLJ+Lilx+enUb1WDbwZDMwJd0DlDVZyRVDJwlJRFUEuJvSRfMNKICEynmqJVc/36
+I7BzHNtRAoGBAOOGrH/r46oiSH6vE0VqgPIdlruLDZWoBIW0tVW1wb9E3NzExK53
+WEGy6FETsFGt3cYxtKd5Qy4rD5gfqYrfmDH/bmkK9p69pSjKcSgynABxCqM0DCth
+F3EGc5ZGDcA7Xar70NEP9COExFvPpi2bBq+8//OHNKWHe/aTYj3FuvyjAoGBAMCv
+ZrUR8NJfxw8Jqygc/L5BBW0gzh8ycHlQQPrpb4j01ncFcjTe1Tsc8BAkHYXZbS7o
+h+3JkgzQf7fHJmafKPO3esj2fZqdCoWBqhAf9Wk+9s33rTPo4OXdk22MdII7kV/e
+VpUKzdznKQmftleoJDVq6qBDMN9qQy8z5hVVv8xdAoGBAJEVSV3wzyWn4s5VWVaE
+SWEaGQnR64Got+mCh7b1xWvvv15PYpNVqsOKD7XTdjU/RxGglG/OVVZVQwZf+j6B
+wYzwMjltMkGa8HwISwu06eEmNABJqhDnQolh8ca7OP2BXYMwO8F0CNu1R3i7+l1O
+Y38gZ52kc5+xuwxKgvSc51U9AoGAKiq4aUvBzegT4eCVyjN9xAzqqRUSxpT9NC8x
+6TcIp4odHPLeKV/Sfhs5Fe8xXsdUM33DsW/5PECskoVMjAyso5k1j6ERn7JaSRk1
+JE46IIwc6roW91MxVFyHFOQ14wIyMC6x9+/jWUJlIqwG9WvgcKgzLFtH6LySc1QC
+OA0J6ikCgYAr7JEzFzckFvXNgdUiADnXztchwmjeV/CJZdaHhlVdHmtt0Z7PiWK9
+wRCKwA+wfTW1MeufP/t3l9MqdFx7MjxBbu2aVnd9BEDtGX6pch1pMa7CHyHayDiL
+UoD0lPrJ9hLftKkyMO2IL3kWlg5g3cpwVBzMKxNBynzQx7TQxUrAgA==
+-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/galera_certs/galera.root.crt b/mysql-test/std_data/galera_certs/galera.root.crt
new file mode 100644
index 00000000000..e965d5a26d6
--- /dev/null
+++ b/mysql-test/std_data/galera_certs/galera.root.crt
@@ -0,0 +1,32 @@
+-----BEGIN CERTIFICATE-----
+MIIFlTCCA32gAwIBAgIUKCF88W+48rZzdfgYpE2dXVMGSKgwDQYJKoZIhvcNAQEL
+BQAwWjELMAkGA1UEBhMCRkkxETAPBgNVBAgMCEhlbHNpbmtpMREwDwYDVQQHDAhI
+ZWxzaW5raTEPMA0GA1UECgwGR2FsZXJhMRQwEgYDVQQDDAtnYWxlcmEucm9vdDAe
+Fw0yMTAyMDQxMzE3MDJaFw0yMzExMjUxMzE3MDJaMFoxCzAJBgNVBAYTAkZJMREw
+DwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVsc2lua2kxDzANBgNVBAoMBkdh
+bGVyYTEUMBIGA1UEAwwLZ2FsZXJhLnJvb3QwggIiMA0GCSqGSIb3DQEBAQUAA4IC
+DwAwggIKAoICAQDKqL45jbaq8RLOj+DeilPcEnBN5gn/y9V3IfZ0BQCd4bR09zLz
+7BQKz6QS825Wi56HC155W1xPMR0RYWy3I3owreQtfdGJuYoTKLpRSoqWJgy/FSzR
++Tr34WfpeIj6754YRm7MndWBPVkujPtOWz6EHn+2oUNIpCZAOwXtMrlJzf5GwNBu
+4kwkylz0whs3iTS//pZLyqk6MsLI7tebmfi9qyaM0b+C1OKiBRQRIjPON8Htp7Au
+GDyOqA4Y9IQlAzZVqy2PP79Ci2FpPF3+01ByWGY6vAIxma2VXS/aNvUvGnuzH8hz
+A5xg1+5Fv2kdxffcWLjp5/WSIaTUiBFMBRKswTtfo+vWuVpzXGvlExGHd10m+MhK
+Avoqq6N28ql6E5pDDH5k6aZ1eB6nKF6BU4BMa4SUPBX/qz8PMbb5j0+n645Gj/G2
+0DfCQoyHd6sMAZZ9LgTjGB/R6sz74YF72q6xECTCygn5HY3qjvmx0BYlIkQDKKqh
+bq2ZmsLLCwtyfUeW144eMhErNZA1MwoJxd8LM0TpJ0nXQdEESf5oS5fMLZnVrxah
+dl5QYYMbmyNedNKdwV4idhGCy+Zq7VAX4lBXazI1rD9vQb+oTcPGQiy4i/Vi/g6i
+F+XZTdTiaOWPEmvFFGLLUQxKl4w872hJaupqfteqdiZ+3ICVIUI8qnXHmwIDAQAB
+o1MwUTAdBgNVHQ4EFgQUs75v/MgjJ5RHGE6+0qdiVo4BwlowHwYDVR0jBBgwFoAU
+s75v/MgjJ5RHGE6+0qdiVo4BwlowDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0B
+AQsFAAOCAgEAOVhBs28dwwvD5q2r7oVVcxLc+tb8zu4XxpXT1p6hiZYUyPguCh00
+GVdXCgR4JMI/NcyM5fBAbF3S8oK3+9rw2kW09afVV06Qf/8o3nIyOiDl7598tGIP
+CCK4QsUW/dGajx5kvhtQ7qce+u9KfFTof6lq2xkYtFBBhmBdSv9A1jAZJMw2x3bc
+nr99PS8XZMphS0MIExHKj6Ry5DdYm722zZHyIEiiEGyMViDm2m1iug5r/LPH5Z56
+BjQiH4VP+0y5mevBOUGuH8ID+J9Hu9BeoXLhkv+W2Ljs/S6wqzjinMBqVG+wwe0Y
+a8F5pABkl5uX38nMQ7CikSbLxSbn7nRf+sux1sbzqjMldeCSqiv9mI5Ysq97+Ni1
+5qMxNxNc0u/wGRnrXH8fWfxBKPP5moA7DQfVcUWPgDGQwDpA8kn8RlJxFk3g4yaK
++NMwk5MORKyx3tz/A3Yhs9AUXk3okvmQCT2YVSHcKUB8PAU+TaKqbr3wk07Y/tL/
+jFPHS+t3eD91Y05KGUXjdtGi+33zpV0biHmTWAZT78VQowDNvEpTnXhkSx8HGHYR
+nqSMU2m2LboHSatY113RYznx0LJ1azczRlJdGs8oyPWLPDD2JCesZaQqGZVRJoms
+lK4EzYEb5mZTCRgtgoiO+iKcf6XifuOCrWZXoLm4FlLEfOQ3b8yAFlo=
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/galera_certs/galera.root.key b/mysql-test/std_data/galera_certs/galera.root.key
new file mode 100644
index 00000000000..8472f87e714
--- /dev/null
+++ b/mysql-test/std_data/galera_certs/galera.root.key
@@ -0,0 +1,54 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,F0ACFFE47CF32BB2
+
+F5PwhFDgzuaD7ISSmSn3+GpEoWipTwOPjE8ei9LsQ1a/RdcW19kmB9sJojOSVlV6
+CbLeEl/YKkkAZvbupKvpL0i82WTi+V7W9iKNU3M9tN1JE3WNGCYrL16aUrlnXszi
+eiNhWzAGxtpXNTv+d9gdgYZ0mHJrDk390tYGRcnrEp8FasL0aI4AnIWrJq9zgHeP
+m8K0RxIB6Rp07+SEfsO0pZuGPIkO/qVhIDXYhQrEkap3viPZouH1qzaJNaQXD1ZE
+EoP0n/jbX3KuLeep4aGdEGq/eAZx/WUZpZWECOqwZ7HDNFcXj4nZRNQmCpSobEHU
+e+9DL+nnmoMtsFG7Jb6S3d8Fxv5DLqm7LTHweZzlkw0pD5sVVMSeb6Xq2Cshxsf2
+htQGZDtxscTimDrLHsNonw1tVBfY0HPpTNNmjyKpa2lmbQ4KQls3A4i9yZaXM1W4
+pkc1Emk0ot+yXZU+SNPeAgAMCf5rygiQtsALYdbkZVpVvziVVBFdav+v9RtwrMfJ
+fli6GbAwm2mKXdFlc8SnfbNxKw8v2K26IUZFEzwiE/MxwOR4UBwcNa2JcXKsMGVt
+o2pBOJr0dquywV37EV7hu2S6Kgf1nREgksON86REmZoPpzMlCpTf805awdDN/a/K
+jJkRrekRinrPaIDfvwQjIhhXYWSVQywJ2nTL6+78SvnKRNmIFDGdmOY7CtsyRvkp
+P2Qp+JhzT4VM8x2sApBQiN3S3dSr1D8gmdwKGiLp82GhMIdGNjVpxPSVjCFC3Apu
+hvRw3LSJ7iUWLrtsR2yZeDBHh1yDraLYo76qYqvgYDKYa+R1GiJd70t5cDSqgwV9
+EXlnA32VsRrAXdRypGNAq934TSWiO4l+M60bt/K/U41uQHas1gWsGdtWcjCLTylf
+YT8G+4QnIrOGJzyKZeIrawu/GtxrK2S5xe0ZAOwYQmJYiIH4TfvdrNX4DNEfGpd/
+CrBULWCvAtgqNrNgpFuV8027yAZWPpG2DSE+Q+XTahxjNUxAI7kkXB/Xxc5KfhSF
+BaYHQ2TfTWnwD3K1BNWM4yZ/L4up8UIrXyMdk7q0LofwCTKGOgqzwVaez86gpriL
+pphXPYIY9cX9qLBs5YuVGk9ApkbC0VRqmXcCL7OEAzso14ItHVlVU73QSS+I+3sK
+sqwb0USLuN7qZUVhtJIyAkK/D+DmNYSg4eqhcMRnJAanD2acmwtAy0HE+YVcQN/X
+gEwSOdkf7WkwDshvBPA8rl4YWRxwKxstS0wyPG8rzMZWYYB2xf3nd78NtdzVZSnN
+pDUJkUKorCaSuanMvjKS9r+sILzUc1bkO/T//qTY/HtRtl8AffcXIjyJkXb5PSjt
+dxq7ktkeESAB9vb+c7nWolMVqxUD+1KpHi1kwR4IuAWtJe4G+82pDc6wLEZjeJMO
+nd2NNW/CToWv0YfWonGUDZbOFqee7H0Tioqjni4uQbLcDZJHr6i3wwGIncIENo73
+DqfYEpNT3U6uLSC/cNv3lvIRjVziBEB9f0KgOHt38UIsZ4oJAMV/B63Wfn1nd1g4
+NBdNwO48M2KHbxgwXJxxX1jQOj9+IJiVaGIbpzeeJ3yTKDMfkBKH4eQj2/aAA1zK
+pqFRyoBhuviMZ1IeBOVyb3QHJSINry/WiiOKoHLvvFM7KXgygedJwg6k8SHCQCfS
+D9RignCNT/O8VhJ4hpzAXbEpeAXJn+AHYGIxL6Fu+0dwDKJjruvcLpVVt9GLLdzX
+OBgsK0z9m3hLOf8dfY97jMkRTHtokrA28iheLh6l8rFFesJM8lqFreFRRJMTXeHW
+Xwa82PbUdIWygguAlSj035aGUuNRNDZq4Bh4XTVndCDbUfRBlYF9yMduvSqaKsmm
+tLJ8V04vDECQpUcAPTCCbTDFoV8/KVDsxMTgZkdiJG/Vv2y8mzy5FPAJBNk/HCcx
+E8qc7KF80l+YGQ/IgGzzz9r9DqaXy21FwaiA6TRFth9hXMdzZLVBNfpzZ+dGMJEQ
+PAoWUshcNNwAZVU0+GzdQvdckGUcWgnMZpzXswaUmXbMidQ6VQnDTQdj5qIEnrMW
+CrIHVs+hhjcGRbGf6DGHQpQbjD9FWX38PVzPpocu1qmLKVTUoFPqm0EqU01SYLFu
+S9ntmlOqYJJIR0LbXJvAL7tVKHiK4gR8NMfN2YKPi4Eg3GKTZ5XaSpNPQJnR0ZqP
++sU07jjQTcVuCD8Cx8c9LGXa6PNAwBufk3jrz/vZy8AQEs13aMu3thHhLQWKrgi5
+jVdoLNIqQZJH7aY0YjoaD6if+4uHtRQOqUcJPUyxWnwXx+Y/o+9DrpH5K9V9fcVR
+e7Ej8j2Ha4yzZw7M9Uze0unMRQOhE2lbRsP4C6f/TK3izeSlmhG0D/pHfHx9GKbf
+S7TPnD0YhUS9TpXX3BEVSXVjIkkbIiC0djq3OI+3PSn/PJqWjCw8pL7JZp5T8J1u
+sqyQCge4XjYmmj9Np511tcviq+jmobf0b+WMmxxV21/Au+v2uI/7eAwUyWYIJYny
+kcGUDmEZohsFx6hYbRsH+bSEUqC6MuKiUaaqEb97IoR33D3ZajMBchw+Yg0jh/wJ
+S8FKEB0NlS00051UnwdsjBKyuOMWT6xH9VVR8W+7t6i0rMDxb4DjP3T+BqjXCT0d
+kiHRXRALxotk+WVRC4qRVr0kmFut9bLjlFu2Hlbnpmm7zmJcE3hbkhWjXqDsysp7
+SKJAs+IvYrTMEtURflKiN/n7y6SbXdCXvw+lRTeTjT9h8DiIMsK5vw2SSjWPaQnu
+ikCATObciGyro3aImzhaBBY0r/F4Q1KsvLi+xKo+JoDHSVNjNg9SNjQKhyVRFJq/
+quwTP019B5U3ykWj2/i7HV9IBH+nGEUuvpI5esUoIWTvdCkVdAEeSg0vwkJoohbb
+l9HjDYyEJxoLhwaR7Mqh+uDxHBK2Kqh8TkIXjdUbXqTRIX6lajzJ/p7owoE48sHa
+iWo9tN+4bOabEjPAkEhLy2cLUfWEPjClo8YZelif8cZigKzdSDbxdmyugfFtZfQX
+NYwcMYayGBCETNyByLbBjNO+7XPlNcfqQJlFWsGOrzmJdoxtW7CYYqbN8qzhpNox
+MSRK7T+eUDFKNjY53lPfUPUFgcXq+9IKicf6cYE8gsI3/5I9vzLk3Lt7ZLXMgFv7
+-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/galera_certs/galera.root.srl b/mysql-test/std_data/galera_certs/galera.root.srl
new file mode 100644
index 00000000000..e6c62e06527
--- /dev/null
+++ b/mysql-test/std_data/galera_certs/galera.root.srl
@@ -0,0 +1 @@
+6D409518A9205687DA79FBF6FB2253AB3CCB1AB1
diff --git a/mysql-test/suite/binlog/r/binlog_empty_xa_prepared.result b/mysql-test/suite/binlog/r/binlog_empty_xa_prepared.result
index eb96f7bb984..9f998e049c0 100644
--- a/mysql-test/suite/binlog/r/binlog_empty_xa_prepared.result
+++ b/mysql-test/suite/binlog/r/binlog_empty_xa_prepared.result
@@ -29,3 +29,82 @@ master-bin.000001 # Query # # XA END X'33',X'',1
master-bin.000001 # XA_prepare # # XA PREPARE X'33',X'',1
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # XA ROLLBACK X'33',X'',1
+RESET MASTER;
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+XA START '1';
+REPLACE INTO t1 SELECT * FROM t1;
+REPLACE INTO t2 SELECT * FROM t2;
+XA END '1';
+XA PREPARE '1';
+XA ROLLBACK '1';
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+DROP TABLE t1, t2;
+# Proof of correct logging incl empty XA-PREPARE
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) ENGINE=MyISAM
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1),(2)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (1),(2)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # REPLACE INTO t1 SELECT * FROM t1
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # XA START X'31',X'',1 GTID #-#-#
+master-bin.000001 # Query # # XA END X'31',X'',1
+master-bin.000001 # XA_prepare # # XA PREPARE X'31',X'',1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # XA ROLLBACK X'31',X'',1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE SEQUENCE s ENGINE=InnoDB;
+XA START '2';
+SELECT NEXT VALUE FOR s;
+NEXT VALUE FOR s
+1
+REPLACE INTO t1 SELECT * FROM t1;
+XA END '2';
+XA PREPARE '2';
+XA ROLLBACK '2';
+DROP SEQUENCE s;
+DROP TABLE t1;
+# Proof of correct logging incl empty XA-PREPARE
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE SEQUENCE s ENGINE=InnoDB
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # SELECT NEXT VALUE FOR s
+master-bin.000001 # Table_map # # table_id: # (test.s)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # XA START X'32',X'',1 GTID #-#-#
+master-bin.000001 # Query # # XA END X'32',X'',1
+master-bin.000001 # XA_prepare # # XA PREPARE X'32',X'',1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # XA ROLLBACK X'32',X'',1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP SEQUENCE `s` /* generated by server */
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
diff --git a/mysql-test/suite/binlog/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result
index f643c5a9c35..4c353bf6abb 100644
--- a/mysql-test/suite/binlog/r/binlog_index.result
+++ b/mysql-test/suite/binlog/r/binlog_index.result
@@ -50,7 +50,7 @@ reset master;
flush logs;
SET SESSION debug_dbug="+d,crash_purge_before_update_index";
purge binary logs TO 'master-bin.000002';
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -62,7 +62,7 @@ master-bin.000003
flush logs;
SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index";
purge binary logs TO 'master-bin.000004';
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -73,7 +73,7 @@ master-bin.000005
flush logs;
SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index";
purge binary logs TO 'master-bin.000006';
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -83,7 +83,7 @@ master-bin.000007
# crash_create_non_critical_before_update_index
SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index";
flush logs;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -94,7 +94,7 @@ master-bin.000008
# crash_create_critical_before_update_index
SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
flush logs;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -106,7 +106,7 @@ master-bin.000009
# crash_create_after_update_index
SET SESSION debug_dbug="+d,crash_create_after_update_index";
flush logs;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
index d6875ab60e0..a4cd5b4080d 100644
--- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
+++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
@@ -50,3 +50,4 @@ a
400
401
drop table t1;
+reset master;
diff --git a/mysql-test/suite/binlog/t/binlog_empty_xa_prepared.test b/mysql-test/suite/binlog/t/binlog_empty_xa_prepared.test
index 7f923f71f81..443feb60627 100644
--- a/mysql-test/suite/binlog/t/binlog_empty_xa_prepared.test
+++ b/mysql-test/suite/binlog/t/binlog_empty_xa_prepared.test
@@ -33,3 +33,50 @@ XA ROLLBACK '3';
--echo # Proof of correct logging incl empty XA-PREPARE
--source include/show_binlog_events.inc
+
+# The test verifies execution and binary logging of user XA that produce empty
+# XA-PREPARE group of events.
+#
+# MDEV-22757 Assertion `!binlog || exist_hton_without_prepare'
+# in MYSQL_BIN_LOG::unlog_xa_prepare
+
+RESET MASTER;
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+
+XA START '1';
+REPLACE INTO t1 SELECT * FROM t1;
+REPLACE INTO t2 SELECT * FROM t2;
+XA END '1';
+XA PREPARE '1';
+
+# Cleanup
+XA ROLLBACK '1';
+DROP TABLE t1, t2;
+
+--echo # Proof of correct logging incl empty XA-PREPARE
+--source include/show_binlog_events.inc
+
+
+# MDEV-22430 Assertion ... in MYSQL_BIN_LOG::unlog_xa_prepare
+
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE SEQUENCE s ENGINE=InnoDB;
+
+XA START '2';
+SELECT NEXT VALUE FOR s;
+REPLACE INTO t1 SELECT * FROM t1;
+XA END '2';
+XA PREPARE '2';
+
+# Cleanup
+XA ROLLBACK '2';
+DROP SEQUENCE s;
+DROP TABLE t1;
+
+--echo # Proof of correct logging incl empty XA-PREPARE
+--source include/show_binlog_events.inc
diff --git a/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
index b2af560fa50..9145afc047f 100644
--- a/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
+++ b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
@@ -10,3 +10,4 @@ disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log;
-- source include/binlog_insert_delayed.test
+reset master;
diff --git a/mysql-test/suite/binlog_encryption/binlog_index.result b/mysql-test/suite/binlog_encryption/binlog_index.result
index f643c5a9c35..4c353bf6abb 100644
--- a/mysql-test/suite/binlog_encryption/binlog_index.result
+++ b/mysql-test/suite/binlog_encryption/binlog_index.result
@@ -50,7 +50,7 @@ reset master;
flush logs;
SET SESSION debug_dbug="+d,crash_purge_before_update_index";
purge binary logs TO 'master-bin.000002';
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -62,7 +62,7 @@ master-bin.000003
flush logs;
SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index";
purge binary logs TO 'master-bin.000004';
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -73,7 +73,7 @@ master-bin.000005
flush logs;
SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index";
purge binary logs TO 'master-bin.000006';
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -83,7 +83,7 @@ master-bin.000007
# crash_create_non_critical_before_update_index
SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index";
flush logs;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -94,7 +94,7 @@ master-bin.000008
# crash_create_critical_before_update_index
SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
flush logs;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -106,7 +106,7 @@ master-bin.000009
# crash_create_after_update_index
SET SESSION debug_dbug="+d,crash_create_after_update_index";
flush logs;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
diff --git a/mysql-test/suite/binlog_encryption/rpl_sync.result b/mysql-test/suite/binlog_encryption/rpl_sync.result
index 1240c446164..5fa3a07a4e7 100644
--- a/mysql-test/suite/binlog_encryption/rpl_sync.result
+++ b/mysql-test/suite/binlog_encryption/rpl_sync.result
@@ -22,7 +22,7 @@ connection slave;
include/stop_slave_io.inc
SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
include/rpl_reconnect.inc
=====Dumping and comparing tables=======;
include/start_slave.inc
@@ -40,7 +40,7 @@ insert into t1(a) values(9);
connection slave;
SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
include/rpl_reconnect.inc
=====Dumping and comparing tables=======;
include/start_slave.inc
diff --git a/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result b/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result
index a0a45446eff..faa85126f03 100644
--- a/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result
+++ b/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result
@@ -99,19 +99,19 @@ Killing server ...
connection node_1;
Killing server ...
connection node_1_insert_simple;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
connection node_1_insert_multi;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
connection node_1_insert_transaction;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
connection node_1_update_simple;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
connection node_1_insert_1k;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
connection node_1_insert_1m;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
connection node_1_insert_10m;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
connection node_1;
Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ...
diff --git a/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result b/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result
index b3096afd387..88cc444106b 100644
--- a/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result
+++ b/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result
@@ -22,12 +22,14 @@ SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3;
COUNT(*) = 1
1
DROP TABLE t1;
+connection node_1;
START TRANSACTION;
SET SESSION wsrep_on=OFF;
ERROR 25000: You are not allowed to execute this command in a transaction
SET GLOBAL wsrep_on=OFF;
ERROR 25000: You are not allowed to execute this command in a transaction
COMMIT;
+connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
START TRANSACTION;
INSERT INTO t1 VALUES (1);
@@ -68,3 +70,58 @@ SET GLOBAL wsrep_on = ON;
SHOW SESSION VARIABLES LIKE 'wsrep_on';
Variable_name Value
wsrep_on ON
+disconnect node_1b;
+connection node_1;
+SET GLOBAL wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+ERROR HY000: Can't enable @@session.wsrep_on, while @@global.wsrep_on is disabled
+SET GLOBAL wsrep_on = ON;
+SET SESSION wsrep_on = ON;
+connection node_1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+SET GLOBAL wsrep_on = OFF;
+connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;;
+connection node_1b;
+SHOW SESSION VARIABLES LIKE 'wsrep_on';
+Variable_name Value
+wsrep_on OFF
+SHOW GLOBAL VARIABLES LIKE 'wsrep_on';
+Variable_name Value
+wsrep_on OFF
+SET GLOBAL wsrep_on = ON;
+START TRANSACTION;
+INSERT INTO t1 VALUES(1);
+COMMIT;
+SELECT * FROM t1;
+f1
+1
+connection node_2;
+SELECT * FROM t1;
+f1
+1
+DROP TABLE t1;
+connection node_1;
+SET SESSION wsrep_on = OFF;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+START TRANSACTION;
+INSERT INTO t1 VALUES (2);
+COMMIT;
+DROP TABLE t1;
+connection node_2;
+SHOW TABLES;
+Tables_in_test
+connection node_1;
+SET SESSION wsrep_on = ON;
+SET GLOBAL wsrep_on = OFF;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+START TRANSACTION;
+INSERT INTO t1 VALUES (2);
+COMMIT;
+connection node_2;
+SHOW TABLES;
+Tables_in_test
+connection node_1;
+DROP TABLE t1;
+SET GLOBAL wsrep_on = ON;
diff --git a/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test b/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test
index 1a48abc25eb..10517f877ae 100644
--- a/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test
+++ b/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test
@@ -36,6 +36,7 @@ DROP TABLE t1;
# active transaction.
#
+--connection node_1
START TRANSACTION;
--error ER_CANT_DO_THIS_DURING_AN_TRANSACTION
SET SESSION wsrep_on=OFF;
@@ -49,6 +50,7 @@ COMMIT;
# @@session.wsrep_on of current sessions
#
+--connection node_1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
START TRANSACTION;
INSERT INTO t1 VALUES (1);
@@ -75,6 +77,7 @@ DROP TABLE t1;
#
# New connections inherit @@session.wsrep_on from @@global.wsrep_on
#
+
--connection node_1
SET GLOBAL wsrep_on = OFF;
@@ -87,3 +90,78 @@ DROP TABLE t2;
SET GLOBAL wsrep_on = ON;
SHOW SESSION VARIABLES LIKE 'wsrep_on';
+
+--disconnect node_1b
+
+
+#
+# Can't set @@session.wsrep_on = ON, while @@global.wsrep_on = OFF
+#
+
+--connection node_1
+SET GLOBAL wsrep_on = OFF;
+--error ER_WRONG_ARGUMENTS
+SET SESSION wsrep_on = ON;
+
+SET GLOBAL wsrep_on = ON;
+SET SESSION wsrep_on = ON;
+
+
+#
+# @@global.wsrep_on = OFF followed by @@global.wsrep_on = ON
+# in a new connection
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+SET GLOBAL wsrep_on = OFF;
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+--connection node_1b
+SHOW SESSION VARIABLES LIKE 'wsrep_on';
+SHOW GLOBAL VARIABLES LIKE 'wsrep_on';
+SET GLOBAL wsrep_on = ON;
+START TRANSACTION;
+INSERT INTO t1 VALUES(1);
+COMMIT;
+
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+
+#
+# Test single statement, multi statement, and
+# TOI tansactions while @@session.wsrep_on = OFF
+# and then same @@global.wsrep_on = OFF.
+# Notice, the combination @@global.wsrep_on = OFF
+# and @@session.wsrep_on = ON is not not possible,
+# (as tested above in this test case)
+#
+
+--connection node_1
+SET SESSION wsrep_on = OFF;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+START TRANSACTION;
+INSERT INTO t1 VALUES (2);
+COMMIT;
+DROP TABLE t1;
+--connection node_2
+SHOW TABLES;
+--connection node_1
+SET SESSION wsrep_on = ON;
+
+SET GLOBAL wsrep_on = OFF;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+START TRANSACTION;
+INSERT INTO t1 VALUES (2);
+COMMIT;
+--connection node_2
+SHOW TABLES;
+--connection node_1
+DROP TABLE t1;
+SET GLOBAL wsrep_on = ON;
diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def
index f69efbde076..2ab0886a427 100644
--- a/mysql-test/suite/galera_3nodes/disabled.def
+++ b/mysql-test/suite/galera_3nodes/disabled.def
@@ -17,8 +17,8 @@ galera_ipv6_mariabackup_section : MDEV-22195: galera_3nodes.galera_ipv6_mariabac
galera_ipv6_mysqldump : MDEV-24036: galera_3nodes.galera_ipv6_mysqldump: rare random crashes during shutdown
galera_ipv6_rsync_section : MDEV-23580: galera_3nodes.galera_ipv6_rsync_section MTR failed: WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(}
-galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query
-galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query
+galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to server during query
+galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to server during query
galera_pc_bootstrap : MDEV-24650 galera_pc_bootstrap MTR failed: Could not execute 'check-testcase' before testcase
galera_safe_to_bootstrap : MDEV-24097 galera_3nodes.galera_safe_to_bootstrap MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
galera_slave_options_do : MDEV-8798
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ssl_reload.result b/mysql-test/suite/galera_3nodes/r/galera_ssl_reload.result
new file mode 100644
index 00000000000..541822797b7
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_ssl_reload.result
@@ -0,0 +1,15 @@
+connection node_2;
+connection node_1;
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+connection node_1;
+connection node_2;
+connection node_3;
+connection node_1;
+connection node_2;
+connection node_2;
+# restart: with restart_parameters
+SET GLOBAL wsrep_provider_options = 'socket.ssl_reload=1';
+connection node_3;
+# restart: with restart_parameters
+connection node_2;
+FLUSH SSL;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf b/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf
new file mode 100644
index 00000000000..65d1599268d
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf
@@ -0,0 +1,10 @@
+!include ../galera_3nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.root.crt;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.crt;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.key'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.root.crt;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.crt;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.key'
+
+[mysqld.3]
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.root.crt;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.crt;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.key'
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.test b/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.test
new file mode 100644
index 00000000000..0c22a58b3e9
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.test
@@ -0,0 +1,67 @@
+#
+# Test reloading of Galera SSL certificate without shutting down node
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--let $node_3=node_3
+--source ../galera/include/auto_increment_offset_save.inc
+
+# Setup galera ports
+--connection node_1
+--source suite/galera/include/galera_base_port.inc
+--let $NODE_GALERAPORT_1 = $_NODE_GALERAPORT
+
+--connection node_2
+--source suite/galera/include/galera_base_port.inc
+--let $NODE_GALERAPORT_2 = $_NODE_GALERAPORT
+
+# Setup temporary file for SSL reloading
+let $ssl_cert = $MYSQLTEST_VARDIR/tmp/ssl_cert.pem;
+let $ssl_key = $MYSQLTEST_VARDIR/tmp/ssl_key.pem;
+let $ssl_ca = $MYSQLTEST_VARDIR/tmp/ssl_ca.pem;
+
+copy_file std_data/galera_certs/galera.root.crt $ssl_ca;
+copy_file std_data/galera_certs/galera.1.crt $ssl_cert;
+copy_file std_data/galera_certs/galera.1.key $ssl_key;
+
+--connection node_2
+--source include/shutdown_mysqld.inc
+--let $restart_noprint=1
+--let $restart_parameters = --wsrep_cluster_address=gcomm://127.0.0.1:$NODE_GALERAPORT_1 --wsrep_provider_options=base_port=$NODE_GALERAPORT_2;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera_certs/galera.root.crt;socket.ssl_cert=$MYSQLTEST_VARDIR/tmp/ssl_cert.pem;socket.ssl_key=$MYSQLTEST_VARDIR/tmp/ssl_key.pem
+--source include/start_mysqld.inc
+--source include/galera_wait_ready.inc
+
+# Set certificate and key and reload by setting directly `wsrep_provider_options`
+remove_file $ssl_cert;
+remove_file $ssl_key;
+copy_file std_data/galera_certs/galera.2.crt $ssl_cert;
+copy_file std_data/galera_certs/galera.2.key $ssl_key;
+SET GLOBAL wsrep_provider_options = 'socket.ssl_reload=1';
+
+--connection node_3
+--source include/shutdown_mysqld.inc
+--let $restart_parameters = --wsrep_cluster_address=gcomm://127.0.0.1:$NODE_GALERAPORT_2
+--source include/start_mysqld.inc
+
+# Set certificate and key and reload by executing `FLUSH SSL`
+--connection node_2
+remove_file $ssl_cert;
+remove_file $ssl_key;
+copy_file std_data/galera_certs/galera.1.crt $ssl_cert;
+copy_file std_data/galera_certs/galera.1.key $ssl_key;
+FLUSH SSL;
+
+# Cleanup
+remove_file $ssl_ca;
+remove_file $ssl_cert;
+remove_file $ssl_key;
+
+# Restore original auto_increment_offset values.
+--source ../galera/include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result b/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result
index 8333fff98db..726f70145f1 100644
--- a/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result
+++ b/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result
@@ -12,7 +12,7 @@ SET SESSION wsrep_trx_fragment_size=1;
START TRANSACTION;
INSERT INTO t1 VALUES ('primary'),('primary'),('primary'),('primary'),('primary');
COMMIT;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# restart
connection node_1;
SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log;
diff --git a/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result b/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result
index 9e223414fe4..1f874acadec 100644
--- a/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result
+++ b/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result
@@ -27,7 +27,7 @@ SET GLOBAL wsrep_cluster_address = '';
SET SESSION wsrep_sync_wait = DEFAULT;
connection node_2;
INSERT INTO t1 VALUES (6);
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
connection node_1;
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
COUNT(*)
diff --git a/mysql-test/suite/innodb/r/alter_crash.result b/mysql-test/suite/innodb/r/alter_crash.result
index bf593c6acca..8cfeb7093ca 100644
--- a/mysql-test/suite/innodb/r/alter_crash.result
+++ b/mysql-test/suite/innodb/r/alter_crash.result
@@ -46,7 +46,7 @@ CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
INSERT INTO t1 VALUES (1,2),(3,4);
SET DEBUG_DBUG='+d,innodb_alter_commit_crash_after_commit';
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# Restart mysqld after the crash and reconnect.
# restart
SELECT * FROM information_schema.innodb_sys_tables
@@ -86,7 +86,7 @@ CREATE TABLE t2 (f1 int not null, f2 int not null) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1,2),(3,4);
SET DEBUG_DBUG='+d,innodb_alter_commit_crash_before_commit';
ALTER TABLE t2 ADD PRIMARY KEY (f2, f1);
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# Startup the server after the crash
# restart
SELECT * FROM information_schema.innodb_sys_tables
@@ -125,7 +125,7 @@ ENGINE=InnoDB;
INSERT INTO t1 SET a=1,c=2;
SET DEBUG_DBUG='+d,innodb_alter_commit_crash_after_commit';
ALTER TABLE t1 ADD INDEX (b), CHANGE c d int, ALGORITHM=INPLACE;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# Restart mysqld after the crash and reconnect.
# restart
SELECT * FROM information_schema.innodb_sys_tables
diff --git a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
index cfc99650db6..9c698d9dab4 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
@@ -7,7 +7,7 @@
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
SET debug_dbug='+d,innodb_alter_commit_crash_before_commit';
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# restart
show create table t1;
Table Create Table
diff --git a/mysql-test/suite/innodb/r/innodb-blob.result b/mysql-test/suite/innodb/r/innodb-blob.result
index fdfbfe3e683..8173d30e92c 100644
--- a/mysql-test/suite/innodb/r/innodb-blob.result
+++ b/mysql-test/suite/innodb/r/innodb-blob.result
@@ -47,7 +47,7 @@ INSERT INTO t2 VALUES (42);
disconnect con1;
disconnect con2;
connection default;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -107,7 +107,7 @@ connection con2;
# restart
disconnect con2;
connection default;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
CHECK TABLE t1,t2,t3;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -139,7 +139,7 @@ UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2
# restart
disconnect con2;
connection default;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
CHECK TABLE t1,t2,t3;
Table Op Msg_type Msg_text
test.t1 check status OK
diff --git a/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
index 678c8c67be5..e3037847441 100644
--- a/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
+++ b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
@@ -26,7 +26,7 @@ DELETE FROM t1 WHERE a=1;
INSERT INTO t1 VALUES(1,'X',1);
SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace';
SELECT b FROM t1 LIMIT 3;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
disconnect con1;
connection default;
FOUND 1 /Wrote log record for ibuf update in place operation/ in mysqld.1.err
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
index 1030fbd0502..91b732ee2a3 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
@@ -15,14 +15,14 @@ CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES(1),(2),(3);
SET SESSION debug_dbug="+d,ib_discard_before_commit_crash";
ALTER TABLE t1 DISCARD TABLESPACE;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES(1),(2),(3);
SET SESSION debug_dbug="+d,ib_discard_after_commit_crash";
ALTER TABLE t1 DISCARD TABLESPACE;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1 (c1 INT) ENGINE = Innodb;
@@ -41,12 +41,12 @@ SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SELECT COUNT(*) FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash";
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/redo_log_during_checkpoint.result b/mysql-test/suite/innodb/r/redo_log_during_checkpoint.result
index c7b4bb4403b..e95ca52b173 100644
--- a/mysql-test/suite/innodb/r/redo_log_during_checkpoint.result
+++ b/mysql-test/suite/innodb/r/redo_log_during_checkpoint.result
@@ -7,7 +7,7 @@ USE very_long_database_name;
SET debug_dbug = '+d,increase_mtr_checkpoint_size';
SET debug_dbug = '+d,crash_after_checkpoint';
set global innodb_log_checkpoint_now = 1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# Skip MLOG_FILE_NAME redo records during recovery
DROP DATABASE very_long_database_name;
SET GLOBAL innodb_flush_sync=OFF;
@@ -21,6 +21,6 @@ CREATE DATABASE very_long_database_name;
USE very_long_database_name;
SET debug_dbug = '+d,crash_after_checkpoint';
set global innodb_log_checkpoint_now = 1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# Skip MLOG_FILE_NAME redo records during recovery
DROP DATABASE very_long_database_name;
diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result
index 732f369c402..37e0eac9ce5 100644
--- a/mysql-test/suite/innodb/r/temporary_table.result
+++ b/mysql-test/suite/innodb/r/temporary_table.result
@@ -678,3 +678,99 @@ SET FOREIGN_KEY_CHECKS = 0;
CREATE TEMPORARY TABLE t1(f1 INT NOT NULL,
FOREIGN KEY(f1) REFERENCES t0(f1))ENGINE=InnoDB;
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
+CREATE TABLE t (c INT) ENGINE=InnoDB;
+INSERT INTO t VALUES(0);
+CREATE TEMPORARY TABLE t2 (c INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+INSERT INTO t2 SELECT * FROM t;
+COMMIT;
+DROP TABLE t, t2;
+CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+INSERT INTO t VALUES(0);
+ERROR 21S01: Column count doesn't match value count at row 1
+SAVEPOINT s;
+INSERT INTO t VALUES(0,0);
+COMMIT;
+DROP TABLE t;
+CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+INSERT INTO t VALUES(0);
+ERROR 21S01: Column count doesn't match value count at row 1
+SAVEPOINT s;
+INSERT INTO t VALUES(0,0);
+ROLLBACK;
+DROP TABLE t;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+COMMIT;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t(c INT) ENGINE=InnoDB;
+SET SESSION tx_read_only=TRUE;
+LOCK TABLE test.t READ;
+SELECT * FROM t;
+c
+INSERT INTO t VALUES(0xADC3);
+SET SESSION tx_read_only=FALSE;
+DROP TABLE t;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+COMMIT;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, 1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET b= 2;
+COMMIT;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int, c varchar(255)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, 1, repeat('a', 200));
+START TRANSACTION READ ONLY;
+UPDATE t1 SET b= 2, c=repeat('a', 250);
+COMMIT;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+ROLLBACK;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+DELETE FROM t1 WHERE a= 2;
+COMMIT;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE tmp (a INT) ENGINE=InnoDB;
+INSERT INTO tmp () VALUES (),();
+SET TX_READ_ONLY= 1;
+INSERT INTO tmp SELECT * FROM tmp;
+SET TX_READ_ONLY= 0;
+DROP TABLE tmp;
+SET sql_mode='';
+SET GLOBAL tx_read_only=TRUE;
+CREATE TEMPORARY TABLE t (c INT);
+SET SESSION tx_read_only=DEFAULT;
+INSERT INTO t VALUES(1);
+INSERT INTO t SELECT * FROM t;
+SET SESSION tx_read_only=FALSE;
+SET GLOBAL tx_read_only=OFF;
+DROP TABLE t;
+CREATE TEMPORARY TABLE t(a INT);
+SET SESSION tx_read_only=ON;
+LOCK TABLE t READ;
+SELECT COUNT(*)FROM t;
+COUNT(*)
+0
+INSERT INTO t VALUES (0);
+SET SESSION tx_read_only=OFF;
+DROP TABLE t;
+CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t SET a = NULL;
+ROLLBACK;
diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test
index f5006c82549..7d63f74c2ea 100644
--- a/mysql-test/suite/innodb/t/temporary_table.test
+++ b/mysql-test/suite/innodb/t/temporary_table.test
@@ -502,3 +502,110 @@ SET FOREIGN_KEY_CHECKS = 0;
--error ER_CANT_CREATE_TABLE
CREATE TEMPORARY TABLE t1(f1 INT NOT NULL,
FOREIGN KEY(f1) REFERENCES t0(f1))ENGINE=InnoDB;
+
+CREATE TABLE t (c INT) ENGINE=InnoDB;
+INSERT INTO t VALUES(0);
+CREATE TEMPORARY TABLE t2 (c INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+INSERT INTO t2 SELECT * FROM t;
+COMMIT;
+DROP TABLE t, t2;
+
+CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t VALUES(0);
+SAVEPOINT s;
+INSERT INTO t VALUES(0,0);
+COMMIT;
+DROP TABLE t;
+
+CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t VALUES(0);
+SAVEPOINT s;
+INSERT INTO t VALUES(0,0);
+ROLLBACK;
+DROP TABLE t;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+COMMIT;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t(c INT) ENGINE=InnoDB;
+SET SESSION tx_read_only=TRUE;
+LOCK TABLE test.t READ;
+SELECT * FROM t;
+INSERT INTO t VALUES(0xADC3);
+SET SESSION tx_read_only=FALSE;
+DROP TABLE t;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+COMMIT;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, 1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET b= 2;
+COMMIT;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int, c varchar(255)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, 1, repeat('a', 200));
+START TRANSACTION READ ONLY;
+UPDATE t1 SET b= 2, c=repeat('a', 250);
+COMMIT;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+ROLLBACK;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+DELETE FROM t1 WHERE a= 2;
+COMMIT;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE tmp (a INT) ENGINE=InnoDB;
+INSERT INTO tmp () VALUES (),();
+SET TX_READ_ONLY= 1;
+INSERT INTO tmp SELECT * FROM tmp;
+SET TX_READ_ONLY= 0;
+DROP TABLE tmp;
+
+SET sql_mode='';
+SET GLOBAL tx_read_only=TRUE;
+CREATE TEMPORARY TABLE t (c INT);
+SET SESSION tx_read_only=DEFAULT;
+INSERT INTO t VALUES(1);
+INSERT INTO t SELECT * FROM t;
+SET SESSION tx_read_only=FALSE;
+SET GLOBAL tx_read_only=OFF;
+DROP TABLE t;
+
+CREATE TEMPORARY TABLE t(a INT);
+SET SESSION tx_read_only=ON;
+LOCK TABLE t READ;
+SELECT COUNT(*)FROM t;
+INSERT INTO t VALUES (0);
+SET SESSION tx_read_only=OFF;
+DROP TABLE t;
+
+CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t SET a = NULL;
+ROLLBACK;
diff --git a/mysql-test/suite/innodb_fts/r/sync.result b/mysql-test/suite/innodb_fts/r/sync.result
index 5b8e4810028..92cb3a748e4 100644
--- a/mysql-test/suite/innodb_fts/r/sync.result
+++ b/mysql-test/suite/innodb_fts/r/sync.result
@@ -97,7 +97,7 @@ FULLTEXT(title)
INSERT INTO t1(title) VALUES('database');
SET debug_dbug = '+d,fts_instrument_sync_debug,fts_write_node_crash';
INSERT INTO t1(title) VALUES('mysql');
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# restart
After restart
SELECT title FROM t1 WHERE MATCH(title) AGAINST ('mysql database');
diff --git a/mysql-test/suite/innodb_gis/r/rollback.result b/mysql-test/suite/innodb_gis/r/rollback.result
index 8688690b66a..0d2b9c7cf2c 100644
--- a/mysql-test/suite/innodb_gis/r/rollback.result
+++ b/mysql-test/suite/innodb_gis/r/rollback.result
@@ -411,6 +411,6 @@ set session debug="+d,row_mysql_crash_if_error";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
update t1 set a=point(5,5), b=point(5,5), c=5 where i < 3;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
insert into t1 values(5, point(5,5), point(5,5), 5);
drop table t1;
diff --git a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
index fccee685caf..ca1a989f253 100644
--- a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
+++ b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
@@ -29,12 +29,12 @@ SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash";
SELECT COUNT(*) FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
unlink: t1.ibd
unlink: t1.cfg
# Restart and reconnect to the server
diff --git a/mysql-test/suite/maria/bulk_insert_crash.result b/mysql-test/suite/maria/bulk_insert_crash.result
index fc28bf325ba..0cf5a474939 100644
--- a/mysql-test/suite/maria/bulk_insert_crash.result
+++ b/mysql-test/suite/maria/bulk_insert_crash.result
@@ -3,7 +3,7 @@ insert into t1 values (1000,1000,1000);
insert into t1 select seq,seq+100, seq+200 from seq_1_to_10;
SET GLOBAL debug_dbug="+d,crash_end_bulk_insert";
REPLACE into t1 select seq+20,seq+95, seq + 300 from seq_1_to_10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
diff --git a/mysql-test/suite/maria/maria-gis-recovery.result b/mysql-test/suite/maria/maria-gis-recovery.result
index f84a01fb854..d95b468bbf6 100644
--- a/mysql-test/suite/maria/maria-gis-recovery.result
+++ b/mysql-test/suite/maria/maria-gis-recovery.result
@@ -28,7 +28,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* copied t1 back for feeding_recovery
* recovery happens
check table t1 extended;
@@ -59,7 +59,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* copied t1 back for feeding_recovery
* recovery happens
check table t1 extended;
diff --git a/mysql-test/suite/maria/maria-recovery-big.result b/mysql-test/suite/maria/maria-recovery-big.result
index a04e24eab74..f9e5c81d8bb 100644
--- a/mysql-test/suite/maria/maria-recovery-big.result
+++ b/mysql-test/suite/maria/maria-recovery-big.result
@@ -73,7 +73,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* copied t1 back for feeding_recovery
* recovery happens
check table t1 extended;
diff --git a/mysql-test/suite/maria/maria-recovery-bitmap.result b/mysql-test/suite/maria/maria-recovery-bitmap.result
index c6d0e2cb4e1..78ae6944aa8 100644
--- a/mysql-test/suite/maria/maria-recovery-bitmap.result
+++ b/mysql-test/suite/maria/maria-recovery-bitmap.result
@@ -25,7 +25,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -47,7 +47,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_bitmap,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/maria/maria-recovery-rtree-ft.result b/mysql-test/suite/maria/maria-recovery-rtree-ft.result
index 3a2716f29d9..329cc71c6e9 100644
--- a/mysql-test/suite/maria/maria-recovery-rtree-ft.result
+++ b/mysql-test/suite/maria/maria-recovery-rtree-ft.result
@@ -38,7 +38,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* copied t2 back for feeding_recovery
* copied t1 back for feeding_recovery
* recovery happens
@@ -68,7 +68,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t2 extended;
Table Op Msg_type Msg_text
@@ -95,7 +95,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_page_cache,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t2 extended;
Table Op Msg_type Msg_text
@@ -122,7 +122,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_states,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t2 extended;
Table Op Msg_type Msg_text
@@ -149,7 +149,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t2 extended;
Table Op Msg_type Msg_text
@@ -169,7 +169,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t2 extended;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/maria/maria-recovery.result b/mysql-test/suite/maria/maria-recovery.result
index 915dc53b460..9aa9213d9bd 100644
--- a/mysql-test/suite/maria/maria-recovery.result
+++ b/mysql-test/suite/maria/maria-recovery.result
@@ -22,7 +22,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* copied t1 back for feeding_recovery
* recovery happens
check table t1 extended;
@@ -49,7 +49,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -74,7 +74,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_page_cache,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -100,7 +100,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_states,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -127,7 +127,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -171,7 +171,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* copied t1 back for feeding_recovery
* recovery happens
check table t1 extended;
@@ -210,7 +210,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* copied t1 back for feeding_recovery
* recovery happens
check table t1 extended;
@@ -242,7 +242,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* copied t1 back for feeding_recovery
* recovery happens
check table t1 extended;
@@ -272,7 +272,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -316,7 +316,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
connection default;
use mysqltest;
diff --git a/mysql-test/suite/maria/maria-recovery2.result b/mysql-test/suite/maria/maria-recovery2.result
index dee99339a87..4240e76f141 100644
--- a/mysql-test/suite/maria/maria-recovery2.result
+++ b/mysql-test/suite/maria/maria-recovery2.result
@@ -25,7 +25,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -60,7 +60,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -93,7 +93,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -134,7 +134,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -162,7 +162,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash_sort_index";
* crashing mysqld intentionally
optimize table t_corrupted1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t_corrupted1 extended;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/maria/maria-recovery3.result b/mysql-test/suite/maria/maria-recovery3.result
index 9d25cd13b90..190a2993e5a 100644
--- a/mysql-test/suite/maria/maria-recovery3.result
+++ b/mysql-test/suite/maria/maria-recovery3.result
@@ -25,7 +25,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -67,7 +67,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* copied t1 back for feeding_recovery
* recovery happens
check table t1 extended;
@@ -96,7 +96,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash_create_table";
* crashing mysqld intentionally
truncate table t1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
@@ -122,7 +122,7 @@ connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/parts/r/debug_fail_myisam.result b/mysql-test/suite/parts/r/debug_fail_myisam.result
index ffbc4ff6694..04297563c50 100644
--- a/mysql-test/suite/parts/r/debug_fail_myisam.result
+++ b/mysql-test/suite/parts/r/debug_fail_myisam.result
@@ -45,7 +45,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -119,7 +119,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -195,7 +195,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -271,7 +271,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -347,7 +347,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -425,7 +425,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -503,7 +503,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -581,7 +581,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -662,7 +662,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -741,7 +741,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -2171,7 +2171,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -2244,7 +2244,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -2319,7 +2319,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -2394,7 +2394,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -2462,7 +2462,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -2530,7 +2530,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -2598,7 +2598,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -2664,7 +2664,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -2728,7 +2728,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -3894,7 +3894,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -3969,7 +3969,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -4046,7 +4046,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -4123,7 +4123,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -4204,7 +4204,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -4285,7 +4285,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -4366,7 +4366,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -4450,7 +4450,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -4534,7 +4534,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -4616,7 +4616,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -4698,7 +4698,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -4778,7 +4778,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
diff --git a/mysql-test/suite/parts/r/debug_innodb_crash.result b/mysql-test/suite/parts/r/debug_innodb_crash.result
index 68195967b5b..228796e5498 100644
--- a/mysql-test/suite/parts/r/debug_innodb_crash.result
+++ b/mysql-test/suite/parts/r/debug_innodb_crash.result
@@ -46,7 +46,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -114,7 +114,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -184,7 +184,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -254,7 +254,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -324,7 +324,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -395,7 +395,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -466,7 +466,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -537,7 +537,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -610,7 +610,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -681,7 +681,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -753,7 +753,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -820,7 +820,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -889,7 +889,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -958,7 +958,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1021,7 +1021,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1084,7 +1084,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1147,7 +1147,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -1208,7 +1208,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -1268,7 +1268,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -1333,7 +1333,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -1402,7 +1402,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1473,7 +1473,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1544,7 +1544,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1617,7 +1617,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1690,7 +1690,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1763,7 +1763,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1838,7 +1838,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1913,7 +1913,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -1986,7 +1986,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -2059,7 +2059,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -2131,7 +2131,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
diff --git a/mysql-test/suite/parts/r/debug_myisam_crash.result b/mysql-test/suite/parts/r/debug_myisam_crash.result
index 5252af12db1..2b0f6973228 100644
--- a/mysql-test/suite/parts/r/debug_myisam_crash.result
+++ b/mysql-test/suite/parts/r/debug_myisam_crash.result
@@ -45,7 +45,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -119,7 +119,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -195,7 +195,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -271,7 +271,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -347,7 +347,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -425,7 +425,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -503,7 +503,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -581,7 +581,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -662,7 +662,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -741,7 +741,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -821,7 +821,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -894,7 +894,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -969,7 +969,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1044,7 +1044,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1112,7 +1112,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1180,7 +1180,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1248,7 +1248,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -1314,7 +1314,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -1378,7 +1378,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -1447,7 +1447,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -1522,7 +1522,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1599,7 +1599,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1676,7 +1676,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1757,7 +1757,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1838,7 +1838,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -1919,7 +1919,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -2003,7 +2003,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-shadow-t1.frm
#sql-shadow-t1.par
@@ -2087,7 +2087,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -2169,7 +2169,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -2251,7 +2251,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -2331,7 +2331,7 @@ a b
ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
diff --git a/mysql-test/suite/parts/r/partition_debug.result b/mysql-test/suite/parts/r/partition_debug.result
index 7c083d826cf..571ab329bc2 100644
--- a/mysql-test/suite/parts/r/partition_debug.result
+++ b/mysql-test/suite/parts/r/partition_debug.result
@@ -76,7 +76,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -191,7 +191,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -306,7 +306,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -421,7 +421,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-exchange.frm
# State after crash recovery
@@ -527,7 +527,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-exchange.frm
# State after crash recovery
@@ -633,7 +633,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-exchange.frm
# State after crash recovery
@@ -739,7 +739,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-exchange.frm
# State after crash recovery
@@ -845,7 +845,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
@@ -960,7 +960,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.MYD
diff --git a/mysql-test/suite/parts/r/partition_debug_innodb.result b/mysql-test/suite/parts/r/partition_debug_innodb.result
index e2631d0d708..6cee58e0074 100644
--- a/mysql-test/suite/parts/r/partition_debug_innodb.result
+++ b/mysql-test/suite/parts/r/partition_debug_innodb.result
@@ -62,7 +62,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -170,7 +170,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -278,7 +278,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -386,7 +386,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-exchange.frm
# State after crash recovery
@@ -488,7 +488,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-exchange.frm
# State after crash recovery
@@ -590,7 +590,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-exchange.ibd
# State after crash recovery
@@ -692,7 +692,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
#sql-exchange.ibd
# State after crash recovery
@@ -794,7 +794,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
@@ -902,7 +902,7 @@ a b
3 Original from partition p0
4 Original from partition p0
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
# State after crash (before recovery)
db.opt
t1#P#p0.ibd
diff --git a/mysql-test/suite/plugins/t/multiauth.test b/mysql-test/suite/plugins/t/multiauth.test
index 73538f23832..66f29bdbfec 100644
--- a/mysql-test/suite/plugins/t/multiauth.test
+++ b/mysql-test/suite/plugins/t/multiauth.test
@@ -1,3 +1,4 @@
+--source include/not_ubsan.inc
let $REGEX_VERSION_ID=/$mysql_get_server_version/VERSION_ID/;
let $REGEX_PASSWORD_LAST_CHANGED=/password_last_changed": [0-9]*/password_last_changed": #/;
let $REGEX_GLOBAL_PRIV=$REGEX_PASSWORD_LAST_CHANGED $REGEX_VERSION_ID;
diff --git a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
index deea7caa12a..5675562a840 100644
--- a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
+++ b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
@@ -2,7 +2,7 @@ include/master-slave.inc
[connection master]
connection slave;
call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
-call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to MySQL server at 'reading initial communication packet'");
+call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to server at 'reading initial communication packet'");
call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*");
call mtr.add_suppression("Slave I/O thread .* register on master");
SET @saved_dbug = @@GLOBAL.debug_dbug;
diff --git a/mysql-test/suite/rpl/r/rpl_sync.result b/mysql-test/suite/rpl/r/rpl_sync.result
index 1240c446164..5fa3a07a4e7 100644
--- a/mysql-test/suite/rpl/r/rpl_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_sync.result
@@ -22,7 +22,7 @@ connection slave;
include/stop_slave_io.inc
SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
include/rpl_reconnect.inc
=====Dumping and comparing tables=======;
include/start_slave.inc
@@ -40,7 +40,7 @@ insert into t1(a) values(9);
connection slave;
SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
include/rpl_reconnect.inc
=====Dumping and comparing tables=======;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
index 02665c70b9e..9e3c771ed98 100644
--- a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
+++ b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
@@ -21,7 +21,7 @@ source include/have_binlog_format_mixed.inc;
connection slave;
call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
-call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to MySQL server at 'reading initial communication packet'");
+call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to server at 'reading initial communication packet'");
call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*");
call mtr.add_suppression("Slave I/O thread .* register on master");
diff --git a/mysql-test/suite/sys_vars/inc/sysvars_server.inc b/mysql-test/suite/sys_vars/inc/sysvars_server.inc
index dff31cb2b97..025f8a8922d 100644
--- a/mysql-test/suite/sys_vars/inc/sysvars_server.inc
+++ b/mysql-test/suite/sys_vars/inc/sysvars_server.inc
@@ -23,8 +23,7 @@ select VARIABLE_NAME,VARIABLE_SCOPE,VARIABLE_TYPE,VARIABLE_COMMENT,NUMERIC_MIN_V
variable_name not like 'wsrep%' and
variable_name not like 's3%' and
variable_name not in (
- 'have_sanitizer',
- 'log_tc_size'
+ 'log_tc_size','have_sanitizer'
)
order by variable_name;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index e4ab38f611d..7d2ca937de2 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -9,8 +9,7 @@ where variable_name not like 'debug%' and
variable_name not like 'wsrep%' and
variable_name not like 's3%' and
variable_name not in (
-'have_sanitizer',
-'log_tc_size'
+'log_tc_size','have_sanitizer'
)
order by variable_name;
VARIABLE_NAME ALTER_ALGORITHM
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index 7cdfdff7129..3498d5de743 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -9,8 +9,7 @@ where variable_name not like 'debug%' and
variable_name not like 'wsrep%' and
variable_name not like 's3%' and
variable_name not in (
-'have_sanitizer',
-'log_tc_size'
+'log_tc_size','have_sanitizer'
)
order by variable_name;
VARIABLE_NAME ALTER_ALGORITHM
diff --git a/mysql-test/suite/sys_vars/r/wsrep_on_without_provider.result b/mysql-test/suite/sys_vars/r/wsrep_on_without_provider.result
new file mode 100644
index 00000000000..525619dba29
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_on_without_provider.result
@@ -0,0 +1,5 @@
+SET GLOBAL wsrep_on=ON;
+ERROR HY000: WSREP (galera) can't be enabled if the wsrep_provider is unset or set to 'none'
+SELECT @@global.wsrep_on;
+@@global.wsrep_on
+0
diff --git a/mysql-test/suite/sys_vars/t/thread_stack_basic.test b/mysql-test/suite/sys_vars/t/thread_stack_basic.test
index 6aeda532fde..39f120e0de1 100644
--- a/mysql-test/suite/sys_vars/t/thread_stack_basic.test
+++ b/mysql-test/suite/sys_vars/t/thread_stack_basic.test
@@ -2,6 +2,7 @@
# only global
#
--source include/not_asan.inc
+--source include/not_ubsan.inc
--replace_result 392192 299008
select @@global.thread_stack;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
diff --git a/mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test b/mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test
new file mode 100644
index 00000000000..5bee3c9a356
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test
@@ -0,0 +1,9 @@
+--source include/not_embedded.inc
+
+#
+# @@global.wsrep_on is not allowed if there
+# is no wsrep_provider
+#
+--error ER_WRONG_ARGUMENTS
+SET GLOBAL wsrep_on=ON;
+SELECT @@global.wsrep_on; \ No newline at end of file
diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result
index d0aa49f2fde..e07f1408ab7 100644
--- a/mysql-test/suite/versioning/r/alter.result
+++ b/mysql-test/suite/versioning/r/alter.result
@@ -746,6 +746,23 @@ alter table t1 add column y timestamp(6) as row start;
ERROR HY000: Table `t1` is not system-versioned
drop table t1;
#
+# MDEV-25327 Unexpected ER_DUP_ENTRY upon dropping PK column from system-versioned table
+#
+create table t1 (pk int, a int, primary key (pk), key (a))
+with system versioning;
+insert into t1 values (1, 1), (2, 2);
+delete from t1;
+set system_versioning_alter_history= keep;
+alter table t1 drop pk;
+drop table t1;
+create table t1 (pk int, a int, primary key (pk), key (a))
+with system versioning;
+insert into t1 values (1, 2), (2, 8), (3, 4), (4, 4), (5, 0);
+delete from t1;
+set system_versioning_alter_history= keep;
+alter ignore table t1 drop pk;
+drop table t1;
+#
# MDEV-21941 RENAME doesn't work for system time or period fields
#
create or replace table t1 (a int) with system versioning;
diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test
index 786627da35e..9d3101fb4ad 100644
--- a/mysql-test/suite/versioning/t/alter.test
+++ b/mysql-test/suite/versioning/t/alter.test
@@ -632,6 +632,29 @@ alter table t1 add column y timestamp(6) as row start;
# cleanup
drop table t1;
+
+--echo #
+--echo # MDEV-25327 Unexpected ER_DUP_ENTRY upon dropping PK column from system-versioned table
+--echo #
+create table t1 (pk int, a int, primary key (pk), key (a))
+with system versioning;
+insert into t1 values (1, 1), (2, 2);
+delete from t1;
+set system_versioning_alter_history= keep;
+alter table t1 drop pk;
+# cleanup
+drop table t1;
+
+create table t1 (pk int, a int, primary key (pk), key (a))
+with system versioning;
+insert into t1 values (1, 2), (2, 8), (3, 4), (4, 4), (5, 0);
+delete from t1;
+set system_versioning_alter_history= keep;
+alter ignore table t1 drop pk;
+# cleanup
+drop table t1;
+
+
--echo #
--echo # MDEV-21941 RENAME doesn't work for system time or period fields
--echo #
diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def
index a1c8165d165..991109d72b8 100644
--- a/mysql-test/suite/wsrep/disabled.def
+++ b/mysql-test/suite/wsrep/disabled.def
@@ -14,3 +14,4 @@
mdev_6832: wsrep_provider is read-only for security reasons
MDEV-23092: wsrep_provider is read-only for security reasons
wsrep_variables_no_provider: wsrep_provider is read-only for security reasons
+MDEV-22443: it is no longer allowed enable wsrep_on if wsrep_provider is 'none'
diff --git a/mysql-test/suite/sys_vars/r/wsrep_on_basic.result b/mysql-test/suite/wsrep/r/wsrep_on_basic.result
index 735e2d77180..b3186fa674f 100644
--- a/mysql-test/suite/sys_vars/r/wsrep_on_basic.result
+++ b/mysql-test/suite/wsrep/r/wsrep_on_basic.result
@@ -7,10 +7,10 @@ SET @wsrep_on_session_saved = @@session.wsrep_on;
# default
SELECT @@global.wsrep_on;
@@global.wsrep_on
-0
+1
SELECT @@session.wsrep_on;
@@session.wsrep_on
-0
+1
# scope and valid values
SET @@global.wsrep_on=OFF;
diff --git a/mysql-test/suite/wsrep/t/wsrep_on_basic.opt b/mysql-test/suite/wsrep/t/wsrep_on_basic.opt
new file mode 100644
index 00000000000..9da4dd32881
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_on_basic.opt
@@ -0,0 +1 @@
+--wsrep-provider=$WSREP_PROVIDER --binlog_format=ROW --wsrep-cluster-address=gcomm://
diff --git a/mysql-test/suite/sys_vars/t/wsrep_on_basic.test b/mysql-test/suite/wsrep/t/wsrep_on_basic.test
index 229d771b5e7..98062dbec83 100644
--- a/mysql-test/suite/sys_vars/t/wsrep_on_basic.test
+++ b/mysql-test/suite/wsrep/t/wsrep_on_basic.test
@@ -1,4 +1,6 @@
--source include/have_wsrep.inc
+--source include/have_wsrep_provider.inc
+--source include/have_innodb.inc
--echo #
--echo # wsrep_on
diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c
index b3d3777d922..8e8ac8a98a4 100644
--- a/mysys/ma_dyncol.c
+++ b/mysys/ma_dyncol.c
@@ -865,7 +865,7 @@ dynamic_column_uint_read(DYNAMIC_COLUMN_VALUE *store_it_here,
static size_t dynamic_column_sint_bytes(longlong val)
{
- return dynamic_column_uint_bytes((val << 1) ^
+ return dynamic_column_uint_bytes((((ulonglong) val) << 1) ^
(val < 0 ? 0xffffffffffffffffull : 0));
}
@@ -883,8 +883,8 @@ static enum enum_dyncol_func_result
dynamic_column_sint_store(DYNAMIC_COLUMN *str, longlong val)
{
return dynamic_column_uint_store(str,
- (val << 1) ^
- (val < 0 ? 0xffffffffffffffffULL : 0));
+ (((ulonglong) val) << 1) ^
+ (val < 0 ? 0xffffffffffffffffULL : 0));
}
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index 82ab6f20646..2d6031fa8cd 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates
- Copyright (c) 2010, 2020, MariaDB
+ Copyright (c) 2010, 2021, MariaDB
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
diff --git a/plugin/auth_ed25519/CMakeLists.txt b/plugin/auth_ed25519/CMakeLists.txt
index 1a3d5cc4bce..1033dc053c8 100644
--- a/plugin/auth_ed25519/CMakeLists.txt
+++ b/plugin/auth_ed25519/CMakeLists.txt
@@ -19,6 +19,10 @@ IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(${REF10_SOURCES} PROPERTY COMPILE_FLAGS "/wd4244 /wd4146")
ENDIF()
+IF(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION LESS 11 AND CMAKE_C_COMPILER_VERSION GREATER 6)
+ SET_SOURCE_FILES_PROPERTIES(${REF10_SOURCES} PROPERTY COMPILE_FLAGS -fno-sanitize=shift)
+ENDIF()
+
# server plugin *cannot* link with the library, it needs all sources to be
# compiled with MYSQL_DYNAMIC_PLUGIN
MYSQL_ADD_PLUGIN(auth_ed25519 server_ed25519.c ${REF10_SOURCES} MODULE_ONLY)
diff --git a/sql/compat56.h b/sql/compat56.h
index 347d6145048..65cd36dacfd 100644
--- a/sql/compat56.h
+++ b/sql/compat56.h
@@ -30,8 +30,8 @@
#define MY_PACKED_TIME_GET_INT_PART(x) ((x) >> 24)
#define MY_PACKED_TIME_GET_FRAC_PART(x) ((x) % (1LL << 24))
-#define MY_PACKED_TIME_MAKE(i, f) ((((longlong) (i)) << 24) + (f))
-#define MY_PACKED_TIME_MAKE_INT(i) ((((longlong) (i)) << 24))
+#define MY_PACKED_TIME_MAKE(i, f) ((((ulonglong) (i)) << 24) + (f))
+#define MY_PACKED_TIME_MAKE_INT(i) ((((ulonglong) (i)) << 24))
longlong TIME_to_longlong_datetime_packed(const MYSQL_TIME *);
longlong TIME_to_longlong_time_packed(const MYSQL_TIME *);
diff --git a/sql/events.cc b/sql/events.cc
index 33ddcdac3cb..9f0aef885df 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -662,8 +662,16 @@ Events::drop_schema_events(THD *thd, const char *db)
*/
if (event_queue)
event_queue->drop_schema_events(thd, &db_lex);
- db_repository->drop_schema_events(thd, &db_lex);
-
+ if (db_repository)
+ db_repository->drop_schema_events(thd, &db_lex);
+ else
+ {
+ if ((db_repository= new Event_db_repository))
+ {
+ db_repository->drop_schema_events(thd, &db_lex);
+ delete db_repository;
+ }
+ }
DBUG_VOID_RETURN;
}
diff --git a/sql/field.h b/sql/field.h
index d808a9b0401..ba50e0da1d7 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -4997,7 +4997,13 @@ public:
void move_field_offset(my_ptrdiff_t ptr_diff) override
{
Field::move_field_offset(ptr_diff);
- bit_ptr= ADD_TO_PTR(bit_ptr, ptr_diff, uchar*);
+
+ /*
+ clang does not like when things are added to a null pointer, even if
+ it is never referenced.
+ */
+ if (bit_ptr)
+ bit_ptr= ADD_TO_PTR(bit_ptr, ptr_diff, uchar*);
}
void hash(ulong *nr, ulong *nr2) override;
diff --git a/sql/gcalc_tools.h b/sql/gcalc_tools.h
index 77da791f0b9..e625b355d95 100644
--- a/sql/gcalc_tools.h
+++ b/sql/gcalc_tools.h
@@ -184,7 +184,11 @@ class Gcalc_result_receiver
double first_x, first_y, prev_x, prev_y;
double shape_area;
public:
- Gcalc_result_receiver() : collection_result(FALSE), n_shapes(0), n_holes(0)
+Gcalc_result_receiver() :
+ n_points(0),
+ common_shapetype(Gcalc_function::shape_point),
+ collection_result(FALSE), n_shapes(0), n_holes(0),
+ cur_shape(Gcalc_function::shape_point), shape_pos(0)
{}
int start_shape(Gcalc_function::shape_type shape);
int add_point(double x, double y);
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 5acdbe5b7e2..8eddec5511f 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -6574,6 +6574,7 @@ int ha_partition::multi_range_read_init(RANGE_SEQ_IF *seq,
DBUG_ENTER("ha_partition::multi_range_read_init");
DBUG_PRINT("enter", ("partition this: %p", this));
+ eq_range= 0;
m_seq_if= seq;
m_seq= seq->init(seq_init_param, n_ranges, mrr_mode);
if (unlikely((error= multi_range_key_create_key(seq, m_seq))))
diff --git a/sql/item.cc b/sql/item.cc
index 152f36bb9e8..5cdbf52e829 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2653,9 +2653,7 @@ Item_sp::Item_sp(THD *thd, Name_resolution_context *context_arg,
dummy_table= (TABLE*) thd->calloc(sizeof(TABLE) + sizeof(TABLE_SHARE) +
sizeof(Query_arena));
dummy_table->s= (TABLE_SHARE*) (dummy_table + 1);
- /* TODO(cvicentiu) Move this sp_query_arena in the class as a direct member.
- Currently it can not be done due to header include dependencies. */
- sp_query_arena= (Query_arena *) (dummy_table->s + 1);
+ sp_query_arena= new(dummy_table->s + 1) Query_arena();
memset(&sp_mem_root, 0, sizeof(sp_mem_root));
}
@@ -2666,7 +2664,7 @@ Item_sp::Item_sp(THD *thd, Item_sp *item):
dummy_table= (TABLE*) thd->calloc(sizeof(TABLE)+ sizeof(TABLE_SHARE) +
sizeof(Query_arena));
dummy_table->s= (TABLE_SHARE*) (dummy_table+1);
- sp_query_arena= (Query_arena *) (dummy_table->s + 1);
+ sp_query_arena= new(dummy_table->s + 1) Query_arena();
memset(&sp_mem_root, 0, sizeof(sp_mem_root));
}
@@ -6285,12 +6283,14 @@ Item *Item_field::replace_equal_field(THD *thd, uchar *arg)
item_equal->compare_type_handler()->cmp_type());
return const_item2;
}
- Item_field *subst=
- (Item_field *)(item_equal->get_first(param->context_tab, this));
+ Item_ident *subst=
+ (Item_ident *) (item_equal->get_first(param->context_tab, this));
if (subst)
- subst= (Item_field *) (subst->real_item());
- if (subst && !field->eq(subst->field))
- return subst;
+ {
+ Item_field *subst2= (Item_field *) (subst->real_item());
+ if (subst2 && !field->eq(subst2->field))
+ return subst2;
+ }
}
return this;
}
diff --git a/sql/item_buff.cc b/sql/item_buff.cc
index 9c96fdb1a9a..05cef6871be 100644
--- a/sql/item_buff.cc
+++ b/sql/item_buff.cc
@@ -47,9 +47,9 @@ Cached_item *new_Cached_item(THD *thd, Item *item, bool pass_through_ref)
}
switch (item->result_type()) {
case STRING_RESULT:
- return new Cached_item_str(thd, (Item_field *) item);
+ return new Cached_item_str(thd, item);
case INT_RESULT:
- return new Cached_item_int((Item_field *) item);
+ return new Cached_item_int(item);
case REAL_RESULT:
return new Cached_item_real(item);
case DECIMAL_RESULT:
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 4a134e99bfc..97c41373d12 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -5800,13 +5800,17 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
if (!res2)
return FALSE; // Null argument
- const size_t len = res2->length();
- const char* first = res2->ptr();
- const char* last = first + len - 1;
+ const size_t len= res2->length();
+
/*
len must be > 2 ('%pattern%')
heuristic: only do TurboBM for pattern_len > 2
*/
+ if (len <= 2)
+ return FALSE;
+
+ const char* first= res2->ptr();
+ const char* last= first + len - 1;
if (len > MIN_TURBOBM_PATTERN_LEN + 2 &&
*first == wild_many &&
diff --git a/sql/item_func.cc b/sql/item_func.cc
index a0ef4020aae..f308435eea7 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2020, MariaDB
+ Copyright (c) 2009, 2021, MariaDB
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
@@ -1104,17 +1104,20 @@ double Item_func_plus::real_op()
return check_float_overflow(value);
}
+#if defined(__powerpc64__) && GCC_VERSION >= 6003 && GCC_VERSION <= 10002
+#pragma GCC push_options
+#pragma GCC optimize ("no-expensive-optimizations")
+#endif
longlong Item_func_plus::int_op()
{
longlong val0= args[0]->val_int();
longlong val1= args[1]->val_int();
- longlong res= val0 + val1;
bool res_unsigned= FALSE;
+ longlong res;
if ((null_value= args[0]->null_value || args[1]->null_value))
return 0;
-
/*
First check whether the result can be represented as a
(bool unsigned_flag, longlong value) pair, then check if it is compatible
@@ -1155,16 +1158,29 @@ longlong Item_func_plus::int_op()
{
if (val0 >=0 && val1 >= 0)
res_unsigned= TRUE;
- else if (val0 < 0 && val1 < 0 && res >= 0)
+ else if (val0 < 0 && val1 < 0 && val0 < (LONGLONG_MIN - val1))
goto err;
}
}
+
+#ifndef WITH_UBSAN
+ res= val0 + val1;
+#else
+ if (res_unsigned)
+ res= (longlong) ((ulonglong) val0 + (ulonglong) val1);
+ else
+ res= val0+val1;
+#endif /* WITH_UBSAN */
+
return check_integer_overflow(res, res_unsigned);
err:
return raise_integer_overflow();
}
+#if defined(__powerpc64__) && GCC_VERSION >= 6003 && GCC_VERSION <= 10002
+#pragma GCC pop_options
+#endif
/**
Calculate plus of two decimals.
@@ -1259,12 +1275,17 @@ double Item_func_minus::real_op()
}
+#if defined(__powerpc64__) && GCC_VERSION >= 6003 && GCC_VERSION <= 10002
+#pragma GCC push_options
+#pragma GCC optimize ("no-expensive-optimizations")
+#endif
+
longlong Item_func_minus::int_op()
{
longlong val0= args[0]->val_int();
longlong val1= args[1]->val_int();
- longlong res= val0 - val1;
bool res_unsigned= FALSE;
+ longlong res;
if ((null_value= args[0]->null_value || args[1]->null_value))
return 0;
@@ -1279,12 +1300,8 @@ longlong Item_func_minus::int_op()
if (args[1]->unsigned_flag)
{
if ((ulonglong) val0 < (ulonglong) val1)
- {
- if (res >= 0)
- goto err;
- }
- else
- res_unsigned= TRUE;
+ goto err;
+ res_unsigned= TRUE;
}
else
{
@@ -1305,23 +1322,35 @@ longlong Item_func_minus::int_op()
{
if (args[1]->unsigned_flag)
{
- if ((ulonglong) (val0 - LONGLONG_MIN) < (ulonglong) val1)
+ if (((ulonglong) val0 - (ulonglong) LONGLONG_MIN) < (ulonglong) val1)
goto err;
}
else
{
if (val0 > 0 && val1 < 0)
res_unsigned= TRUE;
- else if (val0 < 0 && val1 > 0 && res >= 0)
+ else if (val0 < 0 && val1 > 0 && val0 < (LONGLONG_MIN + val1))
goto err;
}
}
+#ifndef WITH_UBSAN
+ res= val0 - val1;
+#else
+ if (res_unsigned)
+ res= (longlong) ((ulonglong) val0 - (ulonglong) val1);
+ else
+ res= val0 - val1;
+#endif /* WITH_UBSAN */
+
return check_integer_overflow(res, res_unsigned);
err:
return raise_integer_overflow();
}
+#if defined(__powerpc64__) && GCC_VERSION >= 6003 && GCC_VERSION <= 10002
+#pragma GCC pop_options
+#endif
/**
See Item_func_plus::decimal_op for comments.
@@ -3114,10 +3143,11 @@ longlong Item_func_locate::val_int()
if (arg_count == 3)
{
- start0= start= args[2]->val_int() - 1;
+ start0= start= args[2]->val_int();
- if ((start < 0) || (start > a->length()))
+ if ((start <= 0) || (start > a->length()))
return 0;
+ start0--; start--;
/* start is now sufficiently valid to pass to charpos function */
start= a->charpos((int) start);
@@ -3281,7 +3311,7 @@ bool Item_func_find_in_set::fix_length_and_dec()
find->length(), 0);
enum_bit=0;
if (enum_value)
- enum_bit=1LL << (enum_value-1);
+ enum_bit= 1ULL << (enum_value-1);
}
}
}
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index af14734eae3..e7f2b3d8eee 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -624,8 +624,6 @@ String *Item_func_json_unquote::read_json(json_engine_t *je)
json_scan_start(je, js->charset(),(const uchar *) js->ptr(),
(const uchar *) js->ptr() + js->length());
- je->value_type= (enum json_value_types) -1; /* To report errors right. */
-
if (json_read_value(je))
goto error;
@@ -988,7 +986,8 @@ my_decimal *Item_func_json_extract::val_decimal(my_decimal *to)
case JSON_VALUE_ARRAY:
case JSON_VALUE_FALSE:
case JSON_VALUE_NULL:
- break;
+ case JSON_VALUE_UNINITALIZED:
+ break;
};
}
int2my_decimal(E_DEC_FATAL_ERROR, 0, false/*unsigned_flag*/, to);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 5a6cb1a4c8f..3123844865f 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1496,17 +1496,18 @@ String *Item_func_insert::val_str(String *str)
null_value=0;
res=args[0]->val_str(str);
res2=args[3]->val_str(&tmp_value);
- start= args[1]->val_int() - 1;
+ start= args[1]->val_int();
length= args[2]->val_int();
if (args[0]->null_value || args[1]->null_value || args[2]->null_value ||
args[3]->null_value)
goto null; /* purecov: inspected */
- if ((start < 0) || (start > res->length()))
+ if ((start <= 0) || (start > res->length()))
return res; // Wrong param; skip insert
if ((length < 0) || (length > res->length()))
length= res->length();
+ start--;
/*
There is one exception not handled (intentionaly) by the character set
@@ -3775,13 +3776,12 @@ String *Item_func_unhex::val_str(String *str)
}
for (end=res->ptr()+res->length(); from < end ; from+=2, to++)
{
- int hex_char;
- *to= (hex_char= hexchar_to_int(from[0])) << 4;
- if ((null_value= (hex_char == -1)))
- return 0;
- *to|= hex_char= hexchar_to_int(from[1]);
- if ((null_value= (hex_char == -1)))
+ int hex_char1, hex_char2;
+ hex_char1= hexchar_to_int(from[0]);
+ hex_char2= hexchar_to_int(from[1]);
+ if ((null_value= (hex_char1 == -1 || hex_char2 == -1)))
return 0;
+ *to= (char) ((hex_char1 << 4) | hex_char2);
}
return str;
}
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 1ae62a4a6e8..36300e57f03 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -42,8 +42,13 @@ protected:
we don't want to free and potentially have to reallocate the buffer
for each call.
*/
- str_value.length(0);
- str_value.set_charset(collation.collation);
+ if (!str_value.is_alloced())
+ str_value.set("", 0, collation.collation); /* Avoid null ptrs */
+ else
+ {
+ str_value.length(0); /* Reuse allocated area */
+ str_value.set_charset(collation.collation);
+ }
return &str_value;
}
public:
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index e4e8bf2a1e8..c9afc9c1bcd 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2002, 2016, Oracle and/or its affiliates.
- Copyright (c) 2010, 2016, MariaDB
+ Copyright (c) 2010, 2021, MariaDB
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
@@ -685,6 +685,31 @@ bool Item_subselect::is_expensive()
}
+static
+int walk_items_for_table_list(Item_processor processor,
+ bool walk_subquery, void *argument,
+ List<TABLE_LIST>& join_list)
+{
+ List_iterator<TABLE_LIST> li(join_list);
+ int res;
+ while (TABLE_LIST *table= li++)
+ {
+ if (table->on_expr)
+ {
+ if ((res= table->on_expr->walk(processor, walk_subquery, argument)))
+ return res;
+ }
+ if (table->nested_join)
+ {
+ if ((res= walk_items_for_table_list(processor, walk_subquery, argument,
+ table->nested_join->join_list)))
+ return res;
+ }
+ }
+ return 0;
+}
+
+
bool Item_subselect::unknown_splocal_processor(void *argument)
{
SELECT_LEX *sl= unit->first_select();
@@ -770,7 +795,6 @@ bool Item_subselect::walk(Item_processor processor, bool walk_subquery,
for (SELECT_LEX *lex= unit->first_select(); lex; lex= lex->next_select())
{
List_iterator<Item> li(lex->item_list);
- Item *item;
ORDER *order;
if (lex->where && (lex->where)->walk(processor, walk_subquery, argument))
@@ -778,14 +802,16 @@ bool Item_subselect::walk(Item_processor processor, bool walk_subquery,
if (lex->having && (lex->having)->walk(processor, walk_subquery,
argument))
return 1;
- /* TODO: why does this walk WHERE/HAVING but not ON expressions of outer joins? */
- /* Consider walking ON epxression in walk_table_functions_for_list */
+
+ if (walk_items_for_table_list(processor, walk_subquery, argument,
+ *lex->join_list))
+ return 1;
if (walk_table_functions_for_list(processor, walk_subquery, argument,
*lex->join_list))
return 1;
- while ((item=li++))
+ while (Item *item= li++)
{
if (item->walk(processor, walk_subquery, argument))
return 1;
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 7106f72e237..537eaaf8dcd 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -2639,9 +2639,9 @@ bool Item_sum_bit::add_as_window(ulonglong value)
void Item_sum_or::set_bits_from_counters()
{
ulonglong value= 0;
- for (int i= 0; i < NUM_BIT_COUNTERS; i++)
+ for (uint i= 0; i < NUM_BIT_COUNTERS; i++)
{
- value|= bit_counters[i] > 0 ? (1 << i) : 0;
+ value|= bit_counters[i] > 0 ? (1ULL << i) : 0ULL;
}
bits= value | reset_bits;
}
@@ -3887,7 +3887,7 @@ Item_func_group_concat(THD *thd, Name_resolution_context *context_arg,
arg_count_field(select_list->elements),
row_count(0),
distinct(distinct_arg),
- warning_for_row(FALSE),
+ warning_for_row(FALSE), always_null(FALSE),
force_copy_fields(0), row_limit(NULL),
offset_limit(NULL), limit_clause(limit_clause),
copy_offset_limit(0), copy_row_limit(0), original(0)
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index b8650a5c7e9..3707811f3f6 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -729,7 +729,10 @@ static bool make_date_time(const String *format, const MYSQL_TIME *l_time,
For example, '1.1' -> '1.100000'
*/
-static bool get_interval_info(const char *str, size_t length,CHARSET_INFO *cs, size_t count, ulonglong *values,
+#define MAX_DIGITS_IN_TIME_SPEC 20
+
+static bool get_interval_info(const char *str, size_t length,CHARSET_INFO *cs,
+ size_t count, ulonglong *values,
bool transform_msec)
{
const char *end=str+length;
@@ -741,11 +744,21 @@ static bool get_interval_info(const char *str, size_t length,CHARSET_INFO *cs, s
for (i=0 ; i < count ; i++)
{
- longlong value;
+ ulonglong value;
const char *start= str;
- for (value= 0; str != end && my_isdigit(cs, *str); str++)
+ const char *local_end= end;
+
+ /*
+ We limit things to 19 digits to not get an overflow. This is ok as
+ this function is meant to read up to microseconds
+ */
+ if ((local_end-str) > MAX_DIGITS_IN_TIME_SPEC)
+ local_end= str+ MAX_DIGITS_IN_TIME_SPEC;
+
+ for (value= 0; str != local_end && my_isdigit(cs, *str) ; str++)
value= value*10 + *str - '0';
- if ((field_length= (size_t)(str - start)) >= 20)
+
+ if ((field_length= (size_t)(str - start)) >= MAX_DIGITS_IN_TIME_SPEC)
return true;
values[i]= value;
while (str != end && !my_isdigit(cs,*str))
@@ -2070,9 +2083,9 @@ bool Func_handler_date_add_interval_datetime_arg0_time::
bool Item_date_add_interval::eq(const Item *item, bool binary_cmp) const
{
- Item_date_add_interval *other= (Item_date_add_interval*) item;
if (!Item_func::eq(item, binary_cmp))
return 0;
+ Item_date_add_interval *other= (Item_date_add_interval*) item;
return ((int_type == other->int_type) &&
(date_sub_interval == other->date_sub_interval));
}
diff --git a/sql/log.cc b/sql/log.cc
index a31b8dd5598..be94a7f7523 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -10217,28 +10217,13 @@ int TC_LOG_BINLOG::unlog_xa_prepare(THD *thd, bool all)
uint rw_count= ha_count_rw_all(thd, &ha_info);
bool rc= false;
-#ifndef DBUG_OFF
- if (rw_count > 1)
- {
- /*
- There must be no binlog_hton used in a transaction consisting of more
- than 1 engine, *when* (at this point) this transaction has not been
- binlogged. The one exception is if there is an engine without a
- prepare method, as in this case the engine doesn't support XA and
- we have to ignore this check.
- */
- bool binlog= false, exist_hton_without_prepare= false;
- for (ha_info= thd->transaction->all.ha_list; ha_info;
- ha_info= ha_info->next())
- {
- if (ha_info->ht() == binlog_hton)
- binlog= true;
- if (!ha_info->ht()->prepare)
- exist_hton_without_prepare= true;
- }
- DBUG_ASSERT(!binlog || exist_hton_without_prepare);
- }
-#endif
+ /*
+ This transaction has not been binlogged as indicated by need_unlog.
+ Such exceptional cases include transactions with no effect to engines,
+ e.g REPLACE that does not change the dat but still the Engine
+ transaction branch claims to be rw, and few more.
+ In all such cases an empty XA-prepare group of events is bin-logged.
+ */
if (rw_count > 0)
{
/* an empty XA-prepare event group is logged */
diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc
index c9cff6ad930..877a49edbec 100644
--- a/sql/mf_iocache.cc
+++ b/sql/mf_iocache.cc
@@ -26,7 +26,7 @@
Used instead of FILE when reading or writing whole files.
This will make mf_rec_cache obsolete.
One can change info->pos_in_file to a higher value to skip bytes in file if
- also info->rc_pos is set to info->rc_end.
+ also info->read_pos is set to info->read_end.
If called through open_cached_file(), then the temporary file will
only be created if a write exeeds the file buffer or if one calls
flush_io_cache().
diff --git a/sql/opt_split.cc b/sql/opt_split.cc
index c81e1ab9e3a..c5bd8076209 100644
--- a/sql/opt_split.cc
+++ b/sql/opt_split.cc
@@ -205,7 +205,7 @@ struct SplM_field_info
struct SplM_plan_info
{
/* The cached splitting execution plan P */
- struct st_position *best_positions;
+ POSITION *best_positions;
/* The cost of the above plan */
double cost;
/* Selectivity of splitting used in P */
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 50be5817df2..582b1b8e8ef 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -3010,7 +3010,7 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx,
}
-void Sj_materialization_picker::set_from_prev(struct st_position *prev)
+void Sj_materialization_picker::set_from_prev(POSITION *prev)
{
if (prev->sjmat_picker.is_used)
set_empty();
@@ -3196,7 +3196,7 @@ bool Sj_materialization_picker::check_qep(JOIN *join,
}
-void LooseScan_picker::set_from_prev(struct st_position *prev)
+void LooseScan_picker::set_from_prev(POSITION *prev)
{
if (prev->loosescan_picker.is_used)
set_empty();
@@ -3217,7 +3217,7 @@ bool LooseScan_picker::check_qep(JOIN *join,
double *read_time,
table_map *handled_fanout,
sj_strategy_enum *strategy,
- struct st_position *loose_scan_pos)
+ POSITION *loose_scan_pos)
{
POSITION *first= join->positions + first_loosescan_table;
/*
@@ -3295,7 +3295,7 @@ bool LooseScan_picker::check_qep(JOIN *join,
return FALSE;
}
-void Firstmatch_picker::set_from_prev(struct st_position *prev)
+void Firstmatch_picker::set_from_prev(POSITION *prev)
{
if (prev->firstmatch_picker.is_used)
invalidate_firstmatch_prefix();
@@ -5831,8 +5831,8 @@ Item *and_new_conditions_to_optimized_cond(THD *thd, Item *cond,
((Item_func *) item)->functype() == Item_func::EQ_FUNC &&
check_simple_equality(thd,
Item::Context(Item::ANY_SUBST,
- ((Item_func_equal *)item)->compare_type_handler(),
- ((Item_func_equal *)item)->compare_collation()),
+ ((Item_func_eq *)item)->compare_type_handler(),
+ ((Item_func_eq *)item)->compare_collation()),
((Item_func *)item)->arguments()[0],
((Item_func *)item)->arguments()[1],
&new_cond_equal))
diff --git a/sql/partition_element.h b/sql/partition_element.h
index ff0d0d59fc4..e0a519065cc 100644
--- a/sql/partition_element.h
+++ b/sql/partition_element.h
@@ -144,6 +144,7 @@ public:
part_min_rows(part_elem->part_min_rows),
range_value(0), partition_name(NULL),
tablespace_name(part_elem->tablespace_name),
+ log_entry(NULL),
part_comment(part_elem->part_comment),
data_file_name(part_elem->data_file_name),
index_file_name(part_elem->index_file_name),
@@ -152,6 +153,8 @@ public:
part_state(part_elem->part_state),
nodegroup_id(part_elem->nodegroup_id),
has_null_value(FALSE),
+ signed_flag(part_elem->signed_flag),
+ max_value(part_elem->max_value),
id(part_elem->id),
empty(part_elem->empty),
type(CONVENTIONAL)
diff --git a/sql/service_wsrep.cc b/sql/service_wsrep.cc
index d0a96a85a60..91b1a48cad7 100644
--- a/sql/service_wsrep.cc
+++ b/sql/service_wsrep.cc
@@ -119,15 +119,23 @@ extern "C" my_bool wsrep_get_debug()
return wsrep_debug;
}
+/*
+ Test if this connection is a true local (user) connection and not
+ a replication or wsrep applier thread.
+
+ Note that this is only usable for galera (as there are other kinds
+ of system threads, and only if WSREP_NNULL() is tested by the caller.
+ */
extern "C" my_bool wsrep_thd_is_local(const THD *thd)
{
/*
- async replication IO and background threads have nothing to replicate in the cluster,
- marking them as non-local here to prevent write set population and replication
+ async replication IO and background threads have nothing to
+ replicate in the cluster, marking them as non-local here to
+ prevent write set population and replication
- async replication SQL thread, applies client transactions from mariadb master
- and will be replicated into cluster
- */
+ async replication SQL thread, applies client transactions from
+ mariadb master and will be replicated into cluster
+ */
return (
thd->system_thread != SYSTEM_THREAD_SLAVE_BACKGROUND &&
thd->system_thread != SYSTEM_THREAD_SLAVE_IO &&
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index 2d3eaa609aa..6aac9ac5962 100644
--- a/sql/signal_handler.cc
+++ b/sql/signal_handler.cc
@@ -32,7 +32,7 @@
#endif
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/sysctl.h>
#endif
@@ -54,7 +54,7 @@ extern const char *optimizer_switch_names[];
static inline void output_core_info()
{
/* proc is optional on some BSDs so it can't hurt to look */
-#if defined(HAVE_READLINK) && !defined(__APPLE__)
+#if defined(HAVE_READLINK) && !defined(__APPLE__) && !defined(__FreeBSD__)
char buff[PATH_MAX];
ssize_t len;
int fd;
@@ -85,7 +85,7 @@ static inline void output_core_info()
my_close(fd, MYF(0));
}
#endif
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(__FreeBSD__)
char buff[PATH_MAX];
size_t len = sizeof(buff);
if (sysctlbyname("kern.corefile", buff, &len, NULL, 0) == 0)
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index c127bad8ef1..6e202185d06 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
- Copyright (c) 2009, 2020, MariaDB
+ Copyright (c) 2009, 2021, MariaDB
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
@@ -5486,7 +5486,7 @@ routine_hash_search(const char *host, const char *ip, const char *db,
const char *user, const char *tname, const Sp_handler *sph,
bool exact)
{
- return (GRANT_TABLE*)
+ return (GRANT_NAME*)
name_hash_search(sph->get_priv_hash(),
host, ip, db, user, tname, exact, TRUE);
}
@@ -5500,6 +5500,10 @@ table_hash_search(const char *host, const char *ip, const char *db,
user, tname, exact, FALSE);
}
+static bool column_priv_insert(GRANT_TABLE *grant)
+{
+ return my_hash_insert(&column_priv_hash,(uchar*) grant);
+}
static GRANT_COLUMN *
column_hash_search(GRANT_TABLE *t, const char *cname, size_t length)
@@ -5729,6 +5733,15 @@ static inline void get_grantor(THD *thd, char *grantor)
strxmov(grantor, user, "@", host, NullS);
}
+
+/**
+ Revoke rights from a grant table entry.
+
+ @return 0 ok
+ @return 1 fatal error (error given)
+ @return -1 grant table was revoked
+*/
+
static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
TABLE *table, const LEX_USER &combo,
const char *db, const char *table_name,
@@ -5753,7 +5766,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
{
my_message(ER_PASSWORD_NO_MATCH, ER_THD(thd, ER_PASSWORD_NO_MATCH),
MYF(0)); /* purecov: deadcode */
- DBUG_RETURN(-1); /* purecov: deadcode */
+ DBUG_RETURN(1); /* purecov: deadcode */
}
}
@@ -5784,7 +5797,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0),
combo.user.str, combo.host.str,
table_name); /* purecov: deadcode */
- DBUG_RETURN(-1); /* purecov: deadcode */
+ DBUG_RETURN(1); /* purecov: deadcode */
}
old_row_exists = 0;
restore_record(table,record[1]); // Get saved record
@@ -5846,13 +5859,14 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
else
{
my_hash_delete(&column_priv_hash,(uchar*) grant_table);
+ DBUG_RETURN(-1); // Entry revoked
}
DBUG_RETURN(0);
/* This should never happen */
table_error:
table->file->print_error(error,MYF(0)); /* purecov: deadcode */
- DBUG_RETURN(-1); /* purecov: deadcode */
+ DBUG_RETURN(1); /* purecov: deadcode */
}
@@ -6613,7 +6627,7 @@ static int update_role_table_columns(GRANT_TABLE *merged,
privs, cols);
merged->init_privs= merged->init_cols= NO_ACL;
update_role_columns(merged, first, last);
- my_hash_insert(&column_priv_hash,(uchar*) merged);
+ column_priv_insert(merged);
return 2;
}
else if ((privs | cols) == NO_ACL)
@@ -7078,12 +7092,12 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
result= TRUE;
continue;
}
- grant_table = new GRANT_TABLE (Str->host.str, db_name,
- Str->user.str, table_name,
- rights,
- column_priv);
+ grant_table= new (&grant_memroot) GRANT_TABLE(Str->host.str, db_name,
+ Str->user.str, table_name,
+ rights,
+ column_priv);
if (!grant_table ||
- my_hash_insert(&column_priv_hash,(uchar*) grant_table))
+ column_priv_insert(grant_table))
{
result= TRUE; /* purecov: deadcode */
continue; /* purecov: deadcode */
@@ -7126,22 +7140,24 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
/* TODO(cvicentiu) refactor replace_table_table to use Tables_priv_table
instead of TABLE directly. */
- if (replace_table_table(thd, grant_table, tables.tables_priv_table().table(),
- *Str, db_name, table_name,
- rights, column_priv, revoke_grant))
- {
- /* Should only happen if table is crashed */
- result= TRUE; /* purecov: deadcode */
- }
- else if (tables.columns_priv_table().table_exists())
+ if (tables.columns_priv_table().table_exists())
{
/* TODO(cvicentiu) refactor replace_column_table to use Columns_priv_table
instead of TABLE directly. */
if (replace_column_table(grant_table, tables.columns_priv_table().table(),
*Str, columns, db_name, table_name, rights,
revoke_grant))
- {
result= TRUE;
+ }
+ if (int res= replace_table_table(thd, grant_table,
+ tables.tables_priv_table().table(),
+ *Str, db_name, table_name,
+ rights, column_priv, revoke_grant))
+ {
+ if (res > 0)
+ {
+ /* Should only happen if table is crashed */
+ result= TRUE; /* purecov: deadcode */
}
}
if (Str->is_role())
@@ -7153,9 +7169,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
mysql_mutex_unlock(&acl_cache->lock);
if (!result) /* success */
- {
result= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
- }
mysql_rwlock_unlock(&LOCK_grant);
@@ -7847,7 +7861,7 @@ static bool grant_load(THD *thd,
if (! mem_check->ok())
delete mem_check;
- else if (my_hash_insert(&column_priv_hash,(uchar*) mem_check))
+ else if (column_priv_insert(mem_check))
{
delete mem_check;
goto end_unlock;
@@ -11339,46 +11353,44 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
{
for (counter= 0, revoked= 0 ; counter < column_priv_hash.records ; )
{
- const char *user,*host;
+ const char *user,*host;
GRANT_TABLE *grant_table=
(GRANT_TABLE*) my_hash_element(&column_priv_hash, counter);
user= grant_table->user;
host= safe_str(grant_table->host.hostname);
- if (!strcmp(lex_user->user.str,user) &&
+ if (!strcmp(lex_user->user.str,user) &&
!strcmp(lex_user->host.str, host))
- {
- /* TODO(cvicentiu) refactor replace_db_table to use
- Db_table instead of TABLE directly. */
- if (replace_table_table(thd, grant_table,
- tables.tables_priv_table().table(),
- *lex_user, grant_table->db,
- grant_table->tname, ALL_KNOWN_ACL, NO_ACL, 1))
- {
- result= -1;
- }
- else
- {
- if (!grant_table->cols)
- {
- revoked= 1;
- continue;
- }
- List<LEX_COLUMN> columns;
- /* TODO(cvicentiu) refactor replace_db_table to use
- Db_table instead of TABLE directly. */
- if (!replace_column_table(grant_table,
- tables.columns_priv_table().table(),
- *lex_user, columns, grant_table->db,
- grant_table->tname, ALL_KNOWN_ACL, 1))
- {
- revoked= 1;
- continue;
- }
- result= -1;
- }
- }
- counter++;
+ {
+ List<LEX_COLUMN> columns;
+ /* TODO(cvicentiu) refactor to use
+ Db_table instead of TABLE directly. */
+ if (replace_column_table(grant_table,
+ tables.columns_priv_table().table(),
+ *lex_user, columns,
+ grant_table->db, grant_table->tname,
+ ALL_KNOWN_ACL, 1))
+ result= -1;
+ if (int res= replace_table_table(thd, grant_table,
+ tables.tables_priv_table().table(),
+ *lex_user,
+ grant_table->db, grant_table->tname,
+ ALL_KNOWN_ACL, NO_ACL, 1))
+ {
+ if (res > 0)
+ result= -1;
+ else
+ {
+ /*
+ Entry was deleted. We have to retry the loop as the
+ hash table has probably been reorganized.
+ */
+ revoked= 1;
+ continue;
+ }
+ }
+ }
+ counter++;
}
} while (revoked);
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 6f6f9da7486..894f457a83c 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -7875,11 +7875,15 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
DBUG_RETURN(1);
}
tablenr++;
- }
- if (tablenr > MAX_TABLES)
- {
- my_error(ER_TOO_MANY_TABLES,MYF(0), static_cast<int>(MAX_TABLES));
- DBUG_RETURN(1);
+ /*
+ We test the max tables here as we setup_table_map() should not be called
+ with tablenr >= 64
+ */
+ if (tablenr > MAX_TABLES)
+ {
+ my_error(ER_TOO_MANY_TABLES,MYF(0), static_cast<int>(MAX_TABLES));
+ DBUG_RETURN(1);
+ }
}
}
else
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index c7ad6ff90ad..9c1d1560955 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -822,7 +822,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
net.reading_or_writing= 0;
client_capabilities= 0; // minimalistic client
system_thread= NON_SYSTEM_THREAD;
- cleanup_done= free_connection_done= abort_on_warning= 0;
+ cleanup_done= free_connection_done= abort_on_warning= got_warning= 0;
peer_port= 0; // For SHOW PROCESSLIST
transaction= &default_transaction;
transaction->m_pending_rows_event= 0;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 9dddc2fc7a9..c9967b98994 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -6632,11 +6632,13 @@ public:
- The sj-materialization temporary table
- Members needed to make index lookup or a full scan of the temptable.
*/
+class POSITION;
+
class SJ_MATERIALIZATION_INFO : public Sql_alloc
{
public:
/* Optimal join sub-order */
- struct st_position *positions;
+ POSITION *positions;
uint tables; /* Number of tables in the sj-nest */
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 29741cb1adb..ecd5e7c21fe 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2002, 2011, Oracle and/or its affiliates.
- Copyright (c) 2010, 2020, MariaDB
+ Copyright (c) 2010, 2021, MariaDB
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
@@ -596,14 +596,20 @@ bool mysql_derived_init(THD *thd, LEX *lex, TABLE_LIST *derived)
}
-/*
+/**
@brief
- Reset the Name_resolution_context::outer_context for all ON expression
- contexts in the given nested join. Do this recursively for all nested joins
- it contains.
+ Prevent name resolution out of context of ON expressions in derived tables
+
+ @param
+ join_list list of tables used in from list of a derived
+
+ @details
+ The function sets the Name_resolution_context::outer_context to NULL
+ for all ON expressions contexts in the given join list. It does this
+ recursively for all nested joins the list contains.
*/
-static void reset_on_clauses_context(List<TABLE_LIST>& join_list)
+static void nullify_outer_context_for_on_clauses(List<TABLE_LIST>& join_list)
{
List_iterator<TABLE_LIST> li(join_list);
while (TABLE_LIST *table= li++)
@@ -611,10 +617,11 @@ static void reset_on_clauses_context(List<TABLE_LIST>& join_list)
if (table->on_context)
table->on_context->outer_context= NULL;
if (table->nested_join)
- reset_on_clauses_context(table->nested_join->join_list);
+ nullify_outer_context_for_on_clauses(table->nested_join->join_list);
}
}
+
/*
Create temporary table structure (but do not fill it)
@@ -783,7 +790,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
sl->context.outer_context= 0;
// And for ON clauses, if there are any
- reset_on_clauses_context(*sl->join_list);
+ nullify_outer_context_for_on_clauses(*sl->join_list);
if (!derived->is_with_table_recursive_reference() ||
(!derived->with->with_anchor &&
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 00fa2add88b..ea37b0cb100 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2971,6 +2971,7 @@ void st_select_lex::init_query()
is_service_select= 0;
parsing_place= NO_MATTER;
save_parsing_place= NO_MATTER;
+ context_analysis_place= NO_MATTER;
exclude_from_table_unique_test= no_wrap_view_item= FALSE;
nest_level= 0;
link_next= 0;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a63b5432936..29884cd843e 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -7641,6 +7641,7 @@ mysql_new_select(LEX *lex, bool move_down, SELECT_LEX *select_lex)
THD *thd= lex->thd;
bool new_select= select_lex == NULL;
int old_nest_level= lex->current_select->nest_level;
+ Name_resolution_context *curr_context= lex->context_stack.head();
DBUG_ENTER("mysql_new_select");
if (new_select)
@@ -7670,7 +7671,8 @@ mysql_new_select(LEX *lex, bool move_down, SELECT_LEX *select_lex)
By default we assume that it is usual subselect and we have outer name
resolution context, if no we will assign it to 0 later
*/
- select_lex->context.outer_context= &select_lex->outer_select()->context;
+
+ select_lex->context.outer_context= curr_context;
}
else
{
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 1a5ba7c320d..74f2e1b33f1 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -1505,7 +1505,7 @@ static bool check_list_constants(THD *thd, partition_info *part_info)
List_iterator<part_elem_value> list_val_it2(part_def->list_val_list);
while ((list_value= list_val_it2++))
{
- calc_value= list_value->value - type_add;
+ calc_value= list_value->value ^ type_add;
part_info->list_array[list_index].list_value= calc_value;
part_info->list_array[list_index++].partition_id= i;
}
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index 8f87d633d19..2974c770252 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -417,6 +417,14 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
{
if (reinit_ssl())
result= 1;
+#ifdef WITH_WSREP
+ if (!result &&
+ WSREP_ON && wsrep_reload_ssl())
+ {
+ my_message(ER_UNKNOWN_ERROR, "Failed to refresh WSREP SSL.", MYF(0));
+ result= 1;
+ }
+#endif
}
if (options & REFRESH_GENERIC)
{
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 88f3a44358c..849e0943acd 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -358,7 +358,31 @@ bool dbug_user_var_equals_int(THD *thd, const char *name, int value)
}
return FALSE;
}
-#endif
+#endif /* DBUG_OFF */
+
+/*
+ Intialize POSITION structure.
+*/
+
+POSITION::POSITION()
+{
+ table= 0;
+ records_read= cond_selectivity= read_time= 0.0;
+ prefix_record_count= 0.0;
+ key= 0;
+ use_join_buffer= 0;
+ sj_strategy= SJ_OPT_NONE;
+ n_sj_tables= 0;
+ spl_plan= 0;
+ range_rowid_filter_info= 0;
+ ref_depend_map= dups_producing_tables= 0;
+ inner_tables_handled_with_other_sjs= 0;
+ dups_weedout_picker.set_empty();
+ firstmatch_picker.set_empty();
+ loosescan_picker.set_empty();
+ sjmat_picker.set_empty();
+}
+
static void trace_table_dependencies(THD *thd,
JOIN_TAB *join_tabs, uint table_count)
@@ -1604,10 +1628,11 @@ bool JOIN::build_explain()
curr_tab->tracker= thd->lex->explain->get_union(select_nr)->
get_tmptable_read_tracker();
}
- else
+ else if (select_nr < INT_MAX)
{
- curr_tab->tracker= thd->lex->explain->get_select(select_nr)->
- get_using_temporary_read_tracker();
+ Explain_select *tmp= thd->lex->explain->get_select(select_nr);
+ if (tmp)
+ curr_tab->tracker= tmp->get_using_temporary_read_tracker();
}
}
DBUG_RETURN(0);
@@ -4970,6 +4995,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
/* The following should be optimized to only clear critical things */
bzero((void*)stat, sizeof(JOIN_TAB)* table_count);
+
/* Initialize POSITION objects */
for (i=0 ; i <= table_count ; i++)
(void) new ((char*) (join->positions + i)) POSITION;
@@ -16126,7 +16152,7 @@ static void update_const_equal_items(THD *thd, COND *cond, JOIN_TAB *tab,
Item_func::COND_AND_FUNC));
}
else if (cond->type() == Item::FUNC_ITEM &&
- ((Item_cond*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
+ ((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
{
Item_equal *item_equal= (Item_equal *) cond;
bool contained_const= item_equal->get_const() != NULL;
@@ -16321,7 +16347,7 @@ propagate_cond_constants(THD *thd, I_List<COND_CMP> *save_list,
(((Item_func*) cond)->functype() == Item_func::EQ_FUNC ||
((Item_func*) cond)->functype() == Item_func::EQUAL_FUNC))
{
- Item_func_eq *func=(Item_func_eq*) cond;
+ Item_bool_func2 *func= dynamic_cast<Item_bool_func2*>(cond);
Item **args= func->arguments();
bool left_const= args[0]->const_item() && !args[0]->is_expensive();
bool right_const= args[1]->const_item() && !args[1]->is_expensive();
@@ -17263,7 +17289,7 @@ void propagate_new_equalities(THD *thd, Item *cond,
}
}
else if (cond->type() == Item::FUNC_ITEM &&
- ((Item_cond*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
+ ((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
{
Item_equal *equal_item;
List_iterator<Item_equal> it(*new_equalities);
@@ -17508,7 +17534,7 @@ Item_cond::remove_eq_conds(THD *thd, Item::cond_result *cond_value,
}
else if (and_level &&
new_item->type() == Item::FUNC_ITEM &&
- ((Item_cond*) new_item)->functype() ==
+ ((Item_func*) new_item)->functype() ==
Item_func::MULT_EQUAL_FUNC)
{
li.remove();
@@ -25455,8 +25481,8 @@ copy_fields(TMP_TABLE_PARAM *param)
(*ptr->do_copy)(ptr);
List_iterator_fast<Item> it(param->copy_funcs);
- Item_copy_string *item;
- while ((item = (Item_copy_string*) it++))
+ Item_copy *item;
+ while ((item= (Item_copy*) it++))
item->copy();
}
@@ -29602,6 +29628,7 @@ void unpack_to_base_table_fields(TABLE *table)
}
+
/**
@} (end of group Query_Optimizer)
*/
diff --git a/sql/sql_select.h b/sql/sql_select.h
index cf451979f8e..ff2b24fdbf7 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -700,8 +700,6 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
bool end_of_records);
-struct st_position;
-
class Semi_join_strategy_picker
{
public:
@@ -712,7 +710,7 @@ public:
Update internal state after another table has been added to the join
prefix
*/
- virtual void set_from_prev(struct st_position *prev) = 0;
+ virtual void set_from_prev(POSITION *prev) = 0;
virtual bool check_qep(JOIN *join,
uint idx,
@@ -722,7 +720,7 @@ public:
double *read_time,
table_map *handled_fanout,
sj_strategy_enum *strategy,
- struct st_position *loose_scan_pos) = 0;
+ POSITION *loose_scan_pos) = 0;
virtual void mark_used() = 0;
@@ -753,7 +751,7 @@ public:
first_dupsweedout_table= MAX_TABLES;
is_used= FALSE;
}
- void set_from_prev(struct st_position *prev);
+ void set_from_prev(POSITION *prev);
bool check_qep(JOIN *join,
uint idx,
@@ -763,7 +761,7 @@ public:
double *read_time,
table_map *handled_fanout,
sj_strategy_enum *stratey,
- struct st_position *loose_scan_pos);
+ POSITION *loose_scan_pos);
void mark_used() { is_used= TRUE; }
friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join);
@@ -799,7 +797,7 @@ public:
is_used= FALSE;
}
- void set_from_prev(struct st_position *prev);
+ void set_from_prev(POSITION *prev);
bool check_qep(JOIN *join,
uint idx,
table_map remaining_tables,
@@ -808,7 +806,7 @@ public:
double *read_time,
table_map *handled_fanout,
sj_strategy_enum *strategy,
- struct st_position *loose_scan_pos);
+ POSITION *loose_scan_pos);
void mark_used() { is_used= TRUE; }
friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join);
@@ -817,6 +815,7 @@ public:
class LooseScan_picker : public Semi_join_strategy_picker
{
+public:
/* The first (i.e. driving) table we're doing loose scan for */
uint first_loosescan_table;
/*
@@ -835,14 +834,13 @@ class LooseScan_picker : public Semi_join_strategy_picker
uint loosescan_parts; /* Number of keyparts to be kept distinct */
bool is_used;
-public:
void set_empty()
{
first_loosescan_table= MAX_TABLES;
is_used= FALSE;
}
- void set_from_prev(struct st_position *prev);
+ void set_from_prev(POSITION *prev);
bool check_qep(JOIN *join,
uint idx,
table_map remaining_tables,
@@ -851,19 +849,19 @@ public:
double *read_time,
table_map *handled_fanout,
sj_strategy_enum *strategy,
- struct st_position *loose_scan_pos);
+ POSITION *loose_scan_pos);
void mark_used() { is_used= TRUE; }
friend class Loose_scan_opt;
friend void best_access_path(JOIN *join,
JOIN_TAB *s,
table_map remaining_tables,
- const struct st_position *join_positions,
+ const POSITION *join_positions,
uint idx,
bool disable_jbuf,
double record_count,
- struct st_position *pos,
- struct st_position *loose_scan_pos);
+ POSITION *pos,
+ POSITION *loose_scan_pos);
friend bool get_best_combination(JOIN *join);
friend int setup_semijoin_loosescan(JOIN *join);
friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join);
@@ -890,7 +888,7 @@ public:
sjm_scan_last_inner= 0;
is_used= FALSE;
}
- void set_from_prev(struct st_position *prev);
+ void set_from_prev(POSITION *prev);
bool check_qep(JOIN *join,
uint idx,
table_map remaining_tables,
@@ -899,7 +897,7 @@ public:
double *read_time,
table_map *handled_fanout,
sj_strategy_enum *strategy,
- struct st_position *loose_scan_pos);
+ POSITION *loose_scan_pos);
void mark_used() { is_used= TRUE; }
friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join);
@@ -914,8 +912,9 @@ class Rowid_filter;
Information about a position of table within a join order. Used in join
optimization.
*/
-typedef struct st_position
+class POSITION
{
+public:
/* The table that's put into join order */
JOIN_TAB *table;
@@ -927,7 +926,7 @@ typedef struct st_position
double records_read;
/* The selectivity of the pushed down conditions */
- double cond_selectivity;
+ double cond_selectivity;
/*
Cost accessing the table in course of the entire complete join execution,
@@ -936,8 +935,6 @@ typedef struct st_position
*/
double read_time;
- /* Cumulative cost and record count for the join prefix */
- Cost_estimate prefix_cost;
double prefix_record_count;
/*
@@ -946,29 +943,46 @@ typedef struct st_position
*/
KEYUSE *key;
+ /* Info on splitting plan used at this position */
+ SplM_plan_info *spl_plan;
+
+ /* Cost info for the range filter used at this position */
+ Range_rowid_filter_cost_info *range_rowid_filter_info;
+
/* If ref-based access is used: bitmap of tables this table depends on */
table_map ref_depend_map;
-
+
/*
- TRUE <=> join buffering will be used. At the moment this is based on
- *very* imprecise guesses made in best_access_path().
+ Bitmap of semi-join inner tables that are in the join prefix and for
+ which there's no provision for how to eliminate semi-join duplicates
+ they produce.
*/
- bool use_join_buffer;
-
+ table_map dups_producing_tables;
+
+ table_map inner_tables_handled_with_other_sjs;
+
+ Duplicate_weedout_picker dups_weedout_picker;
+ Firstmatch_picker firstmatch_picker;
+ LooseScan_picker loosescan_picker;
+ Sj_materialization_picker sjmat_picker;
+
+ /* Cumulative cost and record count for the join prefix */
+ Cost_estimate prefix_cost;
+
/*
Current optimization state: Semi-join strategy to be used for this
and preceding join tables.
-
+
Join optimizer sets this for the *last* join_tab in the
- duplicate-generating range. That is, in order to interpret this field,
+ duplicate-generating range. That is, in order to interpret this field,
one needs to traverse join->[best_]positions array from right to left.
When you see a join table with sj_strategy!= SJ_OPT_NONE, some other
- field (depending on the strategy) tells how many preceding positions
+ field (depending on the strategy) tells how many preceding positions
this applies to. The values of covered_preceding_positions->sj_strategy
must be ignored.
*/
enum sj_strategy_enum sj_strategy;
-
+
/*
Valid only after fix_semijoin_strategies_for_picked_join_order() call:
if sj_strategy!=SJ_OPT_NONE, this is the number of subsequent tables that
@@ -977,26 +991,12 @@ typedef struct st_position
uint n_sj_tables;
/*
- Bitmap of semi-join inner tables that are in the join prefix and for
- which there's no provision for how to eliminate semi-join duplicates
- they produce.
+ TRUE <=> join buffering will be used. At the moment this is based on
+ *very* imprecise guesses made in best_access_path().
*/
- table_map dups_producing_tables;
-
- table_map inner_tables_handled_with_other_sjs;
-
- Duplicate_weedout_picker dups_weedout_picker;
- Firstmatch_picker firstmatch_picker;
- LooseScan_picker loosescan_picker;
- Sj_materialization_picker sjmat_picker;
-
- /* Info on splitting plan used at this position */
- SplM_plan_info *spl_plan;
-
- /* Cost info for the range filter used at this position */
- Range_rowid_filter_cost_info *range_rowid_filter_info;
-
-} POSITION;
+ bool use_join_buffer;
+ POSITION();
+};
typedef Bounds_checked_array<Item_null_result*> Item_null_array;
@@ -1592,6 +1592,7 @@ public:
fields_list= fields_arg;
non_agg_fields.empty();
bzero((char*) &keyuse,sizeof(keyuse));
+ having_value= Item::COND_UNDEF;
tmp_table_param.init();
tmp_table_param.end_write_records= HA_POS_ERROR;
rollup.state= ROLLUP::STATE_NONE;
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc
index f881f6a8cc6..307a0b29c57 100644
--- a/sql/sql_sequence.cc
+++ b/sql/sql_sequence.cc
@@ -727,8 +727,8 @@ longlong SEQUENCE::next_value(TABLE *table, bool second_round, int *error)
if (real_increment > 0)
{
- if (reserved_until + add_to > max_value ||
- reserved_until > max_value - add_to)
+ if (reserved_until > max_value - add_to ||
+ reserved_until + add_to > max_value)
{
reserved_until= max_value + 1;
out_of_values= res_value >= reserved_until;
diff --git a/sql/sql_sequence.h b/sql/sql_sequence.h
index 2d609d8591b..29c589e67cd 100644
--- a/sql/sql_sequence.h
+++ b/sql/sql_sequence.h
@@ -111,8 +111,8 @@ public:
{
if (real_increment > 0)
{
- if (value + real_increment > max_value ||
- value > max_value - real_increment)
+ if (value > max_value - real_increment ||
+ value + real_increment > max_value)
value= max_value + 1;
else
value+= real_increment;
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index b1cc696e9fe..38b3d62d539 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -7061,8 +7061,7 @@ static bool store_trigger(THD *thd, Trigger *trigger,
(my_time_t)(trigger->create_time/100));
/* timestamp is with 6 digits */
timestamp.second_part= (trigger->create_time % 100) * 10000;
- ((Field_temporal_with_date*) table->field[16])->store_time_dec(&timestamp,
- 2);
+ table->field[16]->store_time_dec(&timestamp, 2);
}
sql_mode_string_representation(thd, trigger->sql_mode, &sql_mode_rep);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 9869de4ba5e..3643b19f8fb 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -8730,7 +8730,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
If the '0000-00-00' value isn't allowed then raise the error_if_not_empty
flag to allow ALTER TABLE only if the table to be altered is empty.
*/
- if (!alter_ctx->implicit_default_value_error_field &&
+ if (!alter_ctx->implicit_default_value_error_field && !def->field &&
!(~def->flags & (NO_DEFAULT_VALUE_FLAG | NOT_NULL_FLAG)) &&
def->type_handler()->validate_implicit_default_value(thd, *def))
{
@@ -8988,7 +8988,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
key_parts.push_back(new (thd->mem_root) Key_part_spec(&cfield->field_name,
key_part_length, true),
thd->mem_root);
- if (cfield->invisible < INVISIBLE_SYSTEM)
+ if (!(cfield->invisible == INVISIBLE_SYSTEM && cfield->vers_sys_field()))
user_keyparts= true;
}
if (table->s->tmp_table == NO_TMP_TABLE)
@@ -9000,6 +9000,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
(void) delete_statistics_for_index(thd, table, key_info, TRUE);
}
+ if (!user_keyparts && key_parts.elements)
+ {
+ /*
+ If we dropped all user key-parts we also drop implicit system fields.
+ */
+ key_parts.empty();
+ }
+
if (key_parts.elements)
{
KEY_CREATE_INFO key_create_info;
@@ -9036,7 +9044,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
key_type= Key::PRIMARY;
else
key_type= Key::UNIQUE;
- if (dropped_key_part && user_keyparts)
+ if (dropped_key_part)
{
my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), dropped_key_part);
if (long_hash_key)
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 5ea853ade0b..8c9c56f1db7 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -297,7 +297,6 @@ print_plan(JOIN* join, uint idx, double record_count, double read_time,
double current_read_time, const char *info)
{
uint i;
- POSITION pos;
JOIN_TAB *join_table;
JOIN_TAB **plan_nodes;
TABLE* table;
@@ -324,8 +323,8 @@ print_plan(JOIN* join, uint idx, double record_count, double read_time,
fputs(" POSITIONS: ", DBUG_FILE);
for (i= 0; i < idx ; i++)
{
- pos = join->positions[i];
- table= pos.table->table;
+ POSITION *pos= join->positions + i;
+ table= pos->table->table;
if (table)
fputs(table->s->table_name.str, DBUG_FILE);
fputc(' ', DBUG_FILE);
@@ -341,8 +340,8 @@ print_plan(JOIN* join, uint idx, double record_count, double read_time,
fputs("BEST_POSITIONS: ", DBUG_FILE);
for (i= 0; i < idx ; i++)
{
- pos= join->best_positions[i];
- table= pos.table->table;
+ POSITION *pos= join->best_positions + i;
+ table= pos->table->table;
if (table)
fputs(table->s->table_name.str, DBUG_FILE);
fputc(' ', DBUG_FILE);
diff --git a/sql/sql_type_int.h b/sql/sql_type_int.h
index 9fd4f0c46a0..fca00f25448 100644
--- a/sql/sql_type_int.h
+++ b/sql/sql_type_int.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2018, MariaDB
+/* Copyright (c) 2018, 2021, MariaDB
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
@@ -80,16 +80,20 @@ public:
if (is_null() || llshift.is_null())
return Longlong_null();
uint shift= (uint) llshift.value();
- ulonglong res= ((ulonglong) value()) << shift;
- return Longlong_null(shift < sizeof(longlong) * 8 ? (longlong) res : 0);
+ ulonglong res= (shift < sizeof(longlong) * 8)
+ ? ((ulonglong) value()) << shift
+ : 0;
+ return Longlong_null((longlong) res);
}
Longlong_null operator>>(const Longlong_null &llshift) const
{
if (is_null() || llshift.is_null())
return Longlong_null();
uint shift= (uint) llshift.value();
- ulonglong res= ((ulonglong) value()) >> shift;
- return Longlong_null(shift < sizeof(longlong) * 8 ? (longlong) res : 0);
+ ulonglong res= (shift < sizeof(longlong) * 8)
+ ? ((ulonglong) value()) >> shift
+ : 0;
+ return Longlong_null((longlong) res);
}
Longlong_null bit_count() const
{
diff --git a/sql/strfunc.cc b/sql/strfunc.cc
index c488ab1afbb..6c8fd24f780 100644
--- a/sql/strfunc.cc
+++ b/sql/strfunc.cc
@@ -81,14 +81,17 @@ ulonglong find_set(const TYPELIB *lib,
var_len= (uint) (pos - start);
uint find= cs ? find_type2(lib, start, var_len, cs) :
find_type(lib, start, var_len, (bool) 0);
- if (unlikely(!find && *err_len == 0))
+ if (unlikely(!find))
{
- // report the first error with length > 0
- *err_pos= (char*) start;
- *err_len= var_len;
- *set_warning= 1;
+ if (*err_len == 0)
+ {
+ // report the first error with length > 0
+ *err_pos= (char*) start;
+ *err_len= var_len;
+ *set_warning= 1;
+ }
}
- else
+ else if (find <= sizeof(longlong) * 8)
found|= 1ULL << (find - 1);
if (pos >= end)
break;
@@ -402,4 +405,3 @@ const char *flagset_to_string(THD *thd, LEX_CSTRING *result, ulonglong set,
return result->str;
}
-
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index b72d4a3c358..ebec2a203aa 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates.
- Copyright (c) 2012, 2020, MariaDB Corporation.
+ Copyright (c) 2012, 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
@@ -5051,15 +5051,23 @@ static Sys_var_have Sys_have_symlink(
"--skip-symbolic-links option.",
READ_ONLY GLOBAL_VAR(have_symlink), NO_CMD_LINE);
+#if defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN)
+
#ifdef __SANITIZE_ADDRESS__
+#define SANITIZER_MODE "ASAN"
+#else
+#define SANITIZER_MODE "UBSAN"
+#endif /* __SANITIZE_ADDRESS__ */
+
static char *have_sanitizer;
-static Sys_var_charptr_fscs Sys_have_santitizer(
+static Sys_var_charptr Sys_have_santitizer(
"have_sanitizer",
- "If the server is compiled with ASan (Address sanitizer) this will be "
- "set to ASAN",
- READ_ONLY GLOBAL_VAR(have_sanitizer), NO_CMD_LINE,
- DEFAULT("ASAN"));
-#endif
+ "If the server is compiled with sanitize (compiler option), this "
+ "variable is set to the sanitizer mode used. Possible values are "
+ "ASAN (Address sanitizer) or UBSAN (The Undefined Behavior Sanitizer).",
+ READ_ONLY GLOBAL_VAR(have_sanitizer), NO_CMD_LINE,
+ DEFAULT(SANITIZER_MODE));
+#endif /* defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN) */
static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type);
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc
index 1a8b5c471bd..981958abdb2 100644
--- a/sql/temporary_tables.cc
+++ b/sql/temporary_tables.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2016, 2019, MariaDB Corporation.
+ Copyright (c) 2016, 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
@@ -872,10 +872,12 @@ void THD::restore_tmp_table_share(TMP_TABLE_SHARE *share)
bool THD::has_temporary_tables()
{
DBUG_ENTER("THD::has_temporary_tables");
- bool result= (rgi_slave
- ? (rgi_slave->rli->save_temporary_tables &&
- !rgi_slave->rli->save_temporary_tables->is_empty())
- : (has_thd_temporary_tables()));
+ bool result=
+#ifdef HAVE_REPLICATION
+ rgi_slave ? (rgi_slave->rli->save_temporary_tables &&
+ !rgi_slave->rli->save_temporary_tables->is_empty()) :
+#endif
+ has_thd_temporary_tables();
DBUG_RETURN(result);
}
@@ -1506,12 +1508,14 @@ bool THD::lock_temporary_tables()
DBUG_RETURN(false);
}
+#ifdef HAVE_REPLICATION
if (rgi_slave)
{
mysql_mutex_lock(&rgi_slave->rli->data_lock);
temporary_tables= rgi_slave->rli->save_temporary_tables;
m_tmp_tables_locked= true;
}
+#endif
DBUG_RETURN(m_tmp_tables_locked);
}
@@ -1532,6 +1536,7 @@ void THD::unlock_temporary_tables()
DBUG_VOID_RETURN;
}
+#ifdef HAVE_REPLICATION
if (rgi_slave)
{
rgi_slave->rli->save_temporary_tables= temporary_tables;
@@ -1539,6 +1544,7 @@ void THD::unlock_temporary_tables()
mysql_mutex_unlock(&rgi_slave->rli->data_lock);
m_tmp_tables_locked= false;
}
+#endif
DBUG_VOID_RETURN;
}
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 018b9aab3a7..1618a8b6d50 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -1653,6 +1653,32 @@ exit:
return fail;
}
+bool wsrep_reload_ssl()
+{
+ try
+ {
+ std::string opts= Wsrep_server_state::instance().provider().options();
+ if (opts.find("socket.ssl_reload") == std::string::npos)
+ {
+ WSREP_DEBUG("Option `socket.ssl_reload` not found in parameters.");
+ return false;
+ }
+ const std::string reload_ssl_param("socket.ssl_reload=1");
+ enum wsrep::provider::status ret= Wsrep_server_state::instance().provider().options(reload_ssl_param);
+ if (ret)
+ {
+ WSREP_ERROR("Set options returned %d", ret);
+ return true;
+ }
+ return false;
+ }
+ catch (...)
+ {
+ WSREP_ERROR("Failed to get provider options");
+ return true;
+ }
+}
+
/*!
* @param db Database string
* @param table Table string
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index 8f20eec0701..0541f2b02ad 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -233,6 +233,7 @@ extern void wsrep_last_committed_id (wsrep_gtid_t* gtid);
extern int wsrep_check_opts();
extern void wsrep_prepend_PATH (const char* path);
extern bool wsrep_append_fk_parent_table(THD* thd, TABLE_LIST* table, wsrep::key_array* keys);
+extern bool wsrep_reload_ssl();
/* Other global variables */
extern wsrep_seqno_t wsrep_locked_seqno;
diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h
index 942363d9886..d79bfa0b39b 100644
--- a/sql/wsrep_trans_observer.h
+++ b/sql/wsrep_trans_observer.h
@@ -466,6 +466,16 @@ static inline void wsrep_close(THD* thd)
DBUG_VOID_RETURN;
}
+static inline void wsrep_cleanup(THD* thd)
+{
+ DBUG_ENTER("wsrep_cleanup");
+ if (thd->wsrep_cs().state() != wsrep::client_state::s_none)
+ {
+ thd->wsrep_cs().cleanup();
+ }
+ DBUG_VOID_RETURN;
+}
+
static inline void
wsrep_wait_rollback_complete_and_acquire_ownership(THD *thd)
{
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index e0b9ac889db..386da305a26 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -25,6 +25,7 @@
#include <my_dir.h>
#include <cstdio>
#include <cstdlib>
+#include "wsrep_trans_observer.h"
ulong wsrep_reject_queries;
@@ -102,7 +103,8 @@ void wsrep_set_wsrep_on(THD* thd)
bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type)
{
- if (var_type == OPT_GLOBAL) {
+ if (var_type == OPT_GLOBAL)
+ {
my_bool saved_wsrep_on= global_system_variables.wsrep_on;
thd->variables.wsrep_on= global_system_variables.wsrep_on;
@@ -110,15 +112,15 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type)
// If wsrep has not been inited we need to do it now
if (global_system_variables.wsrep_on && wsrep_provider && !wsrep_inited)
{
- char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider
- //when fails
-
+ // wsrep_init() rewrites provide if it fails
+ char* tmp= strdup(wsrep_provider);
mysql_mutex_unlock(&LOCK_global_system_variables);
if (wsrep_init())
{
my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp, my_error, "wsrep_init failed");
//rcode= true;
+ saved_wsrep_on= false;
}
free(tmp);
@@ -130,20 +132,69 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type)
wsrep_set_wsrep_on(thd);
+ if (var_type == OPT_GLOBAL)
+ {
+ if (thd->variables.wsrep_on &&
+ thd->wsrep_cs().state() == wsrep::client_state::s_none)
+ {
+ wsrep_open(thd);
+ wsrep_before_command(thd);
+ }
+ }
+
return false;
}
bool wsrep_on_check(sys_var *self, THD* thd, set_var* var)
{
+ bool new_wsrep_on= (bool)var->save_result.ulonglong_value;
+
if (check_has_super(self, thd, var))
return true;
+ if (new_wsrep_on)
+ {
+ if (!WSREP_PROVIDER_EXISTS)
+ {
+ my_message(ER_WRONG_ARGUMENTS, "WSREP (galera) can't be enabled "
+ "if the wsrep_provider is unset or set to 'none'", MYF(0));
+ return true;
+ }
+
+ if (var->type == OPT_SESSION &&
+ !global_system_variables.wsrep_on)
+ {
+ my_message(ER_WRONG_ARGUMENTS,
+ "Can't enable @@session.wsrep_on, "
+ "while @@global.wsrep_on is disabled", MYF(0));
+ return true;
+ }
+ }
+
if (thd->in_active_multi_stmt_transaction())
{
my_error(ER_CANT_DO_THIS_DURING_AN_TRANSACTION, MYF(0));
return true;
}
+ if (var->type == OPT_GLOBAL)
+ {
+ /*
+ The global value is about to change. Cleanup
+ the transaction state and close the client
+ state. wsrep_on_update() will take care of
+ reopening it should wsrep_on be re-enabled.
+ */
+ if (global_system_variables.wsrep_on && !new_wsrep_on)
+ {
+ wsrep_commit_empty(thd, true);
+ wsrep_after_statement(thd);
+ wsrep_after_command_ignore_result(thd);
+ wsrep_close(thd);
+ wsrep_cleanup(thd);
+ }
+ }
+
return false;
}
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 4f4d81ffdb2..2df54567285 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -242,6 +242,20 @@ Archive_share::Archive_share()
}
+Archive_share::~Archive_share()
+{
+ DBUG_PRINT("ha_archive", ("~Archive_share: %p", this));
+ if (archive_write_open)
+ {
+ mysql_mutex_lock(&mutex);
+ (void) close_archive_writer(); // Will reset archive_write_open
+ mysql_mutex_unlock(&mutex);
+ }
+ thr_lock_delete(&lock);
+ mysql_mutex_destroy(&mutex);
+}
+
+
ha_archive::ha_archive(handlerton *hton, TABLE_SHARE *table_arg)
:handler(hton, table_arg), delayed_insert(0), bulk_insert(0)
{
@@ -675,7 +689,6 @@ int ha_archive::close(void)
if (azclose(&archive))
rc= 1;
}
-
DBUG_RETURN(rc);
}
diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h
index c1b4f27e45e..2bb5079868b 100644
--- a/storage/archive/ha_archive.h
+++ b/storage/archive/ha_archive.h
@@ -46,19 +46,7 @@ public:
bool dirty; /* Flag for if a flush should occur */
bool crashed; /* Meta file is crashed */
Archive_share();
- ~Archive_share()
- {
- DBUG_PRINT("ha_archive", ("~Archive_share: %p",
- this));
- if (archive_write_open)
- {
- mysql_mutex_lock(&mutex);
- (void) close_archive_writer();
- mysql_mutex_unlock(&mutex);
- }
- thr_lock_delete(&lock);
- mysql_mutex_destroy(&mutex);
- }
+ virtual ~Archive_share();
int init_archive_writer();
void close_archive_writer();
int write_v1_metafile();
diff --git a/storage/connect/colblk.h b/storage/connect/colblk.h
index b22933d9ebb..51ab32cfae2 100644
--- a/storage/connect/colblk.h
+++ b/storage/connect/colblk.h
@@ -62,7 +62,7 @@ class DllExport COLBLK : public XOBJECT {
bool IsVirtual(void) {return Cdp->IsVirtual();}
bool IsNullable(void) {return Nullable;}
void SetNullable(bool b) {Nullable = b;}
-
+ void SetName(PSZ name_var) { Name= name_var; }
// Methods
virtual void Reset(void);
virtual bool Compare(PXOB xp);
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index 484f75d6a04..ee62e0cd03e 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -294,9 +294,9 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2,
/* its column blocks in mode write (required by XML tables). */
/*******************************************************************/
if (mode == MODE_UPDATE) {
- PTDBASE utp;
+ PTDB utp;
- if (!(utp = (PTDBASE)tdbp->Duplicate(g))) {
+ if (!(utp = tdbp->Duplicate(g))) {
sprintf(g->Message, MSG(INV_UPDT_TABLE), tdbp->GetName());
throw 4;
} // endif tp
@@ -591,7 +591,7 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort)
if (!tdbp->IsRemote()) {
// Make all the eventual indexes
- PTDBDOS tbxp = (PTDBDOS)tdbp;
+ PTDBASE tbxp = (PTDBASE)tdbp;
tbxp->ResetKindex(g, NULL);
tbxp->SetKey_Col(NULL);
rc = tbxp->ResetTableOpt(g, true, tbxp->GetDef()->Indexable() == 1);
diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp
index 9b1e5d7689e..d2add16b31d 100644
--- a/storage/connect/filamvct.cpp
+++ b/storage/connect/filamvct.cpp
@@ -4117,7 +4117,8 @@ bool BGVFAM::CleanUnusedSpace(PGLOBAL g)
} else {
int req;
- memset(To_Buf, 0, Buflen);
+ if (To_Buf)
+ memset(To_Buf, 0, Buflen);
for (n = Fpos - Tpos; n > 0; n -= req) {
/*****************************************************************/
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index eb53f4c3bc5..abf30774b09 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -286,7 +286,12 @@ static char *strz(PGLOBAL g, LEX_CSTRING &ls)
{
char *str= (char*)PlugSubAlloc(g, NULL, ls.length + 1);
- memcpy(str, ls.str, ls.length);
+ /*
+ ls.str can be NULL, for example when called with
+ create_info->connect_string
+ */
+ if (ls.str)
+ memcpy(str, ls.str, ls.length);
str[ls.length]= 0;
return str;
} // end of strz
@@ -2829,7 +2834,6 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
} else {
char buff[256];
String *res, tmp(buff, sizeof(buff), &my_charset_bin);
- Item_basic_constant *pval= (Item_basic_constant *)args[i];
PPARM pp= (PPARM)PlugSubAlloc(g, NULL, sizeof(PARM));
// IN and BETWEEN clauses should be col VOP list
@@ -2838,6 +2842,8 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
switch (args[i]->real_type()) {
case COND::CONST_ITEM:
+ {
+ Item *pval= (Item *)args[i];
switch (args[i]->cmp_type()) {
case STRING_RESULT:
res= pval->val_str(&tmp);
@@ -2864,6 +2870,7 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
DBUG_ASSERT(0);
return NULL;
}
+ }
break;
case COND::CACHE_ITEM: // Possible ???
case COND::NULL_ITEM: // TODO: handle this
@@ -3119,7 +3126,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
} else {
char buff[256];
String *res, tmp(buff, sizeof(buff), &my_charset_bin);
- Item_basic_constant *pval= (Item_basic_constant *)args[i];
+ Item *pval= (Item *)args[i];
Item::Type type= args[i]->real_type();
switch (type) {
diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp
index 65361acfcd8..705f567f464 100644
--- a/storage/connect/tabutil.cpp
+++ b/storage/connect/tabutil.cpp
@@ -708,7 +708,7 @@ bool PRXCOL::Init(PGLOBAL g, PTDB tp)
MODE mode = To_Tdb->GetMode();
// Needed for MYSQL subtables
- ((XCOLBLK*)Colp)->Name = Decode(g, Colp->GetName());
+ ((COLBLK*)Colp)->SetName(Decode(g, Colp->GetName()));
// May not have been done elsewhere
Colp->InitValue(g);
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 158c017f1b0..c02fb72a102 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -3551,7 +3551,8 @@ fail_err:
|| thr->graph->trx->id
== trx_read_trx_id(
static_cast<const byte*>(
- trx_id->data)));
+ trx_id->data))
+ || index->table->is_temporary());
}
}
#endif
@@ -4269,7 +4270,8 @@ btr_cur_update_in_place(
index = cursor->index;
ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
- ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG));
+ ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)
+ || index->table->is_temporary());
/* The insert buffer tree should never be updated in place. */
ut_ad(!dict_index_is_ibuf(index));
ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG)
@@ -4566,7 +4568,8 @@ btr_cur_optimistic_update(
page = buf_block_get_frame(block);
rec = btr_cur_get_rec(cursor);
index = cursor->index;
- ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG));
+ ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)
+ || index->table->is_temporary());
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
ut_ad(mtr->memo_contains_flagged(block, MTR_MEMO_PAGE_X_FIX));
/* This is intended only for leaf page updates */
@@ -4922,8 +4925,8 @@ btr_cur_pessimistic_update(
ut_ad(!page_zip || !index->table->is_temporary());
/* The insert buffer tree should never be updated in place. */
ut_ad(!dict_index_is_ibuf(index));
- ut_ad(trx_id > 0
- || (flags & BTR_KEEP_SYS_FLAG));
+ ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)
+ || index->table->is_temporary());
ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG)
|| dict_index_is_clust(index));
ut_ad(thr_get_trx(thr)->id == trx_id
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index b9f5984f3f4..2c0a1b9f972 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -5496,8 +5496,10 @@ ha_innobase::open(const char* name, int, uint)
innobase_copy_frm_flags_from_table_share(ib_table, table->s);
- /* No point to init any statistics if tablespace is still encrypted. */
- if (ib_table->is_readable()) {
+ /* No point to init any statistics if tablespace is still encrypted
+ or if table is being opened by background thread */
+ if (THDVAR(thd, background_thread)) {
+ } else if (ib_table->is_readable()) {
dict_stats_init(ib_table);
} else {
ib_table->stat_initialized = 1;
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 2d09df685b5..791b5c8ac88 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -63,7 +63,7 @@ public:
ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used. */
enum row_type get_row_type() const override;
- const char* table_type() const;
+ const char* table_type() const override;
const char* index_type(uint key_number) override;
diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic
index 2de2ad38080..6514886dd67 100644
--- a/storage/innobase/include/page0page.ic
+++ b/storage/innobase/include/page0page.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2020, MariaDB Corporation.
+Copyright (c) 2016, 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 the Free Software
@@ -717,7 +717,7 @@ page_get_instant(const page_t* page)
break;
}
#endif /* UNIV_DEBUG */
- return i / 8;
+ return static_cast<uint16_t>(i >> 3); /* i / 8 */
}
#endif /* !UNIV_INNOCHECKSUM */
diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h
index 392d44a3cdd..c318251eaa9 100644
--- a/storage/innobase/include/trx0sys.h
+++ b/storage/innobase/include/trx0sys.h
@@ -88,7 +88,6 @@ void
trx_write_trx_id(byte* db_trx_id, trx_id_t id)
{
compile_time_assert(DATA_TRX_ID_LEN == 6);
- ut_ad(id);
mach_write_to_6(db_trx_id, id);
}
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index 1437cee9b85..69abd932375 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -151,7 +151,7 @@ ut_time_ms(void);
store the given number of bits.
@param b in: bits
@return number of bytes (octets) needed to represent b */
-#define UT_BITS_IN_BYTES(b) (((b) + 7) / 8)
+#define UT_BITS_IN_BYTES(b) (((b) + 7) >> 3)
/** Determines if a number is zero or a power of two.
@param[in] n number
diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc
index 6efc74f3038..ec922e85e29 100644
--- a/storage/innobase/pars/pars0pars.cc
+++ b/storage/innobase/pars/pars0pars.cc
@@ -1220,6 +1220,7 @@ pars_update_statement(
sel_node->row_lock_mode = LOCK_X;
} else {
node->has_clust_rec_x_lock = sel_node->set_x_locks;
+ ut_ad(node->has_clust_rec_x_lock);
}
ut_a(sel_node->n_tables == 1);
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index 4a32cb0556c..c4886101499 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -1420,8 +1420,9 @@ rec_convert_dtuple_to_rec_old(
/* If the data is not SQL null, store it */
len = dfield_get_len(field);
- memcpy(rec + end_offset,
- dfield_get_data(field), len);
+ if (len)
+ memcpy(rec + end_offset,
+ dfield_get_data(field), len);
end_offset += len;
ored_offset = end_offset;
@@ -1448,8 +1449,9 @@ rec_convert_dtuple_to_rec_old(
/* If the data is not SQL null, store it */
len = dfield_get_len(field);
- memcpy(rec + end_offset,
- dfield_get_data(field), len);
+ if (len)
+ memcpy(rec + end_offset,
+ dfield_get_data(field), len);
end_offset += len;
ored_offset = end_offset;
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 880554d76b4..2704d265f04 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -3378,7 +3378,8 @@ row_ins_index_entry(
dtuple_t* entry, /*!< in/out: index entry to insert */
que_thr_t* thr) /*!< in: query thread */
{
- ut_ad(thr_get_trx(thr)->id || index->table->no_rollback());
+ ut_ad(thr_get_trx(thr)->id || index->table->no_rollback()
+ || index->table->is_temporary());
DBUG_EXECUTE_IF("row_ins_index_entry_timeout", {
DBUG_SET("-d,row_ins_index_entry_timeout");
@@ -3796,6 +3797,10 @@ row_ins_step(
node->state = INS_NODE_ALLOC_ROW_ID;
+ if (node->table->is_temporary()) {
+ node->trx_id = trx->id;
+ }
+
/* It may be that the current session has not yet started
its transaction, or it has been committed: */
diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc
index 1a61a529e2c..e4a4e2f18e3 100644
--- a/storage/innobase/row/row0uins.cc
+++ b/storage/innobase/row/row0uins.cc
@@ -111,7 +111,8 @@ row_undo_ins_remove_clust_rec(
rec_t* rec = btr_pcur_get_rec(&node->pcur);
- ut_ad(rec_get_trx_id(rec, index) == node->trx->id);
+ ut_ad(rec_get_trx_id(rec, index) == node->trx->id
+ || node->table->is_temporary());
ut_ad(!rec_get_deleted_flag(rec, index->table->not_redundant())
|| rec_is_alter_metadata(rec, index->table->not_redundant()));
ut_ad(rec_is_metadata(rec, index->table->not_redundant())
diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc
index 064a7ffd888..760d7dd1f5f 100644
--- a/storage/innobase/row/row0umod.cc
+++ b/storage/innobase/row/row0umod.cc
@@ -110,7 +110,8 @@ row_undo_mod_clust_low(
ut_ad(success);
ut_ad(rec_get_trx_id(btr_cur_get_rec(btr_cur),
btr_cur_get_index(btr_cur))
- == thr_get_trx(thr)->id);
+ == thr_get_trx(thr)->id
+ || btr_cur_get_index(btr_cur)->table->is_temporary());
ut_ad(node->ref != &trx_undo_metadata
|| node->update->info_bits == REC_INFO_METADATA_ADD
|| node->update->info_bits == REC_INFO_METADATA_ALTER);
diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc
index eb672eb0caa..bfffcbdcdc6 100644
--- a/storage/innobase/row/row0undo.cc
+++ b/storage/innobase/row/row0undo.cc
@@ -196,7 +196,7 @@ row_undo_search_clust_to_pcur(
if (found) {
ut_ad(row_get_rec_trx_id(rec, clust_index, offsets)
- == node->trx->id);
+ == node->trx->id || node->table->is_temporary());
if (dict_table_has_atomic_blobs(node->table)) {
/* There is no prefix of externally stored
diff --git a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp
index 5536eecb255..73639685d0e 100644
--- a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp
+++ b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp
@@ -675,7 +675,8 @@ namespace mrn {
&normalized, &normalized_length, NULL);
uint16 new_blob_data_length;
if (normalized_length <= UINT_MAX16) {
- memcpy(grn_key, normalized, normalized_length);
+ if (normalized_length)
+ memcpy(grn_key, normalized, normalized_length);
if (normalized_length < *mysql_key_size) {
memset(grn_key + normalized_length,
'\0', *mysql_key_size - normalized_length);
diff --git a/storage/mroonga/vendor/groonga/lib/alloc.c b/storage/mroonga/vendor/groonga/lib/alloc.c
index 2e28431595a..5e556b83712 100644
--- a/storage/mroonga/vendor/groonga/lib/alloc.c
+++ b/storage/mroonga/vendor/groonga/lib/alloc.c
@@ -310,13 +310,13 @@ grn_alloc_info_free(grn_ctx *ctx)
}
#endif /* USE_MEMORY_DEBUG */
-#define GRN_CTX_SEGMENT_SIZE (1<<22)
+#define GRN_CTX_SEGMENT_SIZE (1U <<22)
#define GRN_CTX_SEGMENT_MASK (GRN_CTX_SEGMENT_SIZE - 1)
-#define GRN_CTX_SEGMENT_WORD (1<<31)
-#define GRN_CTX_SEGMENT_VLEN (1<<30)
-#define GRN_CTX_SEGMENT_LIFO (1<<29)
-#define GRN_CTX_SEGMENT_DIRTY (1<<28)
+#define GRN_CTX_SEGMENT_WORD (1U <<31)
+#define GRN_CTX_SEGMENT_VLEN (1U <<30)
+#define GRN_CTX_SEGMENT_LIFO (1U <<29)
+#define GRN_CTX_SEGMENT_DIRTY (1U <<28)
void
grn_alloc_init_ctx_impl(grn_ctx *ctx)
@@ -400,8 +400,8 @@ grn_ctx_alloc(grn_ctx *ctx, size_t size, int flags,
header[0] = i;
header[1] = (int32_t) size;
} else {
- i = ctx->impl->currseg;
- mi = &ctx->impl->segs[i];
+ if ((i = ctx->impl->currseg) >= 0)
+ mi = &ctx->impl->segs[i];
if (i < 0 || size + mi->nref > GRN_CTX_SEGMENT_SIZE) {
for (i = 0, mi = ctx->impl->segs;; i++, mi++) {
if (i >= GRN_CTX_N_SEGMENTS) {
diff --git a/storage/mroonga/vendor/groonga/lib/db.c b/storage/mroonga/vendor/groonga/lib/db.c
index 46f3f783e59..7749d4c0165 100644
--- a/storage/mroonga/vendor/groonga/lib/db.c
+++ b/storage/mroonga/vendor/groonga/lib/db.c
@@ -12494,7 +12494,7 @@ grn_db_init_builtin_types(grn_ctx *ctx)
GRN_OBJ_KEY_VAR_SIZE, 1 << 16);
if (!obj || DB_OBJ(obj)->id != GRN_DB_TEXT) { return GRN_FILE_CORRUPT; }
obj = deftype(ctx, "LongText",
- GRN_OBJ_KEY_VAR_SIZE, 1 << 31);
+ GRN_OBJ_KEY_VAR_SIZE, 1U << 31);
if (!obj || DB_OBJ(obj)->id != GRN_DB_LONG_TEXT) { return GRN_FILE_CORRUPT; }
obj = deftype(ctx, "TokyoGeoPoint",
GRN_OBJ_KEY_GEO_POINT, sizeof(grn_geo_point));
diff --git a/storage/mroonga/vendor/groonga/lib/pat.c b/storage/mroonga/vendor/groonga/lib/pat.c
index 642173e2fdc..01f6108fbd0 100644
--- a/storage/mroonga/vendor/groonga/lib/pat.c
+++ b/storage/mroonga/vendor/groonga/lib/pat.c
@@ -899,7 +899,7 @@ chop(grn_ctx *ctx, grn_pat *pat, const char **key, const char *end, uint32_t *lk
case GRN_OBJ_KEY_FLOAT :\
if ((size) == sizeof(int64_t)) {\
int64_t v = *(int64_t *)(key);\
- v ^= ((v >> 63)|(1LL << 63));\
+ v ^= ((v >> 63)|(1ULL << 63));\
grn_hton((keybuf), &v, (size));\
}\
break;\
@@ -924,7 +924,7 @@ chop(grn_ctx *ctx, grn_pat *pat, const char **key, const char *end, uint32_t *lk
if ((size) == sizeof(int64_t)) {\
int64_t v;\
grn_hton(&v, (key), (size));\
- *((int64_t *)(keybuf)) = v ^ (((v^(1LL<<63))>> 63)|(1LL<<63)); \
+ *((int64_t *)(keybuf)) = v ^ ((((int64_t)(v^(1ULL<<63)))>> 63)|(1ULL<<63)); \
}\
break;\
}\
diff --git a/storage/mroonga/vendor/groonga/lib/proc/proc_select.c b/storage/mroonga/vendor/groonga/lib/proc/proc_select.c
index d17571c3470..a665b1cc898 100644
--- a/storage/mroonga/vendor/groonga/lib/proc/proc_select.c
+++ b/storage/mroonga/vendor/groonga/lib/proc/proc_select.c
@@ -2989,7 +2989,8 @@ grn_select(grn_ctx *ctx, grn_select_data *data)
char *cp = cache_key;
#define PUT_CACHE_KEY(string) \
- grn_memcpy(cp, (string).value, (string).length); \
+ if ((string).value) \
+ grn_memcpy(cp, (string).value, (string).length); \
cp += (string).length; \
*cp++ = '\0'
diff --git a/storage/mroonga/vendor/groonga/lib/str.c b/storage/mroonga/vendor/groonga/lib/str.c
index 6b2d17769ca..4f0a3a98699 100644
--- a/storage/mroonga/vendor/groonga/lib/str.c
+++ b/storage/mroonga/vendor/groonga/lib/str.c
@@ -46,7 +46,7 @@ grn_str_charlen_utf8(grn_ctx *ctx, const unsigned char *str, const unsigned char
if (*str & 0x80) {
int i;
int len;
- GRN_BIT_SCAN_REV(~(*str << 24), len);
+ GRN_BIT_SCAN_REV(~(((uint) *str) << 24), len);
len = 31 - len;
if ((unsigned int)(len - 2) >= 3) { /* (len == 1 || len >= 5) */
GRN_LOG(ctx, GRN_LOG_WARNING,
@@ -1963,7 +1963,8 @@ grn_bulk_write(grn_ctx *ctx, grn_obj *buf, const char *str, unsigned int len)
if ((rc = grn_bulk_resize(ctx, buf, GRN_BULK_VSIZE(buf) + len))) { return rc; }
}
curr = GRN_BULK_CURR(buf);
- grn_memcpy(curr, str, len);
+ if (str)
+ grn_memcpy(curr, str, len);
GRN_BULK_INCR_LEN(buf, len);
return rc;
}
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index f7626f93acf..d6cd9334a55 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -1953,7 +1953,7 @@ static void make_traverse_code_tree(HUFF_TREE *huff_tree,
{
chr=element->a.leaf.element_nr;
huff_tree->code_len[chr]= (uchar) (8 * sizeof(ulonglong) - size);
- huff_tree->code[chr]= (code >> size);
+ huff_tree->code[chr]= (size == 8 * sizeof(ulonglong)) ? 0 : (code >> size);
if (huff_tree->height < 8 * sizeof(ulonglong) - size)
huff_tree->height= 8 * sizeof(ulonglong) - size;
}
@@ -2944,12 +2944,15 @@ static void flush_bits(void)
ulonglong bit_buffer;
bits= file_buffer.bits & ~7;
- bit_buffer= file_buffer.bitbucket >> bits;
- bits= BITS_SAVED - bits;
- while (bits > 0)
+ if (bits != BITS_SAVED)
{
- bits-= 8;
- *file_buffer.pos++= (uchar) (bit_buffer >> bits);
+ bit_buffer= file_buffer.bitbucket >> bits;
+ bits= BITS_SAVED - bits;
+ while (bits > 0)
+ {
+ bits-= 8;
+ *file_buffer.pos++= (uchar) (bit_buffer >> bits);
+ }
}
if (file_buffer.pos >= file_buffer.end)
(void) flush_buffer(~ (ulong) 0);
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/add_index_inplace_crash.result b/storage/rocksdb/mysql-test/rocksdb/r/add_index_inplace_crash.result
index d3801258f0c..439383b04f4 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/add_index_inplace_crash.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/add_index_inplace_crash.result
@@ -7,7 +7,7 @@ INSERT INTO t1 (a, b) VALUES (3, 7);
flush logs;
SET SESSION debug_dbug="+d,crash_during_online_index_creation";
ALTER TABLE t1 ADD INDEX kb(b), ALGORITHM=INPLACE;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET SESSION debug_dbug="-d,crash_during_online_index_creation";
SHOW CREATE TABLE t1;
Table Create Table
@@ -26,7 +26,7 @@ CREATE TABLE t1 (i INT, j INT, k INT, PRIMARY KEY (i), KEY(j)) ENGINE = ROCKSDB
flush logs;
SET SESSION debug_dbug="+d,crash_during_index_creation_partition";
ALTER TABLE t1 ADD INDEX kij(i,j), ALGORITHM=INPLACE;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
SET SESSION debug_dbug="-d,crash_during_index_creation_partition";
SHOW CREATE TABLE t1;
Table Create Table
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/allow_to_start_after_corruption.result b/storage/rocksdb/mysql-test/rocksdb/r/allow_to_start_after_corruption.result
index 9b5a335b6f8..9bf297579ed 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/allow_to_start_after_corruption.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/allow_to_start_after_corruption.result
@@ -14,7 +14,7 @@ pk col1
1 1
set session debug_dbug= "+d,rocksdb_return_status_corrupted";
select * from t1 where pk=1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
FOUND 1 /data corruption detected/ in allow_to_start_after_corruption_debug.err
#
# The same for scan queries
@@ -26,7 +26,7 @@ pk col1
3 3
set session debug_dbug= "+d,rocksdb_return_status_corrupted";
select * from t1;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
FOUND 1 /data corruption detected/ in allow_to_start_after_corruption_debug.err
#
# Test restart failure. The server is shutdown at this point.
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/autoinc_debug.result b/storage/rocksdb/mysql-test/rocksdb/r/autoinc_debug.result
index 604e5572eab..ab81b4f5cde 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/autoinc_debug.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/autoinc_debug.result
@@ -58,7 +58,7 @@ insert into t values ();
insert into t values ();
set debug_dbug="+d,crash_commit_before";
commit;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
select max(i) into @row_max from t;
select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't';
table_schema table_name auto_increment > @row_max
@@ -69,7 +69,7 @@ insert into t values ();
insert into t values ();
set debug_dbug="+d,crash_commit_after_prepare";
commit;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
select max(i) into @row_max from t;
select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't';
table_schema table_name auto_increment > @row_max
@@ -80,7 +80,7 @@ insert into t values ();
insert into t values ();
set debug_dbug="+d,crash_commit_after_log";
commit;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
select max(i) into @row_max from t;
select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't';
table_schema table_name auto_increment > @row_max
@@ -91,7 +91,7 @@ insert into t values ();
insert into t values ();
set debug_dbug="+d,crash_commit_after";
commit;
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
select max(i) into @row_max from t;
select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't';
table_schema table_name auto_increment > @row_max
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result
index b2703ee0cbb..2b5c5300a0f 100644
--- a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result
@@ -7,7 +7,7 @@ create table t1 (a int primary key) engine=rocksdb;
insert into t1 values(1);
SET GLOBAL debug = '+d,crash_before_writing_xid';
insert into t1 values(2);
-ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to server during query
include/rpl_reconnect.inc
SET GLOBAL debug = ``;
include/start_slave.inc
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result
index 4884f60637e..0254d8bfd1c 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result
@@ -47,7 +47,7 @@ SELECT * FROM tbl_a;
id node
2 DB-G1
1 DB-G0
-SELECT * FROM tbl_a WHERE id != 0;
+SELECT * FROM tbl_a WHERE id <0 || id >0;
id node
1 DB-G0
2 DB-G1
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test
index 63b04c14e11..9e58bc1a836 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test
@@ -64,7 +64,7 @@ TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT * FROM tbl_a;
-SELECT * FROM tbl_a WHERE id != 0;
+SELECT * FROM tbl_a WHERE id <0 || id >0;
--connection child2_1
eval $CHILD2_1_SELECT_TABLES;
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index eac05ea68f5..f9471f35f79 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1795,9 +1795,10 @@ ret_sign:
{
if (negative)
{
- if (ull > (ulonglong) LONGLONG_MIN)
+ if (ull >= (ulonglong) LONGLONG_MIN)
{
- *error= MY_ERRNO_ERANGE;
+ if (ull != (ulonglong) LONGLONG_MIN)
+ *error= MY_ERRNO_ERANGE;
return (ulonglong) LONGLONG_MIN;
}
*error= 0;
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 2d1fa5ef496..72f90ab79c6 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -31467,9 +31467,11 @@ static inline uint16 *
my_uca_contraction_weight(const MY_CONTRACTIONS *list, my_wc_t *wc, size_t len)
{
MY_CONTRACTION *c, *last;
+ DBUG_ASSERT(len <= MY_UCA_MAX_CONTRACTION);
+
for (c= list->item, last= c + list->nitems; c < last; c++)
{
- if ((len == MY_UCA_MAX_CONTRACTION || c->ch[len] == 0) &&
+ if ((len >= MY_UCA_MAX_CONTRACTION || c->ch[len] == 0) &&
!c->with_context &&
!my_wmemcmp(c->ch, wc, len))
return c->weight;
@@ -33210,7 +33212,8 @@ my_char_weight_put(MY_UCA_WEIGHT_LEVEL *dst,
for (chlen= len; chlen > 1; chlen--)
{
- if ((from= my_uca_contraction_weight(&dst->contractions, str, chlen)))
+ if (chlen <= MY_UCA_MAX_CONTRACTION &&
+ (from= my_uca_contraction_weight(&dst->contractions, str, chlen)))
{
str+= chlen;
len-= chlen;
diff --git a/strings/json_lib.c b/strings/json_lib.c
index 772f6029e77..49f29903ed5 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -948,6 +948,7 @@ int json_read_value(json_engine_t *j)
{
int t_next, c_len, res;
+ j->value_type= JSON_VALUE_UNINITALIZED;
if (j->state == JST_KEY)
{
while (json_read_keyname_chr(j) == 0) {}
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 0a2d16599ae..fc3fd2c0048 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2002, 2014, Oracle and/or its affiliates.
- Copyright (c) 2008, 2020, MariaDB
+ Copyright (c) 2008, 2021, MariaDB
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
@@ -14328,8 +14328,8 @@ static void test_client_character_set()
DIE_UNLESS(rc == 0);
mysql_get_character_set_info(mysql, &cs);
- DIE_UNLESS(!strcmp(cs.csname, "utf8"));
- DIE_UNLESS(!strcmp(cs.name, "utf8_general_ci"));
+ DIE_UNLESS(!strcmp(cs.csname, "utf8mb3"));
+ DIE_UNLESS(!strcmp(cs.name, "utf8mb3_general_ci"));
/* Restore the default character set */
rc= mysql_set_character_set(mysql, csdefault);
myquery(rc);
@@ -17110,7 +17110,7 @@ static void test_bug30472()
/* Check that we have UTF8 on the server and on the client. */
- DIE_UNLESS(strcmp(character_set_name_4, "utf8") == 0);
+ DIE_UNLESS(strcmp(character_set_name_4, "utf8mb3") == 0);
DIE_UNLESS(strcmp(character_set_client_4, "utf8") == 0);
DIE_UNLESS(strcmp(character_set_results_4, "utf8") == 0);
DIE_UNLESS(strcmp(collation_connnection_4, "utf8_general_ci") == 0);