summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-04-10 17:43:18 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-04-10 17:43:18 +0300
commit45e6d0aebf023acb50671f82b87e6de5d1e78f5e (patch)
treec6079a18e158706a0a877d1b522ceb851d6055b5
parentf5cb66fb97101bc0f17ff879025fd7146c032cbc (diff)
parent2e91eb7547dfc7c9a999568bd8245832bbcfefaa (diff)
downloadmariadb-git-45e6d0aebf023acb50671f82b87e6de5d1e78f5e.tar.gz
Merge branch '10.1' into 10.2
-rw-r--r--CREDITS3
-rw-r--r--client/mysqltest.cc2
-rw-r--r--extra/mariabackup/innobackupex.cc2
-rw-r--r--extra/mariabackup/xtrabackup.cc6
-rw-r--r--include/my_service_manager.h (renamed from include/my_systemd.h)11
-rw-r--r--mysql-test/include/start_mysqld.inc3
-rw-r--r--mysql-test/include/wait_until_connected_again.inc6
-rwxr-xr-xmysql-test/mysql-test-run.pl1
-rw-r--r--mysql-test/r/connect.result24
-rw-r--r--mysql-test/r/contributors.result3
-rw-r--r--mysql-test/r/func_misc.result11
-rw-r--r--mysql-test/r/func_str.result37
-rw-r--r--mysql-test/r/mdev375.result12
-rw-r--r--mysql-test/r/myisam.result7
-rw-r--r--mysql-test/r/myisam_recover.result3
-rw-r--r--mysql-test/r/mysqld--help,win.rdiff4
-rw-r--r--mysql-test/r/mysqld--help.result4
-rw-r--r--mysql-test/r/parser.result7
-rw-r--r--mysql-test/r/perror.result2
-rw-r--r--mysql-test/r/ps.result2
-rw-r--r--mysql-test/r/sp.result2
-rw-r--r--mysql-test/r/statistics.result18
-rw-r--r--mysql-test/r/variables.result7
-rw-r--r--mysql-test/r/view.result197
-rw-r--r--mysql-test/std_data/binlog-header.logbin120 -> 0 bytes
-rw-r--r--mysql-test/suite/encryption/r/innodb-remove-encryption.result41
-rw-r--r--mysql-test/suite/encryption/t/innodb-remove-encryption.test59
-rw-r--r--mysql-test/suite/galera/disabled.def51
-rw-r--r--mysql-test/suite/galera/include/kill_galera.inc1
-rw-r--r--mysql-test/suite/galera/r/MW-284.result5
-rw-r--r--mysql-test/suite/galera/r/MW-44.result11
-rw-r--r--mysql-test/suite/galera/r/galera_as_master.result2
-rw-r--r--mysql-test/suite/galera/r/galera_binlog_row_image.result14
-rw-r--r--mysql-test/suite/galera/r/galera_gra_log.result18
-rw-r--r--mysql-test/suite/galera/r/galera_gtid_slave.result3
-rw-r--r--mysql-test/suite/galera/r/galera_lock_table.result4
-rw-r--r--mysql-test/suite/galera/r/galera_parallel_simple.result7
-rw-r--r--mysql-test/suite/galera/r/galera_suspend_slave.result4
-rw-r--r--mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result2
-rw-r--r--mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result12
-rw-r--r--mysql-test/suite/galera/r/galera_var_slave_threads.result2
-rw-r--r--mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result3
-rw-r--r--mysql-test/suite/galera/r/lp1376747-2.result3
-rw-r--r--mysql-test/suite/galera/r/lp1376747.result3
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#33.result5
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#90.result13
-rw-r--r--mysql-test/suite/galera/r/pxc-421.result4
-rw-r--r--mysql-test/suite/galera/t/MW-284.test9
-rw-r--r--mysql-test/suite/galera/t/MW-44.test5
-rw-r--r--mysql-test/suite/galera/t/galera_as_master.test16
-rw-r--r--mysql-test/suite/galera/t/galera_gcs_fragment.test1
-rw-r--r--mysql-test/suite/galera/t/galera_gra_log.test13
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave.test19
-rw-r--r--mysql-test/suite/galera/t/galera_lock_table.test7
-rw-r--r--mysql-test/suite/galera/t/galera_parallel_simple.test7
-rw-r--r--mysql-test/suite/galera/t/galera_suspend_slave.test9
-rw-r--r--mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test2
-rw-r--r--mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test11
-rw-r--r--mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test9
-rw-r--r--mysql-test/suite/galera/t/galera_var_slave_threads.test7
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test2
-rw-r--r--mysql-test/suite/galera/t/lp1376747-2.test7
-rw-r--r--mysql-test/suite/galera/t/lp1376747.test7
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#33.test10
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#90.test2
-rw-r--r--mysql-test/suite/galera/t/pxc-421.test10
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_pc_weight.test5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result16
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result16
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test17
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test17
-rw-r--r--mysql-test/suite/sys_vars/r/host_cache_size_auto.result2
-rw-r--r--mysql-test/suite/sys_vars/r/max_connections_basic.result20
-rw-r--r--mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result20
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result12
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result12
-rw-r--r--mysql-test/suite/sys_vars/r/table_open_cache_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_innodb.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_server_embedded.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_server_notembedded.opt1
-rw-r--r--mysql-test/t/connect.test18
-rw-r--r--mysql-test/t/func_misc.test11
-rw-r--r--mysql-test/t/func_str.test35
-rw-r--r--mysql-test/t/mdev375.test11
-rw-r--r--mysql-test/t/myisam.test7
-rw-r--r--mysql-test/t/myisam_recover.test3
-rw-r--r--mysql-test/t/mysqltest.test2
-rw-r--r--mysql-test/t/parser.test9
-rw-r--r--mysql-test/t/sp.test2
-rw-r--r--mysql-test/t/statistics.test19
-rw-r--r--mysql-test/t/variables.test3
-rw-r--r--mysql-test/t/view.test196
-rw-r--r--mysys/my_addr_resolve.c2
-rw-r--r--sql-common/client.c7
-rw-r--r--sql/contributors.h3
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_strfunc.h6
-rw-r--r--sql/mysqld.cc96
-rw-r--r--sql/mysqld.h2
-rw-r--r--sql/set_var.h10
-rw-r--r--sql/share/errmsg-utf8.txt4
-rw-r--r--sql/sql_const.h2
-rw-r--r--sql/sql_parse.cc34
-rw-r--r--sql/sql_statistics.cc23
-rw-r--r--sql/sql_yacc.yy5
-rw-r--r--sql/sys_vars.cc8
-rw-r--r--sql/table.h1
-rw-r--r--storage/innobase/buf/buf0dump.cc9
-rw-r--r--storage/innobase/buf/buf0flu.cc13
-rw-r--r--storage/innobase/fil/fil0crypt.cc57
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
-rw-r--r--storage/innobase/include/trx0roll.h2
-rw-r--r--storage/innobase/include/univ.i4
-rw-r--r--storage/innobase/log/log0log.cc60
-rw-r--r--storage/innobase/log/log0recv.cc11
-rw-r--r--storage/innobase/srv/srv0srv.cc10
-rw-r--r--storage/innobase/trx/trx0roll.cc12
-rw-r--r--storage/oqgraph/graphcore-graph.cc1
-rw-r--r--storage/oqgraph/graphcore.cc1
-rw-r--r--storage/oqgraph/oqgraph_shim.h2
-rw-r--r--storage/sphinx/snippets_udf.cc8
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db917.result4
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/db917.test4
-rw-r--r--storage/xtradb/buf/buf0dump.cc9
-rw-r--r--storage/xtradb/buf/buf0flu.cc13
-rw-r--r--storage/xtradb/fil/fil0crypt.cc57
-rw-r--r--storage/xtradb/handler/ha_innodb.cc2
-rw-r--r--storage/xtradb/include/univ.i4
-rw-r--r--storage/xtradb/log/log0log.cc65
-rw-r--r--storage/xtradb/log/log0recv.cc9
-rw-r--r--storage/xtradb/srv/srv0srv.cc10
-rw-r--r--storage/xtradb/trx/trx0roll.cc12
134 files changed, 1474 insertions, 391 deletions
diff --git a/CREDITS b/CREDITS
index 7572f6f5dd9..1788b6304fe 100644
--- a/CREDITS
+++ b/CREDITS
@@ -5,15 +5,14 @@ The current main sponsors of the MariaDB Foundation are:
Alibaba Cloud https://www.alibabacloud.com/ (2017)
Booking.com https://www.booking.com (2013)
+MariaDB Corporation https://www.mariadb.com (2013)
Microsoft https://microsoft.com/ (2017)
Tencent Cloud https://cloud.tencent.com (2017)
Development Bank of Singapore https://dbs.com (2016)
IBM https://www.ibm.com (2017)
-MariaDB Corporation https://www.mariadb.com (2013)
Visma https://visma.com (2015)
Acronis http://acronis.com (2016)
Nexedi https://www.nexedi.com (2016)
-Automattic https://automattic.com (2014)
Tencent Game DBA http://tencentdba.com/about (2016)
Tencent TDSQL http://tdsql.org (2016)
Verkkokauppa.com https://www.verkkokauppa.com (2015)
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 6f041e92a32..95165b63e42 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -522,7 +522,7 @@ struct st_match_err
struct st_expected_errors
{
- struct st_match_err err[10];
+ struct st_match_err err[12];
uint count;
};
static struct st_expected_errors saved_expected_errors;
diff --git a/extra/mariabackup/innobackupex.cc b/extra/mariabackup/innobackupex.cc
index c15e02cdff3..1e174c0fec8 100644
--- a/extra/mariabackup/innobackupex.cc
+++ b/extra/mariabackup/innobackupex.cc
@@ -241,7 +241,7 @@ static struct my_option ibx_long_options[] =
{"galera-info", OPT_GALERA_INFO, "This options creates the "
"xtrabackup_galera_info file which contains the local node state at "
"the time of the backup. Option should be used when performing the "
- "backup of Percona-XtraDB-Cluster. Has no effect when backup locks "
+ "backup of MariaDB Galera Cluster. Has no effect when backup locks "
"are used to create the backup.",
(uchar *) &opt_ibx_galera_info, (uchar *) &opt_ibx_galera_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 7691fba7f2f..ff0d4f0453a 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -813,7 +813,7 @@ struct my_option xb_client_options[] =
{"galera-info", OPT_GALERA_INFO, "This options creates the "
"xtrabackup_galera_info file which contains the local node state at "
"the time of the backup. Option should be used when performing the "
- "backup of Percona-XtraDB-Cluster. Has no effect when backup locks "
+ "backup of MariaDB Galera Cluster. Has no effect when backup locks "
"are used to create the backup.",
(uchar *) &opt_galera_info, (uchar *) &opt_galera_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -5705,6 +5705,10 @@ static int main_low(char** argv)
xtrabackup_incremental = NULL;
}
+ if (xtrabackup_stream && !xtrabackup_backup) {
+ msg("Warning: --stream parameter is ignored, it only works together with --backup.\n");
+ }
+
if (!xb_init()) {
return(EXIT_FAILURE);
}
diff --git a/include/my_systemd.h b/include/my_service_manager.h
index bef75576422..4d88e992b5e 100644
--- a/include/my_systemd.h
+++ b/include/my_service_manager.h
@@ -16,8 +16,8 @@
*/
-#ifndef MY_SYSTEMD_INCLUDED
-#define MY_SYSTEMD_INCLUDED
+#ifndef MY_SERVICE_MANAGER_INCLUDED
+#define MY_SERVICE_MANAGER_INCLUDED
#if defined(HAVE_SYSTEMD) && !defined(EMBEDDED_LIBRARY)
/*
@@ -26,9 +26,14 @@
*/
#define __STDC_FORMAT_MACROS
#include <systemd/sd-daemon.h>
+/** INTERVAL in seconds followed by printf style status */
+#define service_manager_extend_timeout(INTERVAL, FMTSTR, ...) \
+ sd_notifyf(0, "STATUS=" FMTSTR "\nEXTEND_TIMEOUT_USEC=%u\n", ##__VA_ARGS__, INTERVAL * 1000000)
+
#else
#define sd_notify(X, Y)
#define sd_notifyf(E, F, ...)
+#define service_manager_extend_timeout(I, FMTSTR, ...)
#endif
-#endif /* MY_SYSTEMD_INCLUDED */
+#endif /* MY_SERVICE_MANAGER_INCLUDED */
diff --git a/mysql-test/include/start_mysqld.inc b/mysql-test/include/start_mysqld.inc
index 04dff714d49..e31f26aad8c 100644
--- a/mysql-test/include/start_mysqld.inc
+++ b/mysql-test/include/start_mysqld.inc
@@ -16,9 +16,6 @@ if (!$restart_parameters)
# Call script that will poll the server waiting for it to be back online again
--source include/wait_until_connected_again.inc
-# Wait for wsrep
---source include/wait_wsrep_ready.inc
-
# Turn off reconnect again
--disable_reconnect
diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc
index bdd99af2fc1..2e80ea2ed7d 100644
--- a/mysql-test/include/wait_until_connected_again.inc
+++ b/mysql-test/include/wait_until_connected_again.inc
@@ -23,3 +23,9 @@ while ($mysql_errno)
}
--enable_query_log
--enable_result_log
+
+# WSREP: SHOW STATUS queries are allowed even if wsrep
+# is not ready. Make sure wsrep is ready before
+# returning from this script
+
+--source include/wait_wsrep_ready.inc
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 5e6eeb8ede2..9e08427bf3e 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -4446,6 +4446,7 @@ sub extract_warning_lines ($$) {
qr|SSL error: Failed to set ciphers to use|,
qr/Plugin 'InnoDB' will be forced to shutdown/,
qr|Could not increase number of max_open_files to more than|,
+ qr|Changed limits: max_open_files|,
qr/InnoDB: Error table encrypted but encryption service not available.*/,
qr/InnoDB: Could not find a valid tablespace file for*/,
qr/InnoDB: Tablespace open failed for*/,
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index dfe4406605e..20a01c6f78e 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -179,8 +179,16 @@ drop table t1;
CREATE USER mysqltest_u1@localhost;
GRANT USAGE ON *.* TO mysqltest_u1@localhost;
-SET GLOBAL max_connections = 3;
+SET GLOBAL max_connections = 10;
SET GLOBAL event_scheduler = ON;
+connect tmp_con1,localhost,mysqltest_u1,,;
+connect tmp_con2,localhost,mysqltest_u1,,;
+connect tmp_con3,localhost,mysqltest_u1,,;
+connect tmp_con4,localhost,mysqltest_u1,,;
+connect tmp_con5,localhost,mysqltest_u1,,;
+connect tmp_con6,localhost,mysqltest_u1,,;
+connect tmp_con7,localhost,mysqltest_u1,,;
+connection default;
# -- Waiting for Event Scheduler to start...
@@ -224,6 +232,13 @@ event_scheduler
mysqltest_u1
mysqltest_u1
mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
root
# -- Resetting variables...
@@ -239,6 +254,13 @@ disconnect con_1;
disconnect con_2;
disconnect con_3;
disconnect con_super_1;
+disconnect tmp_con1;
+disconnect tmp_con2;
+disconnect tmp_con3;
+disconnect tmp_con4;
+disconnect tmp_con5;
+disconnect tmp_con6;
+disconnect tmp_con7;
# -- Restoring default connection...
connect default,localhost,root,,test;
diff --git a/mysql-test/r/contributors.result b/mysql-test/r/contributors.result
index 927c0bcccbf..36d033f4cb3 100644
--- a/mysql-test/r/contributors.result
+++ b/mysql-test/r/contributors.result
@@ -4,13 +4,12 @@ Booking.com https://www.booking.com Founding member, Platinum Sponsor of the Mar
Alibaba Cloud https://www.alibabacloud.com/ Platinum Sponsor of the MariaDB Foundation
Tencent Cloud https://cloud.tencent.com Platinum Sponsor of the MariaDB Foundation
Microsoft https://microsoft.com/ Platinum Sponsor of the MariaDB Foundation
-MariaDB Corporation https://mariadb.com Founding member, Gold Sponsor of the MariaDB Foundation
+MariaDB Corporation https://mariadb.com Founding member, Platinum Sponsor of the MariaDB Foundation
Visma https://visma.com Gold Sponsor of the MariaDB Foundation
DBS https://dbs.com Gold Sponsor of the MariaDB Foundation
IBM https://www.ibm.com Gold Sponsor of the MariaDB Foundation
Nexedi https://www.nexedi.com Silver Sponsor of the MariaDB Foundation
Acronis http://www.acronis.com Silver Sponsor of the MariaDB Foundation
-Auttomattic https://automattic.com Bronze Sponsor of the MariaDB Foundation
Verkkokauppa.com https://www.verkkokauppa.com Bronze Sponsor of the MariaDB Foundation
Virtuozzo https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation
Tencent Game DBA http://tencentdba.com/about Bronze Sponsor of the MariaDB Foundation
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 218b11a2fc2..c3c03242caf 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -585,6 +585,17 @@ SELECT NAME_CONST('a', -(1)) OR 1;
NAME_CONST('a', -(1)) OR 1
1
#
+# MDEV-15630 uuid() function evaluates at wrong time in query
+#
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT COUNT(1), UUID() as uid FROM t1 GROUP BY uid;
+COUNT(1) uid
+1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+DROP TABLE t1;
+#
# End of 5.5 tests
#
#
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 0b620d9cccd..5334cc055d1 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -4577,6 +4577,43 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select char(0xdf) AS `CHAR(0xDF)`
#
+# MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data
+#
+CREATE TABLE t1 (
+id int(11) NOT NULL,
+session_id varchar(255) DEFAULT NULL,
+directory mediumtext,
+checksum int(10) DEFAULT NULL,
+last_update datetime DEFAULT NULL,
+PRIMARY KEY (id),
+KEY lastupdate (last_update)
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,'',NULL,38391,'2017-06-24 07:35:28');
+UPDATE t1 SET directory = AES_ENCRYPT(CONVERT('test stringrererejrjerjehrjekhrjkehrjkehrkjehrjkerhkjehrjekrhkjehrkjerhjkehrkjehrkjehrjkehrjkehrjkehrjkerjkehrjkehrjkehrjke rekjhrejrejhrjehgrehjgrhjerjhegrjherejhgrjhegrjehgrjhegrejhrgjehgrjhegrjhegrjhergjhegrjhegrhjegrjerhthkjjkdhjkgdfjkgjkdgdjkfjkhgjkfdhjgjkfdghkjdfghkjfdghfjkdghkdjfghdkjfghfjkdghfkjdghkjfdghfkjdghfkdjghfkjdghfdjkghjkdfhgdfjkghfjkdghfjkdghfjdkghfjkdghkfjdghfkjdghfkjdghkjdfghfjdkghjkfdghkjdfhgjkdfhgjkfdhgkjfdghkfjdhgkjfdgdjkejktjherjthkjrethkjrethjkerthjkerhtjkerhtkjerhtjkerhtjkerhtjkrehtkjerhtkjrehtjkrehtkjrehtkjerhtkjerhtjkrehtkjrehtjkrehtkjrethjkrethkjrehtkjethjkerhtjkrehtjkretkjerhtkjrehtjkerhtjkrehtjrehtkjrekjtrfgdsfgdhjsghjgfdhjsfhjdfgdhjshjdshjfghjdsfgjhsfgjhsdfgjhdsfgjdhsfgsjhfgjhsdfgsdjhfgjdhsfdjshfgdsjhfgjsdhfdjshfgdjhsfgdjshfgjdhsfgjhsdfgjhsdgfjhsdgfjhdsgfjhsgfjhsdgfjhdsgfhjsdehkjthrkjethjkre' USING latin1), '95F5A1F52A554'), last_update= NOW();
+SELECT directory IS NULL FROM t1;
+directory IS NULL
+0
+DROP TABLE t1;
+CREATE TABLE t1 (
+id int(11) NOT NULL PRIMARY KEY,
+directory mediumtext
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,AES_ENCRYPT(CONVERT(REPEAT('a',800) USING latin1),'95F5A1F52A554'));
+SELECT AES_DECRYPT(directory,'95F5A1F52A554') FROM t1;
+AES_DECRYPT(directory,'95F5A1F52A554')
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+DROP TABLE t1;
+SET @enc=AES_ENCRYPT(REPEAT(_latin1'a',800),'95F5A1F52A554');
+CREATE TABLE t1 (
+id int(11) NOT NULL PRIMARY KEY,
+directory mediumtext
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,AES_DECRYPT(CONVERT(@enc USING binary),'95F5A1F52A554'));
+SELECT * FROM t1;
+id directory
+1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+DROP TABLE t1;
+#
# Start of 10.1 tests
#
#
diff --git a/mysql-test/r/mdev375.result b/mysql-test/r/mdev375.result
index d7a66ebd6dd..0ae8375ff24 100644
--- a/mysql-test/r/mdev375.result
+++ b/mysql-test/r/mdev375.result
@@ -1,5 +1,13 @@
SET GLOBAL log_warnings=4;
-SET GLOBAL max_connections=2;
+SET GLOBAL max_connections=10;
+connect tmp_con1,localhost,root,,;
+connect tmp_con2,localhost,root,,;
+connect tmp_con3,localhost,root,,;
+connect tmp_con4,localhost,root,,;
+connect tmp_con5,localhost,root,,;
+connect tmp_con6,localhost,root,,;
+connect tmp_con7,localhost,root,,;
+connect tmp_con8,localhost,root,,;
connect con1,localhost,root,,;
SELECT 1;
1
@@ -15,6 +23,6 @@ SELECT 0;
0
show status like "Threads_connected";
Variable_name Value
-Threads_connected 3
+Threads_connected 11
SET GLOBAL log_warnings=default;
SET GLOBAL max_connections=default;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index f20a08d690a..f2f06f9413a 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -1938,16 +1938,17 @@ DROP TABLE t1;
#
# BUG#48438 - crash with error in unioned query against merge table and view...
#
-SET GLOBAL table_open_cache=3;
+SET @save_table_open_cache=@@table_open_cache;
+SET GLOBAL table_open_cache=10;
CREATE TABLE t1(a INT);
-SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
+SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4, t1 AS a5, t1 AS a6, t1 AS a7, t1 AS a8, t1 AS a9, t1 AS a10, t1 AS a11 FOR UPDATE;
1
SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
TABLE_ROWS DATA_LENGTH
0 0
DROP TABLE t1;
-SET GLOBAL table_open_cache=DEFAULT;
+SET GLOBAL table_open_cache=@save_table_open_cache;
End of 5.0 tests
create table t1 (a int not null, key `a` (a) key_block_size=1024);
show create table t1;
diff --git a/mysql-test/r/myisam_recover.result b/mysql-test/r/myisam_recover.result
index 12184ad0ca6..1af3dbf9ad5 100644
--- a/mysql-test/r/myisam_recover.result
+++ b/mysql-test/r/myisam_recover.result
@@ -18,6 +18,7 @@ connection con1;
call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:");
call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
call mtr.add_suppression(" '\..test.t1'");
+set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=256;
set global table_definition_cache=400;
drop procedure if exists p_create;
@@ -98,7 +99,7 @@ prepare stmt from @drop_table_stmt;
execute stmt;
deallocate prepare stmt;
set @@global.table_definition_cache=default;
-set @@global.table_open_cache=default;
+set @@global.table_open_cache=@save_table_open_cache;
disconnect con1;
connection default;
#
diff --git a/mysql-test/r/mysqld--help,win.rdiff b/mysql-test/r/mysqld--help,win.rdiff
index ac0f75b94eb..7ef9ec5da5f 100644
--- a/mysql-test/r/mysqld--help,win.rdiff
+++ b/mysql-test/r/mysqld--help,win.rdiff
@@ -105,10 +105,10 @@
sync-relay-log 10000
sync-relay-log-info 10000
sysdate-is-now FALSE
--table-cache 431
+-table-cache 421
+table-cache 2000
table-definition-cache 400
--table-open-cache 431
+-table-open-cache 421
+table-open-cache 2000
table-open-cache-instances 8
tc-heuristic-recover OFF
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index 3729fa32feb..c1afe42695a 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -1508,9 +1508,9 @@ sync-master-info 10000
sync-relay-log 10000
sync-relay-log-info 10000
sysdate-is-now FALSE
-table-cache 431
+table-cache 421
table-definition-cache 400
-table-open-cache 431
+table-open-cache 421
table-open-cache-instances 8
tc-heuristic-recover OFF
thread-cache-size 151
diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result
index 6029a976ba3..09bbd7cf176 100644
--- a/mysql-test/r/parser.result
+++ b/mysql-test/r/parser.result
@@ -673,6 +673,13 @@ PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '\' at line 1
DROP TABLE t1;
#
+# MDEV-15620 Crash when using "SET @@NEW.a=expr" inside a trigger
+#
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @@NEW.a=0;
+ERROR HY000: Unknown system variable 'NEW'
+DROP TABLE t1;
+#
# MDEV-7792 - SQL Parsing Error - UNION AND ORDER BY WITH JOIN
#
CREATE TABLE t1(a INT);
diff --git a/mysql-test/r/perror.result b/mysql-test/r/perror.result
index 432a4fd4c04..46554442721 100644
--- a/mysql-test/r/perror.result
+++ b/mysql-test/r/perror.result
@@ -3,4 +3,4 @@ MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
MySQL error code 1408 (ER_STARTUP): %s: ready for connections.
Version: '%s' socket: '%s' port: %d %s
MySQL error code 1459 (ER_TABLE_NEEDS_UPGRADE): Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!
-MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %lu)
+MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %u)
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 74dbfed6cc2..84d705587e8 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -821,7 +821,7 @@ Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '10000000000000000'
select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
-1048576
+4294967295
set global max_prepared_stmt_count=default;
select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 274727d58c4..537da742032 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -7954,7 +7954,7 @@ CLOSE cur1;
end|
set @tmp_toc= @@table_open_cache;
set @tmp_tdc= @@table_definition_cache;
-set global table_open_cache=1;
+set global table_open_cache=10;
set global table_definition_cache=1;
Warnings:
Warning 1292 Truncated incorrect table_definition_cache value: '1'
diff --git a/mysql-test/r/statistics.result b/mysql-test/r/statistics.result
index ffaaf09acc8..8f87b166e8d 100644
--- a/mysql-test/r/statistics.result
+++ b/mysql-test/r/statistics.result
@@ -1664,6 +1664,24 @@ db_name table_name column_name HEX(min_value) HEX(max_value) nulls_ratio avg_fre
test t1 a D879626AF872675F73E662F8 D879626AF872675F73E662F8 0.0000 1.0000 0 NULL NULL
drop table t1;
#
+# MDEB-9744: session optimizer_use_condition_selectivity=5 causing SQL Error (1918):
+# Encountered illegal value '' when converting to DECIMAL
+#
+set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+set optimizer_use_condition_selectivity=3, use_stat_tables=preferably;
+create table t1 (id int(10),cost decimal(9,2)) engine=innodb;
+ANALYZE TABLE t1 PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create temporary table t2 (id int);
+insert into t2 (id) select id from t1 where cost > 0;
+select * from t2;
+id
+set use_stat_tables=@save_use_stat_tables;
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+drop table t1,t2;
+#
# MDEV-9590: Always print "Engine-independent statistic" warnings and
# might be filtering columns unintentionally from engines
#
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index c87f7057f1d..7549832e09d 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -568,6 +568,7 @@ set sql_safe_updates=1;
set sql_select_limit=1;
set sql_select_limit=default;
set sql_warnings=1;
+set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=100;
set default_storage_engine=myisam;
set global thread_cache_size=100;
@@ -748,11 +749,11 @@ Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '-1'
SHOW VARIABLES LIKE 'table_open_cache';
Variable_name Value
-table_open_cache 1
+table_open_cache 10
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
VARIABLE_NAME VARIABLE_VALUE
-TABLE_OPEN_CACHE 1
-SET GLOBAL table_open_cache=DEFAULT;
+TABLE_OPEN_CACHE 10
+SET GLOBAL table_open_cache=@save_table_open_cache;
set character_set_results=NULL;
select ifnull(@@character_set_results,"really null");
ifnull(@@character_set_results,"really null")
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 13c63ebed89..c5c4df01abd 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -5583,6 +5583,203 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select group_concat(`t1`.`str` separator '\\') AS `GROUP_CONCAT(str SEPARATOR '\\')` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1;
+CREATE TABLE IF NOT EXISTS t0 (f0 INT);
+CREATE TABLE IF NOT EXISTS t1 (f1 INT);
+CREATE TABLE IF NOT EXISTS t2 (f2 INT);
+CREATE TABLE IF NOT EXISTS t3 (f3 INT);
+CREATE TABLE IF NOT EXISTS t4 (f4 INT);
+CREATE TABLE IF NOT EXISTS t5 (f5 INT);
+CREATE TABLE IF NOT EXISTS t6 (f6 INT);
+CREATE TABLE IF NOT EXISTS t7 (f7 INT);
+CREATE TABLE IF NOT EXISTS t8 (f8 INT);
+CREATE TABLE IF NOT EXISTS t9 (f9 INT);
+CREATE TABLE IF NOT EXISTS t10 (f10 INT);
+CREATE TABLE IF NOT EXISTS t11 (f11 INT);
+CREATE TABLE IF NOT EXISTS t12 (f12 INT);
+CREATE TABLE IF NOT EXISTS t13 (f13 INT);
+CREATE TABLE IF NOT EXISTS t14 (f14 INT);
+CREATE TABLE IF NOT EXISTS t15 (f15 INT);
+CREATE TABLE IF NOT EXISTS t16 (f16 INT);
+CREATE TABLE IF NOT EXISTS t17 (f17 INT);
+CREATE TABLE IF NOT EXISTS t18 (f18 INT);
+CREATE TABLE IF NOT EXISTS t19 (f19 INT);
+CREATE TABLE IF NOT EXISTS t20 (f20 INT);
+CREATE TABLE IF NOT EXISTS t21 (f21 INT);
+CREATE TABLE IF NOT EXISTS t22 (f22 INT);
+CREATE TABLE IF NOT EXISTS t23 (f23 INT);
+CREATE TABLE IF NOT EXISTS t24 (f24 INT);
+CREATE TABLE IF NOT EXISTS t25 (f25 INT);
+CREATE TABLE IF NOT EXISTS t26 (f26 INT);
+CREATE TABLE IF NOT EXISTS t27 (f27 INT);
+CREATE TABLE IF NOT EXISTS t28 (f28 INT);
+CREATE TABLE IF NOT EXISTS t29 (f29 INT);
+CREATE TABLE IF NOT EXISTS t30 (f30 INT);
+CREATE TABLE IF NOT EXISTS t31 (f31 INT);
+CREATE TABLE IF NOT EXISTS t32 (f32 INT);
+CREATE TABLE IF NOT EXISTS t33 (f33 INT);
+CREATE TABLE IF NOT EXISTS t34 (f34 INT);
+CREATE TABLE IF NOT EXISTS t35 (f35 INT);
+CREATE TABLE IF NOT EXISTS t36 (f36 INT);
+CREATE TABLE IF NOT EXISTS t37 (f37 INT);
+CREATE TABLE IF NOT EXISTS t38 (f38 INT);
+CREATE TABLE IF NOT EXISTS t39 (f39 INT);
+CREATE TABLE IF NOT EXISTS t40 (f40 INT);
+CREATE TABLE IF NOT EXISTS t41 (f41 INT);
+CREATE TABLE IF NOT EXISTS t42 (f42 INT);
+CREATE TABLE IF NOT EXISTS t43 (f43 INT);
+CREATE TABLE IF NOT EXISTS t44 (f44 INT);
+CREATE TABLE IF NOT EXISTS t45 (f45 INT);
+CREATE TABLE IF NOT EXISTS t46 (f46 INT);
+CREATE TABLE IF NOT EXISTS t47 (f47 INT);
+CREATE TABLE IF NOT EXISTS t48 (f48 INT);
+CREATE TABLE IF NOT EXISTS t49 (f49 INT);
+CREATE TABLE IF NOT EXISTS t50 (f50 INT);
+CREATE TABLE IF NOT EXISTS t51 (f51 INT);
+CREATE TABLE IF NOT EXISTS t52 (f52 INT);
+CREATE TABLE IF NOT EXISTS t53 (f53 INT);
+CREATE TABLE IF NOT EXISTS t54 (f54 INT);
+CREATE TABLE IF NOT EXISTS t55 (f55 INT);
+CREATE TABLE IF NOT EXISTS t56 (f56 INT);
+CREATE TABLE IF NOT EXISTS t57 (f57 INT);
+CREATE TABLE IF NOT EXISTS t58 (f58 INT);
+CREATE TABLE IF NOT EXISTS t59 (f59 INT);
+CREATE TABLE IF NOT EXISTS t60 (f60 INT);
+CREATE OR REPLACE VIEW v60 AS SELECT * FROM t60;
+EXPLAIN
+SELECT t0.*
+FROM t0
+JOIN t1
+ON t1.f1 = t0.f0
+LEFT JOIN t2
+ON t0.f0 = t2.f2
+LEFT JOIN t3
+ON t0.f0 = t3.f3
+LEFT JOIN t4
+ON t0.f0 = t4.f4
+LEFT JOIN t5
+ON t4.f4 = t5.f5
+LEFT JOIN t6
+ON t0.f0 = t6.f6
+LEFT JOIN t7
+ON t0.f0 = t7.f7
+LEFT JOIN t8
+ON t0.f0 = t8.f8
+LEFT JOIN t9
+ON t0.f0 = t9.f9
+LEFT JOIN t10
+ON t0.f0 = t10.f10
+LEFT JOIN t11
+ON t0.f0 = t11.f11
+LEFT JOIN t12
+ON t0.f0 = t12.f12
+LEFT JOIN t13
+ON t0.f0 = t13.f13
+LEFT JOIN t14
+ON t0.f0 = t14.f14
+LEFT JOIN t15
+ON t0.f0 = t15.f15
+LEFT JOIN t16
+ON t0.f0 = t16.f16
+LEFT JOIN t17
+ON t0.f0 = t17.f17
+LEFT JOIN t18
+ON t0.f0 = t18.f18
+LEFT JOIN t19
+ON t18.f18 = t19.f19
+LEFT JOIN t20
+ON t20.f20 = t19.f19
+LEFT JOIN t21
+ON t20.f20 = t21.f21
+LEFT JOIN t22
+ON t19.f19 = t22.f22
+LEFT JOIN t23
+ON t23.f23 = t0.f0
+LEFT JOIN t24
+ON t24.f24 = t23.f23
+LEFT JOIN t25
+ON t0.f0 = t25.f25
+LEFT JOIN t26
+ON t26.f26 = t0.f0
+LEFT JOIN t27
+ON t27.f27 = t0.f0
+LEFT JOIN t28
+ON t0.f0 = t28.f28
+LEFT JOIN t29
+ON t0.f0 = t29.f29
+LEFT JOIN t30
+ON t30.f30 = t0.f0
+LEFT JOIN t31
+ON t0.f0 = t31.f31
+LEFT JOIN t32
+ON t32.f32 = t31.f31
+LEFT JOIN t33
+ON t33.f33 = t0.f0
+LEFT JOIN t34
+ON t33.f33 = t34.f34
+LEFT JOIN t35
+ON t33.f33 = t35.f35
+LEFT JOIN t36
+ON t36.f36 = t0.f0
+LEFT JOIN t37
+ON t32.f32 = t37.f37
+LEFT JOIN t38
+ON t31.f31 = t38.f38
+LEFT JOIN t39
+ON t39.f39 = t0.f0
+LEFT JOIN t40
+ON t40.f40 = t39.f39
+LEFT JOIN t41
+ON t41.f41 = t0.f0
+LEFT JOIN t42
+ON t42.f42 = t41.f41
+LEFT JOIN t43
+ON t43.f43 = t41.f41
+LEFT JOIN t44
+ON t44.f44 = t0.f0
+LEFT JOIN t45
+ON t45.f45 = t0.f0
+LEFT JOIN t46
+ON t46.f46 = t0.f0
+LEFT JOIN t47
+ON t47.f47 = t0.f0
+LEFT JOIN t48
+ON t48.f48 = t0.f0
+LEFT JOIN t49
+ON t0.f0 = t49.f49
+LEFT JOIN t50
+ON t0.f0 = t50.f50
+LEFT JOIN t51
+ON t0.f0 = t51.f51
+LEFT JOIN t52
+ON t52.f52 = t0.f0
+LEFT JOIN t53
+ON t53.f53 = t0.f0
+LEFT JOIN t54
+ON t54.f54 = t0.f0
+LEFT JOIN t55
+ON t55.f55 = t0.f0
+LEFT JOIN t56
+ON t56.f56 = t0.f0
+LEFT JOIN t57
+ON t57.f57 = t0.f0
+LEFT JOIN t58
+ON t58.f58 = t57.f57
+LEFT JOIN t59
+ON t36.f36 = t59.f59
+LEFT JOIN v60
+ON t36.f36 = v60.f60
+;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9,
+t10, t11, t12, t13, t14, t15, t16, t17, t18,
+t19, t20, t21, t22, t23, t24, t25, t26, t27,
+t28, t29, t30, t31, t32, t33, t34, t35, t36,
+t37, t38, t39, t40, t41, t42, t43, t44, t45,
+t46, t47, t48, t49, t50, t51, t52, t53, t54,
+t55, t56, t57, t58, t59,t60;
+drop view v60;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/std_data/binlog-header.log b/mysql-test/std_data/binlog-header.log
deleted file mode 100644
index c415a57e616..00000000000
--- a/mysql-test/std_data/binlog-header.log
+++ /dev/null
Binary files differ
diff --git a/mysql-test/suite/encryption/r/innodb-remove-encryption.result b/mysql-test/suite/encryption/r/innodb-remove-encryption.result
new file mode 100644
index 00000000000..7146ea9de4a
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-remove-encryption.result
@@ -0,0 +1,41 @@
+set global innodb_file_per_table=OFF;
+call mtr.add_suppression("mysqld: file-key-management-filename is not set");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error.");
+call mtr.add_suppression("Plugin 'file_key_management' registration as a ENCRYPTION failed.");
+flush tables;
+create table t1(a int not null primary key, b char(200)) engine=innodb;
+
+# Restart server with encryption
+# Wait until encryption threads have encrypted all tablespaces
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+innodb_system
+mysql/innodb_index_stats
+mysql/innodb_table_stats
+# Success!
+SELECT * from t1;
+a b
+# Now turn off encryption and wait for threads to decrypt all tablespaces
+SET GLOBAL innodb_encrypt_tables = off;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+innodb_system
+mysql/innodb_index_stats
+mysql/innodb_table_stats
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+# Success!
+
+# Restart server with no encryption setup, there should be no crashes
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+NAME
+innodb_system
+mysql/innodb_index_stats
+mysql/innodb_table_stats
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+NAME
+SELECT * from t1;
+a b
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/t/innodb-remove-encryption.test b/mysql-test/suite/encryption/t/innodb-remove-encryption.test
new file mode 100644
index 00000000000..24e00a00a02
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-remove-encryption.test
@@ -0,0 +1,59 @@
+--source include/have_innodb.inc
+# Test uses restart
+--source include/not_embedded.inc
+--source filekeys_plugin.inc
+
+#
+# MDEV-15566: System tablespace does not easily key rotate to unencrypted
+#
+
+set global innodb_file_per_table=OFF;
+
+call mtr.add_suppression("mysqld: file-key-management-filename is not set");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error.");
+call mtr.add_suppression("Plugin 'file_key_management' registration as a ENCRYPTION failed.");
+flush tables;
+
+create table t1(a int not null primary key, b char(200)) engine=innodb;
+
+--echo
+--echo # Restart server with encryption
+-- let $restart_parameters=--plugin-load-add=$FILE_KEY_MANAGEMENT_SO --loose-file-key-management --loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt --file-key-management-encryption-algorithm=aes_cbc --innodb-encrypt-tables=ON --innodb-encryption-threads=4 --innodb-tablespaces-encryption --innodb-encryption-rotate-key-age=15
+-- source include/restart_mysqld.inc
+
+--echo # Wait until encryption threads have encrypted all tablespaces
+
+--let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'`
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND ROTATING_OR_FLUSHING = 0;
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+
+--echo # Success!
+
+SELECT * from t1;
+
+--echo # Now turn off encryption and wait for threads to decrypt all tablespaces
+SET GLOBAL innodb_encrypt_tables = off;
+
+--let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND ROTATING_OR_FLUSHING = 0;
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+
+--echo # Success!
+
+--echo
+--echo # Restart server with no encryption setup, there should be no crashes
+--let $restart_parameters=--skip-file-key-management --innodb-encrypt-tables=OFF --innodb-encryption-threads=0 --innodb-tablespaces-encryption
+-- source include/restart_mysqld.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+
+SELECT * from t1;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index 29673ce5884..ec8d0c4de25 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -9,51 +9,30 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-galera_gra_log : MDEV-13549 Galera test failures
-galera_flush : MDEV-13549 Galera test failures
+
+galera_flush : MariaDB does not have global.thread_statistics
galera_account_management : MariaDB 10.0 does not support ALTER USER
-galera_binlog_row_image : MariaDB 10.0 does not support binlog_row_image
galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events
-GAL-419 : MDEV-13549 Galera test failures
-galera_toi_ddl_fk_insert : MDEV-13549 Galera test failures
-galera_var_notify_cmd : MDEV-13549 Galera test failures
-mysql-wsrep#90 : MDEV-13549 Galera test failures
+galera_migrate : MariaDB does not support START SLAVE USER
galera_as_master_gtid : Requires MySQL GTID
galera_as_master_gtid_change_master : Requires MySQL GTID
-galera_as_slave_replication_bundle : MDEV-13549 Galera test failures
galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB
-galera_gcs_fragment : MDEV-13549 Galera test failures
+GAL-419 : MDEV-13549 Galera test failures
+galera_var_notify_cmd : MDEV-13549 Galera test failures
+galera_as_slave_replication_bundle : MDEV-13549 Galera test failures
galera_gcache_recover : MDEV-13549 Galera test failures
galera_gcache_recover_full_gcache : MDEV-13549 Galera test failures
galera_gcache_recover_manytrx : MDEV-13549 Galera test failures
galera_ist_mysqldump : MDEV-13549 Galera test failures
-mysql-wsrep#31 : MDEV-13549 Galera test failures
-galera_migrate : MariaDB 10.0 does not support START SLAVE USER
-galera_wsrep_desync_wsrep_on : MDEV-13549 Galera test failures
galera_ssl_upgrade : MDEV-13549 Galera test failures
-mysql-wsrep#33 : MDEV-13549 Galera test failures
-galera_var_auto_inc_control_on : MDEV-13549 Galera test failures
-MW-44 : MDEV-13549 Galera test failures
-galera_var_retry_autocommit : MDEV-13549 Galera test failures
-pxc-421 : MDEV-13549 Galera test failures
-lp1376747-2 : MDEV-13549 Galera test failures
-lp1376747 : MDEV-13549 Galera test failures
-galera_toi_ddl_nonconflicting : MDEV-13549 Galera test failures
-galera_parallel_simple : MDEV-13549 Galera test failures
-galera_admin : MDEV-13549 Galera test failures
-galera_as_master: MDEV-13549 Galera test failures 10.1
-galera_pc_ignore_sb : MDEV-13549 Galera test failures 10.1
-galera_lock_table : MDEV-13549 Galera test failures 10.1
-MW-284 : MDEV-13549 Galera test failures 10.1
-galera_as_slave : MDEV-13549 Galera test failures 10.1
+galera.MW-329 : wsrep_local_replays not stable
+galera.MW-328A : have_deadlocks test not stable
+galera_var_retry_autocommit: MDEV-15794 Test failure on galera.galera_var_retry_autocommit
+galera_var_auto_inc_control_on: MDEV-15803 Test failure on galera.galera_var_auto_inc_control_on
+pxc-421 : MDEV-15804 Test failure on galera.pxc-421
+query_cache : MDEV-15805 Test failure on galera.query_cache
+galera.galera_gra_log : MDEV-15808 Test failure on galera.galera_gra_log
+galera.MW-44 : MDEV-15809 Test failure on galera.MW-44
+galera.galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb
galera_kill_applier : race condition at the start of the test
-MW-328C: MDEV-13549 Galera test failures 10.1
-MW-328A: MDEV-13549 Galera test failures 10.1
-MW-328B: MDEV-13549 Galera test failures 10.1
-MW-328: MDEV-13549 Galera test failures 10.1
-galera_suspend_slave: MDEV-13549 Galera test failures 10.1
galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status
-galera_gtid : MDEV-13549 Galera test failures 10.1
-galera_gtid_slave : MDEV-13549 Galera test failures 10.1
-galera_unicode_identifiers : MDEV-13549 Galera test failures 10.1
-galera.galera_gcs_fc_limit : MDEV-13549 Galera test failures 10.1
diff --git a/mysql-test/suite/galera/include/kill_galera.inc b/mysql-test/suite/galera/include/kill_galera.inc
index c61bad8e19d..d7f665df6c7 100644
--- a/mysql-test/suite/galera/include/kill_galera.inc
+++ b/mysql-test/suite/galera/include/kill_galera.inc
@@ -1,7 +1,6 @@
--echo Killing server ...
# Write file to make mysql-test-run.pl expect the crash, but don't start it
---source include/wait_until_connected_again.inc
--let $_server_id= `SELECT @@server_id`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--exec echo "wait" > $_expect_file_name
diff --git a/mysql-test/suite/galera/r/MW-284.result b/mysql-test/suite/galera/r/MW-284.result
index bfb1301f7bd..0f6c0be25fe 100644
--- a/mysql-test/suite/galera/r/MW-284.result
+++ b/mysql-test/suite/galera/r/MW-284.result
@@ -23,3 +23,8 @@ STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('failed registering on master');
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
+connection node_1;
+RESET MASTER;
+CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
+connection node_2;
+CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
diff --git a/mysql-test/suite/galera/r/MW-44.result b/mysql-test/suite/galera/r/MW-44.result
index c007779bc79..7ae34440f7a 100644
--- a/mysql-test/suite/galera/r/MW-44.result
+++ b/mysql-test/suite/galera/r/MW-44.result
@@ -1,8 +1,18 @@
+SET @@global.wsrep_replicate_myisam=OFF;
connection node_1;
TRUNCATE TABLE mysql.general_log;
+SELECT COUNT(*) from mysql.general_log;
+COUNT(*)
+1
connection node_2;
TRUNCATE TABLE mysql.general_log;
+SELECT COUNT(*) from mysql.general_log;
+COUNT(*)
+1
connection node_1;
+SELECT COUNT(*) from mysql.general_log;
+COUNT(*)
+1
SET SESSION wsrep_osu_method=TOI;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_osu_method=RSU;
@@ -16,3 +26,4 @@ SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
COUNT(*) = 0
1
DROP TABLE t1;
+SET @@global.wsrep_replicate_myisam=Default;
diff --git a/mysql-test/suite/galera/r/galera_as_master.result b/mysql-test/suite/galera/r/galera_as_master.result
index 9d1262724d2..2a7262359fa 100644
--- a/mysql-test/suite/galera/r/galera_as_master.result
+++ b/mysql-test/suite/galera/r/galera_as_master.result
@@ -53,3 +53,5 @@ connection node_3;
STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
+connection node_1;
+RESET MASTER;
diff --git a/mysql-test/suite/galera/r/galera_binlog_row_image.result b/mysql-test/suite/galera/r/galera_binlog_row_image.result
index a1f0fb455f3..d54db61105e 100644
--- a/mysql-test/suite/galera/r/galera_binlog_row_image.result
+++ b/mysql-test/suite/galera/r/galera_binlog_row_image.result
@@ -1,3 +1,4 @@
+connection node_1;
SET SESSION binlog_row_image=minimal;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (f1 INTEGER NOT NULL UNIQUE) ENGINE=InnoDB;
@@ -5,6 +6,7 @@ CREATE TABLE t3 (f1 VARCHAR(1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t3 VALUES (1);
+connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1;
COUNT(*) = 1
1
@@ -14,9 +16,11 @@ COUNT(*) = 1
SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 1;
COUNT(*) = 1
1
+connection node_1;
UPDATE t1 SET f1 = 2 WHERE f1 = 1;
UPDATE t2 SET f1 = 2 WHERE f1 = 1;
UPDATE t3 SET f1 = 2 WHERE f1 = 1;
+connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
COUNT(*) = 1
1
@@ -26,9 +30,11 @@ COUNT(*) = 1
SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 2;
COUNT(*) = 1
1
+connection node_1;
DELETE FROM t1;
DELETE FROM t2;
DELETE FROM t3;
+connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
@@ -41,34 +47,42 @@ COUNT(*) = 0
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection node_1;
SET SESSION binlog_row_image=noblob;
CREATE TABLE t1 (f1 BLOB, f2 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('abc', 1);
INSERT INTO t2 VALUES ('abc');
+connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'abc';
COUNT(*) = 1
1
SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'abc';
COUNT(*) = 1
1
+connection node_1;
UPDATE t1 SET f1 = 'xyz';
UPDATE t2 SET f1 = 'xyz';
+connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz';
COUNT(*) = 1
1
SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'xyz';
COUNT(*) = 1
1
+connection node_1;
UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 2;
COUNT(*) = 1
1
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz';
COUNT(*) = 1
1
+connection node_1;
DELETE FROM t1;
DELETE FROM t2;
+connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
diff --git a/mysql-test/suite/galera/r/galera_gra_log.result b/mysql-test/suite/galera/r/galera_gra_log.result
index 9f5cbdd75fc..e45882db523 100644
--- a/mysql-test/suite/galera/r/galera_gra_log.result
+++ b/mysql-test/suite/galera/r/galera_gra_log.result
@@ -1,6 +1,9 @@
+connection node_2;
SET SESSION wsrep_on=OFF;
CREATE TABLE t1 (f1 INTEGER);
+connection node_1;
CREATE TABLE t1 (f1 INTEGER);
+connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
@@ -8,22 +11,13 @@ COUNT(*) = 0
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-# at 4
-<ISO TIMESTAMP> server id 2 end_log_pos 120 Start: binlog v 4, server v 5.6.24-debug-log created 150804 11:37:14 at startup
-# Warning: this binlog is either in use or was not closed properly.
ROLLBACK/*!*/;
-BINLOG '
-unnAVQ8CAAAAdAAAAHgAAAABAAQANS42LjI0LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAC6ecBVEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAAKNu
-Jfk=
-'/*!*/;
-# at 120
-<ISO TIMESTAMP> server id 1 end_log_pos 91 Query thread_id=<QUERY_THREAD_ID> exec_time=0 error_code=0
+ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=<TIMESTAMP>/*!*/;
SET @@session.pseudo_thread_id=<PSEUDO_THREAD_ID>/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
-SET @@session.sql_mode=1073741824/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
+SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
diff --git a/mysql-test/suite/galera/r/galera_gtid_slave.result b/mysql-test/suite/galera/r/galera_gtid_slave.result
index 0b6306bdc6a..f8ca6322d22 100644
--- a/mysql-test/suite/galera/r/galera_gtid_slave.result
+++ b/mysql-test/suite/galera/r/galera_gtid_slave.result
@@ -25,7 +25,6 @@ SELECT @@global.gtid_binlog_state;
1-1-4,2-2-2,2-3-3
connection node_1;
DROP TABLE t1,t2;
-reset master;
connection node_2;
connection node_3;
connection node_2;
@@ -34,3 +33,5 @@ RESET SLAVE ALL;
reset master;
connection node_3;
reset master;
+connection node_1;
+reset master;
diff --git a/mysql-test/suite/galera/r/galera_lock_table.result b/mysql-test/suite/galera/r/galera_lock_table.result
index c15f61d298e..ce529deb22c 100644
--- a/mysql-test/suite/galera/r/galera_lock_table.result
+++ b/mysql-test/suite/galera/r/galera_lock_table.result
@@ -1,6 +1,10 @@
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+NAME
+test/t1
+test/t2
LOCK TABLE t1 READ;
connection node_1;
INSERT INTO t1 VALUES (1);
diff --git a/mysql-test/suite/galera/r/galera_parallel_simple.result b/mysql-test/suite/galera/r/galera_parallel_simple.result
index 3b10815c63d..3f657a0479e 100644
--- a/mysql-test/suite/galera/r/galera_parallel_simple.result
+++ b/mysql-test/suite/galera/r/galera_parallel_simple.result
@@ -1,7 +1,13 @@
CREATE TABLE t1 (id INT) ENGINE=InnoDB;
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
+connection node_2;
SET GLOBAL wsrep_slave_threads = 2;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+NAME
+test/t1
+test/t2
LOCK TABLE t1 WRITE;
+connection node_1;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
@@ -14,6 +20,7 @@ INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
+connection node_2;
SET SESSION wsrep_sync_wait = 0;
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = 15;
diff --git a/mysql-test/suite/galera/r/galera_suspend_slave.result b/mysql-test/suite/galera/r/galera_suspend_slave.result
index 384d91f1d49..3b950e82e33 100644
--- a/mysql-test/suite/galera/r/galera_suspend_slave.result
+++ b/mysql-test/suite/galera/r/galera_suspend_slave.result
@@ -6,13 +6,13 @@ connection node_2;
disconnect node_2;
connection node_1;
Suspending node_2 ...
+SET SESSION wsrep_sync_wait = 0;
INSERT INTO t1 VALUES (1);
Got one of the listed errors
Resuming node_2 ...
-SET SESSION wsrep_sync_wait = 1;
INSERT INTO t1 VALUES (1);
connection node_2a;
-SET SESSION wsrep_sync_wait = 1;
+SET SESSION wsrep_sync_wait = 0;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result b/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result
index 81781fbeae7..1726bb6445f 100644
--- a/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result
+++ b/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result
@@ -9,7 +9,7 @@ CREATE TABLE child (
id INT PRIMARY KEY AUTO_INCREMENT,
parent_id INT
) ENGINE=InnoDB;
-INSERT INTO parent VALUES (DEFAULT, 0);
+INSERT INTO parent VALUES (1, 0);
INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
INSERT INTO parent (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
INSERT INTO parent (f2) SELECT 2 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
diff --git a/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result b/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result
index c1bb065975b..0cbba2fa124 100644
--- a/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result
+++ b/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result
@@ -1,4 +1,10 @@
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE
+2
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
+VARIABLE_VALUE
+0
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size')
1
@@ -7,6 +13,12 @@ SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_
1
INSERT INTO t1 VALUES (DEFAULT, 'node1');;
INSERT INTO t1 VALUES (DEFAULT, 'node2');;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE
+2
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
+VARIABLE_VALUE
+1
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size')
1
diff --git a/mysql-test/suite/galera/r/galera_var_slave_threads.result b/mysql-test/suite/galera/r/galera_var_slave_threads.result
index 79fe64f2783..3f0a63ab9d7 100644
--- a/mysql-test/suite/galera/r/galera_var_slave_threads.result
+++ b/mysql-test/suite/galera/r/galera_var_slave_threads.result
@@ -110,6 +110,8 @@ INSERT INTO t1 VALUES (DEFAULT);
INSERT INTO t1 VALUES (DEFAULT);
DROP TABLE t1;
connection node_2;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+NAME
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
COUNT(*) = 1
1
diff --git a/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result b/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result
index 5324d1c11dd..99c680c7b12 100644
--- a/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result
+++ b/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result
@@ -4,6 +4,9 @@ INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
connection node_2;
+SELECT COUNT(*) = 100000 FROM t1;
+COUNT(*) = 100000
+1
SET GLOBAL wsrep_desync = TRUE;
SET SESSION wsrep_on = FALSE;
ALTER TABLE t1 ADD PRIMARY KEY (f1);
diff --git a/mysql-test/suite/galera/r/lp1376747-2.result b/mysql-test/suite/galera/r/lp1376747-2.result
index dba3eb45af5..b85e130f4f4 100644
--- a/mysql-test/suite/galera/r/lp1376747-2.result
+++ b/mysql-test/suite/galera/r/lp1376747-2.result
@@ -1,6 +1,9 @@
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+NAME
+test/t1
FLUSH TABLES t1 FOR EXPORT;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
diff --git a/mysql-test/suite/galera/r/lp1376747.result b/mysql-test/suite/galera/r/lp1376747.result
index 4858835c83f..16d4fa3fc52 100644
--- a/mysql-test/suite/galera/r/lp1376747.result
+++ b/mysql-test/suite/galera/r/lp1376747.result
@@ -1,6 +1,9 @@
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+NAME
+test/t1
FLUSH TABLES t1 WITH READ LOCK;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#33.result b/mysql-test/suite/galera/r/mysql-wsrep#33.result
index 1c4bbc3f369..fc3db249c25 100644
--- a/mysql-test/suite/galera/r/mysql-wsrep#33.result
+++ b/mysql-test/suite/galera/r/mysql-wsrep#33.result
@@ -1,4 +1,6 @@
Setting SST method to mysqldump ...
+call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to '127.0.0.1'");
+call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos");
CREATE USER 'sst';
GRANT ALL PRIVILEGES ON *.* TO 'sst';
SET GLOBAL wsrep_sst_auth = 'sst:';
@@ -98,5 +100,4 @@ CALL mtr.add_suppression("Can't open and lock time zone table");
CALL mtr.add_suppression("Can't open and lock privilege tables");
CALL mtr.add_suppression("Info table is not ready to be used");
CALL mtr.add_suppression("Native table .* has the wrong structure");
-SET GLOBAL general_log = ON;
-SET GLOBAL slow_query_log = ON;
+Restarting server ...
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#90.result b/mysql-test/suite/galera/r/mysql-wsrep#90.result
index da57b9d0068..0b8f55e6219 100644
--- a/mysql-test/suite/galera/r/mysql-wsrep#90.result
+++ b/mysql-test/suite/galera/r/mysql-wsrep#90.result
@@ -1,31 +1,44 @@
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+connection node_1;
SET GLOBAL wsrep_OSU_method = "RSU";
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_OSU_method = "TOI";
SET DEBUG_SYNC= 'now SIGNAL continue';
+connection node_1;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
+connection node_2;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
+connection node_1;
DROP TABLE t1;
+SET DEBUG_SYNC = 'RESET';
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+connection node_1;
SET GLOBAL wsrep_OSU_method = "TOI";
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_OSU_method = "RSU";
SET DEBUG_SYNC= 'now SIGNAL continue';
+connection node_1;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
INSERT INTO t1 VALUES (1,2);
+connection node_2;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
INSERT INTO t1 VALUES (3,4);
+connection node_1;
DROP TABLE t1;
SET GLOBAL WSREP_OSU_METHOD = TOI;
+SET DEBUG_SYNC = 'RESET';
diff --git a/mysql-test/suite/galera/r/pxc-421.result b/mysql-test/suite/galera/r/pxc-421.result
index 38bf64f20c5..d60c7c4540e 100644
--- a/mysql-test/suite/galera/r/pxc-421.result
+++ b/mysql-test/suite/galera/r/pxc-421.result
@@ -1,4 +1,6 @@
connection node_1;
+connection node_2;
+connection node_1;
set GLOBAL wsrep_slave_threads=26;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
@@ -32,7 +34,6 @@ SET GLOBAL wsrep_slave_threads = 1;
SELECT COUNT(*) FROM t1;
COUNT(*)
16
-SET GLOBAL auto_increment_offset = 2;
connection node_1;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -42,4 +43,3 @@ Variable_name Value
wsrep_slave_threads 12
SET GLOBAL wsrep_slave_threads = 1;
DROP TABLE t1;
-SET GLOBAL auto_increment_offset = 1;
diff --git a/mysql-test/suite/galera/t/MW-284.test b/mysql-test/suite/galera/t/MW-284.test
index 7add82f1227..5e17baa1bdb 100644
--- a/mysql-test/suite/galera/t/MW-284.test
+++ b/mysql-test/suite/galera/t/MW-284.test
@@ -24,7 +24,6 @@ SET global wsrep_sync_wait=0;
--connection node_3
START SLAVE;
---sleep 1
--let $slave_param= Slave_IO_Running
--let $slave_param_value= Connecting
--source include/wait_for_slave_param.inc
@@ -38,6 +37,7 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
--source include/wait_for_slave_to_start.inc
--connection node_1
+--source include/galera_wait_ready.inc
INSERT INTO t1 VALUES (1);
--connection node_3
@@ -61,3 +61,10 @@ RESET SLAVE ALL;
CALL mtr.add_suppression('failed registering on master');
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
+
+--connection node_1
+RESET MASTER;
+CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
+
+--connection node_2
+CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member'); \ No newline at end of file
diff --git a/mysql-test/suite/galera/t/MW-44.test b/mysql-test/suite/galera/t/MW-44.test
index 133676b9141..2b27e69893c 100644
--- a/mysql-test/suite/galera/t/MW-44.test
+++ b/mysql-test/suite/galera/t/MW-44.test
@@ -5,15 +5,19 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+SET @@global.wsrep_replicate_myisam=OFF;
--connection node_1
TRUNCATE TABLE mysql.general_log;
+SELECT COUNT(*) from mysql.general_log;
--sleep 1
--connection node_2
TRUNCATE TABLE mysql.general_log;
+SELECT COUNT(*) from mysql.general_log;
--sleep 1
--connection node_1
+SELECT COUNT(*) from mysql.general_log;
SET SESSION wsrep_osu_method=TOI;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_osu_method=RSU;
@@ -25,3 +29,4 @@ SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argu
--connection node_2
SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
DROP TABLE t1;
+SET @@global.wsrep_replicate_myisam=Default;
diff --git a/mysql-test/suite/galera/t/galera_as_master.test b/mysql-test/suite/galera/t/galera_as_master.test
index a56fb6dc976..49f3c993256 100644
--- a/mysql-test/suite/galera/t/galera_as_master.test
+++ b/mysql-test/suite/galera/t/galera_as_master.test
@@ -27,7 +27,6 @@ CREATE TABLE test.t3 AS SELECT * from t1;
SET SQL_LOG_BIN=ON;
INSERT INTO t1 VALUES(3);
CREATE TABLE test.t4 AS SELECT * from t1;
---save_master_pos
--connection node_2
SELECT * FROM t1;
@@ -36,7 +35,12 @@ SELECT * FROM t3;
SELECT * FROM t4;
--connection node_3
---sync_with_master
+--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 3 FROM t4;
+--source include/wait_condition.inc
+
SHOW TABLES;
SELECT * FROM t1;
@@ -45,15 +49,19 @@ SELECT * FROM t4;
--echo # Cleanup
--connection node_1
DROP TABLE t1, t4;
---save_master_pos
SET SQL_LOG_BIN=OFF;
DROP TABLE t2, t3;
--connection node_3
---sync_with_master
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't4';
+--source include/wait_condition.inc
STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
+--connection node_1
+RESET MASTER;
diff --git a/mysql-test/suite/galera/t/galera_gcs_fragment.test b/mysql-test/suite/galera/t/galera_gcs_fragment.test
index ae1e0d8bab0..0436e312f6e 100644
--- a/mysql-test/suite/galera/t/galera_gcs_fragment.test
+++ b/mysql-test/suite/galera/t/galera_gcs_fragment.test
@@ -1,6 +1,7 @@
# Test fragmentation over configuration changes
--source include/galera_cluster.inc
--source include/have_innodb.inc
+--source suite/galera/include/galera_have_debug_sync.inc
# Prepare table
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
diff --git a/mysql-test/suite/galera/t/galera_gra_log.test b/mysql-test/suite/galera/t/galera_gra_log.test
index 5329dc24546..adb37de9188 100644
--- a/mysql-test/suite/galera/t/galera_gra_log.test
+++ b/mysql-test/suite/galera/t/galera_gra_log.test
@@ -19,17 +19,10 @@ CREATE TABLE t1 (f1 INTEGER);
--connection node_2
SELECT COUNT(*) = 0 FROM t1;
-# Compose a valid binlog from a header file and the GRA file
+# Make sure the GRA file produced is readable and contains the failure
---let $gra_binlog_file = $MYSQLTEST_VARDIR/tmp/gra.log
---exec rm -rf $gra_binlog_file
-
---exec cp std_data/binlog-header.log $gra_binlog_file
---exec cat $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log >> $gra_binlog_file
-
-# Make sure the binlog thus produced is readable and contains the failure
---replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=<TIMESTAMP>/ /#[0-9]+ +[0-9]+:[0-9]+:[0-9]+/<ISO TIMESTAMP>/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=<PSEUDO_THREAD_ID>/ /thread_id=[0-9]+/thread_id=<QUERY_THREAD_ID>/
---exec $MYSQL_BINLOG $gra_binlog_file
+--replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=<TIMESTAMP>/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=<PSEUDO_THREAD_ID>/
+--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log
SET SESSION wsrep_on=ON;
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave.test b/mysql-test/suite/galera/t/galera_gtid_slave.test
index 8ef87452a5b..19bfd8e17db 100644
--- a/mysql-test/suite/galera/t/galera_gtid_slave.test
+++ b/mysql-test/suite/galera/t/galera_gtid_slave.test
@@ -38,7 +38,13 @@ SELECT @@global.gtid_binlog_state;
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
---sleep 1
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 2 FROM t2;
+--source include/wait_condition.inc
+
INSERT INTO t1 VALUES(2);
INSERT INTO t1 VALUES(3);
SELECT @@global.gtid_binlog_state;
@@ -52,14 +58,6 @@ SELECT @@global.gtid_binlog_state;
--connection node_1
DROP TABLE t1,t2;
-reset master;
-#
-# Unfortunately without the sleep below the following statement fails with "query returned no rows", which
-# is difficult to understand given that it is an aggregate query. A "query execution was interrupted"
-# warning is also reported by MTR, which is also weird.
-#
-
---sleep 1
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
@@ -76,3 +74,6 @@ reset master;
--connection node_3
reset master;
+
+--connection node_1
+reset master;
diff --git a/mysql-test/suite/galera/t/galera_lock_table.test b/mysql-test/suite/galera/t/galera_lock_table.test
index 0bcaf646917..3e365036405 100644
--- a/mysql-test/suite/galera/t/galera_lock_table.test
+++ b/mysql-test/suite/galera/t/galera_lock_table.test
@@ -14,6 +14,13 @@ CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
--sleep 1
--connection node_2
+
+# Wait until above DDL's are replicated
+--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+
LOCK TABLE t1 READ;
--connection node_1
diff --git a/mysql-test/suite/galera/t/galera_parallel_simple.test b/mysql-test/suite/galera/t/galera_parallel_simple.test
index 41cd0c8e6fa..2cd840123cf 100644
--- a/mysql-test/suite/galera/t/galera_parallel_simple.test
+++ b/mysql-test/suite/galera/t/galera_parallel_simple.test
@@ -13,6 +13,13 @@ CREATE TABLE t2 (id INT) ENGINE=InnoDB;
--connection node_2
SET GLOBAL wsrep_slave_threads = 2;
+
+# Wait until above DDL's are replicated
+--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+
LOCK TABLE t1 WRITE;
--connection node_1
diff --git a/mysql-test/suite/galera/t/galera_suspend_slave.test b/mysql-test/suite/galera/t/galera_suspend_slave.test
index aa4543cf81c..6f0f8014397 100644
--- a/mysql-test/suite/galera/t/galera_suspend_slave.test
+++ b/mysql-test/suite/galera/t/galera_suspend_slave.test
@@ -29,6 +29,11 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
exit(0);
EOF
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
--error ER_UNKNOWN_COM_ERROR,ER_LOCK_WAIT_TIMEOUT,ER_LOCK_DEADLOCK,ER_ERROR_DURING_COMMIT
INSERT INTO t1 VALUES (1);
@@ -41,8 +46,6 @@ INSERT INTO t1 VALUES (1);
exit(0);
EOF
-SET SESSION wsrep_sync_wait = 1;
---sleep 10
--source include/wait_until_ready.inc
INSERT INTO t1 VALUES (1);
@@ -51,7 +54,7 @@ INSERT INTO t1 VALUES (1);
--source include/galera_connect.inc
--connection node_2a
-SET SESSION wsrep_sync_wait = 1;
+SET SESSION wsrep_sync_wait = 0;
--source include/wait_until_ready.inc
SELECT COUNT(*) = 1 FROM t1;
diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test b/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test
index 1f446938775..9f161afc52e 100644
--- a/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test
+++ b/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test
@@ -20,7 +20,7 @@ CREATE TABLE child (
parent_id INT
) ENGINE=InnoDB;
-INSERT INTO parent VALUES (DEFAULT, 0);
+INSERT INTO parent VALUES (1, 0);
--connection node_2
--send INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test b/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test
index 821f7a6eb2c..dbd2510cba3 100644
--- a/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test
+++ b/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test
@@ -17,12 +17,23 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
--reap
INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 234);
+--let $wait_condition = SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 2 FROM t1;
--connection node_1
--reap
+
+--let $wait_condition = SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 2 FROM t1;
diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt
new file mode 100644
index 00000000000..0a03610888c
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt
@@ -0,0 +1 @@
+--wsrep-auto-increment-control=ON
diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test
index d65a35be4d1..6abaecb144b 100644
--- a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test
+++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test
@@ -5,6 +5,11 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
--connection node_1
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
@@ -12,6 +17,8 @@ CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE
# auto_increment_increment is equal to the number of nodes
# auto_increment_offset is equal to the ID of the node
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
@@ -27,6 +34,8 @@ SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_
--connection node_2
--reap
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
diff --git a/mysql-test/suite/galera/t/galera_var_slave_threads.test b/mysql-test/suite/galera/t/galera_var_slave_threads.test
index 3896b1d48cf..e5986f7ee12 100644
--- a/mysql-test/suite/galera/t/galera_var_slave_threads.test
+++ b/mysql-test/suite/galera/t/galera_var_slave_threads.test
@@ -86,6 +86,13 @@ INSERT INTO t1 VALUES (DEFAULT);
DROP TABLE t1;
--connection node_2
+
+# Wait until above DDL is replicated
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+
#
# make sure that we are left with exactly one applier thread before we leaving the test
#
diff --git a/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test b/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test
index 3c7988a4924..ecf255f59c3 100644
--- a/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test
+++ b/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test
@@ -17,6 +17,8 @@ CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
--connection node_2
+SELECT COUNT(*) = 100000 FROM t1;
+
SET GLOBAL wsrep_desync = TRUE;
SET SESSION wsrep_on = FALSE;
diff --git a/mysql-test/suite/galera/t/lp1376747-2.test b/mysql-test/suite/galera/t/lp1376747-2.test
index 360681d7674..c570dd7d143 100644
--- a/mysql-test/suite/galera/t/lp1376747-2.test
+++ b/mysql-test/suite/galera/t/lp1376747-2.test
@@ -5,6 +5,13 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
+
+# Wait until above DDL's are replicated
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+
FLUSH TABLES t1 FOR EXPORT;
--connection node_1
diff --git a/mysql-test/suite/galera/t/lp1376747.test b/mysql-test/suite/galera/t/lp1376747.test
index 769bb665c77..7daa544686f 100644
--- a/mysql-test/suite/galera/t/lp1376747.test
+++ b/mysql-test/suite/galera/t/lp1376747.test
@@ -5,6 +5,13 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
+
+# Wait until above DDL's are replicated
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+--source include/wait_condition.inc
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
+
FLUSH TABLES t1 WITH READ LOCK;
--connection node_1
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#33.test b/mysql-test/suite/galera/t/mysql-wsrep#33.test
index acc7c735849..351e457f165 100644
--- a/mysql-test/suite/galera/t/mysql-wsrep#33.test
+++ b/mysql-test/suite/galera/t/mysql-wsrep#33.test
@@ -3,6 +3,9 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+--let $node_1=node_1
+--let $node_2=node_2
+--source suite/galera/include/auto_increment_offset_save.inc
--source suite/galera/include/galera_sst_set_mysqldump.inc
--source suite/galera/include/galera_st_disconnect_slave.inc
@@ -10,9 +13,8 @@
--source suite/galera/include/galera_sst_restore.inc
--connection node_2
-# We have to manually restore global_log and slow_query_log due to mysql-wsrep#108
-# Otherwise MTR's check_testcases complains
-SET GLOBAL general_log = ON;
-SET GLOBAL slow_query_log = ON;
+--echo Restarting server ...
+--source include/restart_mysqld.inc
+--source suite/galera/include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#90.test b/mysql-test/suite/galera/t/mysql-wsrep#90.test
index 5af86fb2872..11ef6416526 100644
--- a/mysql-test/suite/galera/t/mysql-wsrep#90.test
+++ b/mysql-test/suite/galera/t/mysql-wsrep#90.test
@@ -31,6 +31,7 @@ SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
--connection node_1
DROP TABLE t1;
+SET DEBUG_SYNC = 'RESET';
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
@@ -63,3 +64,4 @@ INSERT INTO t1 VALUES (3,4);
DROP TABLE t1;
SET GLOBAL WSREP_OSU_METHOD = TOI;
+SET DEBUG_SYNC = 'RESET';
diff --git a/mysql-test/suite/galera/t/pxc-421.test b/mysql-test/suite/galera/t/pxc-421.test
index 381f9bb4494..7bb2354853b 100644
--- a/mysql-test/suite/galera/t/pxc-421.test
+++ b/mysql-test/suite/galera/t/pxc-421.test
@@ -6,6 +6,11 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
--connection node_1
--let $wsrep_slave_1 = `SELECT @@wsrep_slave_threads`
set GLOBAL wsrep_slave_threads=26;
@@ -54,12 +59,11 @@ show global variables like 'wsrep_slave_threads';
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_2
SELECT COUNT(*) FROM t1;
-SET GLOBAL auto_increment_offset = 2;
-
--connection node_1
SELECT COUNT(*) FROM t1;
show global variables like 'wsrep_slave_threads';
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_1
DROP TABLE t1;
-SET GLOBAL auto_increment_offset = 1;
+--source include/auto_increment_offset_restore.inc
+
diff --git a/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
index c118b7481bc..d69881aa5eb 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
@@ -9,16 +9,12 @@
--connection node_1
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
-
---source include/wait_until_connected_again.inc
--source include/galera_suspend.inc
--sleep 10
--connection node_2
# Do not wait for causality as we are no longer in the primary component
SET SESSION wsrep_sync_wait=0;
---source include/wait_until_connected_again.inc
-
SET SESSION wsrep_on=OFF;
--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'
--source include/wait_condition.inc
@@ -39,7 +35,6 @@ SHOW STATUS LIKE 'wsrep_local_state_comment';
--source include/galera_connect.inc
--connection node_3
SET SESSION wsrep_sync_wait=0;
---source include/wait_until_connected_again.inc
SHOW STATUS LIKE 'wsrep_cluster_size';
SHOW STATUS LIKE 'wsrep_cluster_status';
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
index f294b441411..7b852609f58 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
@@ -561,8 +561,15 @@ disconnect con4a;
disconnect con4b;
disconnect con4c;
set global max_user_connections = 0;
-set global max_connections = 3;
+set global max_connections = 10;
flush user_resources;
+connect tmp_con1,localhost,root,,;
+connect tmp_con2,localhost,root,,;
+connect tmp_con3,localhost,root,,;
+connect tmp_con4,localhost,root,,;
+connect tmp_con5,localhost,root,,;
+connect tmp_con6,localhost,root,,;
+connect tmp_con7,localhost,root,,;
connect con5a,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con4a is alive";
Con4a is alive
@@ -697,6 +704,13 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
disconnect con5a;
disconnect con5b;
+disconnect tmp_con1;
+disconnect tmp_con2;
+disconnect tmp_con3;
+disconnect tmp_con4;
+disconnect tmp_con5;
+disconnect tmp_con6;
+disconnect tmp_con7;
set global max_connections = @saved_max_connections;
set global max_user_connections = @saved_max_user_connections;
drop user 'quota'@'santa.claus.ipv4.example.com';
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
index d97fe0a82ff..ef807bebc9e 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
@@ -561,8 +561,15 @@ disconnect con4a;
disconnect con4b;
disconnect con4c;
set global max_user_connections = 0;
-set global max_connections = 3;
+set global max_connections = 10;
flush user_resources;
+connect tmp_con1,localhost,root,,;
+connect tmp_con2,localhost,root,,;
+connect tmp_con3,localhost,root,,;
+connect tmp_con4,localhost,root,,;
+connect tmp_con5,localhost,root,,;
+connect tmp_con6,localhost,root,,;
+connect tmp_con7,localhost,root,,;
connect con5a,"::1",quota,,test,$MASTER_MYPORT,;
select "Con4a is alive";
Con4a is alive
@@ -697,6 +704,13 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
disconnect con5a;
disconnect con5b;
+disconnect tmp_con1;
+disconnect tmp_con2;
+disconnect tmp_con3;
+disconnect tmp_con4;
+disconnect tmp_con5;
+disconnect tmp_con6;
+disconnect tmp_con7;
set global max_connections = @saved_max_connections;
set global max_user_connections = @saved_max_user_connections;
drop user 'quota'@'santa.claus.ipv6.example.com';
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test
index 3bf5ef3b68d..a76e04ea35e 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test
@@ -176,9 +176,17 @@ disconnect con4c;
--source ../include/wait_for_pfs_thread_count.inc
set global max_user_connections = 0;
-set global max_connections = 3;
+set global max_connections = 10;
flush user_resources;
+connect (tmp_con1,localhost,root,,);
+connect (tmp_con2,localhost,root,,);
+connect (tmp_con3,localhost,root,,);
+connect (tmp_con4,localhost,root,,);
+connect (tmp_con5,localhost,root,,);
+connect (tmp_con6,localhost,root,,);
+connect (tmp_con7,localhost,root,,);
+
connect (con5a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
select "Con4a is alive";
select current_user();
@@ -233,6 +241,13 @@ connect (con5d,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
disconnect con5a;
disconnect con5b;
+--disconnect tmp_con1
+--disconnect tmp_con2
+--disconnect tmp_con3
+--disconnect tmp_con4
+--disconnect tmp_con5
+--disconnect tmp_con6
+--disconnect tmp_con7
# Wait for all disconnects
--source ../include/wait_for_pfs_thread_count.inc
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
index 0ced79544a3..96a5d10d6e1 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
@@ -177,9 +177,17 @@ disconnect con4c;
--source ../include/wait_for_pfs_thread_count.inc
set global max_user_connections = 0;
-set global max_connections = 3;
+set global max_connections = 10;
flush user_resources;
+connect (tmp_con1,localhost,root,,);
+connect (tmp_con2,localhost,root,,);
+connect (tmp_con3,localhost,root,,);
+connect (tmp_con4,localhost,root,,);
+connect (tmp_con5,localhost,root,,);
+connect (tmp_con6,localhost,root,,);
+connect (tmp_con7,localhost,root,,);
+
connect (con5a,"::1",quota,,test,$MASTER_MYPORT,);
select "Con4a is alive";
select current_user();
@@ -215,6 +223,13 @@ connect (con5d,"::1",quota,,test,$MASTER_MYPORT,);
disconnect con5a;
disconnect con5b;
+--disconnect tmp_con1
+--disconnect tmp_con2
+--disconnect tmp_con3
+--disconnect tmp_con4
+--disconnect tmp_con5
+--disconnect tmp_con6
+--disconnect tmp_con7
# Wait for all disconnects
--source ../include/wait_for_pfs_thread_count.inc
diff --git a/mysql-test/suite/sys_vars/r/host_cache_size_auto.result b/mysql-test/suite/sys_vars/r/host_cache_size_auto.result
index a9a683e017b..a0a849c1d7a 100644
--- a/mysql-test/suite/sys_vars/r/host_cache_size_auto.result
+++ b/mysql-test/suite/sys_vars/r/host_cache_size_auto.result
@@ -1,3 +1,3 @@
select @@global.host_cache_size;
@@global.host_cache_size
-653
+632
diff --git a/mysql-test/suite/sys_vars/r/max_connections_basic.result b/mysql-test/suite/sys_vars/r/max_connections_basic.result
index 708342b016d..f9b2c034400 100644
--- a/mysql-test/suite/sys_vars/r/max_connections_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_connections_basic.result
@@ -27,20 +27,24 @@ SELECT @@global.max_connections;
@@global.max_connections
65536
SET @@global.max_connections = 1;
+Warnings:
+Warning 1292 Truncated incorrect max_connections value: '1'
SELECT @@global.max_connections;
@@global.max_connections
-1
+10
SET @@global.max_connections = 2;
+Warnings:
+Warning 1292 Truncated incorrect max_connections value: '2'
SELECT @@global.max_connections;
@@global.max_connections
-2
+10
'#--------------------FN_DYNVARS_074_04-------------------------#'
SET @@global.max_connections = -1;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '-1'
SELECT @@global.max_connections;
@@global.max_connections
-1
+10
SET @@global.max_connections = 100000000000;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '100000000000'
@@ -57,13 +61,13 @@ Warnings:
Warning 1292 Truncated incorrect max_connections value: '-1024'
SELECT @@global.max_connections;
@@global.max_connections
-1
+10
SET @@global.max_connections = 0;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '0'
SELECT @@global.max_connections;
@@global.max_connections
-1
+10
SET @@global.max_connections = 100001;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '100001'
@@ -98,15 +102,17 @@ WHERE VARIABLE_NAME='max_connections';
1
'#---------------------FN_DYNVARS_074_07----------------------#'
SET @@global.max_connections = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect max_connections value: '1'
SELECT @@global.max_connections;
@@global.max_connections
-1
+10
SET @@global.max_connections = FALSE;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '0'
SELECT @@global.max_connections;
@@global.max_connections
-1
+10
'#---------------------FN_DYNVARS_074_08----------------------#'
SET @@global.max_connections = 5000;
SELECT @@max_connections = @@global.max_connections;
diff --git a/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
index 9419f251930..d3de7707f84 100644
--- a/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
@@ -46,40 +46,40 @@ Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '100000000000'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
-1048576
+4294967295
SET @@global.max_prepared_stmt_count = 10000.01;
ERROR 42000: Incorrect argument type to variable 'max_prepared_stmt_count'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
-1048576
+4294967295
SET @@global.max_prepared_stmt_count = -1024;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1024'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
0
-SET @@global.max_prepared_stmt_count = 1048577;
+SET @@global.max_prepared_stmt_count = 4294967296;
Warnings:
-Warning 1292 Truncated incorrect max_prepared_stmt_count value: '1048577'
+Warning 1292 Truncated incorrect max_prepared_stmt_count value: '4294967296'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
-1048576
-SET @@global.max_prepared_stmt_count = 104857612;
+4294967295
+SET @@global.max_prepared_stmt_count = 4294967295*1024;
Warnings:
-Warning 1292 Truncated incorrect max_prepared_stmt_count value: '104857612'
+Warning 1292 Truncated incorrect max_prepared_stmt_count value: '4398046510080'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
-1048576
+4294967295
SET @@global.max_prepared_stmt_count = ON;
ERROR 42000: Incorrect argument type to variable 'max_prepared_stmt_count'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
-1048576
+4294967295
SET @@global.max_prepared_stmt_count = 'test';
ERROR 42000: Incorrect argument type to variable 'max_prepared_stmt_count'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
-1048576
+4294967295
'#-------------------FN_DYNVARS_081_05----------------------------#'
SET @@session.max_prepared_stmt_count = 4096;
ERROR HY000: Variable 'max_prepared_stmt_count' is a GLOBAL variable and should be set with SET GLOBAL
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 8c05ea96637..f7a5cf591c2 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -1879,7 +1879,7 @@ DEFAULT_VALUE 151
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The number of simultaneous clients allowed
-NUMERIC_MIN_VALUE 1
+NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 100000
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
@@ -2017,10 +2017,10 @@ GLOBAL_VALUE 16382
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16382
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Maximum number of prepared statements in the server
NUMERIC_MIN_VALUE 0
-NUMERIC_MAX_VALUE 1048576
+NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -3917,13 +3917,13 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TABLE_OPEN_CACHE
SESSION_VALUE NULL
-GLOBAL_VALUE 2000
-GLOBAL_VALUE_ORIGIN COMPILE-TIME
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The number of cached open tables
-NUMERIC_MIN_VALUE 1
+NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 1048576
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
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 63cc1fe82f0..034195efbd1 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -2061,7 +2061,7 @@ DEFAULT_VALUE 151
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The number of simultaneous clients allowed
-NUMERIC_MIN_VALUE 1
+NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 100000
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
@@ -2199,10 +2199,10 @@ GLOBAL_VALUE 16382
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16382
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Maximum number of prepared statements in the server
NUMERIC_MIN_VALUE 0
-NUMERIC_MAX_VALUE 1048576
+NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -4701,13 +4701,13 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TABLE_OPEN_CACHE
SESSION_VALUE NULL
-GLOBAL_VALUE 2000
-GLOBAL_VALUE_ORIGIN COMPILE-TIME
+GLOBAL_VALUE 100
+GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The number of cached open tables
-NUMERIC_MIN_VALUE 1
+NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 1048576
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
diff --git a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
index 4c635783753..bc373003e1d 100644
--- a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
+++ b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
@@ -1,7 +1,7 @@
SET @start_value = @@global.table_open_cache ;
SELECT @start_value;
@start_value
-2000
+421
'#--------------------FN_DYNVARS_001_01------------------------#'
SET @@global.table_open_cache = 99;
SET @@global.table_open_cache = DeFAULT;
@@ -15,13 +15,17 @@ SELECT @@global.table_open_cache = 400;
0
'#--------------------FN_DYNVARS_001_03------------------------#'
SET @@global.table_open_cache = 8;
+Warnings:
+Warning 1292 Truncated incorrect table_open_cache value: '8'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-8
+10
SET @@global.table_open_cache = 1;
+Warnings:
+Warning 1292 Truncated incorrect table_open_cache value: '1'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-1
+10
SET @@global.table_open_cache = 1073741824;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '1073741824'
@@ -42,7 +46,7 @@ Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '-1'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-1
+10
SET @@global.table_open_cache = 100000000000;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '100000000000'
@@ -54,13 +58,13 @@ Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '-1024'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-1
+10
SET @@global.table_open_cache = 0;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-1
+10
SET @@global.table_open_cache = 10000.01;
ERROR 42000: Incorrect argument type to variable 'table_open_cache'
SET @@global.table_open_cache = ON;
@@ -78,15 +82,17 @@ SELECT @@global.table_open_cache = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL
1
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.table_open_cache = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect table_open_cache value: '1'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-1
+10
SET @@global.table_open_cache = FALSE;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-1
+10
'#---------------------FN_DYNVARS_001_10----------------------#'
SET @@global.table_open_cache = 10;
SELECT @@table_open_cache = @@global.table_open_cache ;
@@ -104,4 +110,4 @@ ERROR 42S22: Unknown column 'table_open_cache' in 'field list'
SET @@global.table_open_cache = @start_value;
SELECT @@global.table_open_cache ;
@@global.table_open_cache
-2000
+421
diff --git a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
index 5bf5d9c8834..a97256d84a4 100644
--- a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
@@ -92,9 +92,9 @@ SET @@global.max_prepared_stmt_count = 10000.01;
SELECT @@global.max_prepared_stmt_count;
SET @@global.max_prepared_stmt_count = -1024;
SELECT @@global.max_prepared_stmt_count;
-SET @@global.max_prepared_stmt_count = 1048577;
+SET @@global.max_prepared_stmt_count = 4294967296;
SELECT @@global.max_prepared_stmt_count;
-SET @@global.max_prepared_stmt_count = 104857612;
+SET @@global.max_prepared_stmt_count = 4294967295*1024;
SELECT @@global.max_prepared_stmt_count;
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/suite/sys_vars/t/sysvars_innodb.opt b/mysql-test/suite/sys_vars/t/sysvars_innodb.opt
index 462e83d98b6..c3eec59bc17 100644
--- a/mysql-test/suite/sys_vars/t/sysvars_innodb.opt
+++ b/mysql-test/suite/sys_vars/t/sysvars_innodb.opt
@@ -1 +1,2 @@
--loose-innodb-flush-log-at-timeout=3
+--table_open_cache=200
diff --git a/mysql-test/suite/sys_vars/t/sysvars_server_embedded.opt b/mysql-test/suite/sys_vars/t/sysvars_server_embedded.opt
new file mode 100644
index 00000000000..c3f0d3bd51f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_server_embedded.opt
@@ -0,0 +1 @@
+--table_open_cache=100
diff --git a/mysql-test/suite/sys_vars/t/sysvars_server_notembedded.opt b/mysql-test/suite/sys_vars/t/sysvars_server_notembedded.opt
new file mode 100644
index 00000000000..c3f0d3bd51f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_server_notembedded.opt
@@ -0,0 +1 @@
+--table_open_cache=100
diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test
index 20989e70ef9..c2d44c08e22 100644
--- a/mysql-test/t/connect.test
+++ b/mysql-test/t/connect.test
@@ -143,9 +143,18 @@ GRANT USAGE ON *.* TO mysqltest_u1@localhost;
--echo
let $saved_max_connections = `SELECT @@global.max_connections`;
-SET GLOBAL max_connections = 3;
+SET GLOBAL max_connections = 10;
SET GLOBAL event_scheduler = ON;
+connect (tmp_con1,localhost,mysqltest_u1,,);
+connect (tmp_con2,localhost,mysqltest_u1,,);
+connect (tmp_con3,localhost,mysqltest_u1,,);
+connect (tmp_con4,localhost,mysqltest_u1,,);
+connect (tmp_con5,localhost,mysqltest_u1,,);
+connect (tmp_con6,localhost,mysqltest_u1,,);
+connect (tmp_con7,localhost,mysqltest_u1,,);
+connection default;
+
--echo
--echo # -- Waiting for Event Scheduler to start...
let $wait_condition =
@@ -230,6 +239,13 @@ let $wait_condition =
--disconnect con_2
--disconnect con_3
--disconnect con_super_1
+--disconnect tmp_con1
+--disconnect tmp_con2
+--disconnect tmp_con3
+--disconnect tmp_con4
+--disconnect tmp_con5
+--disconnect tmp_con6
+--disconnect tmp_con7
--echo
--echo # -- Restoring default connection...
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index e2684ab4957..101b3d75574 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -607,6 +607,17 @@ SELECT NAME_CONST('a', -(1 AND 2)) OR 1;
SELECT NAME_CONST('a', -(1)) OR 1;
--echo #
+--echo # MDEV-15630 uuid() function evaluates at wrong time in query
+--echo #
+
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+--replace_column 2 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+SELECT COUNT(1), UUID() as uid FROM t1 GROUP BY uid;
+DROP TABLE t1;
+
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 421bf635193..881f21f3b64 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1769,6 +1769,41 @@ EXPLAIN EXTENDED SELECT CHAR(0xDF USING `binary`);
EXPLAIN EXTENDED SELECT CHAR(0xDF);
--echo #
+--echo # MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data
+--echo #
+
+CREATE TABLE t1 (
+ id int(11) NOT NULL,
+ session_id varchar(255) DEFAULT NULL,
+ directory mediumtext,
+ checksum int(10) DEFAULT NULL,
+ last_update datetime DEFAULT NULL,
+ PRIMARY KEY (id),
+ KEY lastupdate (last_update)
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,'',NULL,38391,'2017-06-24 07:35:28');
+UPDATE t1 SET directory = AES_ENCRYPT(CONVERT('test stringrererejrjerjehrjekhrjkehrjkehrkjehrjkerhkjehrjekrhkjehrkjerhjkehrkjehrkjehrjkehrjkehrjkehrjkerjkehrjkehrjkehrjke rekjhrejrejhrjehgrehjgrhjerjhegrjherejhgrjhegrjehgrjhegrejhrgjehgrjhegrjhegrjhergjhegrjhegrhjegrjerhthkjjkdhjkgdfjkgjkdgdjkfjkhgjkfdhjgjkfdghkjdfghkjfdghfjkdghkdjfghdkjfghfjkdghfkjdghkjfdghfkjdghfkdjghfkjdghfdjkghjkdfhgdfjkghfjkdghfjkdghfjdkghfjkdghkfjdghfkjdghfkjdghkjdfghfjdkghjkfdghkjdfhgjkdfhgjkfdhgkjfdghkfjdhgkjfdgdjkejktjherjthkjrethkjrethjkerthjkerhtjkerhtkjerhtjkerhtjkerhtjkrehtkjerhtkjrehtjkrehtkjrehtkjerhtkjerhtjkrehtkjrehtjkrehtkjrethjkrethkjrehtkjethjkerhtjkrehtjkretkjerhtkjrehtjkerhtjkrehtjrehtkjrekjtrfgdsfgdhjsghjgfdhjsfhjdfgdhjshjdshjfghjdsfgjhsfgjhsdfgjhdsfgjdhsfgsjhfgjhsdfgsdjhfgjdhsfdjshfgdsjhfgjsdhfdjshfgdjhsfgdjshfgjdhsfgjhsdfgjhsdgfjhsdgfjhdsgfjhsgfjhsdgfjhdsgfhjsdehkjthrkjethjkre' USING latin1), '95F5A1F52A554'), last_update= NOW();
+SELECT directory IS NULL FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ id int(11) NOT NULL PRIMARY KEY,
+ directory mediumtext
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,AES_ENCRYPT(CONVERT(REPEAT('a',800) USING latin1),'95F5A1F52A554'));
+SELECT AES_DECRYPT(directory,'95F5A1F52A554') FROM t1;
+DROP TABLE t1;
+
+SET @enc=AES_ENCRYPT(REPEAT(_latin1'a',800),'95F5A1F52A554');
+CREATE TABLE t1 (
+ id int(11) NOT NULL PRIMARY KEY,
+ directory mediumtext
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,AES_DECRYPT(CONVERT(@enc USING binary),'95F5A1F52A554'));
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo # Start of 10.1 tests
--echo #
diff --git a/mysql-test/t/mdev375.test b/mysql-test/t/mdev375.test
index 92e403b6513..759f7bd31f0 100644
--- a/mysql-test/t/mdev375.test
+++ b/mysql-test/t/mdev375.test
@@ -4,7 +4,16 @@
--source include/not_embedded.inc
SET GLOBAL log_warnings=4;
-SET GLOBAL max_connections=2;
+SET GLOBAL max_connections=10;
+
+--connect (tmp_con1,localhost,root,,)
+--connect (tmp_con2,localhost,root,,)
+--connect (tmp_con3,localhost,root,,)
+--connect (tmp_con4,localhost,root,,)
+--connect (tmp_con5,localhost,root,,)
+--connect (tmp_con6,localhost,root,,)
+--connect (tmp_con7,localhost,root,,)
+--connect (tmp_con8,localhost,root,,)
--connect (con1,localhost,root,,)
SELECT 1;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 1407e9fcf98..c2b022ff091 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -1225,13 +1225,14 @@ DROP TABLE t1;
--echo #
--echo # BUG#48438 - crash with error in unioned query against merge table and view...
--echo #
-SET GLOBAL table_open_cache=3;
+SET @save_table_open_cache=@@table_open_cache;
+SET GLOBAL table_open_cache=10;
CREATE TABLE t1(a INT);
-SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
+SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4, t1 AS a5, t1 AS a6, t1 AS a7, t1 AS a8, t1 AS a9, t1 AS a10, t1 AS a11 FOR UPDATE;
SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DROP TABLE t1;
-SET GLOBAL table_open_cache=DEFAULT;
+SET GLOBAL table_open_cache=@save_table_open_cache;
--echo End of 5.0 tests
diff --git a/mysql-test/t/myisam_recover.test b/mysql-test/t/myisam_recover.test
index 86a4d16d0f9..316be56609b 100644
--- a/mysql-test/t/myisam_recover.test
+++ b/mysql-test/t/myisam_recover.test
@@ -23,6 +23,7 @@ call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:");
call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
call mtr.add_suppression(" '\..test.t1'");
+set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=256;
set global table_definition_cache=400;
--disable_warnings
@@ -104,7 +105,7 @@ prepare stmt from @drop_table_stmt;
execute stmt;
deallocate prepare stmt;
set @@global.table_definition_cache=default;
-set @@global.table_open_cache=default;
+set @@global.table_open_cache=@save_table_open_cache;
disconnect con1;
connection default;
--enable_ps_protocol
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index d6c68ecf3c2..b545e354040 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -684,7 +684,7 @@ remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
# Too many errorcodes specified
--error 1
---exec echo "--error 1,2,3,4,5,6,7,8,9,10,11" | $MYSQL_TEST 2>&1
+--exec echo "--error 1,2,3,4,5,6,7,8,9,10,11,12,13" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test
index a29a2f14d25..5faaca00ea8 100644
--- a/mysql-test/t/parser.test
+++ b/mysql-test/t/parser.test
@@ -781,6 +781,15 @@ CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\;
PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\\';
DROP TABLE t1;
+--echo #
+--echo # MDEV-15620 Crash when using "SET @@NEW.a=expr" inside a trigger
+--echo #
+
+CREATE TABLE t1 (a INT);
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @@NEW.a=0;
+DROP TABLE t1;
+
#
# start of 10.1 tests
#
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 529ebd4736a..b7a84bccb47 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -9401,7 +9401,7 @@ DELIMITER ;|
set @tmp_toc= @@table_open_cache;
set @tmp_tdc= @@table_definition_cache;
-set global table_open_cache=1;
+set global table_open_cache=10;
set global table_definition_cache=1;
call p1();
diff --git a/mysql-test/t/statistics.test b/mysql-test/t/statistics.test
index e9ecb56a1cb..368cee0f8c8 100644
--- a/mysql-test/t/statistics.test
+++ b/mysql-test/t/statistics.test
@@ -800,6 +800,25 @@ select db_name, table_name, column_name,
drop table t1;
--echo #
+--echo # MDEB-9744: session optimizer_use_condition_selectivity=5 causing SQL Error (1918):
+--echo # Encountered illegal value '' when converting to DECIMAL
+--echo #
+
+set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+set optimizer_use_condition_selectivity=3, use_stat_tables=preferably;
+
+create table t1 (id int(10),cost decimal(9,2)) engine=innodb;
+ANALYZE TABLE t1 PERSISTENT FOR ALL;
+
+create temporary table t2 (id int);
+insert into t2 (id) select id from t1 where cost > 0;
+select * from t2;
+
+set use_stat_tables=@save_use_stat_tables;
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+drop table t1,t2;
+
+--echo #
--echo # MDEV-9590: Always print "Engine-independent statistic" warnings and
--echo # might be filtering columns unintentionally from engines
--echo #
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index ed6e92f145e..fc8dc89373b 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -343,6 +343,7 @@ set sql_select_limit=1;
# reset it, so later tests don't get confused
set sql_select_limit=default;
set sql_warnings=1;
+set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=100;
set default_storage_engine=myisam;
set global thread_cache_size=100;
@@ -502,7 +503,7 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'MYI
SET GLOBAL table_open_cache=-1;
SHOW VARIABLES LIKE 'table_open_cache';
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
-SET GLOBAL table_open_cache=DEFAULT;
+SET GLOBAL table_open_cache=@save_table_open_cache;
#
# Bugs12363: character_set_results is nullable,
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index bf22d978fd5..d271070bc60 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -5483,6 +5483,202 @@ SHOW CREATE VIEW v1;
drop view v1;
drop table t1;
+CREATE TABLE IF NOT EXISTS t0 (f0 INT);
+CREATE TABLE IF NOT EXISTS t1 (f1 INT);
+CREATE TABLE IF NOT EXISTS t2 (f2 INT);
+CREATE TABLE IF NOT EXISTS t3 (f3 INT);
+CREATE TABLE IF NOT EXISTS t4 (f4 INT);
+CREATE TABLE IF NOT EXISTS t5 (f5 INT);
+CREATE TABLE IF NOT EXISTS t6 (f6 INT);
+CREATE TABLE IF NOT EXISTS t7 (f7 INT);
+CREATE TABLE IF NOT EXISTS t8 (f8 INT);
+CREATE TABLE IF NOT EXISTS t9 (f9 INT);
+CREATE TABLE IF NOT EXISTS t10 (f10 INT);
+CREATE TABLE IF NOT EXISTS t11 (f11 INT);
+CREATE TABLE IF NOT EXISTS t12 (f12 INT);
+CREATE TABLE IF NOT EXISTS t13 (f13 INT);
+CREATE TABLE IF NOT EXISTS t14 (f14 INT);
+CREATE TABLE IF NOT EXISTS t15 (f15 INT);
+CREATE TABLE IF NOT EXISTS t16 (f16 INT);
+CREATE TABLE IF NOT EXISTS t17 (f17 INT);
+CREATE TABLE IF NOT EXISTS t18 (f18 INT);
+CREATE TABLE IF NOT EXISTS t19 (f19 INT);
+CREATE TABLE IF NOT EXISTS t20 (f20 INT);
+CREATE TABLE IF NOT EXISTS t21 (f21 INT);
+CREATE TABLE IF NOT EXISTS t22 (f22 INT);
+CREATE TABLE IF NOT EXISTS t23 (f23 INT);
+CREATE TABLE IF NOT EXISTS t24 (f24 INT);
+CREATE TABLE IF NOT EXISTS t25 (f25 INT);
+CREATE TABLE IF NOT EXISTS t26 (f26 INT);
+CREATE TABLE IF NOT EXISTS t27 (f27 INT);
+CREATE TABLE IF NOT EXISTS t28 (f28 INT);
+CREATE TABLE IF NOT EXISTS t29 (f29 INT);
+CREATE TABLE IF NOT EXISTS t30 (f30 INT);
+CREATE TABLE IF NOT EXISTS t31 (f31 INT);
+CREATE TABLE IF NOT EXISTS t32 (f32 INT);
+CREATE TABLE IF NOT EXISTS t33 (f33 INT);
+CREATE TABLE IF NOT EXISTS t34 (f34 INT);
+CREATE TABLE IF NOT EXISTS t35 (f35 INT);
+CREATE TABLE IF NOT EXISTS t36 (f36 INT);
+CREATE TABLE IF NOT EXISTS t37 (f37 INT);
+CREATE TABLE IF NOT EXISTS t38 (f38 INT);
+CREATE TABLE IF NOT EXISTS t39 (f39 INT);
+CREATE TABLE IF NOT EXISTS t40 (f40 INT);
+CREATE TABLE IF NOT EXISTS t41 (f41 INT);
+CREATE TABLE IF NOT EXISTS t42 (f42 INT);
+CREATE TABLE IF NOT EXISTS t43 (f43 INT);
+CREATE TABLE IF NOT EXISTS t44 (f44 INT);
+CREATE TABLE IF NOT EXISTS t45 (f45 INT);
+CREATE TABLE IF NOT EXISTS t46 (f46 INT);
+CREATE TABLE IF NOT EXISTS t47 (f47 INT);
+CREATE TABLE IF NOT EXISTS t48 (f48 INT);
+CREATE TABLE IF NOT EXISTS t49 (f49 INT);
+CREATE TABLE IF NOT EXISTS t50 (f50 INT);
+CREATE TABLE IF NOT EXISTS t51 (f51 INT);
+CREATE TABLE IF NOT EXISTS t52 (f52 INT);
+CREATE TABLE IF NOT EXISTS t53 (f53 INT);
+CREATE TABLE IF NOT EXISTS t54 (f54 INT);
+CREATE TABLE IF NOT EXISTS t55 (f55 INT);
+CREATE TABLE IF NOT EXISTS t56 (f56 INT);
+CREATE TABLE IF NOT EXISTS t57 (f57 INT);
+CREATE TABLE IF NOT EXISTS t58 (f58 INT);
+CREATE TABLE IF NOT EXISTS t59 (f59 INT);
+CREATE TABLE IF NOT EXISTS t60 (f60 INT);
+CREATE OR REPLACE VIEW v60 AS SELECT * FROM t60;
+
+EXPLAIN
+ SELECT t0.*
+FROM t0
+JOIN t1
+ ON t1.f1 = t0.f0
+LEFT JOIN t2
+ ON t0.f0 = t2.f2
+LEFT JOIN t3
+ ON t0.f0 = t3.f3
+LEFT JOIN t4
+ ON t0.f0 = t4.f4
+LEFT JOIN t5
+ ON t4.f4 = t5.f5
+LEFT JOIN t6
+ ON t0.f0 = t6.f6
+LEFT JOIN t7
+ ON t0.f0 = t7.f7
+LEFT JOIN t8
+ ON t0.f0 = t8.f8
+LEFT JOIN t9
+ ON t0.f0 = t9.f9
+LEFT JOIN t10
+ ON t0.f0 = t10.f10
+LEFT JOIN t11
+ ON t0.f0 = t11.f11
+LEFT JOIN t12
+ ON t0.f0 = t12.f12
+LEFT JOIN t13
+ ON t0.f0 = t13.f13
+LEFT JOIN t14
+ ON t0.f0 = t14.f14
+LEFT JOIN t15
+ ON t0.f0 = t15.f15
+LEFT JOIN t16
+ ON t0.f0 = t16.f16
+LEFT JOIN t17
+ ON t0.f0 = t17.f17
+LEFT JOIN t18
+ ON t0.f0 = t18.f18
+LEFT JOIN t19
+ ON t18.f18 = t19.f19
+LEFT JOIN t20
+ ON t20.f20 = t19.f19
+LEFT JOIN t21
+ ON t20.f20 = t21.f21
+LEFT JOIN t22
+ ON t19.f19 = t22.f22
+LEFT JOIN t23
+ ON t23.f23 = t0.f0
+LEFT JOIN t24
+ ON t24.f24 = t23.f23
+LEFT JOIN t25
+ ON t0.f0 = t25.f25
+LEFT JOIN t26
+ ON t26.f26 = t0.f0
+LEFT JOIN t27
+ ON t27.f27 = t0.f0
+LEFT JOIN t28
+ ON t0.f0 = t28.f28
+LEFT JOIN t29
+ ON t0.f0 = t29.f29
+LEFT JOIN t30
+ ON t30.f30 = t0.f0
+LEFT JOIN t31
+ ON t0.f0 = t31.f31
+LEFT JOIN t32
+ ON t32.f32 = t31.f31
+LEFT JOIN t33
+ ON t33.f33 = t0.f0
+LEFT JOIN t34
+ ON t33.f33 = t34.f34
+LEFT JOIN t35
+ ON t33.f33 = t35.f35
+LEFT JOIN t36
+ ON t36.f36 = t0.f0
+LEFT JOIN t37
+ ON t32.f32 = t37.f37
+LEFT JOIN t38
+ ON t31.f31 = t38.f38
+LEFT JOIN t39
+ ON t39.f39 = t0.f0
+LEFT JOIN t40
+ ON t40.f40 = t39.f39
+LEFT JOIN t41
+ ON t41.f41 = t0.f0
+LEFT JOIN t42
+ ON t42.f42 = t41.f41
+LEFT JOIN t43
+ ON t43.f43 = t41.f41
+LEFT JOIN t44
+ ON t44.f44 = t0.f0
+LEFT JOIN t45
+ ON t45.f45 = t0.f0
+LEFT JOIN t46
+ ON t46.f46 = t0.f0
+LEFT JOIN t47
+ ON t47.f47 = t0.f0
+LEFT JOIN t48
+ ON t48.f48 = t0.f0
+LEFT JOIN t49
+ ON t0.f0 = t49.f49
+LEFT JOIN t50
+ ON t0.f0 = t50.f50
+LEFT JOIN t51
+ ON t0.f0 = t51.f51
+LEFT JOIN t52
+ ON t52.f52 = t0.f0
+LEFT JOIN t53
+ ON t53.f53 = t0.f0
+LEFT JOIN t54
+ ON t54.f54 = t0.f0
+LEFT JOIN t55
+ ON t55.f55 = t0.f0
+LEFT JOIN t56
+ ON t56.f56 = t0.f0
+LEFT JOIN t57
+ ON t57.f57 = t0.f0
+LEFT JOIN t58
+ ON t58.f58 = t57.f57
+LEFT JOIN t59
+ ON t36.f36 = t59.f59
+LEFT JOIN v60
+ ON t36.f36 = v60.f60
+;
+drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9,
+t10, t11, t12, t13, t14, t15, t16, t17, t18,
+t19, t20, t21, t22, t23, t24, t25, t26, t27,
+t28, t29, t30, t31, t32, t33, t34, t35, t36,
+t37, t38, t39, t40, t41, t42, t43, t44, t45,
+t46, t47, t48, t49, t50, t51, t52, t53, t54,
+t55, t56, t57, t58, t59,t60;
+drop view v60;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.5 tests.
--echo # -----------------------------------------------------------------
diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c
index 84bff47d1a9..c16f269d574 100644
--- a/mysys/my_addr_resolve.c
+++ b/mysys/my_addr_resolve.c
@@ -226,7 +226,7 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
strnmov(addr2line_binary, info.dli_fname, sizeof(addr2line_binary));
}
offset = info.dli_fbase;
- len= my_snprintf(input, sizeof(input), "%p\n", ptr - offset);
+ len= my_snprintf(input, sizeof(input), "%08x\n", (ulonglong)(ptr - offset));
if (write(in[1], input, len) <= 0)
return 3;
diff --git a/sql-common/client.c b/sql-common/client.c
index 163589a3978..727211e35d9 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1822,7 +1822,8 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c
*/
#ifdef HAVE_X509_check_host
- ret_validation= X509_check_host(server_cert, server_hostname, 0, 0, 0) != 1;
+ ret_validation= X509_check_host(server_cert, server_hostname,
+ strlen(server_hostname), 0, 0) != 1;
#else
subject= X509_get_subject_name(server_cert);
cn_loc= X509_NAME_get_index_by_NID(subject, NID_commonName, -1);
@@ -2512,10 +2513,10 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
if (mysql->client_flag & CLIENT_MULTI_STATEMENTS)
mysql->client_flag|= CLIENT_MULTI_RESULTS;
-#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
+#ifdef HAVE_OPENSSL
if (mysql->options.use_ssl)
mysql->client_flag|= CLIENT_SSL;
-#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY*/
+#endif /* HAVE_OPENSSL */
if (mpvio->db)
mysql->client_flag|= CLIENT_CONNECT_WITH_DB;
diff --git a/sql/contributors.h b/sql/contributors.h
index 7369dcd141d..a0d05af3fa6 100644
--- a/sql/contributors.h
+++ b/sql/contributors.h
@@ -41,13 +41,12 @@ struct show_table_contributors_st show_table_contributors[]= {
{"Alibaba Cloud", "https://www.alibabacloud.com/", "Platinum Sponsor of the MariaDB Foundation"},
{"Tencent Cloud", "https://cloud.tencent.com", "Platinum Sponsor of the MariaDB Foundation"},
{"Microsoft", "https://microsoft.com/", "Platinum Sponsor of the MariaDB Foundation"},
- {"MariaDB Corporation", "https://mariadb.com", "Founding member, Gold Sponsor of the MariaDB Foundation"},
+ {"MariaDB Corporation", "https://mariadb.com", "Founding member, Platinum Sponsor of the MariaDB Foundation"},
{"Visma", "https://visma.com", "Gold Sponsor of the MariaDB Foundation"},
{"DBS", "https://dbs.com", "Gold Sponsor of the MariaDB Foundation"},
{"IBM", "https://www.ibm.com", "Gold Sponsor of the MariaDB Foundation"},
{"Nexedi", "https://www.nexedi.com", "Silver Sponsor of the MariaDB Foundation"},
{"Acronis", "http://www.acronis.com", "Silver Sponsor of the MariaDB Foundation"},
- {"Auttomattic", "https://automattic.com", "Bronze Sponsor of the MariaDB Foundation"},
{"Verkkokauppa.com", "https://www.verkkokauppa.com", "Bronze Sponsor of the MariaDB Foundation"},
{"Virtuozzo", "https://virtuozzo.com", "Bronze Sponsor of the MariaDB Foundation"},
{"Tencent Game DBA", "http://tencentdba.com/about", "Bronze Sponsor of the MariaDB Foundation"},
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index b2317caf61e..7d7614171b5 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -317,7 +317,7 @@ String *Item_aes_crypt::val_str(String *str2)
{
DBUG_ASSERT(fixed == 1);
StringBuffer<80> user_key_buf;
- String *sptr= args[0]->val_str(&str_value);
+ String *sptr= args[0]->val_str(&tmp_value);
String *user_key= args[1]->val_str(&user_key_buf);
uint32 aes_length;
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 3723f4eb5f4..4372855ccf5 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -213,6 +213,7 @@ class Item_aes_crypt :public Item_str_binary_checksum_func
protected:
int what;
+ String tmp_value;
public:
Item_aes_crypt(THD *thd, Item *a, Item *b)
:Item_str_binary_checksum_func(thd, a, b) {}
@@ -222,8 +223,8 @@ public:
class Item_func_aes_encrypt :public Item_aes_crypt
{
public:
- Item_func_aes_encrypt(THD *thd, Item *a, Item *b):
- Item_aes_crypt(thd, a, b) {}
+ Item_func_aes_encrypt(THD *thd, Item *a, Item *b)
+ :Item_aes_crypt(thd, a, b) {}
void fix_length_and_dec();
const char *func_name() const { return "aes_encrypt"; }
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
@@ -1383,6 +1384,7 @@ public:
DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII);
fix_char_length(MY_UUID_STRING_LENGTH);
}
+ table_map used_tables() const { return RAND_TABLE_BIT; }
const char *func_name() const{ return "uuid"; }
String *val_str(String *);
bool check_vcol_func_processor(void *arg)
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1c4fcaeca20..99cad2c0423 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -115,7 +115,7 @@
#include <poll.h>
#endif
-#include <my_systemd.h>
+#include <my_service_manager.h>
#define mysqld_charset &my_charset_latin1
@@ -547,7 +547,7 @@ bool max_user_connections_checking=0;
Limit of the total number of prepared statements in the server.
Is necessary to protect the server against out-of-memory attacks.
*/
-ulong max_prepared_stmt_count;
+uint max_prepared_stmt_count;
/**
Current total number of prepared statements in the server. This number
is exact, and therefore may not be equal to the difference between
@@ -558,7 +558,7 @@ ulong max_prepared_stmt_count;
two different connections, this counts as two distinct prepared
statements.
*/
-ulong prepared_stmt_count=0;
+uint prepared_stmt_count=0;
my_thread_id global_thread_id= 0;
ulong current_pid;
ulong slow_launch_threads = 0;
@@ -4393,11 +4393,20 @@ static int init_common_variables()
/* connections and databases needs lots of files */
{
- uint files, wanted_files, max_open_files;
+ uint files, wanted_files, max_open_files, min_tc_size, extra_files,
+ min_connections;
+ ulong org_max_connections, org_tc_size;
+ /* Number of files reserved for temporary files */
+ extra_files= 30;
+ min_connections= 10;
/* MyISAM requires two file handles per table. */
- wanted_files= (10 + max_connections + extra_max_connections +
+ wanted_files= (extra_files + max_connections + extra_max_connections +
tc_size * 2);
+ min_tc_size= MY_MIN(tc_size, TABLE_OPEN_CACHE_MIN);
+ org_max_connections= max_connections;
+ org_tc_size= tc_size;
+
/*
We are trying to allocate no less than max_connections*5 file
handles (i.e. we are trying to set the limit so that they will
@@ -4409,44 +4418,49 @@ static int init_common_variables()
requested (value of wanted_files).
*/
max_open_files= MY_MAX(MY_MAX(wanted_files,
- (max_connections + extra_max_connections)*5),
- open_files_limit);
+ (max_connections + extra_max_connections)*5),
+ open_files_limit);
files= my_set_max_open_files(max_open_files);
+ SYSVAR_AUTOSIZE_IF_CHANGED(open_files_limit, files, ulong);
- if (files < wanted_files)
- {
- if (!open_files_limit || IS_SYSVAR_AUTOSIZE(&open_files_limit))
- {
- /*
- If we have requested too much file handles than we bring
- max_connections in supported bounds.
- */
- SYSVAR_AUTOSIZE(max_connections,
- (ulong) MY_MIN(files-10-TABLE_OPEN_CACHE_MIN*2, max_connections));
- /*
- Decrease tc_size according to max_connections, but
- not below TABLE_OPEN_CACHE_MIN. Outer MY_MIN() ensures that we
- never increase tc_size automatically (that could
- happen if max_connections is decreased above).
- */
- SYSVAR_AUTOSIZE(tc_size,
- (ulong) MY_MIN(MY_MAX((files - 10 - max_connections) / 2,
- TABLE_OPEN_CACHE_MIN), tc_size));
- DBUG_PRINT("warning",
- ("Changed limits: max_open_files: %u max_connections: %ld table_cache: %ld",
- files, max_connections, tc_size));
- if (global_system_variables.log_warnings > 1)
- sql_print_warning("Changed limits: max_open_files: %u max_connections: %ld table_cache: %ld",
- files, max_connections, tc_size);
- }
- else if (global_system_variables.log_warnings)
- sql_print_warning("Could not increase number of max_open_files to more than %u (request: %u)", files, wanted_files);
- }
- SYSVAR_AUTOSIZE(open_files_limit, files);
- }
+ if (files < wanted_files && global_system_variables.log_warnings)
+ sql_print_warning("Could not increase number of max_open_files to more than %u (request: %u)", files, wanted_files);
+
+ /*
+ If we have requested too much file handles than we bring
+ max_connections in supported bounds. Still leave at least
+ 'min_connections' connections
+ */
+ SYSVAR_AUTOSIZE_IF_CHANGED(max_connections,
+ (ulong) MY_MAX(MY_MIN(files- extra_files-
+ min_tc_size*2,
+ max_connections),
+ min_connections),
+ ulong);
+ /*
+ Decrease tc_size according to max_connections, but
+ not below min_tc_size. Outer MY_MIN() ensures that we
+ never increase tc_size automatically (that could
+ happen if max_connections is decreased above).
+ */
+ SYSVAR_AUTOSIZE_IF_CHANGED(tc_size,
+ (ulong) MY_MIN(MY_MAX((files - extra_files -
+ max_connections) / 2,
+ min_tc_size),
+ tc_size), ulong);
+ DBUG_PRINT("warning",
+ ("Current limits: max_open_files: %u max_connections: %ld table_cache: %ld",
+ files, max_connections, tc_size));
+ if (global_system_variables.log_warnings > 1 &&
+ (max_connections < org_max_connections ||
+ tc_size < org_tc_size))
+ sql_print_warning("Changed limits: max_open_files: %u max_connections: %lu (was %lu) table_cache: %lu (was %lu)",
+ files, max_connections, org_max_connections,
+ tc_size, org_tc_size);
+ }
/*
- Max_connections is now set.
+ Max_connections and tc_cache are now set.
Now we can fix other variables depending on this variable.
*/
@@ -6579,7 +6593,7 @@ void handle_connections_sockets()
#endif
sd_notify(0, "READY=1\n"
- "STATUS=Taking your SQL requests now...");
+ "STATUS=Taking your SQL requests now...\n");
DBUG_PRINT("general",("Waiting for connections."));
MAYBE_BROKEN_SYSCALL;
@@ -6781,7 +6795,7 @@ void handle_connections_sockets()
create_new_thread(connect);
}
sd_notify(0, "STOPPING=1\n"
- "STATUS=Shutdown in progress");
+ "STATUS=Shutdown in progress\n");
DBUG_VOID_RETURN;
}
diff --git a/sql/mysqld.h b/sql/mysqld.h
index d13fdd193ef..74e4f1ecb43 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -208,7 +208,7 @@ extern uint slave_net_timeout;
extern int max_user_connections;
extern volatile ulong cached_thread_count;
extern ulong what_to_log,flush_time;
-extern ulong max_prepared_stmt_count, prepared_stmt_count;
+extern uint max_prepared_stmt_count, prepared_stmt_count;
extern ulong open_files_limit;
extern ulonglong binlog_cache_size, binlog_stmt_cache_size;
extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size;
diff --git a/sql/set_var.h b/sql/set_var.h
index 97dc3b5ba51..7a48e319466 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -399,6 +399,16 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list, bool free);
set_sys_var_value_origin(&VAR, sys_var::AUTO); \
} while(0)
+#define SYSVAR_AUTOSIZE_IF_CHANGED(VAR,VAL,TYPE) \
+ do { \
+ TYPE tmp= (VAL); \
+ if (VAR != tmp) \
+ { \
+ VAR= (VAL); \
+ set_sys_var_value_origin(&VAR, sys_var::AUTO); \
+ } \
+ } while(0)
+
void set_sys_var_value_origin(void *ptr, enum sys_var::where here);
enum sys_var::where get_sys_var_value_origin(void *ptr);
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 4285f5cffa5..0bb1974b6cd 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -5749,8 +5749,8 @@ ER_SP_NO_AGGREGATE 42000
eng "AGGREGATE is not supported for stored functions"
ger "AGGREGATE wird bei gespeicherten Funktionen nicht unterstützt"
ER_MAX_PREPARED_STMT_COUNT_REACHED 42000
- eng "Can't create more than max_prepared_stmt_count statements (current value: %lu)"
- ger "Kann nicht mehr Anweisungen als max_prepared_stmt_count erzeugen (aktueller Wert: %lu)"
+ eng "Can't create more than max_prepared_stmt_count statements (current value: %u)"
+ ger "Kann nicht mehr Anweisungen als max_prepared_stmt_count erzeugen (aktueller Wert: %u)"
ER_VIEW_RECURSIVE
eng "`%-.192s`.`%-.192s` contains view recursion"
ger "`%-.192s`.`%-.192s` enthält View-Rekursion"
diff --git a/sql/sql_const.h b/sql/sql_const.h
index c91992a9029..7395ae3c08a 100644
--- a/sql/sql_const.h
+++ b/sql/sql_const.h
@@ -126,7 +126,7 @@
#define MAX_ACCEPT_RETRY 10 // Test accept this many times
#define MAX_FIELDS_BEFORE_HASH 32
#define USER_VARS_HASH_SIZE 16
-#define TABLE_OPEN_CACHE_MIN 400
+#define TABLE_OPEN_CACHE_MIN 200
#define TABLE_OPEN_CACHE_DEFAULT 2000
#define TABLE_DEF_CACHE_DEFAULT 400
/**
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 33039847cb7..5edf92f2a96 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1341,22 +1341,27 @@ bool do_command(THD *thd)
command= fetch_command(thd, packet);
#ifdef WITH_WSREP
- /*
- Bail out if DB snapshot has not been installed.
- */
- if (thd->variables.wsrep_on && !thd->wsrep_applier &&
- (!wsrep_ready || wsrep_reject_queries != WSREP_REJECT_NONE) &&
- (server_command_flags[command] & CF_SKIP_WSREP_CHECK) == 0)
+ if (WSREP(thd))
{
- thd->protocol->end_statement();
+ /*
+ Bail out if DB snapshot has not been installed.
+ */
+ if (!thd->wsrep_applier &&
+ (!wsrep_ready || wsrep_reject_queries != WSREP_REJECT_NONE) &&
+ (server_command_flags[command] & CF_SKIP_WSREP_CHECK) == 0)
+ {
+ my_message(ER_UNKNOWN_COM_ERROR,
+ "WSREP has not yet prepared node for application use", MYF(0));
+ thd->protocol->end_statement();
- /* Performance Schema Interface instrumentation end. */
- MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
- thd->m_statement_psi= NULL;
- thd->m_digest= NULL;
+ /* Performance Schema Interface instrumentation end. */
+ MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
+ thd->m_statement_psi= NULL;
+ thd->m_digest= NULL;
- return_value= FALSE;
- goto out;
+ return_value= FALSE;
+ goto out;
+ }
}
#endif
@@ -3156,8 +3161,7 @@ mysql_execute_command(THD *thd)
* allow SET and SHOW queries and reads from information schema
* and dirty reads (if configured)
*/
- if (thd->variables.wsrep_on &&
- !thd->wsrep_applier &&
+ if (!thd->wsrep_applier &&
!(wsrep_ready && wsrep_reject_queries == WSREP_REJECT_NONE) &&
!(thd->variables.wsrep_dirty_reads &&
(sql_command_flags[lex->sql_command] & CF_CHANGES_DATA) == 0) &&
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 5a9bf08d99b..5badcad3492 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -3083,18 +3083,19 @@ bool statistics_for_tables_is_needed(THD *thd, TABLE_LIST *tables)
return FALSE;
/*
- Do not read statistics for any query over non-user tables.
- If the query references some statistical tables, but not all
- of them, reading the statistics may lead to a deadlock
- */
+ Do not read statistics for any query that explicity involves
+ statistical tables, failure to to do so we may end up
+ in a deadlock.
+ */
+
for (TABLE_LIST *tl= tables; tl; tl= tl->next_global)
{
if (!tl->is_view_or_derived() && tl->table)
{
TABLE_SHARE *table_share= tl->table->s;
if (table_share &&
- (table_share->table_category != TABLE_CATEGORY_USER ||
- table_share->tmp_table != NO_TMP_TABLE))
+ table_share->table_category != TABLE_CATEGORY_USER
+ && is_stat_table(tl->db, tl->alias))
return FALSE;
}
}
@@ -3770,6 +3771,15 @@ double get_column_range_cardinality(Field *field,
if (!col_stats)
return tab_records;
+ /*
+ Use statistics for a table only when we have actually read
+ the statistics from the stat tables. For example due to
+ chances of getting a deadlock we disable reading statistics for
+ a table.
+ */
+
+ if (!table->stats_is_read)
+ return tab_records;
double col_nulls= tab_records * col_stats->get_nulls_ratio();
@@ -3993,4 +4003,3 @@ bool is_stat_table(const char *db, const char *table)
}
return false;
}
-
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 112cf9877b4..b2088b0e640 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -15174,6 +15174,11 @@ option_value_no_option_type:
| '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default
{
struct sys_var_with_base tmp= $4;
+ if (tmp.var == trg_new_row_fake_var)
+ {
+ my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), 3, "NEW");
+ MYSQL_YYABORT;
+ }
/* Lookup if necessary: must be a system variable. */
if (tmp.var == NULL)
{
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index a640bc40f85..c3d786af945 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1414,7 +1414,7 @@ static bool fix_max_connections(sys_var *self, THD *thd, enum_var_type type)
static Sys_var_ulong Sys_max_connections(
"max_connections", "The number of simultaneous clients allowed",
PARSED_EARLY GLOBAL_VAR(max_connections), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(1, 100000),
+ VALID_RANGE(10, 100000),
DEFAULT(MAX_CONNECTIONS_DEFAULT), BLOCK_SIZE(1), NO_MUTEX_GUARD,
NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_max_connections));
@@ -2142,11 +2142,11 @@ static Sys_var_ulong Sys_max_long_data_size(
BLOCK_SIZE(1));
static PolyLock_mutex PLock_prepared_stmt_count(&LOCK_prepared_stmt_count);
-static Sys_var_ulong Sys_max_prepared_stmt_count(
+static Sys_var_uint Sys_max_prepared_stmt_count(
"max_prepared_stmt_count",
"Maximum number of prepared statements in the server",
GLOBAL_VAR(max_prepared_stmt_count), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(0, 1024*1024), DEFAULT(16382), BLOCK_SIZE(1),
+ VALID_RANGE(0, UINT_MAX32), DEFAULT(16382), BLOCK_SIZE(1),
&PLock_prepared_stmt_count);
static Sys_var_ulong Sys_max_recursive_iterations(
@@ -3224,7 +3224,7 @@ static bool fix_table_open_cache(sys_var *, THD *, enum_var_type)
static Sys_var_ulong Sys_table_cache_size(
"table_open_cache", "The number of cached open tables",
GLOBAL_VAR(tc_size), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(1, 1024*1024), DEFAULT(TABLE_OPEN_CACHE_DEFAULT),
+ VALID_RANGE(10, 1024*1024), DEFAULT(TABLE_OPEN_CACHE_DEFAULT),
BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(fix_table_open_cache));
diff --git a/sql/table.h b/sql/table.h
index f77f9fcf9ec..7af45b9f169 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -2334,6 +2334,7 @@ struct TABLE_LIST
DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
(alias ? alias : "<NULL>"),
get_unit()));
+ derived= get_unit();
derived_type= ((derived_type & (derived ? DTYPE_MASK : DTYPE_VIEW)) |
DTYPE_TABLE | DTYPE_MATERIALIZE);
set_check_materialized();
diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc
index c40020b167e..f27c2524782 100644
--- a/storage/innobase/buf/buf0dump.cc
+++ b/storage/innobase/buf/buf0dump.cc
@@ -45,6 +45,7 @@ Created April 08, 2011 Vasil Dimov
#include <algorithm>
#include "mysql/service_wsrep.h" /* wsrep_recovery */
+#include <my_service_manager.h>
enum status_severity {
STATUS_INFO,
@@ -390,6 +391,14 @@ buf_dump(
/* leave tmp_filename to exist */
return;
}
+ if ( (j % 1024) == 0) {
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "Dumping buffer pool "
+ ULINTPF "/" ULINTPF ", "
+ "page " ULINTPF "/" ULINTPF,
+ i + 1, srv_buf_pool_instances,
+ j + 1, n_pages);
+ }
}
ut_free(dump);
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index aa982ba0bdc..99a36fc3c45 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -63,6 +63,8 @@ static const int buf_flush_page_cleaner_priority = -20;
modification lsn */
static const ulint buf_flush_wait_flushed_sleep_time = 10000;
+#include <my_service_manager.h>
+
/** Number of pages flushed through non flush_list flushes. */
static ulint buf_lru_flush_page_count = 0;
@@ -641,6 +643,17 @@ buf_flush_remove(
{
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
+#if 0 // FIXME: Rate-limit the output. Move this to the page cleaner?
+ if (UNIV_UNLIKELY(srv_shutdown_state == SRV_SHUTDOWN_FLUSH_PHASE)) {
+ service_manager_extend_timeout(
+ INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "Flush and remove page with tablespace id %u"
+ ", Poolid " ULINTPF ", flush list length " ULINTPF,
+ bpage->space, buf_pool->instance_no,
+ UT_LIST_GET_LEN(buf_pool->flush_list));
+ }
+#endif
+
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(mutex_own(buf_page_get_mutex(bpage)));
ut_ad(bpage->in_flush_list);
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 08a832a4cd5..9259e89886c 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (c) 2014, 2017, MariaDB Corporation.
+Copyright (c) 2014, 2018, MariaDB Corporation. All Rights Reserved.
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
@@ -95,17 +95,17 @@ extern my_bool srv_background_scrub_data_compressed;
/***********************************************************************
Check if a key needs rotation given a key_state
-@param[in] encrypt_mode Encryption mode
+@param[in] crypt_data Encryption information
@param[in] key_version Current key version
@param[in] latest_key_version Latest key version
@param[in] rotate_key_age when to rotate
@return true if key needs rotation, false if not */
static bool
fil_crypt_needs_rotation(
- fil_encryption_t encrypt_mode,
- uint key_version,
- uint latest_key_version,
- uint rotate_key_age)
+ const fil_space_crypt_t* crypt_data,
+ uint key_version,
+ uint latest_key_version,
+ uint rotate_key_age)
MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************
@@ -164,7 +164,8 @@ fil_crypt_get_latest_key_version(
if (crypt_data->is_key_found()) {
- if (fil_crypt_needs_rotation(crypt_data->encryption,
+ if (fil_crypt_needs_rotation(
+ crypt_data,
crypt_data->min_key_version,
key_version,
srv_fil_crypt_rotate_key_age)) {
@@ -904,17 +905,17 @@ fil_crypt_get_key_state(
/***********************************************************************
Check if a key needs rotation given a key_state
-@param[in] encrypt_mode Encryption mode
+@param[in] crypt_data Encryption information
@param[in] key_version Current key version
@param[in] latest_key_version Latest key version
@param[in] rotate_key_age when to rotate
@return true if key needs rotation, false if not */
static bool
fil_crypt_needs_rotation(
- fil_encryption_t encrypt_mode,
- uint key_version,
- uint latest_key_version,
- uint rotate_key_age)
+ const fil_space_crypt_t* crypt_data,
+ uint key_version,
+ uint latest_key_version,
+ uint rotate_key_age)
{
if (key_version == ENCRYPTION_KEY_VERSION_INVALID) {
return false;
@@ -927,13 +928,20 @@ fil_crypt_needs_rotation(
}
if (latest_key_version == 0 && key_version != 0) {
- if (encrypt_mode == FIL_ENCRYPTION_DEFAULT) {
+ if (crypt_data->encryption == FIL_ENCRYPTION_DEFAULT) {
/* this is rotation encrypted => unencrypted */
return true;
}
return false;
}
+ if (crypt_data->encryption == FIL_ENCRYPTION_DEFAULT
+ && crypt_data->type == CRYPT_SCHEME_1
+ && srv_encrypt_tables == 0 ) {
+ /* This is rotation encrypted => unencrypted */
+ return true;
+ }
+
/* this is rotation encrypted => encrypted,
* only reencrypt if key is sufficiently old */
if (key_version + rotate_key_age < latest_key_version) {
@@ -949,10 +957,17 @@ static inline
void
fil_crypt_read_crypt_data(fil_space_t* space)
{
- if (space->crypt_data || space->size) {
+ if (space->crypt_data || space->size
+ || !fil_space_get_size(space->id)) {
/* The encryption metadata has already been read, or
the tablespace is not encrypted and the file has been
- opened already. */
+ opened already, or the file cannot be accessed,
+ likely due to a concurrent TRUNCATE or
+ RENAME or DROP (possibly as part of ALTER TABLE).
+ FIXME: The file can become unaccessible any time
+ after this check! We should really remove this
+ function and instead make crypt_data an integral
+ part of fil_space_t. */
return;
}
@@ -1213,9 +1228,10 @@ fil_crypt_space_needs_rotation(
}
bool need_key_rotation = fil_crypt_needs_rotation(
- crypt_data->encryption,
+ crypt_data,
crypt_data->min_key_version,
- key_state->key_version, key_state->rotate_key_age);
+ key_state->key_version,
+ key_state->rotate_key_age);
crypt_data->rotate_state.scrubbing.is_active =
btr_scrub_start_space(space->id, &state->scrub_data);
@@ -1811,9 +1827,10 @@ fil_crypt_rotate_page(
ut_ad(kv == 0);
ut_ad(page_get_space_id(frame) == 0);
} else if (fil_crypt_needs_rotation(
- crypt_data->encryption,
- kv, key_state->key_version,
- key_state->rotate_key_age)) {
+ crypt_data,
+ kv,
+ key_state->key_version,
+ key_state->rotate_key_age)) {
mtr.set_named_space(space);
modified = true;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 82e3dfb9533..3f707e5e631 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -58,7 +58,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
// MYSQL_PLUGIN_IMPORT extern my_bool lower_case_file_system;
// MYSQL_PLUGIN_IMPORT extern char mysql_unpacked_real_data_home[];
-#include <my_systemd.h>
+#include <my_service_manager.h>
#include <key.h>
/* Include necessary InnoDB headers */
diff --git a/storage/innobase/include/trx0roll.h b/storage/innobase/include/trx0roll.h
index f7b999ae70a..66e6f137b5a 100644
--- a/storage/innobase/include/trx0roll.h
+++ b/storage/innobase/include/trx0roll.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2017, MariaDB Corporation.
+Copyright (c) 2015, 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
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index d9f26319de6..2f423f0b835 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -61,6 +61,10 @@ component, i.e. we show M.N.P as M.N */
IB_TO_STR(INNODB_VERSION_MAJOR) "." \
IB_TO_STR(INNODB_VERSION_MINOR) "/en/"
+/** How far ahead should we tell the service manager the timeout
+(time in seconds) */
+#define INNODB_EXTEND_TIMEOUT_INTERVAL 30
+
#ifdef MYSQL_DYNAMIC_PLUGIN
/* In the dynamic plugin, redefine some externally visible symbols
in order not to conflict with the symbols of a builtin InnoDB. */
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index 9ff474697be..4e3722391b3 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -33,6 +33,7 @@ Created 12/9/1995 Heikki Tuuri
#include "ha_prototypes.h"
#include <debug_sync.h>
+#include <my_service_manager.h>
#include "log0log.h"
#include "log0crypt.h"
@@ -1132,6 +1133,12 @@ log_write_up_to(
return;
}
+ if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "log write up to: " LSN_PF,
+ lsn);
+ }
+
loop:
ut_ad(++loop_count < 128);
@@ -1905,7 +1912,9 @@ loop:
os_event_set(recv_sys->flush_start);
}
}
- os_thread_sleep(100000);
+#define COUNT_INTERVAL 600U
+#define CHECK_INTERVAL 100000U
+ os_thread_sleep(CHECK_INTERVAL);
count++;
@@ -1918,7 +1927,11 @@ loop:
&& srv_force_recovery < SRV_FORCE_NO_TRX_UNDO
? trx_sys_any_active_transactions() : 0) {
- if (srv_print_verbose_log && count > 600) {
+ if (srv_print_verbose_log && count > COUNT_INTERVAL) {
+ service_manager_extend_timeout(
+ COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2,
+ "Waiting for %lu active transactions to finish",
+ (ulong) total_trx);
ib::info() << "Waiting for " << total_trx << " active"
<< " transactions to finish";
@@ -1956,7 +1969,10 @@ loop:
if (thread_name) {
ut_ad(!srv_read_only_mode);
wait_suspend_loop:
- if (srv_print_verbose_log && count > 600) {
+ service_manager_extend_timeout(
+ COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2,
+ "Waiting for %s to exit", thread_name);
+ if (srv_print_verbose_log && count > COUNT_INTERVAL) {
ib::info() << "Waiting for " << thread_name
<< "to exit";
count = 0;
@@ -1991,12 +2007,16 @@ wait_suspend_loop:
before proceeding further. */
count = 0;
+ service_manager_extend_timeout(COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2,
+ "Waiting for page cleaner");
while (buf_page_cleaner_is_active) {
++count;
- os_thread_sleep(100000);
- if (srv_print_verbose_log && count > 600) {
- ib::info() << "Waiting for page_cleaner to"
- " finish flushing of buffer pool";
+ os_thread_sleep(CHECK_INTERVAL);
+ if (srv_print_verbose_log && count > COUNT_INTERVAL) {
+ service_manager_extend_timeout(COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2,
+ "Waiting for page cleaner");
+ ib::info() << "Waiting for page_cleaner to "
+ "finish flushing of buffer pool";
count = 0;
}
}
@@ -2067,6 +2087,8 @@ wait_suspend_loop:
}
if (!srv_read_only_mode) {
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "ensuring dirty buffer pool are written to log");
log_make_checkpoint_at(LSN_MAX, TRUE);
log_mutex_enter();
@@ -2082,22 +2104,6 @@ wait_suspend_loop:
goto loop;
}
- fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
- fil_flush_file_spaces(FIL_TYPE_LOG);
-
- /* The call fil_write_flushed_lsn_to_data_files() will
- bypass the buffer pool: therefore it is essential that
- the buffer pool has been completely flushed to disk! */
-
- if (!buf_all_freed()) {
- if (srv_print_verbose_log && count > 600) {
- ib::info() << "Waiting for dirty buffer pages"
- " to be flushed";
- count = 0;
- }
-
- goto loop;
- }
} else {
lsn = srv_start_lsn;
}
@@ -2107,8 +2113,9 @@ wait_suspend_loop:
/* Make some checks that the server really is quiet */
ut_a(srv_get_active_thread_type() == SRV_NONE);
- bool freed = buf_all_freed();
- ut_a(freed);
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "Free innodb buffer pool");
+ buf_all_freed();
ut_a(lsn == log_sys->lsn
|| srv_force_recovery == SRV_FORCE_NO_LOG_REDO);
@@ -2134,9 +2141,6 @@ wait_suspend_loop:
/* Make some checks that the server really is quiet */
ut_a(srv_get_active_thread_type() == SRV_NONE);
- freed = buf_all_freed();
- ut_a(freed);
-
ut_a(lsn == log_sys->lsn
|| srv_force_recovery == SRV_FORCE_NO_LOG_REDO);
}
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index afcb289d6a0..59f8595c2c4 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -30,7 +30,7 @@ Created 9/20/1997 Heikki Tuuri
#include <vector>
#include <map>
#include <string>
-#include <my_systemd.h>
+#include <my_service_manager.h>
#include "log0recv.h"
@@ -727,8 +727,9 @@ loop:
if (recv_sys->report(ut_time())) {
ib::info() << "Read redo log up to LSN=" << *start_lsn;
- sd_notifyf(0, "STATUS=Read redo log up to LSN=" LSN_PF,
- *start_lsn);
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "Read redo log up to LSN=" LSN_PF,
+ *start_lsn);
}
if (*start_lsn != end_lsn) {
@@ -1936,8 +1937,8 @@ recv_recover_page(bool just_read_in, buf_block_t* block)
if (ulint n = --recv_sys->n_addrs) {
if (recv_sys->report(time)) {
ib::info() << "To recover: " << n << " pages from log";
- sd_notifyf(0, "STATUS=To recover: " ULINTPF
- " pages from log", n);
+ service_manager_extend_timeout(
+ INNODB_EXTEND_TIMEOUT_INTERVAL, "To recover: " ULINTPF " pages from log", n);
}
}
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 73bacb8c6d5..2ad5064b540 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -78,6 +78,12 @@ Created 10/8/1995 Heikki Tuuri
#include "fil0pagecompress.h"
#include "btr0scrub.h"
+#include <my_service_manager.h>
+
+#ifdef WITH_WSREP
+extern int wsrep_debug;
+extern int wsrep_trx_is_aborting(void *thd_ptr);
+#endif
/* The following is the maximum allowed duration of a lock wait. */
UNIV_INTERN ulong srv_fatal_semaphore_wait_threshold = DEFAULT_SRV_FATAL_SEMAPHORE_TIMEOUT;
@@ -2511,6 +2517,9 @@ srv_purge_should_exit(ulint n_purged)
}
/* Slow shutdown was requested. */
if (n_purged) {
+ service_manager_extend_timeout(
+ INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "InnoDB " ULINTPF " pages purged", n_purged);
/* The previous round still did some work. */
return(false);
}
@@ -2702,7 +2711,6 @@ srv_do_purge(ulint* n_total_purged)
(++count % rseg_truncate_frequency) == 0);
*n_total_purged += n_pages_purged;
-
} while (!srv_purge_should_exit(n_pages_purged)
&& n_pages_purged > 0
&& purge_sys->state == PURGE_STATE_RUN);
diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc
index a5be54b7b79..d1f33c2efd6 100644
--- a/storage/innobase/trx/trx0roll.cc
+++ b/storage/innobase/trx/trx0roll.cc
@@ -25,7 +25,7 @@ Created 3/26/1996 Heikki Tuuri
*******************************************************/
#include "my_config.h"
-#include <my_systemd.h>
+#include <my_service_manager.h>
#include "ha_prototypes.h"
#include "trx0roll.h"
@@ -765,7 +765,6 @@ trx_roll_must_shutdown()
const trx_t* trx = trx_roll_crash_recv_trx;
ut_ad(trx);
ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));
- ut_ad(trx->in_rollback);
if (trx_get_dict_operation(trx) == TRX_DICT_OP_NONE
&& !srv_is_being_started
@@ -791,10 +790,15 @@ trx_roll_must_shutdown()
n_rows += t->undo_no;
}
}
+ if (n_rows > 0) {
+ service_manager_extend_timeout(
+ INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "To roll back: " ULINTPF " transactions, "
+ "%llu rows", n_trx, n_rows);
+ }
+
ib::info() << "To roll back: " << n_trx << " transactions, "
<< n_rows << " rows";
- sd_notifyf(0, "STATUS=To roll back: " ULINTPF " transactions, "
- "%llu rows", n_trx, n_rows);
}
mutex_exit(&recv_sys->mutex);
diff --git a/storage/oqgraph/graphcore-graph.cc b/storage/oqgraph/graphcore-graph.cc
index 6decce601fe..42366787340 100644
--- a/storage/oqgraph/graphcore-graph.cc
+++ b/storage/oqgraph/graphcore-graph.cc
@@ -22,6 +22,5 @@
======================================================================
*/
-#include "graphcore-config.h"
#include "graphcore-graph.h"
diff --git a/storage/oqgraph/graphcore.cc b/storage/oqgraph/graphcore.cc
index bf454aa3333..1a7df6147e7 100644
--- a/storage/oqgraph/graphcore.cc
+++ b/storage/oqgraph/graphcore.cc
@@ -25,7 +25,6 @@
#include <string.h>
#include <cstdlib>
-#include "graphcore-config.h"
#include "graphcore-graph.h"
#include <set>
diff --git a/storage/oqgraph/oqgraph_shim.h b/storage/oqgraph/oqgraph_shim.h
index f24732af4ef..df578c9e4d0 100644
--- a/storage/oqgraph/oqgraph_shim.h
+++ b/storage/oqgraph/oqgraph_shim.h
@@ -24,8 +24,8 @@
#pragma once
-#include "oqgraph_thunk.h"
#include "oqgraph_judy.h"
+#include "oqgraph_thunk.h"
#define BOOST_NO_HASH 1
#define BOOST_NO_SLIST 1
diff --git a/storage/sphinx/snippets_udf.cc b/storage/sphinx/snippets_udf.cc
index 1eab4b4ed3d..edde806f682 100644
--- a/storage/sphinx/snippets_udf.cc
+++ b/storage/sphinx/snippets_udf.cc
@@ -178,10 +178,10 @@ enum
SEARCHD_WARNING = 3 ///< general success, warning message and command-specific reply follow
};
-#define SPHINXSE_DEFAULT_SCHEME "sphinx"
-#define SPHINXSE_DEFAULT_HOST "127.0.0.1"
+#define SPHINXSE_DEFAULT_SCHEME (char*) "sphinx"
+#define SPHINXSE_DEFAULT_HOST (char*) "127.0.0.1"
#define SPHINXSE_DEFAULT_PORT 9312
-#define SPHINXSE_DEFAULT_INDEX "*"
+#define SPHINXSE_DEFAULT_INDEX (char*) "*"
class CSphBuffer
{
@@ -447,7 +447,7 @@ int CSphUrl::Connect()
uint uServerVersion;
uint uClientVersion = htonl ( SPHINX_SEARCHD_PROTO );
int iSocket = -1;
- char * pError = NULL;
+ const char * pError = NULL;
do
{
iSocket = (int)socket ( iDomain, SOCK_STREAM, 0 );
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db917.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db917.result
index 9c29033429e..9276664f84f 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db917.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db917.result
@@ -1,8 +1,8 @@
drop table if exists t1;
set @orig_table_open_cache = @@global.table_open_cache;
create table t1(a int) engine = tokudb partition by key(a) partitions 2 (partition p0 engine = tokudb, partition p1 engine = tokudb);
-lock tables t1 read;
-set @@global.table_open_cache = 1;
+lock tables t1 read,t1 as t2 read,t1 as t3 read, t1 as t4 read, t1 as t5 read, t1 as t6 read, t1 as t7 read, t1 as t8 read, t1 as t9 read, t1 as t10 read;
+set @@global.table_open_cache = 10;
begin;
insert into t1 values(1),(1);
select * from t1 where c like _ucs2 0x039C0025 collate ucs2_unicode_ci;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db917.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db917.test
index ae94d7b30de..781fdb012f1 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/db917.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db917.test
@@ -7,8 +7,8 @@ drop table if exists t1;
enable_warnings;
set @orig_table_open_cache = @@global.table_open_cache;
create table t1(a int) engine = tokudb partition by key(a) partitions 2 (partition p0 engine = tokudb, partition p1 engine = tokudb);
-lock tables t1 read;
-set @@global.table_open_cache = 1;
+lock tables t1 read,t1 as t2 read,t1 as t3 read, t1 as t4 read, t1 as t5 read, t1 as t6 read, t1 as t7 read, t1 as t8 read, t1 as t9 read, t1 as t10 read;
+set @@global.table_open_cache = 10;
begin;
insert into t1 values(1),(1);
# when the bug is present, this results in a lock wait timeout
diff --git a/storage/xtradb/buf/buf0dump.cc b/storage/xtradb/buf/buf0dump.cc
index 1cc40fcfbad..ce21a308960 100644
--- a/storage/xtradb/buf/buf0dump.cc
+++ b/storage/xtradb/buf/buf0dump.cc
@@ -42,6 +42,7 @@ Created April 08, 2011 Vasil Dimov
#include "ut0byte.h" /* ut_ull_create() */
#include "ut0sort.h" /* UT_SORT_FUNCTION_BODY */
#include "mysql/service_wsrep.h" /* wsrep_recovery */
+#include <my_service_manager.h>
enum status_severity {
STATUS_INFO,
@@ -333,6 +334,14 @@ buf_dump(
i + 1, srv_buf_pool_instances,
j + 1, n_pages);
}
+ if ( (j % 1024) == 0) {
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "Dumping buffer pool "
+ ULINTPF "/" ULINTPF ", "
+ "page " ULINTPF "/" ULINTPF,
+ i + 1, srv_buf_pool_instances,
+ j + 1, n_pages);
+ }
}
ut_free(dump);
diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc
index 528bfcb9f4a..ffb9c941fe2 100644
--- a/storage/xtradb/buf/buf0flu.cc
+++ b/storage/xtradb/buf/buf0flu.cc
@@ -54,6 +54,8 @@ Created 11/11/1995 Heikki Tuuri
#include "mysql/service_thd_wait.h"
#include "fil0pagecompress.h"
+#include <my_service_manager.h>
+
/** Number of pages flushed through non flush_list flushes. */
// static ulint buf_lru_flush_page_count = 0;
@@ -575,6 +577,17 @@ buf_flush_remove(
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
ulint zip_size;
+#if 0 // FIXME: Rate-limit the output. Move this to the page cleaner?
+ if (UNIV_UNLIKELY(srv_shutdown_state == SRV_SHUTDOWN_FLUSH_PHASE)) {
+ service_manager_extend_timeout(
+ INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "Flush and remove page with tablespace id %u"
+ ", Poolid " ULINTPF ", flush list length " ULINTPF,
+ bpage->space, buf_pool->instance_no,
+ UT_LIST_GET_LEN(buf_pool->flush_list));
+ }
+#endif
+
ut_ad(mutex_own(buf_page_get_mutex(bpage)));
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_ad(buf_page_get_state(bpage) != BUF_BLOCK_ZIP_DIRTY
diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc
index 167f9e48273..f4dd83b566a 100644
--- a/storage/xtradb/fil/fil0crypt.cc
+++ b/storage/xtradb/fil/fil0crypt.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (c) 2014, 2017, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2014, 2018, MariaDB Corporation. All Rights Reserved.
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
@@ -114,17 +114,17 @@ extern my_bool srv_background_scrub_data_compressed;
/***********************************************************************
Check if a key needs rotation given a key_state
-@param[in] encrypt_mode Encryption mode
+@param[in] crypt_data Encryption information
@param[in] key_version Current key version
@param[in] latest_key_version Latest key version
@param[in] rotate_key_age when to rotate
@return true if key needs rotation, false if not */
static bool
fil_crypt_needs_rotation(
- fil_encryption_t encrypt_mode,
- uint key_version,
- uint latest_key_version,
- uint rotate_key_age)
+ const fil_space_crypt_t* crypt_data,
+ uint key_version,
+ uint latest_key_version,
+ uint rotate_key_age)
MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************
@@ -187,7 +187,8 @@ fil_crypt_get_latest_key_version(
if (crypt_data->is_key_found()) {
- if (fil_crypt_needs_rotation(crypt_data->encryption,
+ if (fil_crypt_needs_rotation(
+ crypt_data,
crypt_data->min_key_version,
key_version,
srv_fil_crypt_rotate_key_age)) {
@@ -963,17 +964,17 @@ fil_crypt_get_key_state(
/***********************************************************************
Check if a key needs rotation given a key_state
-@param[in] encrypt_mode Encryption mode
+@param[in] crypt_data Encryption information
@param[in] key_version Current key version
@param[in] latest_key_version Latest key version
@param[in] rotate_key_age when to rotate
@return true if key needs rotation, false if not */
static bool
fil_crypt_needs_rotation(
- fil_encryption_t encrypt_mode,
- uint key_version,
- uint latest_key_version,
- uint rotate_key_age)
+ const fil_space_crypt_t* crypt_data,
+ uint key_version,
+ uint latest_key_version,
+ uint rotate_key_age)
{
if (key_version == ENCRYPTION_KEY_VERSION_INVALID) {
return false;
@@ -986,13 +987,20 @@ fil_crypt_needs_rotation(
}
if (latest_key_version == 0 && key_version != 0) {
- if (encrypt_mode == FIL_ENCRYPTION_DEFAULT) {
+ if (crypt_data->encryption == FIL_ENCRYPTION_DEFAULT) {
/* this is rotation encrypted => unencrypted */
return true;
}
return false;
}
+ if (crypt_data->encryption == FIL_ENCRYPTION_DEFAULT
+ && crypt_data->type == CRYPT_SCHEME_1
+ && srv_encrypt_tables == 0 ) {
+ /* This is rotation encrypted => unencrypted */
+ return true;
+ }
+
/* this is rotation encrypted => encrypted,
* only reencrypt if key is sufficiently old */
if (key_version + rotate_key_age < latest_key_version) {
@@ -1008,10 +1016,17 @@ static inline
void
fil_crypt_read_crypt_data(fil_space_t* space)
{
- if (space->crypt_data || space->size) {
+ if (space->crypt_data || space->size
+ || !fil_space_get_size(space->id)) {
/* The encryption metadata has already been read, or
the tablespace is not encrypted and the file has been
- opened already. */
+ opened already, or the file cannot be accessed,
+ likely due to a concurrent TRUNCATE or
+ RENAME or DROP (possibly as part of ALTER TABLE).
+ FIXME: The file can become unaccessible any time
+ after this check! We should really remove this
+ function and instead make crypt_data an integral
+ part of fil_space_t. */
return;
}
@@ -1272,9 +1287,10 @@ fil_crypt_space_needs_rotation(
}
bool need_key_rotation = fil_crypt_needs_rotation(
- crypt_data->encryption,
+ crypt_data,
crypt_data->min_key_version,
- key_state->key_version, key_state->rotate_key_age);
+ key_state->key_version,
+ key_state->rotate_key_age);
crypt_data->rotate_state.scrubbing.is_active =
btr_scrub_start_space(space->id, &state->scrub_data);
@@ -1862,9 +1878,10 @@ fil_crypt_rotate_page(
ut_ad(kv == 0);
ut_ad(page_get_space_id(frame) == 0);
} else if (fil_crypt_needs_rotation(
- crypt_data->encryption,
- kv, key_state->key_version,
- key_state->rotate_key_age)) {
+ crypt_data,
+ kv,
+ key_state->key_version,
+ key_state->rotate_key_age)) {
modified = true;
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 0f5ef12bfb3..c711cc565f7 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -50,7 +50,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include <io.h>
#endif
-#include <my_systemd.h>
+#include <my_service_manager.h>
/** @file ha_innodb.cc */
diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i
index e6c4917f532..f4adc2e8e54 100644
--- a/storage/xtradb/include/univ.i
+++ b/storage/xtradb/include/univ.i
@@ -73,6 +73,10 @@ component, i.e. we show M.N.P as M.N */
IB_TO_STR(INNODB_VERSION_MAJOR) "." \
IB_TO_STR(INNODB_VERSION_MINOR) "/en/"
+/** How far ahead should we tell the service manager the timeout
+(time in seconds) */
+#define INNODB_EXTEND_TIMEOUT_INTERVAL 30
+
#ifdef MYSQL_DYNAMIC_PLUGIN
/* In the dynamic plugin, redefine some externally visible symbols
in order not to conflict with the symbols of a builtin InnoDB. */
diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc
index 8f8984f8880..cb61e3fb0c6 100644
--- a/storage/xtradb/log/log0log.cc
+++ b/storage/xtradb/log/log0log.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
-Copyright (c) 2014, 2017, MariaDB Corporation.
+Copyright (c) 2014, 2018, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -49,7 +49,7 @@ Created 12/9/1995 Heikki Tuuri
#ifndef UNIV_HOTBACKUP
#if MYSQL_VERSION_ID < 100200
-# include <my_systemd.h> /* sd_notifyf() */
+# include <my_service_manager.h>
#endif
#include "mem0mem.h"
@@ -1561,6 +1561,12 @@ log_write_up_to(
return;
}
+ if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "log write up to: " LSN_PF,
+ lsn);
+ }
+
loop:
ut_ad(++loop_count < 100);
@@ -2602,8 +2608,9 @@ loop:
if (recv_recovery_is_on() && recv_sys && recv_sys->report(ut_time())) {
ib_logf(IB_LOG_LEVEL_INFO, "Read redo log up to LSN=" LSN_PF,
start_lsn);
- sd_notifyf(0, "STATUS=Read redo log up to LSN=" LSN_PF,
- start_lsn);
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "Read redo log up to LSN=" LSN_PF,
+ start_lsn);
}
if (start_lsn != end_lsn) {
@@ -3553,7 +3560,9 @@ loop:
os_event_set(lock_sys->timeout_event);
os_event_set(dict_stats_event);
}
- os_thread_sleep(100000);
+#define COUNT_INTERVAL 600U
+#define CHECK_INTERVAL 100000U
+ os_thread_sleep(CHECK_INTERVAL);
count++;
@@ -3565,7 +3574,11 @@ loop:
if (ulint total_trx = srv_was_started && !srv_read_only_mode
&& srv_force_recovery < SRV_FORCE_NO_TRX_UNDO
? trx_sys_any_active_transactions() : 0) {
- if (srv_print_verbose_log && count > 600) {
+ if (srv_print_verbose_log && count > COUNT_INTERVAL) {
+ service_manager_extend_timeout(
+ COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2,
+ "Waiting for %lu active transactions to finish",
+ (ulong) total_trx);
ib_logf(IB_LOG_LEVEL_INFO,
"Waiting for %lu active transactions to finish",
(ulong) total_trx);
@@ -3600,7 +3613,10 @@ loop:
if (thread_name) {
ut_ad(!srv_read_only_mode);
wait_suspend_loop:
- if (srv_print_verbose_log && count > 600) {
+ service_manager_extend_timeout(
+ COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2,
+ "Waiting for %s to exit", thread_name);
+ if (srv_print_verbose_log && count > COUNT_INTERVAL) {
ib_logf(IB_LOG_LEVEL_INFO,
"Waiting for %s to exit", thread_name);
count = 0;
@@ -3636,6 +3652,8 @@ wait_suspend_loop:
before proceeding further. */
count = 0;
+ service_manager_extend_timeout(COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2,
+ "Waiting for page cleaner");
os_rmb;
while (buf_page_cleaner_is_active || buf_lru_manager_is_active) {
if (srv_print_verbose_log && count == 0) {
@@ -3644,8 +3662,10 @@ wait_suspend_loop:
"finish flushing of buffer pool");
}
++count;
- os_thread_sleep(100000);
- if (count > 600) {
+ os_thread_sleep(CHECK_INTERVAL);
+ if (srv_print_verbose_log && count > COUNT_INTERVAL) {
+ service_manager_extend_timeout(COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2,
+ "Waiting for page cleaner");
count = 0;
}
os_rmb;
@@ -3730,6 +3750,8 @@ wait_suspend_loop:
}
if (!srv_read_only_mode) {
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "ensuring dirty buffer pool are written to log");
log_make_checkpoint_at(LSN_MAX, TRUE);
mutex_enter(&log_sys->mutex);
@@ -3758,23 +3780,6 @@ wait_suspend_loop:
mutex_exit(&log_sys->mutex);
- fil_flush_file_spaces(FIL_TABLESPACE);
- fil_flush_file_spaces(FIL_LOG);
-
- /* The call fil_write_flushed_lsn_to_data_files() will
- bypass the buffer pool: therefore it is essential that
- the buffer pool has been completely flushed to disk! */
-
- if (!buf_all_freed()) {
- if (srv_print_verbose_log && count > 600) {
- ib_logf(IB_LOG_LEVEL_INFO,
- "Waiting for dirty buffer pages"
- " to be flushed");
- count = 0;
- }
-
- goto loop;
- }
} else {
lsn = srv_start_lsn;
}
@@ -3791,8 +3796,9 @@ wait_suspend_loop:
srv_thread_type type = srv_get_active_thread_type();
ut_a(type == SRV_NONE);
- bool freed = buf_all_freed();
- ut_a(freed);
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "Free innodb buffer pool");
+ buf_all_freed();
ut_a(lsn == log_sys->lsn);
ut_ad(srv_force_recovery >= SRV_FORCE_NO_LOG_REDO
@@ -3824,9 +3830,6 @@ wait_suspend_loop:
type = srv_get_active_thread_type();
ut_a(type == SRV_NONE);
- freed = buf_all_freed();
- ut_a(freed);
-
ut_a(lsn == log_sys->lsn);
}
diff --git a/storage/xtradb/log/log0recv.cc b/storage/xtradb/log/log0recv.cc
index 1943fb51f37..d8e90de45e9 100644
--- a/storage/xtradb/log/log0recv.cc
+++ b/storage/xtradb/log/log0recv.cc
@@ -30,7 +30,7 @@ Created 9/20/1997 Heikki Tuuri
#include <stdio.h> // Solaris/x86 header file bug
#include <vector>
-#include <my_systemd.h>
+#include <my_service_manager.h>
#include "log0recv.h"
@@ -1804,8 +1804,8 @@ recv_recover_page_func(
if (recv_sys->report(time)) {
ib_logf(IB_LOG_LEVEL_INFO,
"To recover: " ULINTPF " pages from log", n);
- sd_notifyf(0, "STATUS=To recover: " ULINTPF
- " pages from log", n);
+ service_manager_extend_timeout(
+ INNODB_EXTEND_TIMEOUT_INTERVAL, "To recover: " ULINTPF " pages from log", n);
}
}
@@ -3001,6 +3001,9 @@ recv_init_crash_recovery(void)
and restore them from the doublewrite buffer if
possible */
+ service_manager_extend_timeout(
+ INNODB_EXTEND_TIMEOUT_INTERVAL, "Starting Innodb crash recovery");
+
if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
buf_dblwr_process();
diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc
index 0ec49ab39e3..3e3b44d9106 100644
--- a/storage/xtradb/srv/srv0srv.cc
+++ b/storage/xtradb/srv/srv0srv.cc
@@ -86,6 +86,12 @@ ibool innobase_get_slow_log();
in the server */
UNIV_INTERN ulint srv_activity_count = 0;
+#include <my_service_manager.h>
+
+#ifdef WITH_WSREP
+extern int wsrep_debug;
+extern int wsrep_trx_is_aborting(void *thd_ptr);
+#endif
/* The following is the maximum allowed duration of a lock wait. */
UNIV_INTERN ulong srv_fatal_semaphore_wait_threshold = DEFAULT_SRV_FATAL_SEMAPHORE_TIMEOUT;
@@ -3225,6 +3231,9 @@ srv_purge_should_exit(ulint n_purged)
}
/* Slow shutdown was requested. */
if (n_purged) {
+ service_manager_extend_timeout(
+ INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "InnoDB " ULINTPF " pages purged", n_purged);
/* The previous round still did some work. */
return(false);
}
@@ -3429,7 +3438,6 @@ srv_do_purge(
(++count % TRX_SYS_N_RSEGS) == 0);
*n_total_purged += n_pages_purged;
-
} while (!srv_purge_should_exit(n_pages_purged)
&& n_pages_purged > 0
&& purge_sys->state == PURGE_STATE_RUN);
diff --git a/storage/xtradb/trx/trx0roll.cc b/storage/xtradb/trx/trx0roll.cc
index 1075064a2d6..56b7120fa34 100644
--- a/storage/xtradb/trx/trx0roll.cc
+++ b/storage/xtradb/trx/trx0roll.cc
@@ -25,7 +25,7 @@ Created 3/26/1996 Heikki Tuuri
*******************************************************/
#include "my_config.h"
-#include <my_systemd.h>
+#include <my_service_manager.h>
#include "trx0roll.h"
@@ -764,11 +764,17 @@ trx_roll_must_shutdown()
n_rows += t->undo_no;
}
}
+
+ if (n_rows > 0) {
+ service_manager_extend_timeout(
+ INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "To roll back: " ULINTPF " transactions, "
+ "%llu rows", n_trx, n_rows);
+ }
+
ib_logf(IB_LOG_LEVEL_INFO,
"To roll back: " ULINTPF " transactions, "
"%llu rows", n_trx, n_rows);
- sd_notifyf(0, "STATUS=To roll back: " ULINTPF " transactions, "
- "%llu rows", n_trx, n_rows);
}
mutex_exit(&recv_sys->mutex);