summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/default_mysqld.cnf1
-rw-r--r--mysql-test/include/have_perfschema.inc2
-rw-r--r--mysql-test/include/icp_tests.inc21
-rw-r--r--mysql-test/include/install_semisync.inc39
-rw-r--r--mysql-test/include/uninstall_semisync.inc24
-rw-r--r--mysql-test/include/wait_for_slave_param.inc2
-rw-r--r--mysql-test/lib/My/CoreDump.pm10
-rw-r--r--mysql-test/lib/My/SafeProcess/CMakeLists.txt20
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.cc2
-rw-r--r--mysql-test/lib/My/SysInfo.pm4
-rwxr-xr-xmysql-test/lib/v1/mysql-test-run.pl11
-rwxr-xr-xmysql-test/mysql-test-run.pl14
-rw-r--r--mysql-test/purify.supp4
-rw-r--r--mysql-test/r/adddate_454.result2
-rw-r--r--mysql-test/r/cast.result28
-rw-r--r--mysql-test/r/date_formats.result2
-rw-r--r--mysql-test/r/fulltext_derived_4257.result6
-rw-r--r--mysql-test/r/func_sapdb.result6
-rw-r--r--mysql-test/r/func_time.result32
-rw-r--r--mysql-test/r/grant_4332.result26
-rw-r--r--mysql-test/r/group_min_max.result42
-rw-r--r--mysql-test/r/index_merge_myisam.result26
-rw-r--r--mysql-test/r/information_schema_routines.result10
-rw-r--r--mysql-test/r/innodb_icp,innodb_plugin.rdiff17
-rw-r--r--mysql-test/r/innodb_icp.result27
-rw-r--r--mysql-test/r/join.result5
-rw-r--r--mysql-test/r/mdev316.result2
-rw-r--r--mysql-test/r/mrr_derived_crash_4610.result19
-rw-r--r--mysql-test/r/mrr_icp_extra.result2
-rw-r--r--mysql-test/r/myisam_icp.result29
-rw-r--r--mysql-test/r/mysql_binary_mode.result50
-rw-r--r--mysql-test/r/mysql_upgrade.result1
-rw-r--r--mysql-test/r/mysqld--help.result2
-rw-r--r--mysql-test/r/not_partition.result20
-rw-r--r--mysql-test/r/null_key.result20
-rw-r--r--mysql-test/r/order_by.result2
-rw-r--r--mysql-test/r/outfile_loaddata.result8
-rw-r--r--mysql-test/r/parser.result8
-rw-r--r--mysql-test/r/partition_datatype.result9
-rw-r--r--mysql-test/r/partition_pruning.result3
-rw-r--r--mysql-test/r/plugin.result21
-rw-r--r--mysql-test/r/processlist.result15
-rw-r--r--mysql-test/r/servers.result8
-rw-r--r--mysql-test/r/show_check.result10
-rw-r--r--mysql-test/r/shutdown.result5
-rw-r--r--mysql-test/r/sp_missing_4665.result6
-rw-r--r--mysql-test/r/str_to_datetime_457.result4
-rw-r--r--mysql-test/r/strict.result8
-rw-r--r--mysql-test/r/subselect.result4
-rw-r--r--mysql-test/r/subselect_exists_to_in.result4
-rw-r--r--mysql-test/r/subselect_innodb.result44
-rw-r--r--mysql-test/r/subselect_no_mat.result4
-rw-r--r--mysql-test/r/subselect_no_opts.result4
-rw-r--r--mysql-test/r/subselect_no_scache.result4
-rw-r--r--mysql-test/r/subselect_no_semijoin.result4
-rw-r--r--mysql-test/r/subselect_sj.result36
-rw-r--r--mysql-test/r/subselect_sj2.result22
-rw-r--r--mysql-test/r/subselect_sj2_jcl6.result22
-rw-r--r--mysql-test/r/subselect_sj2_mat.result22
-rw-r--r--mysql-test/r/subselect_sj_jcl6.result36
-rw-r--r--mysql-test/r/temporal_literal.result4
-rw-r--r--mysql-test/r/type_date.result13
-rw-r--r--mysql-test/r/type_datetime.result12
-rw-r--r--mysql-test/r/type_datetime_hires.result12
-rw-r--r--mysql-test/r/type_time.result11
-rw-r--r--mysql-test/r/variables.result2
-rw-r--r--mysql-test/r/view.result12
-rw-r--r--mysql-test/suite/archive/discover.result11
-rw-r--r--mysql-test/suite/archive/discover.test20
-rw-r--r--mysql-test/suite/archive/repair.result10
-rw-r--r--mysql-test/suite/archive/repair.test17
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_annotate.result2
-rw-r--r--mysql-test/suite/federated/federated.result6
-rw-r--r--mysql-test/suite/federated/federated.test12
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result16
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result16
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_events.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_routines.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_triggers.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_views.result6
-rw-r--r--mysql-test/suite/handler/disconnect_4480.result5
-rw-r--r--mysql-test/suite/handler/disconnect_4480.test10
-rw-r--r--mysql-test/suite/maria/icp.result29
-rw-r--r--mysql-test/suite/maria/maria3.result2
-rw-r--r--mysql-test/suite/perfschema/r/ortho_iter.result2
-rw-r--r--mysql-test/suite/perfschema/r/privilege_table_io.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_idle.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_stages.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_statements.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_waits.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_innodb.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_account.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_host.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_actors.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_objects.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stage_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_hdl.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_user.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_off.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_on.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_off.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result2
-rw-r--r--mysql-test/suite/plugins/r/audit_null.result6
-rw-r--r--mysql-test/suite/plugins/r/fulltext_plugin.result2
-rw-r--r--mysql-test/suite/plugins/r/locales.result112
-rw-r--r--mysql-test/suite/plugins/r/pam_cleartext.result10
-rw-r--r--mysql-test/suite/plugins/t/audit_null.test1
-rw-r--r--mysql-test/suite/plugins/t/fulltext_plugin.test6
-rw-r--r--mysql-test/suite/plugins/t/locales.opt3
-rw-r--r--mysql-test/suite/plugins/t/locales.test7
-rw-r--r--mysql-test/suite/plugins/t/pam.test13
-rw-r--r--mysql-test/suite/plugins/t/pam_cleartext.opt1
-rw-r--r--mysql-test/suite/plugins/t/pam_cleartext.test12
-rw-r--r--mysql-test/suite/plugins/t/pam_init.inc14
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_basic.result47
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result63
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_reconnect.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_startpos.result36
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_stop_start.result95
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_m.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev382.result2
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_db.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_basic.test37
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test58
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_reconnect.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_startpos.test73
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_stop_start.test154
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_m.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev382.test1
-rw-r--r--mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/join_buffer_size_basic.result14
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/sort_buffer_size_basic.result11
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test6
-rw-r--r--mysql-test/suite/sys_vars/t/join_buffer_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/sort_buffer_size_basic.test5
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result4
-rw-r--r--mysql-test/t/cast.test3
-rw-r--r--mysql-test/t/fulltext_derived_4257.test6
-rw-r--r--mysql-test/t/func_time.test8
-rw-r--r--mysql-test/t/grant_4332.test22
-rw-r--r--mysql-test/t/group_min_max.test47
-rw-r--r--mysql-test/t/index_merge_myisam.test27
-rw-r--r--mysql-test/t/join.test7
-rw-r--r--mysql-test/t/mrr_derived_crash_4610.test16
-rw-r--r--mysql-test/t/mysql_binary_mode.test169
-rw-r--r--mysql-test/t/mysql_upgrade.test4
-rw-r--r--mysql-test/t/mysqld--help.test3
-rw-r--r--mysql-test/t/plugin.test21
-rw-r--r--mysql-test/t/processlist.test35
-rw-r--r--mysql-test/t/servers.test8
-rw-r--r--mysql-test/t/shutdown.test28
-rw-r--r--mysql-test/t/sp_missing_4665.test9
-rw-r--r--mysql-test/t/strict.test10
-rw-r--r--mysql-test/t/subselect_innodb.test41
-rw-r--r--mysql-test/t/subselect_sj.test38
-rw-r--r--mysql-test/t/subselect_sj2.test29
-rw-r--r--mysql-test/t/type_date.test9
-rw-r--r--mysql-test/t/type_datetime.test5
-rw-r--r--mysql-test/t/type_datetime_hires.test9
-rw-r--r--mysql-test/t/type_time.test9
-rw-r--r--mysql-test/t/variables.test3
-rw-r--r--mysql-test/t/view.test14
232 files changed, 2415 insertions, 334 deletions
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
index 1aa551af57f..1c21a4f03cc 100644
--- a/mysql-test/include/default_mysqld.cnf
+++ b/mysql-test/include/default_mysqld.cnf
@@ -36,6 +36,7 @@ log-bin-trust-function-creators=1
key_buffer_size= 1M
sort_buffer= 256K
max_heap_table_size= 1M
+loose-aria-pagecache-buffer-size=8M
loose-feedback-user-info= mysql-test
diff --git a/mysql-test/include/have_perfschema.inc b/mysql-test/include/have_perfschema.inc
index 6d52a53b6b1..6b558e07c20 100644
--- a/mysql-test/include/have_perfschema.inc
+++ b/mysql-test/include/have_perfschema.inc
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
if (!`SELECT count(*) FROM information_schema.engines WHERE
(support = 'YES' OR support = 'DEFAULT') AND
diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc
index ffe8d7f1eb1..7c9feea55c2 100644
--- a/mysql-test/include/icp_tests.inc
+++ b/mysql-test/include/icp_tests.inc
@@ -892,3 +892,24 @@ insert into t1 values ('',1);
select 1 from t1 where b <= 1 and a <> '';
drop table t1;
+--echo #
+--echo # MDEV-4778: Incorrect results from Aria/MyISAM SELECT using index with prefix length on TEXT column
+--echo #
+CREATE TABLE t1 (
+ c1 TEXT ,
+ c2 VARCHAR(2) ,
+ INDEX idx1 (c2,c1(2)),
+ INDEX idx2 (c2,c1(1))
+);
+
+INSERT INTO t1 (c1,c2) VALUES ('aa','x'), ('a' ,'y');
+
+SELECT * FROM t1 IGNORE INDEX(idx1,idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+
+EXPLAIN
+SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+
+SELECT * FROM t1 FORCE INDEX(idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+
+DROP TABLE t1;
diff --git a/mysql-test/include/install_semisync.inc b/mysql-test/include/install_semisync.inc
new file mode 100644
index 00000000000..368b7b7cb4a
--- /dev/null
+++ b/mysql-test/include/install_semisync.inc
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+#
+--let $include_filename= install_semisync.inc
+--source include/begin_include_file.inc
+
+--source include/not_embedded.inc
+--source include/have_semisync_plugin.inc
+
+--connection master
+
+--disable_query_log
+--let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1)
+if ($value == No such row)
+{
+ SET sql_log_bin = 0;
+ eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+ SET GLOBAL rpl_semi_sync_master_enabled = 1;
+ SET sql_log_bin = 1;
+}
+--enable_query_log
+
+--connection slave
+--source include/stop_slave_io.inc
+
+--disable_query_log
+--let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1)
+if ($value == No such row)
+{
+ SET sql_log_bin = 0;
+ eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
+ SET GLOBAL rpl_semi_sync_slave_enabled = 1;
+ SET sql_log_bin = 1;
+}
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+--enable_query_log
+
+--source include/end_include_file.inc
diff --git a/mysql-test/include/uninstall_semisync.inc b/mysql-test/include/uninstall_semisync.inc
new file mode 100644
index 00000000000..11668d1db97
--- /dev/null
+++ b/mysql-test/include/uninstall_semisync.inc
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+#
+--let $include_filename= uninstall_semisync.inc
+--source include/begin_include_file.inc
+
+--disable_query_log
+--connection slave
+--source include/stop_slave_io.inc
+
+# Uninstall rpl_semi_sync_slave first
+--disable_warnings
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+
+--connection master
+UNINSTALL PLUGIN rpl_semi_sync_master;
+--enable_warnings
+
+--connection slave
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+--enable_query_log
+
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc
index d6cff32b398..d3f7ec56614 100644
--- a/mysql-test/include/wait_for_slave_param.inc
+++ b/mysql-test/include/wait_for_slave_param.inc
@@ -12,7 +12,7 @@
# [--let $slave_timeout= NUMBER]
# [--let $slave_error_param= [Slave_SQL_Errno | Slave_IO_Errno]]
# [--let $rpl_debug= 1]
-# --source include/slave_wait_param.inc
+# --source include/wait_for_slave_param.inc
#
# Parameters:
#
diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm
index 419a0e7f39f..0e90967ef95 100644
--- a/mysql-test/lib/My/CoreDump.pm
+++ b/mysql-test/lib/My/CoreDump.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2013, Oracle and/or its affiliates. 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
@@ -255,13 +255,17 @@ EOF
sub show {
- my ($class, $core_name, $exe_mysqld)= @_;
+ my ($class, $core_name, $exe_mysqld, $parallel)= @_;
$hint_mysqld= $exe_mysqld;
# On Windows, rely on cdb to be there...
if (IS_WINDOWS)
{
- _cdb($core_name);
+ # Starting cdb is unsafe when used with --parallel > 1 option
+ if ( $parallel < 2 )
+ {
+ _cdb($core_name);
+ }
return;
}
diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt
index 95e23756c30..7d39129d0f5 100644
--- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt
+++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2013, Oracle and/or its affiliates. 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
@@ -13,6 +13,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+IF (NOT INSTALL_MYSQLTESTDIR)
+ RETURN()
+ENDIF()
+
SET(INSTALL_ARGS
DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess"
COMPONENT Test
@@ -25,8 +29,16 @@ ELSE()
MYSQL_ADD_EXECUTABLE(my_safe_process safe_process.cc ${INSTALL_ARGS})
ENDIF()
-INSTALL(TARGETS my_safe_process DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test)
+INSTALL(TARGETS my_safe_process
+ DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test
+)
+
IF(WIN32)
- INSTALL(TARGETS my_safe_kill DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test)
+ INSTALL(TARGETS my_safe_kill
+ DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test
+ )
ENDIF()
-INSTALL(FILES Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test)
+
+INSTALL(FILES Base.pm
+ DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test
+)
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
index f41a77ff6ac..007acf77617 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/*
diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm
index 28660f44bae..36c50ab91d1 100644
--- a/mysql-test/lib/My/SysInfo.pm
+++ b/mysql-test/lib/My/SysInfo.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2008 MySQL AB, 2008 Sun Microsystems, Inc.
+# Copyright (c) 2013 MySQL AB, 2008 Sun Microsystems, Inc.
# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
@@ -60,7 +60,7 @@ sub _cpuinfo {
}
# Make sure bogomips is set to some value
- $cpuinfo->{bogomips} |= DEFAULT_BOGO_MIPS;
+ $cpuinfo->{bogomips} ||= DEFAULT_BOGO_MIPS;
# Cpus reported once, but with 'cpu_count' set to the actual number
my $cpu_count= $cpuinfo->{cpu_count} || 1;
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
index b3360aec986..6249ea0f6c1 100755
--- a/mysql-test/lib/v1/mysql-test-run.pl
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# -*- cperl -*-
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2013, Oracle and/or its affiliates. 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
@@ -133,7 +133,6 @@ our $path_timefile;
our $path_snapshot;
our $path_mysqltest_log;
our $path_current_test_log;
-our $path_my_basedir;
our $opt_vardir; # A path but set directly on cmd line
our $path_vardir_trace; # unix formatted opt_vardir for trace files
@@ -779,8 +778,6 @@ sub command_line_setup () {
$glob_mysql_bench_dir= undef
unless -d $glob_mysql_bench_dir;
- $path_my_basedir=
- $source_dist ? $glob_mysql_test_dir : $glob_basedir;
$glob_timers= mtr_init_timers();
@@ -3171,7 +3168,7 @@ sub install_db ($$) {
mtr_init_args(\$args);
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--bootstrap");
- mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
+ mtr_add_arg($args, "--basedir=%s", $glob_basedir);
mtr_add_arg($args, "--datadir=%s", $data_dir);
mtr_add_arg($args, "--loose-skip-ndbcluster");
mtr_add_arg($args, "--loose-skip-aria");
@@ -3333,7 +3330,7 @@ log = $instance->{path_datadir}/mysqld$server_id.log
log-error = $instance->{path_datadir}/mysqld$server_id.err.log
log-slow-queries = $instance->{path_datadir}/mysqld$server_id.slow.log
character-sets-dir = $path_charsetsdir
-basedir = $path_my_basedir
+basedir = $glob_basedir
server_id = $server_id
shutdown-delay = 10
skip-stack-trace
@@ -3942,7 +3939,7 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--no-defaults", $prefix);
- mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
+ mtr_add_arg($args, "%s--basedir=%s", $prefix, $glob_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
if ( $mysql_version_id >= 50036)
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 90988c73c66..ea5b556fbaf 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1,8 +1,8 @@
#!/usr/bin/perl
# -*- cperl -*-
-# Copyright (c) 2004, 2012, Oracle and/or its affiliates.
-# Copyright (c) 2009, 2012, Monty Program Ab
+# Copyright (c) 2004, 2013, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2013, Monty Program Ab
#
# 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
@@ -377,7 +377,13 @@ sub main {
# directly before it executes them, like "make test-force-pl" in RPM builds.
mtr_report("Logging: $0 ", join(" ", @ARGV));
- $DEFAULT_SUITES.=",sequence,sql_discovery,spider,spider/bg" if $source_dist;
+ $DEFAULT_SUITES.= ',' . join(',', qw(
+ query_response_time
+ sequence
+ spider
+ spider/bg
+ sql_discovery
+ )) if $source_dist;
command_line_setup();
@@ -691,7 +697,7 @@ sub run_test_server ($$$) {
mtr_report(" - found '$core_name'",
"($num_saved_cores/$opt_max_save_core)");
- My::CoreDump->show($core_file, $exe_mysqld);
+ My::CoreDump->show($core_file, $exe_mysqld, $opt_parallel);
if ($num_saved_cores >= $opt_max_save_core) {
mtr_report(" - deleting it, already saved",
diff --git a/mysql-test/purify.supp b/mysql-test/purify.supp
index 74ed8c42181..230dae20140 100644
--- a/mysql-test/purify.supp
+++ b/mysql-test/purify.supp
@@ -12,8 +12,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA
suppress UMR rw_read_held; mi_open; ha_myisam::open64; handler::ha_open; openfrm
suppress UMR my_end; main
diff --git a/mysql-test/r/adddate_454.result b/mysql-test/r/adddate_454.result
index 0993cdce32c..8b7c17cd47e 100644
--- a/mysql-test/r/adddate_454.result
+++ b/mysql-test/r/adddate_454.result
@@ -4,6 +4,8 @@ select * from t1;
d
2012-00-00
update t1 set d = adddate(d, interval 1 day);
+Warnings:
+Warning 1292 Incorrect datetime value: '2012-00-00'
select * from t1;
d
NULL
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index ac7be28d736..03b4b84e461 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -268,37 +268,37 @@ cast(010203101112.121314 as datetime)
0001-02-03 10:11:12
select cast(120010203101112.121314 as datetime);
cast(120010203101112.121314 as datetime)
-0000-00-00 00:00:00
+NULL
Warnings:
Warning 1292 Incorrect datetime value: '120010203101112.121314'
select cast(cast(1.1 as decimal) as datetime);
cast(cast(1.1 as decimal) as datetime)
-0000-00-00 00:00:00
+NULL
Warnings:
Warning 1292 Incorrect datetime value: '1'
select cast(cast(-1.1 as decimal) as datetime);
cast(cast(-1.1 as decimal) as datetime)
-0000-00-00 00:00:00
+NULL
Warnings:
Warning 1292 Incorrect datetime value: '-1'
select cast('0' as date);
cast('0' as date)
-0000-00-00
+NULL
Warnings:
Warning 1292 Incorrect datetime value: '0'
select cast('' as date);
cast('' as date)
-0000-00-00
+NULL
Warnings:
Warning 1292 Incorrect datetime value: ''
select cast('0' as datetime);
cast('0' as datetime)
-0000-00-00 00:00:00
+NULL
Warnings:
Warning 1292 Incorrect datetime value: '0'
select cast('' as datetime);
cast('' as datetime)
-0000-00-00 00:00:00
+NULL
Warnings:
Warning 1292 Incorrect datetime value: ''
select cast('0' as time);
@@ -306,7 +306,7 @@ cast('0' as time)
00:00:00
select cast('' as time);
cast('' as time)
-00:00:00
+NULL
Warnings:
Warning 1292 Truncated incorrect time value: ''
select cast(NULL as DATE);
@@ -323,13 +323,13 @@ cast(NULL as BINARY)
NULL
select cast(cast(120010203101112.121314 as double) as datetime);
cast(cast(120010203101112.121314 as double) as datetime)
-0000-00-00 00:00:00
+NULL
select cast(cast(1.1 as double) as datetime);
cast(cast(1.1 as double) as datetime)
0000-00-00 00:00:01
select cast(cast(-1.1 as double) as datetime);
cast(cast(-1.1 as double) as datetime)
-0000-00-00 00:00:00
+NULL
explain extended select cast(10 as double(5,2));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@@ -786,4 +786,10 @@ SELECT CAST(TIME('10:20:30') AS DATE) + INTERVAL 1 DAY;
CAST(TIME('10:20:30') AS DATE) + INTERVAL 1 DAY
NULL
Warnings:
-Warning 1292 Truncated incorrect date value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
+SET SQL_MODE=ALLOW_INVALID_DATES;
+SELECT DATE("foo");
+DATE("foo")
+NULL
+Warnings:
+Warning 1292 Incorrect datetime value: 'foo'
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index 3bbd25cbbcc..7f69fd1a5a4 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -521,7 +521,7 @@ TIME_FORMAT("25:00:00", '%l %p')
1 AM
SELECT DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896);
DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896)
-1151414896
+NULL
Warnings:
Warning 1292 Incorrect datetime value: '%Y-%m-%d %H:%i:%s'
select str_to_date('04 /30/2004', '%m /%d/%Y');
diff --git a/mysql-test/r/fulltext_derived_4257.result b/mysql-test/r/fulltext_derived_4257.result
new file mode 100644
index 00000000000..8479baef388
--- /dev/null
+++ b/mysql-test/r/fulltext_derived_4257.result
@@ -0,0 +1,6 @@
+set optimizer_switch = 'derived_merge=on';
+create table t1 (c1 char(8), c2 char(8)) engine=myisam;
+insert into t1 values ('test1','test2'),('test3','test4');
+select * from (select c1 from t1 where match (c2) against ('hello' in boolean mode)) as alias;
+c1
+drop table t1;
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index 1f20ddc6cbb..72c7a5a128f 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -168,7 +168,7 @@ date("1997-12-31 23:59:59.000001")
1997-12-31
select date("1997-13-31 23:59:59.000001");
date("1997-13-31 23:59:59.000001")
-0000-00-00
+NULL
Warnings:
Warning 1292 Incorrect datetime value: '1997-13-31 23:59:59.000001'
select time("1997-12-31 23:59:59.000001");
@@ -176,7 +176,7 @@ time("1997-12-31 23:59:59.000001")
23:59:59.000001
select time("1997-12-31 25:59:59.000001");
time("1997-12-31 25:59:59.000001")
-00:00:00
+NULL
Warnings:
Warning 1292 Truncated incorrect time value: '1997-12-31 25:59:59.000001'
select microsecond("1997-12-31 23:59:59.000001");
@@ -250,8 +250,6 @@ a
select microsecond(19971231235959.01) as a;
a
10000
-Warnings:
-Warning 1292 Truncated incorrect time value: '19971231235959.01'
select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a;
a
1997-12-31 00:00:10.090000
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index e8526ae8f1f..f50458695a7 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -1222,14 +1222,13 @@ DROP TABLE t1,t2;
set time_zone= @@global.time_zone;
select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
-NULL
-Warnings:
-Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date
+22:10:00
select str_to_date("1997-00-04 22:23:00","%Y-%m-%D") + interval 10 minute;
str_to_date("1997-00-04 22:23:00","%Y-%m-%D") + interval 10 minute
NULL
Warnings:
-Warning 1411 Incorrect datetime value: '1997-00-04 22:23:00' for function str_to_date
+Warning 1292 Truncated incorrect date value: '1997-00-04 22:23:00'
+Warning 1292 Incorrect datetime value: '1997-00-04'
create table t1 (field DATE);
insert into t1 values ('2006-11-06');
select * from t1 where field < '2006-11-06 04:08:36.0';
@@ -1423,13 +1422,15 @@ MAKEDATE(11111111,1)
NULL
SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1)
-0
+NULL
+Warnings:
+Warning 1292 Incorrect datetime value: '0000-00-00'
#
# Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0,
#
DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5);
Warnings:
-Warning 1292 Incorrect datetime value: '0'
+Warning 1292 Incorrect datetime value: '0000-00-00'
#
# BUG#13458237 INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY
# SIMILAR TO '2009-10-00'
@@ -1713,6 +1714,7 @@ min(timestampadd(month, 1>'', from_days('%Z')))
NULL
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '%Z'
+Warning 1292 Incorrect datetime value: '0000-00-00'
create table t1(a time);
insert into t1 values ('00:00:00'),('00:01:00');
select 1 from t1 where 1 < some (select cast(a as datetime) from t1);
@@ -1781,7 +1783,7 @@ Warnings:
Warning 1441 Datetime function: time field overflow
select cast('131415.123e0' as time);
cast('131415.123e0' as time)
-00:00:00
+NULL
Warnings:
Warning 1292 Truncated incorrect time value: '131415.123e0'
select cast('2010-01-02 03:04:05' as datetime) between null and '2010-01-02 03:04:04';
@@ -1801,12 +1803,12 @@ unix_timestamp(null)
NULL
select truncate(date('2010-40-10'), 6);
truncate(date('2010-40-10'), 6)
-0.000000
+NULL
Warnings:
Warning 1292 Incorrect datetime value: '2010-40-10'
select extract(month from '2010-40-50');
extract(month from '2010-40-50')
-0
+NULL
Warnings:
Warning 1292 Incorrect datetime value: '2010-40-50'
select subtime('0000-00-10 10:10:10', '30 10:00:00');
@@ -1884,6 +1886,8 @@ insert into t1 values ('0000-00-00');
select timestampadd(week, 1, f1) from t1;
timestampadd(week, 1, f1)
NULL
+Warnings:
+Warning 1292 Incorrect datetime value: '0000-00-00'
select timestampadd(week, 1, date("0000-00-00"));
timestampadd(week, 1, date("0000-00-00"))
NULL
@@ -1936,3 +1940,13 @@ SELECT 1 FROM DUAL WHERE MINUTE(TIMEDIFF(NULL, '12:12:12'));
1
SELECT 1 FROM DUAL WHERE SECOND(TIMEDIFF(NULL, '12:12:12'));
1
+#
+# MDEV-4635 Crash in UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
+#
+SET TIME_ZONE='+02:00';
+SELECT UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'));
+UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
+NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '2020' for function str_to_date
+SET TIME_ZONE=DEFAULT;
diff --git a/mysql-test/r/grant_4332.result b/mysql-test/r/grant_4332.result
index ef92b62ab32..cca7825a07e 100644
--- a/mysql-test/r/grant_4332.result
+++ b/mysql-test/r/grant_4332.result
@@ -41,7 +41,7 @@ a17aaaaaaaaaaaaa0 localhost
b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0 localhost
c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0 localhost
select user,host from mysql.db;
-ERROR 42000: SELECT command denied to user 'b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'@'localhost' for table 'db'
+ERROR 42000: SELECT command denied to user 'b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0'@'localhost' for table 'db'
select user(), current_user();
user() current_user()
c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost
@@ -54,15 +54,37 @@ user
b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0
c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0
select user,host from mysql.tables_priv;
-ERROR 42000: SELECT command denied to user 'c80ccccccccccccccccccccccccccccccccccccccccccccc'@'localhost' for column 'host' in table 'tables_priv'
+ERROR 42000: SELECT command denied to user 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost' for column 'host' in table 'tables_priv'
+use mtr;
+ERROR 42000: Access denied for user 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost' to database 'mtr'
+drop procedure mtr.add_suppression;
+ERROR 42000: alter routine command denied to user 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost' for routine 'mtr.add_suppression'
create procedure test.p1() select user(), current_user(), user from mysql.tables_priv;
show create procedure test.p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p1 CREATE DEFINER=`c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0`@`localhost` PROCEDURE `p1`()
select user(), current_user(), user from mysql.tables_priv latin1 latin1_swedish_ci latin1_swedish_ci
+select definer from information_schema.routines;
+definer
+c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost
create table test.t1 (a text);
create event e1 on schedule every 1 second
do insert test.t1 values (concat(user(), ' ', current_user()));
+select definer from information_schema.events;
+definer
+c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost
+create view v1 as select * from t1;
+select definer from information_schema.views;
+definer
+c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost
+drop view v1;
+create trigger tr1 before delete on t1 for each row set @a:=1;
+select definer from information_schema.triggers;
+definer
+c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost
+drop trigger tr1;
+connect(localhost,c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0,foobar,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost' (using password: YES)
call test.p1();
user() current_user() user
root@localhost c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index cc7c9c4d364..229481f5ec8 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -3561,3 +3561,45 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL PRIMARY 5 NULL 9 Using index for group-by (scanning)
drop table t1;
# End of test#50539.
+#
+# MDEV-4219 A simple select query returns random data (upstream bug#68473)
+#
+drop table if exists faulty;
+CREATE TABLE faulty (
+a int(11) unsigned NOT NULL AUTO_INCREMENT,
+b int(11) unsigned NOT NULL,
+c datetime NOT NULL,
+PRIMARY KEY (a),
+UNIQUE KEY b_and_c (b,c)
+);
+INSERT INTO faulty (b, c) VALUES
+(1801, '2013-02-15 09:00:00'),
+(1802, '2013-02-28 09:00:00'),
+(1802, '2013-03-01 09:00:00'),
+(5, '1990-02-15 09:00:00'),
+(5, '2013-02-15 09:00:00'),
+(5, '2009-02-15 17:00:00');
+EXPLAIN
+SELECT DISTINCT b, c FROM faulty WHERE b='1802' ORDER BY c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE faulty range b_and_c b_and_c 12 NULL 2 Using where; Using index for group-by; Using filesort
+SELECT DISTINCT b, c FROM faulty WHERE b='1802' ORDER BY c;
+b c
+1802 2013-02-28 09:00:00
+1802 2013-03-01 09:00:00
+drop table faulty;
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3);
+INSERT INTO t1 SELECT a + 1, b FROM t1;
+INSERT INTO t1 SELECT a + 2, b FROM t1;
+CREATE INDEX break_it ON t1 (a, b);
+EXPLAIN
+SELECT distinct a, b FROM t1 where a = '3' ORDER BY b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range break_it break_it 10 NULL 2 Using where; Using index for group-by; Using filesort
+SELECT distinct a, b FROM t1 where a = '3' ORDER BY b;
+a b
+3 1
+3 2
+3 3
+drop table t1;
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index 0b6959d15a9..e771d48b6d2 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -1617,4 +1617,30 @@ GROUP BY 2;
COUNT(DISTINCT t2.b) CONCAT(t1.c)
2 0
DROP TABLE t1,t2,t3;
+#
+# MDEV-4556 Server crashes in SEL_ARG::rb_insert with index_merge+index_merge_sort_union, FORCE INDEX
+#
+CREATE TABLE t1 (
+pk int,
+code char(2),
+population_rate int,
+area_rate int,
+primary key (pk),
+index (code),
+key (population_rate),
+key (area_rate)
+);
+INSERT INTO t1 VALUES (1,'WI',20, 23), (2, 'WA', 13, 18);
+EXPLAIN
+SELECT * FROM t1 FORCE INDEX ( PRIMARY, population_rate, area_rate, code )
+WHERE pk = 1 OR population_rate = 1 OR ( area_rate IN ( 1,2 ) OR area_rate IS NULL )
+AND (population_rate = 25 OR area_rate BETWEEN 2 AND 25 OR code BETWEEN 'MA' AND 'TX');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge PRIMARY,code,population_rate,area_rate PRIMARY,population_rate,area_rate 4,5,5 NULL 2 Using sort_union(PRIMARY,population_rate,area_rate); Using where
+SELECT * FROM t1 FORCE INDEX ( PRIMARY, population_rate, area_rate, code )
+WHERE pk = 1 OR population_rate = 1 OR ( area_rate IN ( 1,2 ) OR area_rate IS NULL )
+AND (population_rate = 25 OR area_rate BETWEEN 2 AND 25 OR code BETWEEN 'MA' AND 'TX');
+pk code population_rate area_rate
+1 WI 20 23
+DROP TABLE t1;
set optimizer_switch= @optimizer_switch_save;
diff --git a/mysql-test/r/information_schema_routines.result b/mysql-test/r/information_schema_routines.result
index 36f8637faa9..b8f4fb9b1ef 100644
--- a/mysql-test/r/information_schema_routines.result
+++ b/mysql-test/r/information_schema_routines.result
@@ -30,7 +30,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
`ROUTINE_COMMENT` longtext NOT NULL,
- `DEFINER` varchar(77) NOT NULL DEFAULT '',
+ `DEFINER` varchar(189) NOT NULL DEFAULT '',
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
`COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
`DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
@@ -587,14 +587,14 @@ ORDINAL_POSITION 28
COLUMN_DEFAULT
IS_NULLABLE NO
DATA_TYPE varchar
-CHARACTER_MAXIMUM_LENGTH 77
-CHARACTER_OCTET_LENGTH 231
+CHARACTER_MAXIMUM_LENGTH 189
+CHARACTER_OCTET_LENGTH 567
NUMERIC_PRECISION NULL
NUMERIC_SCALE NULL
DATETIME_PRECISION NULL
CHARACTER_SET_NAME utf8
COLLATION_NAME utf8_general_ci
-COLUMN_TYPE varchar(77)
+COLUMN_TYPE varchar(189)
COLUMN_KEY
EXTRA
PRIVILEGES #
@@ -688,7 +688,7 @@ CREATED datetime NO 0000-00-00 00:00:00
LAST_ALTERED datetime NO 0000-00-00 00:00:00
SQL_MODE varchar(8192) NO
ROUTINE_COMMENT longtext NO NULL
-DEFINER varchar(77) NO
+DEFINER varchar(189) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
diff --git a/mysql-test/r/innodb_icp,innodb_plugin.rdiff b/mysql-test/r/innodb_icp,innodb_plugin.rdiff
index c74a8473486..3cb85b79ece 100644
--- a/mysql-test/r/innodb_icp,innodb_plugin.rdiff
+++ b/mysql-test/r/innodb_icp,innodb_plugin.rdiff
@@ -1,5 +1,5 @@
---- r/innodb_icp.result 2012-02-25 17:31:11.000000000 +0100
-+++ /usr/home/serg/Abk/mysql/5.5-mtr/mysql-test/r/innodb_icp,innodb_plugin.reject 2012-02-25 22:32:18.000000000 +0100
+--- r/innodb_icp.result 2013-07-16 17:01:00.000000000 +0400
++++ r/innodb_icp,innodb_plugin.reject 2013-07-16 17:16:53.000000000 +0400
@@ -213,7 +213,7 @@
EXPLAIN
SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2;
@@ -45,5 +45,14 @@
+Handler_icp_attempts 0
+Handler_icp_match 0
DROP TABLE t1;
- #
- # BUG#920132: Assert trx->n_active_thrs == 1 failed at que0que.c line 1050
+ create table t1 (a int,b char(5),primary key (a), key (b(1)));
+ insert into t1 values ('a','b');
+@@ -868,7 +868,7 @@
+ EXPLAIN
+ SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+ id select_type table type possible_keys key key_len ref rows Extra
+-1 SIMPLE t1 range idx1 idx1 10 NULL 2 Using index condition; Using where
++1 SIMPLE t1 range idx1 idx1 10 NULL 2 Using where
+ SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+ c1 c2
+ aa x
diff --git a/mysql-test/r/innodb_icp.result b/mysql-test/r/innodb_icp.result
index 54ad9ecafad..07c75986392 100644
--- a/mysql-test/r/innodb_icp.result
+++ b/mysql-test/r/innodb_icp.result
@@ -852,6 +852,33 @@ select 1 from t1 where b <= 1 and a <> '';
1
drop table t1;
#
+# MDEV-4778: Incorrect results from Aria/MyISAM SELECT using index with prefix length on TEXT column
+#
+CREATE TABLE t1 (
+c1 TEXT ,
+c2 VARCHAR(2) ,
+INDEX idx1 (c2,c1(2)),
+INDEX idx2 (c2,c1(1))
+);
+INSERT INTO t1 (c1,c2) VALUES ('aa','x'), ('a' ,'y');
+SELECT * FROM t1 IGNORE INDEX(idx1,idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+c1 c2
+aa x
+a y
+EXPLAIN
+SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1 idx1 10 NULL 2 Using index condition; Using where
+SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+c1 c2
+aa x
+a y
+SELECT * FROM t1 FORCE INDEX(idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+c1 c2
+aa x
+a y
+DROP TABLE t1;
+#
# BUG#920132: Assert trx->n_active_thrs == 1 failed at que0que.c line 1050
#
CREATE TABLE t1 ( a INT )
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 1d045d0a58d..0e5b36acb10 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -1472,6 +1472,11 @@ dog_id dog_id birthday dog_id t_id birthday dog_id t_id birthday a_id dog_id
5918 5918 2004-07-22 5918 N 2004-07-22 5918 N 2004-07-22 5992424 5918
SET optimizer_switch=@tmp_optimizer_switch;
DROP TABLE t1,t2,t3,t4,t5;
+#
+# MDEV-4752: Segfault during parsing of illegal query
+#
+SELECT * FROM t5 JOIN (t1 JOIN t2 UNION SELECT * FROM t3 JOIN t4);
+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
SET optimizer_switch=@save_optimizer_switch;
#
# Bug #35268: Parser can't handle STRAIGHT_JOIN with USING
diff --git a/mysql-test/r/mdev316.result b/mysql-test/r/mdev316.result
index 78272549e81..43082769872 100644
--- a/mysql-test/r/mdev316.result
+++ b/mysql-test/r/mdev316.result
@@ -16,7 +16,7 @@ cast(convert(0x0030 using ucs2) as decimal(5.2)) cast(concat(convert(0x0030 usin
0 0
select cast(convert(_ucs2 0x0030 using latin1) as date), cast(concat(convert(_ucs2 0x0030 using latin1)) as date);
cast(convert(_ucs2 0x0030 using latin1) as date) cast(concat(convert(_ucs2 0x0030 using latin1)) as date)
-0000-00-00 0000-00-00
+NULL NULL
Warnings:
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '0'
diff --git a/mysql-test/r/mrr_derived_crash_4610.result b/mysql-test/r/mrr_derived_crash_4610.result
new file mode 100644
index 00000000000..8dcdfda9276
--- /dev/null
+++ b/mysql-test/r/mrr_derived_crash_4610.result
@@ -0,0 +1,19 @@
+create table t1 (f1 char(4) primary key) engine=innodb charset=utf8 ;
+insert into t1 values ('aaaa');
+create table t2 (f2 text, f3 char(4) not null) engine=innodb charset=utf8 ;
+create table t3 (id int not null) engine=innodb charset=utf8 ;
+create table t4 (val int not null) engine=innodb charset=utf8;
+explain select 1 from
+(select f2, f3, val, count(id) from t4 join t2 left join t3 on 0) top
+join t1 on f1 = f3 where f3 = 'aaaa' order by val;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 const PRIMARY PRIMARY 12 const 1 Using index; Using filesort
+1 PRIMARY <derived2> ref key0 key0 13 const 0 Using where
+2 DERIVED t4 ALL NULL NULL NULL NULL 1
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
+2 DERIVED t3 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+select 1 from
+(select f2, f3, val, count(id) from t4 join t2 left join t3 on 0) top
+join t1 on f1 = f3 where f3 = 'aaaa' order by val;
+1
+drop table t1, t2, t3, t4;
diff --git a/mysql-test/r/mrr_icp_extra.result b/mysql-test/r/mrr_icp_extra.result
index 5e49fb6e956..f7adcfb19fd 100644
--- a/mysql-test/r/mrr_icp_extra.result
+++ b/mysql-test/r/mrr_icp_extra.result
@@ -105,7 +105,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range FieldKey FieldKey 38 NULL 4 Using index condition; Rowid-ordered scan; Using filesort
EXPLAIN SELECT * FROM t1 IGNORE INDEX (FieldKey, LongField) WHERE FieldKey > '2' ORDER BY LongVal;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range StringField StringField 38 NULL 4 Using index condition; Using filesort
+1 SIMPLE t1 range StringField StringField 38 NULL 4 Using where; Using filesort
SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
FieldKey LongVal StringVal
3 1 2
diff --git a/mysql-test/r/myisam_icp.result b/mysql-test/r/myisam_icp.result
index bc7ebf9c439..2c157102270 100644
--- a/mysql-test/r/myisam_icp.result
+++ b/mysql-test/r/myisam_icp.result
@@ -211,7 +211,7 @@ c-1006=w
EXPLAIN
SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 range c1 c1 12 NULL 2 Using index condition; Using where
+1 SIMPLE t3 range c1 c1 12 NULL 2 Using where
SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2;
c1
EXPLAIN
@@ -855,6 +855,33 @@ insert into t1 values ('',1);
select 1 from t1 where b <= 1 and a <> '';
1
drop table t1;
+#
+# MDEV-4778: Incorrect results from Aria/MyISAM SELECT using index with prefix length on TEXT column
+#
+CREATE TABLE t1 (
+c1 TEXT ,
+c2 VARCHAR(2) ,
+INDEX idx1 (c2,c1(2)),
+INDEX idx2 (c2,c1(1))
+);
+INSERT INTO t1 (c1,c2) VALUES ('aa','x'), ('a' ,'y');
+SELECT * FROM t1 IGNORE INDEX(idx1,idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+c1 c2
+aa x
+a y
+EXPLAIN
+SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1 idx1 10 NULL 2 Using where
+SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+c1 c2
+aa x
+a y
+SELECT * FROM t1 FORCE INDEX(idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+c1 c2
+aa x
+a y
+DROP TABLE t1;
drop table if exists t0, t1, t1i, t1m;
#
# BUG#826935 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed
diff --git a/mysql-test/r/mysql_binary_mode.result b/mysql-test/r/mysql_binary_mode.result
new file mode 100644
index 00000000000..cb230037108
--- /dev/null
+++ b/mysql-test/r/mysql_binary_mode.result
@@ -0,0 +1,50 @@
+RESET MASTER;
+# Bug#33048 Not able to recover binary/blob data correctly using mysqlbinlog
+# --------------------------------------------------------------------------
+# The test verify that 0x00 and 0x0D0A sequence can be handled correctly by
+# mysql
+
+CREATE TABLE `A
+B` (c1 CHAR(100));
+# It is a faked statement. ASCII 0 is in the original statement, it would
+# make the test result to become a binary file which was difficult to get
+# the diff result if the original query was logged in the result.
+INSERT INTO `A\r\nB` VALUES("A\0B");
+
+INSERT INTO `A
+B` VALUES("A
+B");
+SELECT HEX(c1) FROM `A
+B`;
+HEX(c1)
+410042
+410D0A42
+
+FLUSH LOGS;
+DROP TABLE `A
+B`;
+
+RESET MASTER;
+# '--exec mysql ...' without --binary-mode option
+# It creates the table with a wrong table name and generates an error.
+# (error output was suppressed to make the test case platform agnostic)
+
+# It is not in binary_mode, so table name '0x410D0A42' can be translated to
+# '0x410A42' by mysql depending on the OS - Windows or Unix-like.
+DROP TABLE `TABLE_NAME_MASKED`;
+
+# In binary_mode, table name '0x410D0A42' and string '0x410042' can be
+# handled correctly.
+RESET MASTER;
+SELECT HEX(c1) FROM `A
+B`;
+HEX(c1)
+410042
+410D0A42
+
+DROP TABLE `A
+B`;
+RESET MASTER;
+include/assert.inc [Table and contents created through mysqltest match 0x610D0A62.]
+include/assert.inc [Table and contents created while replaying binary log without --binary-mode set match 0x61(0D)0A62.]
+include/assert.inc [Table and contents created while replaying binary log with --binary-mode set match 0x610D0A62.]
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index 3921d6c9627..a08e6f63fb4 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -136,7 +136,6 @@ Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK
DROP USER mysqltest1@'%';
Run mysql_upgrade with a non existing server socket
-Phase 1/3: Fixing table and database names
mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
FATAL ERROR: Upgrade failed
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index 51dfc3123a4..5f8cf38ac09 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -1174,7 +1174,7 @@ performance-schema-max-rwlock-instances 1000000
performance-schema-max-socket-classes 10
performance-schema-max-socket-instances 1000
performance-schema-max-stage-classes 150
-performance-schema-max-statement-classes 173
+performance-schema-max-statement-classes 174
performance-schema-max-table-handles 10000
performance-schema-max-table-instances 1000
performance-schema-max-thread-classes 50
diff --git a/mysql-test/r/not_partition.result b/mysql-test/r/not_partition.result
index 3c0523279a9..adda476da95 100644
--- a/mysql-test/r/not_partition.result
+++ b/mysql-test/r/not_partition.result
@@ -3,7 +3,7 @@ FLUSH TABLES;
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'partition'
TRUNCATE TABLE t1;
-ERROR 42S02: Table 'test.t1' doesn't exist
+ERROR 42000: Unknown storage engine 'partition'
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze Error Unknown storage engine 'partition'
@@ -21,17 +21,17 @@ Table Op Msg_type Msg_text
test.t1 repair Error Unknown storage engine 'partition'
test.t1 repair error Corrupt
ALTER TABLE t1 REPAIR PARTITION ALL;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working
ALTER TABLE t1 CHECK PARTITION ALL;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working
ALTER TABLE t1 OPTIMIZE PARTITION ALL;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working
ALTER TABLE t1 ANALYZE PARTITION ALL;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working
ALTER TABLE t1 REBUILD PARTITION ALL;
ERROR 42000: Unknown storage engine 'partition'
ALTER TABLE t1 TRUNCATE PARTITION ALL;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working
ALTER TABLE t1 ENGINE Memory;
ERROR 42000: Unknown storage engine 'partition'
ALTER TABLE t1 ADD (new INT);
@@ -46,9 +46,9 @@ joined DATE NOT NULL
)
PARTITION BY KEY(joined)
PARTITIONS 6;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working
ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working
drop table t1;
ERROR 42S02: Unknown table 't1'
CREATE TABLE t1 (
@@ -65,7 +65,7 @@ PARTITION p2 VALUES LESS THAN (1980),
PARTITION p3 VALUES LESS THAN (1990),
PARTITION p4 VALUES LESS THAN MAXVALUE
);
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working
drop table t1;
ERROR 42S02: Unknown table 't1'
CREATE TABLE t1 (id INT, purchased DATE)
@@ -76,7 +76,7 @@ PARTITION p0 VALUES LESS THAN (1990),
PARTITION p1 VALUES LESS THAN (2000),
PARTITION p2 VALUES LESS THAN MAXVALUE
);
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working
drop table t1;
ERROR 42S02: Unknown table 't1'
create table t1 (a varchar(10) charset latin1 collate latin1_bin);
diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result
index ba79011f53e..e80851329a4 100644
--- a/mysql-test/r/null_key.result
+++ b/mysql-test/r/null_key.result
@@ -78,13 +78,13 @@ insert into t2 select * from t1;
alter table t1 modify b blob not null, add c int not null, drop key a, add unique key (a,b(20),c), drop key b, add key (b(10));
explain select * from t1 where a is null and b = 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where
+1 SIMPLE t1 ref a,b a 5 const 3 Using where
explain select * from t1 where a is null and b = 2 and c=0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where
+1 SIMPLE t1 ref a,b a 5 const 3 Using where
explain select * from t1 where a is null and b = 7 and c=0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where
+1 SIMPLE t1 ref a,b a 5 const 3 Using where
explain select * from t1 where a=2 and b = 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a,b a 5 const 1 Using where
@@ -93,25 +93,25 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 12 Using where
explain select * from t1 where (a is null or a > 0 and a < 3) and b < 5 and c=0 limit 3;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a,b a 5 NULL 5 Using index condition; Using where
+1 SIMPLE t1 range a,b a 5 NULL 5 Using where
explain select * from t1 where (a is null or a = 7) and b=7 and c=0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref_or_null a,b a 5 const 4 Using index condition; Using where
+1 SIMPLE t1 ref_or_null a,b a 5 const 4 Using where
explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where
+1 SIMPLE t1 ref a,b a 5 const 3 Using where
explain select * from t1 where a is null and b=9 or a is null and b=7 limit 3;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where
+1 SIMPLE t1 ref a,b a 5 const 3 Using where
explain select * from t1 where a > 1 and a < 3 limit 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 5 NULL 1 Using index condition
+1 SIMPLE t1 range a a 5 NULL 1 Using where
explain select * from t1 where a is null and b=7 or a > 1 and a < 3 limit 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a,b a 5 NULL 4 Using index condition; Using where
+1 SIMPLE t1 range a,b a 5 NULL 4 Using where
explain select * from t1 where a > 8 and a < 9;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 5 NULL 1 Using index condition
+1 SIMPLE t1 range a a 5 NULL 1 Using where
explain select * from t1 where b like "6%";
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range b b 12 NULL 1 Using where
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 054dc9e4fc4..a8e610a561a 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -618,7 +618,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range FieldKey FieldKey 38 NULL 4 Using index condition; Using filesort
EXPLAIN SELECT * FROM t1 IGNORE INDEX (FieldKey, LongField) WHERE FieldKey > '2' ORDER BY LongVal;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range StringField StringField 38 NULL 4 Using index condition; Using filesort
+1 SIMPLE t1 range StringField StringField 38 NULL 4 Using where; Using filesort
SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
FieldKey LongVal StringVal
3 1 2
diff --git a/mysql-test/r/outfile_loaddata.result b/mysql-test/r/outfile_loaddata.result
index 36a72fd84ce..e91855b8dcd 100644
--- a/mysql-test/r/outfile_loaddata.result
+++ b/mysql-test/r/outfile_loaddata.result
@@ -143,15 +143,8 @@ TRUNCATE t2;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary FIELDS TERMINATED BY 'ъ';
Warnings:
Warning 1638 Non-ASCII separator arguments are not fully supported
-Warning 1265 Data truncated for column 'a' at row 1
-Warning 1261 Row 1 doesn't contain data for all columns
-Warning 1261 Row 1 doesn't contain data for all columns
-Warning 1265 Data truncated for column 'a' at row 2
-Warning 1261 Row 2 doesn't contain data for all columns
-Warning 1261 Row 2 doesn't contain data for all columns
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
a b c
-1 NULL NULL
1 ABC-АБВ DEF-ÂÃÄ
2 NULL NULL
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' LINES STARTING BY 'ъ';
@@ -181,7 +174,6 @@ Warning 1638 Non-ASCII separator arguments are not fully supported
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
a b c
1 ABC-АБВ DEF-ÂÃÄ
-1 ABC-АБВ DEF-ÂÃÄÑŠ2
2 NULL NULL
# Default (binary) charset:
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FROM t1;
diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result
index 54378f16d49..e81eea6e887 100644
--- a/mysql-test/r/parser.result
+++ b/mysql-test/r/parser.result
@@ -555,14 +555,10 @@ ERROR 42000: Incorrect parameters in the call to native function 'atan'
DROP TABLE IF EXISTS t1;
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
-NULL
-Warnings:
-Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date
+22:10:00
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE
-NULL
-Warnings:
-Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date
+22:01:00
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
"1997-12-31 23:59:59" + INTERVAL 1 SECOND
1998-01-01 00:00:00
diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result
index 8d72d8781ee..804d9dd1c34 100644
--- a/mysql-test/r/partition_datatype.result
+++ b/mysql-test/r/partition_datatype.result
@@ -699,6 +699,7 @@ a tz
2038-01-19 03:14:06 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a);
Warnings:
+Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1264 Out of range value for column 'a' at row 34
Warning 1264 Out of range value for column 'a' at row 35
SELECT MIN(a), MAX(a) FROM t2;
@@ -780,6 +781,10 @@ a tz
2038-01-19 03:14:07 UTC
2011-10-30 00:00:02 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a);
+Warnings:
+Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
SELECT MIN(a), MAX(a) FROM t2;
MIN(a) MAX(a)
1970-01-01 00:00:01 2038-01-19 03:14:06
@@ -1174,6 +1179,7 @@ a tz
2038-01-19 06:14:06 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a);
Warnings:
+Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 8
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 9
Warning 1264 Out of range value for column 'a' at row 34
@@ -1258,6 +1264,9 @@ a tz
2011-10-30 03:00:02 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a);
Warnings:
+Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 18
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 19
SELECT MIN(a), MAX(a) FROM t2;
diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result
index f4d473c00d5..ec7fd798d4c 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -2235,10 +2235,9 @@ INSERT INTO t1 VALUES (1, '2009-01-01'), (2, NULL);
# test with an invalid date, which lead to item->null_value is set.
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-99' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401 ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Warning 1292 Incorrect datetime value: '2009-04-99'
-Warning 1292 Incorrect datetime value: '2009-04-99'
DROP TABLE t1;
CREATE TABLE t1
(a INT NOT NULL AUTO_INCREMENT,
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index e175d59cbac..241e7a11ecc 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -199,3 +199,24 @@ select 1;
1
1
UNINSTALL PLUGIN example;
+UNINSTALL PLUGIN MyISAM;
+ERROR HY000: Built-in plugins cannot be deleted
+select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
+plugin_name
+install soname 'ha_example';
+select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
+plugin_name
+EXAMPLE
+UNUSABLE
+uninstall plugin example;
+select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
+plugin_name
+UNUSABLE
+install soname 'ha_example';
+select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
+plugin_name
+EXAMPLE
+UNUSABLE
+uninstall soname 'ha_example';
+select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
+plugin_name
diff --git a/mysql-test/r/processlist.result b/mysql-test/r/processlist.result
new file mode 100644
index 00000000000..fc03f920533
--- /dev/null
+++ b/mysql-test/r/processlist.result
@@ -0,0 +1,15 @@
+SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time';
+SELECT 1;
+SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed';
+SELECT INFO,TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO IS NULL;
+1
+1
+SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
+INFO TIME TIME_MS
+NULL 0 0.000
+select sleep(5);
+sleep(5)
+0
+select command, time < 5 from information_schema.processlist where id != connection_id();
+command time < 5
+Sleep 1
diff --git a/mysql-test/r/servers.result b/mysql-test/r/servers.result
new file mode 100644
index 00000000000..c9d82c9cfcc
--- /dev/null
+++ b/mysql-test/r/servers.result
@@ -0,0 +1,8 @@
+#
+# MDEV-4594 - CREATE SERVER crashes embedded
+#
+CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(HOST 'localhost');
+SELECT * FROM mysql.servers;
+Server_name Host Db Username Password Port Socket Wrapper Owner
+s1 localhost 0 mysql
+DROP SERVER s1;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 809aef3ac99..44a37b9a9e5 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -998,7 +998,7 @@ def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 1
def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33
def information_schema TRIGGERS TRIGGERS CREATED Created 12 19 0 Y 128 0 63
def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33
-def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 231 14 N 1 0 33
+def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 567 14 N 1 0 33
def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33
def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33
def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
@@ -1042,7 +1042,7 @@ def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFER
def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33
def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33
def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
-def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 567 14 N 1 0 33
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER
def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost
----------------------------------------------------------------
@@ -1065,7 +1065,7 @@ def information_schema VIEWS VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
def information_schema VIEWS VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33
def information_schema VIEWS VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33
def information_schema VIEWS VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33
-def information_schema VIEWS VIEWS DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema VIEWS VIEWS DEFINER DEFINER 253 567 14 N 1 0 33
def information_schema VIEWS VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
def information_schema VIEWS VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33
def information_schema VIEWS VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33
@@ -1123,7 +1123,7 @@ def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33
-def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 567 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
----------------------------------------------------------------
@@ -1178,7 +1178,7 @@ def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33
-def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 567 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
f1 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
----------------------------------------------------------------
diff --git a/mysql-test/r/shutdown.result b/mysql-test/r/shutdown.result
new file mode 100644
index 00000000000..fae3af1cd08
--- /dev/null
+++ b/mysql-test/r/shutdown.result
@@ -0,0 +1,5 @@
+create user user1@localhost;
+shutdown;
+ERROR 42000: Access denied; you need (at least one of) the SHUTDOWN privilege(s) for this operation
+shutdown;
+drop user user1@localhost;
diff --git a/mysql-test/r/sp_missing_4665.result b/mysql-test/r/sp_missing_4665.result
new file mode 100644
index 00000000000..47587c180c6
--- /dev/null
+++ b/mysql-test/r/sp_missing_4665.result
@@ -0,0 +1,6 @@
+create table t (a int);
+create or replace view v as select 1 from t where a;
+delete from v where (select g());
+ERROR 42000: FUNCTION test.g does not exist
+drop view v;
+drop table t;
diff --git a/mysql-test/r/str_to_datetime_457.result b/mysql-test/r/str_to_datetime_457.result
index 630be9ffbaa..4fd0d00691c 100644
--- a/mysql-test/r/str_to_datetime_457.result
+++ b/mysql-test/r/str_to_datetime_457.result
@@ -12,12 +12,12 @@ Warning 1292 Truncated incorrect datetime value: '2012103123595912'
Warning 1292 Truncated incorrect datetime value: '20121031235959123'
select cast(0 as date), cast('0000-00-00' as date), cast('0' as date);
cast(0 as date) cast('0000-00-00' as date) cast('0' as date)
-0000-00-00 0000-00-00 0000-00-00
+0000-00-00 0000-00-00 NULL
Warnings:
Warning 1292 Incorrect datetime value: '0'
select extract(hour from '100000:02:03'), extract(hour from '100000:02:03 ');
extract(hour from '100000:02:03') extract(hour from '100000:02:03 ')
-0 0
+NULL NULL
Warnings:
Warning 1292 Truncated incorrect time value: '100000:02:03'
Warning 1292 Truncated incorrect time value: '100000:02:03 '
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index 139994445f9..cee4cf3ebe6 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -206,7 +206,9 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y'));
INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
-ERROR HY000: Incorrect datetime value: '31.10.0000 15.30' for function str_to_date
+Warnings:
+Note 1265 Data truncated for column 'col1' at row 1
+INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
ERROR HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_date
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
@@ -221,8 +223,6 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
ERROR HY000: Incorrect datetime value: '00.00.0000' for function str_to_date
-INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
-ERROR HY000: Incorrect datetime value: '31.10.0000 15.30' for function str_to_date
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
ERROR HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_date
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
@@ -238,7 +238,7 @@ ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_da
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
ERROR HY000: Incorrect datetime value: '00.00.0000' for function str_to_date
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
-ERROR HY000: Incorrect datetime value: '31.10.0000 15.30' for function str_to_date
+ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
ERROR HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_date
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index b3536661125..eac53365329 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -5173,9 +5173,9 @@ a 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 'ON 1' at line 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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ') ON 1' at line 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
diff --git a/mysql-test/r/subselect_exists_to_in.result b/mysql-test/r/subselect_exists_to_in.result
index 579277f11f9..a71e57b2566 100644
--- a/mysql-test/r/subselect_exists_to_in.result
+++ b/mysql-test/r/subselect_exists_to_in.result
@@ -5179,9 +5179,9 @@ a 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 'ON 1' at line 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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ') ON 1' at line 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result
index 0b339738432..a5800883711 100644
--- a/mysql-test/r/subselect_innodb.result
+++ b/mysql-test/r/subselect_innodb.result
@@ -450,4 +450,48 @@ a d2
select distinct (1 + (select 1 from `t2` where `a`)) `d2` from `t1`;
d2
drop table t1,t2;
+#
+# MDEV-4042: Assertion `table->key_read == 0' fails in close_thread_table on EXPLAIN with GROUP BY and HAVING in EXISTS SQ,
+# MDEV-4536: ...sql/sql_base.cc:1598: bool close_thread_table(THD*, TABLE**): Assertion `table->key_read == 0' failed.
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (b INT PRIMARY KEY, c INT) ENGINE=InnoDB;
+CREATE TABLE t3 (d INT) ENGINE=InnoDB;
+EXPLAIN
+SELECT * FROM t1 WHERE EXISTS ( SELECT b FROM t2, t3 GROUP BY b HAVING b != 3 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+2 SUBQUERY t2 index NULL PRIMARY 4 NULL 1 Using index; Using temporary; Using filesort
+2 SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
+SELECT * FROM t1 WHERE EXISTS ( SELECT b FROM t2, t3 GROUP BY b HAVING b != 3 );
+a
+DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (
+pk int auto_increment primary key,
+col_int_key int(11),
+key col_int_key (col_int_key),col_varchar_key varchar(128),
+key (col_varchar_key)
+) engine=innodb;
+EXPLAIN
+SELECT 1 FROM t1 AS alias1
+WHERE EXISTS ( SELECT SQ2_alias1 . col_int_key AS SQ2_field1
+FROM ( t1 AS SQ2_alias1 RIGHT OUTER JOIN
+t1 AS SQ2_alias2 ON (SQ2_alias2 . col_int_key = SQ2_alias1 . col_int_key )
+)
+GROUP BY SQ2_field1
+HAVING SQ2_alias1 . col_int_key >= 7
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+2 SUBQUERY SQ2_alias2 index NULL col_int_key 5 NULL 1 Using index; Using temporary; Using filesort
+2 SUBQUERY SQ2_alias1 ref col_int_key col_int_key 5 test.SQ2_alias2.col_int_key 1 Using where; Using index
+SELECT 1 FROM t1 AS alias1
+WHERE EXISTS ( SELECT SQ2_alias1 . col_int_key AS SQ2_field1
+FROM ( t1 AS SQ2_alias1 RIGHT OUTER JOIN
+t1 AS SQ2_alias2 ON (SQ2_alias2 . col_int_key = SQ2_alias1 . col_int_key )
+)
+GROUP BY SQ2_field1
+HAVING SQ2_alias1 . col_int_key >= 7
+);
+1
+drop table t1;
set optimizer_switch=@subselect_innodb_tmp;
diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result
index ce9a4ad444f..bf98b912a9e 100644
--- a/mysql-test/r/subselect_no_mat.result
+++ b/mysql-test/r/subselect_no_mat.result
@@ -5175,9 +5175,9 @@ a 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 'ON 1' at line 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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ') ON 1' at line 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result
index e017e67cfe6..05f7a25e0ef 100644
--- a/mysql-test/r/subselect_no_opts.result
+++ b/mysql-test/r/subselect_no_opts.result
@@ -5171,9 +5171,9 @@ a 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 'ON 1' at line 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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ') ON 1' at line 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result
index 492321c5d81..ee84bfd1eca 100644
--- a/mysql-test/r/subselect_no_scache.result
+++ b/mysql-test/r/subselect_no_scache.result
@@ -5179,9 +5179,9 @@ a 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 'ON 1' at line 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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ') ON 1' at line 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result
index eb92936e85d..5a7e303f4b9 100644
--- a/mysql-test/r/subselect_no_semijoin.result
+++ b/mysql-test/r/subselect_no_semijoin.result
@@ -5171,9 +5171,9 @@ a 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 'ON 1' at line 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 ') ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ') ON 1' at line 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 ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result
index 56c3044c4e4..3fc91b452a5 100644
--- a/mysql-test/r/subselect_sj.result
+++ b/mysql-test/r/subselect_sj.result
@@ -2884,4 +2884,40 @@ HAVING c <> ( SELECT MAX( c ) FROM t1 )
ORDER BY sm;
c sm
DROP TABLE t1,t2;
+#
+# mdev-4173 ignored duplicate value when converting heap to temp table
+# could lead to extra rows in semijoin queries or missing row in union queries
+#
+CREATE TABLE t1 (i1 INT) engine=myisam;
+INSERT INTO t1 VALUES
+(4),(8),(0),(0),(0),(7),(7),(5),(3),(4),(9),(6),(1),(5),(6),(2),(4),(4);
+CREATE TABLE t2 (i2 INT, j2 INT) engine=myisam;
+INSERT INTO t2 VALUES
+(7,1),(0,7),(9,4),(3,7),(4,0),(2,2),(5,9),(3,4),
+(1,0),(3,9),(5,8),(1,8),(204,18),(224,84),(9,6);
+CREATE TABLE t3 (i3 INT, KEY(i3)) engine=myisam;
+INSERT INTO t3 VALUES
+(0),(8),(1),(8),(9),(24),(6),(1),(6),(2),(4),(2),(1);
+select @@max_heap_table_size into @tmp_max_heap_table_size;
+select @@join_buffer_size into @tmp_join_buffer_size;
+set max_heap_table_size=16*1024;
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+DROP TABLE t1, t2, t3;
+set join_buffer_size = @tmp_join_buffer_size;
+set max_heap_table_size = @tmp_max_heap_table_size;
set optimizer_switch=@subselect_sj_tmp;
diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result
index c4b9933ae07..4f94f5a704c 100644
--- a/mysql-test/r/subselect_sj2.result
+++ b/mysql-test/r/subselect_sj2.result
@@ -1094,5 +1094,27 @@ COUNT(*)
3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
+DROP TABLE IF EXISTS t1,t2,t3,t4;
+#
+# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
+#
+CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English');
+CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (86,'English');
+CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron');
+create table t4 like t1;
+insert into t4 select * from t1;
+SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
+t1_pk1 t1_pk2 t3_i t3_c
+explain
+SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; End temporary
+DROP TABLE t1,t2,t3,t4;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result
index d9b9815133c..e0c5864f1b3 100644
--- a/mysql-test/r/subselect_sj2_jcl6.result
+++ b/mysql-test/r/subselect_sj2_jcl6.result
@@ -1109,6 +1109,28 @@ COUNT(*)
3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
+DROP TABLE IF EXISTS t1,t2,t3,t4;
+#
+# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
+#
+CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English');
+CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (86,'English');
+CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron');
+create table t4 like t1;
+insert into t4 select * from t1;
+SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
+t1_pk1 t1_pk2 t3_i t3_c
+explain
+SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
+1 PRIMARY t4 hash_index NULL #hash#$hj:PRIMARY 55:59 test.t3.t3_c 2 Using where; End temporary; Using join buffer (incremental, BNLH join)
+DROP TABLE t1,t2,t3,t4;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
#
diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result
index 1af507668da..fbe6db4edda 100644
--- a/mysql-test/r/subselect_sj2_mat.result
+++ b/mysql-test/r/subselect_sj2_mat.result
@@ -1096,6 +1096,28 @@ COUNT(*)
3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
+DROP TABLE IF EXISTS t1,t2,t3,t4;
+#
+# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
+#
+CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English');
+CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (86,'English');
+CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron');
+create table t4 like t1;
+insert into t4 select * from t1;
+SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
+t1_pk1 t1_pk2 t3_i t3_c
+explain
+SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; End temporary
+DROP TABLE t1,t2,t3,t4;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
set optimizer_switch=default;
diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result
index 7be29201c63..f18de3c4d0b 100644
--- a/mysql-test/r/subselect_sj_jcl6.result
+++ b/mysql-test/r/subselect_sj_jcl6.result
@@ -2898,6 +2898,42 @@ HAVING c <> ( SELECT MAX( c ) FROM t1 )
ORDER BY sm;
c sm
DROP TABLE t1,t2;
+#
+# mdev-4173 ignored duplicate value when converting heap to temp table
+# could lead to extra rows in semijoin queries or missing row in union queries
+#
+CREATE TABLE t1 (i1 INT) engine=myisam;
+INSERT INTO t1 VALUES
+(4),(8),(0),(0),(0),(7),(7),(5),(3),(4),(9),(6),(1),(5),(6),(2),(4),(4);
+CREATE TABLE t2 (i2 INT, j2 INT) engine=myisam;
+INSERT INTO t2 VALUES
+(7,1),(0,7),(9,4),(3,7),(4,0),(2,2),(5,9),(3,4),
+(1,0),(3,9),(5,8),(1,8),(204,18),(224,84),(9,6);
+CREATE TABLE t3 (i3 INT, KEY(i3)) engine=myisam;
+INSERT INTO t3 VALUES
+(0),(8),(1),(8),(9),(24),(6),(1),(6),(2),(4),(2),(1);
+select @@max_heap_table_size into @tmp_max_heap_table_size;
+select @@join_buffer_size into @tmp_join_buffer_size;
+set max_heap_table_size=16*1024;
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+COUNT(*)
+2834
+DROP TABLE t1, t2, t3;
+set join_buffer_size = @tmp_join_buffer_size;
+set max_heap_table_size = @tmp_max_heap_table_size;
set optimizer_switch=@subselect_sj_tmp;
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
diff --git a/mysql-test/r/temporal_literal.result b/mysql-test/r/temporal_literal.result
index c79ed311d16..84749302337 100644
--- a/mysql-test/r/temporal_literal.result
+++ b/mysql-test/r/temporal_literal.result
@@ -399,9 +399,7 @@ Warnings:
Warning 1292 Incorrect datetime value: '00:00:00'
SELECT DATE_ADD(TIME'00:00:00', INTERVAL 1 HOUR);
DATE_ADD(TIME'00:00:00', INTERVAL 1 HOUR)
-NULL
-Warnings:
-Warning 1292 Incorrect datetime value: '00:00:00'
+01:00:00
SELECT TIMESTAMPDIFF(SECOND,TIME'00:00:00', TIME'00:00:00');
TIMESTAMPDIFF(SECOND,TIME'00:00:00', TIME'00:00:00')
NULL
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 2d4a290751f..af747dca562 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -136,7 +136,7 @@ select @d:=1311;
1311
select year(@d), month(@d), day(@d), cast(@d as date);
year(@d) month(@d) day(@d) cast(@d as date)
-0 0 0 0000-00-00
+NULL NULL NULL NULL
Warnings:
Warning 1292 Incorrect datetime value: '1311'
Warning 1292 Incorrect datetime value: '1311'
@@ -303,6 +303,17 @@ Warnings:
Warning 1265 Data truncated for column 'f1' at row 1
drop table t1;
#
+# MDEV-4634 Crash in CONVERT_TZ
+#
+SELECT CONVERT_TZ(GREATEST(DATE('2021-00-00'),DATE('2022-00-00')),'+00:00','+7:5');
+CONVERT_TZ(GREATEST(DATE('2021-00-00'),DATE('2022-00-00')),'+00:00','+7:5')
+NULL
+Warnings:
+Warning 1292 Incorrect datetime value: '2022-00-00 00:00:00'
+#
+# End of 5.3 tests
+#
+#
# Bug #33629: last_day function can return null, but has 'not null'
# flag set for result
#
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index d6676bbf16b..1b53f92f82a 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -657,8 +657,8 @@ create table t1 (d date, t time) engine=myisam;
insert into t1 values ('2000-12-03','22:55:23'),('2008-05-03','10:19:31');
select case when d = '2012-12-12' then d else t end as cond, group_concat( d ) from t1 group by cond;
cond group_concat( d )
-0000-00-00 00:00:00 2000-12-03
-0000-00-00 00:00:00 2008-05-03
+NULL 2000-12-03
+NULL 2008-05-03
Warnings:
Warning 1292 Incorrect datetime value: '22:55:23'
Warning 1292 Incorrect datetime value: '10:19:31'
@@ -681,6 +681,14 @@ c a b
1 1 0000-00-00
3 NULL NULL
drop table t1,t2;
+#
+# MDEV-4634 Crash in CONVERT_TZ
+#
+SELECT CONVERT_TZ(GREATEST(TIMESTAMP('2021-00-00'),TIMESTAMP('2022-00-00')),'+00:00','+7:5');
+CONVERT_TZ(GREATEST(TIMESTAMP('2021-00-00'),TIMESTAMP('2022-00-00')),'+00:00','+7:5')
+NULL
+Warnings:
+Warning 1292 Incorrect datetime value: '2022-00-00 00:00:00'
End of 5.3 tests
#
# Start of 5.5 tests
diff --git a/mysql-test/r/type_datetime_hires.result b/mysql-test/r/type_datetime_hires.result
index ba1fe4adedb..203e45b86cb 100644
--- a/mysql-test/r/type_datetime_hires.result
+++ b/mysql-test/r/type_datetime_hires.result
@@ -338,3 +338,15 @@ select * from t1;
a b
2010-01-02 03:04:05.000000 2010-01-02 03:04:05
drop table t1;
+#
+# MDEV-4651 Crash in my_decimal2decimal in a ORDER BY query
+#
+SET @@time_zone='+00:00';
+CREATE TABLE t1 (a DATETIME(4) NOT NULL);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2000-00-00 00:00:00');
+SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY 1;
+UNIX_TIMESTAMP(a)
+NULL
+978307200.0000
+DROP TABLE t1;
+SET @@time_zone=DEFAULT;
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result
index 7bc0327178b..4167cbbe252 100644
--- a/mysql-test/r/type_time.result
+++ b/mysql-test/r/type_time.result
@@ -174,6 +174,17 @@ select f1, f1 = '2010-10-11 23:38:57' from t1;
f1 f1 = '2010-10-11 23:38:57'
23:38:57 0
drop table t1;
+#
+# MDEV-4634 Crash in CONVERT_TZ
+#
+SELECT CONVERT_TZ(GREATEST(TIME('00:00:00'),TIME('00:00:00')),'+00:00','+7:5');
+CONVERT_TZ(GREATEST(TIME('00:00:00'),TIME('00:00:00')),'+00:00','+7:5')
+NULL
+Warnings:
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
+#
+# End of 5.3 tests
+#
CREATE TABLE t1 (f1 TIME);
INSERT INTO t1 VALUES ('24:00:00');
SELECT '24:00:00' = (SELECT f1 FROM t1);
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 0db68c4934f..417ac0158ce 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -1491,7 +1491,7 @@ SET @old_max_binlog_cache_size = @@GLOBAL.max_binlog_cache_size;
SET GLOBAL max_binlog_cache_size = 5 * 1024 * 1024 * 1024;
SELECT @@GLOBAL.max_binlog_cache_size;
@@GLOBAL.max_binlog_cache_size
-5368709120
+max_size
SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size;
#
# Bug #37168 : Missing variable - skip_name_resolve
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index ef4bcc33c48..40d6c71b5af 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -4863,6 +4863,18 @@ a
1
drop view v1;
drop table t1,t2;
+#
+# MDEV-4593: p_s: crash in simplify_joins with delete using subselect
+# from view
+#
+create table `t1`(`a` int);
+create table `t2`(`a` int);
+create or replace view `v1` as select `a` from `t1`;
+prepare s from "delete from `t2` order by (select 1 from `v1`)";
+execute s;
+deallocate prepare s;
+drop view v1;
+drop tables t1,t2;
# -----------------------------------------------------------------
# -- End of 5.3 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/suite/archive/discover.result b/mysql-test/suite/archive/discover.result
index 59e79664eb6..4701d70273b 100644
--- a/mysql-test/suite/archive/discover.result
+++ b/mysql-test/suite/archive/discover.result
@@ -83,8 +83,6 @@ t0.ARZ
select * from t0;
a
flush tables;
-select * from t1;
-ERROR 42S02: Table 'test.t1' doesn't exist
drop table t0;
show status like 'Handler_discover';
Variable_name Value
@@ -123,3 +121,12 @@ select * from `a/../`;
a
flush tables;
drop table `a/../`;
+create database test1;
+create table test1.t1 (i int) engine=archive;
+drop database test1;
+create table t1 (a int) engine=archive;
+select * from t1;
+a
+flush tables;
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
diff --git a/mysql-test/suite/archive/discover.test b/mysql-test/suite/archive/discover.test
index 0b7e521185d..ad53ffa78c8 100644
--- a/mysql-test/suite/archive/discover.test
+++ b/mysql-test/suite/archive/discover.test
@@ -72,8 +72,6 @@ drop table t1;
select * from t0;
remove_file $mysqld_datadir/test/t0.ARZ;
flush tables;
---error ER_NO_SUCH_TABLE
-select * from t1;
drop table t0;
--list_files $mysqld_datadir/test
show status like 'Handler_discover';
@@ -102,3 +100,21 @@ select * from `a/../`; flush tables;
remove_file $mysqld_datadir/test/a@002f@002e@002e@002f.frm;
drop table `a/../`;
+#
+# MDEV-4441 DROP DATABASE with a newly created ARCHIVE table does not work
+#
+create database test1;
+create table test1.t1 (i int) engine=archive;
+drop database test1;
+
+#
+# MDEV-4456 Reverse discovery of ARCHIVE table on SELECT after disappearance of ARZ file
+#
+create table t1 (a int) engine=archive;
+select * from t1;
+flush tables;
+remove_file $mysqld_datadir/test/t1.ARZ;
+--error ER_NO_SUCH_TABLE
+select * from t1;
+--list_files $mysqld_datadir/test
+
diff --git a/mysql-test/suite/archive/repair.result b/mysql-test/suite/archive/repair.result
new file mode 100644
index 00000000000..16f0f2c1608
--- /dev/null
+++ b/mysql-test/suite/archive/repair.result
@@ -0,0 +1,10 @@
+create table t1 (a int) engine=archive;
+insert into t1 values (1);
+select * from t1;
+Got one of the listed errors
+insert into t1 values (2);
+ERROR HY000: Table 't1' is marked as crashed and should be repaired
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair error Corrupt
+drop table t1;
diff --git a/mysql-test/suite/archive/repair.test b/mysql-test/suite/archive/repair.test
new file mode 100644
index 00000000000..03946d31ead
--- /dev/null
+++ b/mysql-test/suite/archive/repair.test
@@ -0,0 +1,17 @@
+#
+# MDEV-4444 Server crashes with "safe_mutex: Trying to destroy a mutex share->mutex that was locked" on attempt to recover an archive table
+#
+
+--source include/have_archive.inc
+
+--let $datadir = `SELECT @@datadir`
+
+create table t1 (a int) engine=archive;
+insert into t1 values (1);
+--remove_file $datadir/test/t1.ARZ
+--error 13,1017
+select * from t1;
+--error ER_CRASHED_ON_USAGE
+insert into t1 values (2);
+repair table t1;
+drop table t1;
diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result
index 00e77dc0331..bf6e13d803d 100644
--- a/mysql-test/suite/binlog/r/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result
@@ -447,6 +447,7 @@ BEGIN
### DELETE FROM `test1`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+'/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1111,6 +1112,7 @@ BEGIN
### DELETE FROM `test1`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+'/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/federated/federated.result b/mysql-test/suite/federated/federated.result
index 49f9d338c6a..4d35550f210 100644
--- a/mysql-test/suite/federated/federated.result
+++ b/mysql-test/suite/federated/federated.result
@@ -7,6 +7,12 @@ Level Code Message
Error 1 server name: 'non_existing' doesn't exist!
Error 1 Can't create/write to file 'non_existing' (Errcode: 14 "Bad address")
Error 1005 Can't create table `test`.`t1` (errno: 1 "Operation not permitted")
+create table t1 (a int);
+create table fed (a int) engine=Federated CONNECTION='mysql://root@127.0.0.1:MASTER_PORT/test/t1';
+drop table t1;
+select * from fed;
+Got one of the listed errors
+drop table fed;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
diff --git a/mysql-test/suite/federated/federated.test b/mysql-test/suite/federated/federated.test
index 88d20817996..cb14dc2a239 100644
--- a/mysql-test/suite/federated/federated.test
+++ b/mysql-test/suite/federated/federated.test
@@ -8,5 +8,17 @@ connection master;
CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='non_existing';
SHOW WARNINGS;
+#
+# MDEV-4468 Assertion `error != 0' fails or timeout occurs on select from a FEDERATED table which points at a non-existent table
+#
+
+create table t1 (a int);
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval create table fed (a int) engine=Federated CONNECTION='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t1';
+drop table t1;
+--error 1146,1431
+select * from fed;
+drop table fed;
+
source include/federated_cleanup.inc;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 52a8fbaadc6..da1e59dba03 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -88,7 +88,7 @@ def information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NUL
def information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
def information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select
def information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
-def information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select
+def information_schema EVENTS DEFINER 4 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select
def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select
def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -267,7 +267,7 @@ def information_schema ROUTINES CREATED 24 0000-00-00 00:00:00 NO datetime NULL
def information_schema ROUTINES DATABASE_COLLATION 31 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
def information_schema ROUTINES DATA_TYPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
-def information_schema ROUTINES DEFINER 28 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select
+def information_schema ROUTINES DEFINER 28 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select
def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select
def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -378,7 +378,7 @@ def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL N
def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
def information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
-def information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select
+def information_schema TRIGGERS DEFINER 19 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select
def information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL NULL utf8 utf8_general_ci varchar(6) select
def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select
def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -417,7 +417,7 @@ def information_schema USER_STATISTICS USER 1 NO varchar 128 384 NULL NULL NULL
def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select
def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
-def information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select
+def information_schema VIEWS DEFINER 7 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select
def information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) select
def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL NULL utf8 utf8_general_ci varchar(7) select
def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select
@@ -570,7 +570,7 @@ NULL information_schema COLUMNS DATETIME_PRECISION bigint NULL NULL NULL NULL bi
3.0000 information_schema EVENTS EVENT_CATALOG varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema EVENTS EVENT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema EVENTS EVENT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema EVENTS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
+3.0000 information_schema EVENTS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189)
3.0000 information_schema EVENTS TIME_ZONE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema EVENTS EVENT_BODY varchar 8 24 utf8 utf8_general_ci varchar(8)
1.0000 information_schema EVENTS EVENT_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
@@ -767,7 +767,7 @@ NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime
NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime
3.0000 information_schema ROUTINES SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
1.0000 information_schema ROUTINES ROUTINE_COMMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
-3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
+3.0000 information_schema ROUTINES DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189)
3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema ROUTINES COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
@@ -866,7 +866,7 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(
3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
3.0000 information_schema TRIGGERS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
-3.0000 information_schema TRIGGERS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
+3.0000 information_schema TRIGGERS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189)
3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
@@ -903,7 +903,7 @@ NULL information_schema USER_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL
1.0000 information_schema VIEWS VIEW_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema VIEWS CHECK_OPTION varchar 8 24 utf8 utf8_general_ci varchar(8)
3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
-3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
+3.0000 information_schema VIEWS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189)
3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index 1fe4e2ebeb6..66c0f1c0622 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -89,7 +89,7 @@ def information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NUL
def information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
def information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL 0 NULL NULL datetime
def information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
-def information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema EVENTS DEFINER 4 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189)
def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime
def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8)
def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
@@ -268,7 +268,7 @@ def information_schema ROUTINES CREATED 24 0000-00-00 00:00:00 NO datetime NULL
def information_schema ROUTINES DATABASE_COLLATION 31 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
def information_schema ROUTINES DATA_TYPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
-def information_schema ROUTINES DEFINER 28 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema ROUTINES DEFINER 28 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189)
def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext
def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
@@ -379,7 +379,7 @@ def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL N
def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime
def information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
-def information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema TRIGGERS DEFINER 19 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189)
def information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL NULL utf8 utf8_general_ci varchar(6)
def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512)
def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
@@ -418,7 +418,7 @@ def information_schema USER_STATISTICS USER 1 NO varchar 128 384 NULL NULL NULL
def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8)
def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
-def information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema VIEWS DEFINER 7 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189)
def information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3)
def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL NULL utf8 utf8_general_ci varchar(7)
def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512)
@@ -575,7 +575,7 @@ NULL information_schema COLUMNS DATETIME_PRECISION bigint NULL NULL NULL NULL bi
3.0000 information_schema EVENTS EVENT_CATALOG varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema EVENTS EVENT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema EVENTS EVENT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema EVENTS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
+3.0000 information_schema EVENTS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189)
3.0000 information_schema EVENTS TIME_ZONE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema EVENTS EVENT_BODY varchar 8 24 utf8 utf8_general_ci varchar(8)
1.0000 information_schema EVENTS EVENT_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
@@ -772,7 +772,7 @@ NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime
NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime
3.0000 information_schema ROUTINES SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
1.0000 information_schema ROUTINES ROUTINE_COMMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
-3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
+3.0000 information_schema ROUTINES DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189)
3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema ROUTINES COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
@@ -871,7 +871,7 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(
3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
3.0000 information_schema TRIGGERS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
-3.0000 information_schema TRIGGERS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
+3.0000 information_schema TRIGGERS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189)
3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
@@ -908,7 +908,7 @@ NULL information_schema USER_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL
1.0000 information_schema VIEWS VIEW_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema VIEWS CHECK_OPTION varchar 8 24 utf8 utf8_general_ci varchar(8)
3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
-3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
+3.0000 information_schema VIEWS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189)
3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
index c49312e4a53..7b7b13c6a8c 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
@@ -81,7 +81,7 @@ def mysql gtid_slave_pos sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL b
def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned PRI select,insert,update,references
def mysql help_category name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references
-def mysql help_category url 4 NULL NO char 128 384 NULL NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references
+def mysql help_category url 4 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_general_ci text select,insert,update,references
def mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references
def mysql help_keyword name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
def mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references
@@ -91,7 +91,7 @@ def mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8
def mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references
def mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references
def mysql help_topic name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
-def mysql help_topic url 6 NULL NO char 128 384 NULL NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references
+def mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_general_ci text select,insert,update,references
def mysql host Alter_priv 12 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql host Create_priv 7 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
@@ -445,7 +445,7 @@ NULL mysql gtid_slave_pos seq_no bigint NULL NULL NULL NULL bigint(20) unsigned
NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64)
NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
-3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128)
+1.0000 mysql help_category url text 65535 65535 utf8 utf8_general_ci text
NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned
3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64)
NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned
@@ -455,7 +455,7 @@ NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned
NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text
1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text
-3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128)
+1.0000 mysql help_topic url text 65535 65535 utf8 utf8_general_ci text
3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
index 1b3bb575b61..4cb5ee917a4 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
@@ -81,7 +81,7 @@ def mysql gtid_slave_pos sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL b
def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned PRI
def mysql help_category name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI
def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned
-def mysql help_category url 4 NULL NO char 128 384 NULL NULL NULL utf8 utf8_general_ci char(128)
+def mysql help_category url 4 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_general_ci text
def mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI
def mysql help_keyword name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI
def mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI
@@ -91,7 +91,7 @@ def mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8
def mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned
def mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI
def mysql help_topic name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI
-def mysql help_topic url 6 NULL NO char 128 384 NULL NULL NULL utf8 utf8_general_ci char(128)
+def mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_general_ci text
def mysql host Alter_priv 12 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql host Create_priv 7 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
@@ -445,7 +445,7 @@ NULL mysql gtid_slave_pos seq_no bigint NULL NULL NULL NULL bigint(20) unsigned
NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64)
NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
-3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128)
+1.0000 mysql help_category url text 65535 65535 utf8 utf8_general_ci text
NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned
3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64)
NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned
@@ -455,7 +455,7 @@ NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned
NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text
1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text
-3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128)
+1.0000 mysql help_topic url text 65535 65535 utf8 utf8_general_ci text
3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
diff --git a/mysql-test/suite/funcs_1/r/is_events.result b/mysql-test/suite/funcs_1/r/is_events.result
index 7115b57fe47..79f60821347 100644
--- a/mysql-test/suite/funcs_1/r/is_events.result
+++ b/mysql-test/suite/funcs_1/r/is_events.result
@@ -31,7 +31,7 @@ Field Type Null Key Default Extra
EVENT_CATALOG varchar(64) NO
EVENT_SCHEMA varchar(64) NO
EVENT_NAME varchar(64) NO
-DEFINER varchar(77) NO
+DEFINER varchar(189) NO
TIME_ZONE varchar(64) NO
EVENT_BODY varchar(8) NO
EVENT_DEFINITION longtext NO NULL
@@ -58,7 +58,7 @@ EVENTS CREATE TEMPORARY TABLE `EVENTS` (
`EVENT_CATALOG` varchar(64) NOT NULL DEFAULT '',
`EVENT_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`EVENT_NAME` varchar(64) NOT NULL DEFAULT '',
- `DEFINER` varchar(77) NOT NULL DEFAULT '',
+ `DEFINER` varchar(189) NOT NULL DEFAULT '',
`TIME_ZONE` varchar(64) NOT NULL DEFAULT '',
`EVENT_BODY` varchar(8) NOT NULL DEFAULT '',
`EVENT_DEFINITION` longtext NOT NULL,
@@ -85,7 +85,7 @@ Field Type Null Key Default Extra
EVENT_CATALOG varchar(64) NO
EVENT_SCHEMA varchar(64) NO
EVENT_NAME varchar(64) NO
-DEFINER varchar(77) NO
+DEFINER varchar(189) NO
TIME_ZONE varchar(64) NO
EVENT_BODY varchar(8) NO
EVENT_DEFINITION longtext NO NULL
diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result
index a1aa40a59c3..a062e2d7b8f 100644
--- a/mysql-test/suite/funcs_1/r/is_routines.result
+++ b/mysql-test/suite/funcs_1/r/is_routines.result
@@ -55,7 +55,7 @@ CREATED datetime NO 0000-00-00 00:00:00
LAST_ALTERED datetime NO 0000-00-00 00:00:00
SQL_MODE varchar(8192) NO
ROUTINE_COMMENT longtext NO NULL
-DEFINER varchar(77) NO
+DEFINER varchar(189) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
@@ -89,7 +89,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
`ROUTINE_COMMENT` longtext NOT NULL,
- `DEFINER` varchar(77) NOT NULL DEFAULT '',
+ `DEFINER` varchar(189) NOT NULL DEFAULT '',
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
`COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
`DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
@@ -123,7 +123,7 @@ CREATED datetime NO 0000-00-00 00:00:00
LAST_ALTERED datetime NO 0000-00-00 00:00:00
SQL_MODE varchar(8192) NO
ROUTINE_COMMENT longtext NO NULL
-DEFINER varchar(77) NO
+DEFINER varchar(189) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
index 39102037a40..6693143e1b0 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
@@ -171,7 +171,7 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
-user_comment Replication slave GTID state
+user_comment Replication slave GTID position
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
@@ -179,7 +179,7 @@ TABLE_NAME help_category
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
VERSION 10
-ROW_FORMAT Fixed
+ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
index 40508c02abe..89f9255a294 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
@@ -171,7 +171,7 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
-user_comment Replication slave GTID state
+user_comment Replication slave GTID position
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
@@ -179,7 +179,7 @@ TABLE_NAME help_category
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
VERSION 10
-ROW_FORMAT Fixed
+ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -946,7 +946,7 @@ TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
-user_comment Replication slave GTID state
+user_comment Replication slave GTID position
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
@@ -954,7 +954,7 @@ TABLE_NAME help_category
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
VERSION 10
-ROW_FORMAT Fixed
+ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result
index 8f07bca408a..53bb54aa0f2 100644
--- a/mysql-test/suite/funcs_1/r/is_triggers.result
+++ b/mysql-test/suite/funcs_1/r/is_triggers.result
@@ -46,7 +46,7 @@ ACTION_REFERENCE_OLD_ROW varchar(3) NO
ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
SQL_MODE varchar(8192) NO
-DEFINER varchar(77) NO
+DEFINER varchar(189) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
@@ -71,7 +71,7 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
`ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '',
`CREATED` datetime DEFAULT NULL,
`SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
- `DEFINER` varchar(77) NOT NULL DEFAULT '',
+ `DEFINER` varchar(189) NOT NULL DEFAULT '',
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
`COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
`DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
@@ -96,7 +96,7 @@ ACTION_REFERENCE_OLD_ROW varchar(3) NO
ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
SQL_MODE varchar(8192) NO
-DEFINER varchar(77) NO
+DEFINER varchar(189) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
diff --git a/mysql-test/suite/funcs_1/r/is_views.result b/mysql-test/suite/funcs_1/r/is_views.result
index 73d46b4d627..ebb0e1ac091 100644
--- a/mysql-test/suite/funcs_1/r/is_views.result
+++ b/mysql-test/suite/funcs_1/r/is_views.result
@@ -34,7 +34,7 @@ TABLE_NAME varchar(64) NO
VIEW_DEFINITION longtext NO NULL
CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
-DEFINER varchar(77) NO
+DEFINER varchar(189) NO
SECURITY_TYPE varchar(7) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
@@ -47,7 +47,7 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` (
`VIEW_DEFINITION` longtext NOT NULL,
`CHECK_OPTION` varchar(8) NOT NULL DEFAULT '',
`IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '',
- `DEFINER` varchar(77) NOT NULL DEFAULT '',
+ `DEFINER` varchar(189) NOT NULL DEFAULT '',
`SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
`COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT ''
@@ -60,7 +60,7 @@ TABLE_NAME varchar(64) NO
VIEW_DEFINITION longtext NO NULL
CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
-DEFINER varchar(77) NO
+DEFINER varchar(189) NO
SECURITY_TYPE varchar(7) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
diff --git a/mysql-test/suite/handler/disconnect_4480.result b/mysql-test/suite/handler/disconnect_4480.result
new file mode 100644
index 00000000000..d0a67c72c05
--- /dev/null
+++ b/mysql-test/suite/handler/disconnect_4480.result
@@ -0,0 +1,5 @@
+create temporary table t1 as select 1;
+handler t1 open;
+handler t1 read next;
+1
+1
diff --git a/mysql-test/suite/handler/disconnect_4480.test b/mysql-test/suite/handler/disconnect_4480.test
new file mode 100644
index 00000000000..507249bd8bc
--- /dev/null
+++ b/mysql-test/suite/handler/disconnect_4480.test
@@ -0,0 +1,10 @@
+#
+# MDEV-4480 Assertion `inited == NONE' fails on closing a connection with open handler on temporary table
+#
+
+--connect (con1,localhost,root,,)
+create temporary table t1 as select 1;
+handler t1 open;
+handler t1 read next;
+--disconnect con1
+
diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result
index a8756a4a6f1..9552580bb88 100644
--- a/mysql-test/suite/maria/icp.result
+++ b/mysql-test/suite/maria/icp.result
@@ -213,7 +213,7 @@ c-1006=w
EXPLAIN
SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 range c1 c1 12 NULL 2 Using index condition; Using where
+1 SIMPLE t3 range c1 c1 12 NULL 2 Using where
SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2;
c1
EXPLAIN
@@ -857,5 +857,32 @@ insert into t1 values ('',1);
select 1 from t1 where b <= 1 and a <> '';
1
drop table t1;
+#
+# MDEV-4778: Incorrect results from Aria/MyISAM SELECT using index with prefix length on TEXT column
+#
+CREATE TABLE t1 (
+c1 TEXT ,
+c2 VARCHAR(2) ,
+INDEX idx1 (c2,c1(2)),
+INDEX idx2 (c2,c1(1))
+);
+INSERT INTO t1 (c1,c2) VALUES ('aa','x'), ('a' ,'y');
+SELECT * FROM t1 IGNORE INDEX(idx1,idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+c1 c2
+aa x
+a y
+EXPLAIN
+SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1 idx1 10 NULL 2 Using where
+SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+c1 c2
+aa x
+a y
+SELECT * FROM t1 FORCE INDEX(idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y');
+c1 c2
+aa x
+a y
+DROP TABLE t1;
set storage_engine= @save_storage_engine;
set optimizer_switch=@maria_icp_tmp;
diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result
index 189329fe5c8..2aad2f5cc75 100644
--- a/mysql-test/suite/maria/maria3.result
+++ b/mysql-test/suite/maria/maria3.result
@@ -312,7 +312,7 @@ aria_log_file_size 4294959104
aria_log_purge_type immediate
aria_max_sort_file_size 9223372036853727232
aria_pagecache_age_threshold 300
-aria_pagecache_buffer_size 134217728
+aria_pagecache_buffer_size 8388608
aria_pagecache_division_limit 100
aria_page_checksum OFF
aria_recover NORMAL
diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result
index 6a4fde4287a..0498fbca25f 100644
--- a/mysql-test/suite/perfschema/r/ortho_iter.result
+++ b/mysql-test/suite/perfschema/r/ortho_iter.result
@@ -115,7 +115,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result
index 92c5d36ed9f..3881a2ca6b7 100644
--- a/mysql-test/suite/perfschema/r/privilege_table_io.result
+++ b/mysql-test/suite/perfschema/r/privilege_table_io.result
@@ -40,7 +40,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
index 48501d2ae26..bde23fff83e 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
index f03b7b27546..94d9efd8beb 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
index 46ddeb32c08..9b7bebed018 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
index 00d98b6af78..1a5394e41d5 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result
index da836c0f933..0f2019a6e78 100644
--- a/mysql-test/suite/perfschema/r/start_server_innodb.result
+++ b/mysql-test/suite/perfschema/r/start_server_innodb.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result
index 201df2c98bd..bd07bab8e2f 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_account.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_account.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
index e8ee3d0e429..a210a97a6a6 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
index 5bc02d14e7e..b2c3eedcdea 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
index 64d99d2109a..8720de80017 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
index 388ab1796b6..f57609092d0 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result
index b09adcfe953..51dab043968 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_host.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_host.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
index e4264ad0554..870e5524b8c 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
index 4a642fda1e1..2a26112e693 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
index 79636014743..397365a9755 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
index 88003d2978c..f3557a1cf9e 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 0
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
index 47b5c326703..a65f90977af 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
index 66adafb7dd5..b08fc537dcd 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
index 612cc625132..2d9b36583a5 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 0
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
index 981b322041c..1679fba7ac3 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 0
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
index 172f3e87d13..a8d763afa0c 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 0
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
index 8f3bd08a5de..40f7e9fa1c6 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
index 1cd07ad93a6..48093277aac 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
index d2d0bd012c7..b6be8047d31 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
index 16eb55d80e4..740d4ad74ef 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
index 23248e97911..6f83d396458 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 0
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
index 4cfe58e360a..667b28dae88 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 0
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
index 98cc88ec36a..e6db3e23483 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 0
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
index dd22fb22773..cc3cd9b1ed3 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result
index de1f2dc0b6f..d3b69586def 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_user.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_user.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
index 36a8307de13..155ab82c0d4 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
index 5954fe64333..1a64bb98d65 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result
index ad019bbc650..5db8896faca 100644
--- a/mysql-test/suite/perfschema/r/start_server_off.result
+++ b/mysql-test/suite/perfschema/r/start_server_off.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result
index da836c0f933..0f2019a6e78 100644
--- a/mysql-test/suite/perfschema/r/start_server_on.result
+++ b/mysql-test/suite/perfschema/r/start_server_on.result
@@ -90,7 +90,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
index 98f21895e81..5db83182106 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
@@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
index 6d983b32bd3..5e31faf740b 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
@@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
index 45935f943ff..eacd331f5a8 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
@@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
index 6feab956ef3..2035cdbe84f 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
@@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
index 50217f4fb32..5496d6bc755 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
@@ -61,7 +61,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
index 47bd8f84455..83ebe3ccad0 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
@@ -60,7 +60,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
index 26e86a12f24..985a3cee16f 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
@@ -61,7 +61,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
index 67a80884008..d3c6e468c5a 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
@@ -60,7 +60,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_off.result b/mysql-test/suite/perfschema/r/table_aggregate_off.result
index 8c2ff29c2ce..0b36f7f559d 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_off.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result
@@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
index 31b43996de4..1898ee90d72 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
@@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
index 1379d07719a..72665ace56e 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
@@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
index 3001ad34e68..0f552bf578d 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
@@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
index feed7c53c93..ac9c539430b 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
@@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
index dac12573832..278d0051a04 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
@@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
index 1f3e0fb9ef1..d6725a70b68 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
@@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
index ee7958082f6..fdaef3f147b 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
@@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
index ee04ee712f0..4adb2eaf89d 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
@@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
index 9c1fbf6d557..0af737eee96 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
@@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
index d537088ddfd..6fab82b38df 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
@@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
index 217cbced878..0338bde63a2 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
@@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
index f25669430a0..29ee1bda675 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
@@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
index 681a9019281..232e8af1017 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
@@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
index a852647f566..a97e6f693ac 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
@@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
index caedc66d8a7..fdcdda4d6f0 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
@@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
index 1b860c73ae6..09f4e3aff5e 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
@@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
index df500a28e44..3e13281e0d9 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
@@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
index 4afca2b1133..e1264576c56 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
@@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
index 86cd1d5efe6..ccdcc67156c 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
@@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
index fd4d0ef1b93..d36a8a1a279 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
@@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
index 3d54f3822ec..396df8f69d2 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
@@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
index 7df9f026f85..09b59ef8c31 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
@@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
index 34a7864fce1..d2e7c407cc3 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
@@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
index 051df916023..fd9bd38a81a 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
@@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
index 4f4de1d0416..5f13b37b262 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
@@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
index c79f6134e0a..456c570a34f 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
@@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
index 777a169c194..7a2df579687 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
@@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
index ad08341c159..1f5dc009e67 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
@@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 173
+performance_schema_max_statement_classes 174
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/plugins/r/audit_null.result b/mysql-test/suite/plugins/r/audit_null.result
index 81d047c077b..07bc5b787c7 100644
--- a/mysql-test/suite/plugins/r/audit_null.result
+++ b/mysql-test/suite/plugins/r/audit_null.result
@@ -19,7 +19,7 @@ concat("test1", x)
test1-12
show status like 'audit_null%';
Variable_name Value
-Audit_null_called 21
+Audit_null_called 22
Audit_null_general_error 1
Audit_null_general_log 7
Audit_null_general_result 5
@@ -44,6 +44,7 @@ insert t2 values ('2020-10-09');
select * from t2;
a
2020-10-09
+alter table t2 add column b int;
drop table t2;
explain select distinct * from t2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -80,8 +81,8 @@ root[root] @ localhost [] mysql.table_stats : write
root[root] @ localhost [] mysql.column_stats : write
root[root] @ localhost [] mysql.index_stats : write
root[root] @ localhost [] >> alter table t2 add column b int
-root[root] @ localhost [] test.t2 : alter
root[root] @ localhost [] test.t2 : read
+root[root] @ localhost [] test.t2 : alter
root[root] @ localhost [] >> create definer=testuser@localhost view v1 as select t2.a+1, t2_copy.a+2 from t2, t2 as t2_copy
root[root] @ localhost [] test.t2 : read
root[root] @ localhost [] test.t2 : read
@@ -92,6 +93,7 @@ root[root] @ localhost [] >> drop view v1
root[root] @ localhost [] >> create temporary table t2 (a date)
root[root] @ localhost [] >> insert t2 values ('2020-10-09')
root[root] @ localhost [] >> select * from t2
+root[root] @ localhost [] >> alter table t2 add column b int
root[root] @ localhost [] >> drop table t2
root[root] @ localhost [] >> explain select distinct * from t2
root[root] @ localhost [] test.t2 : read
diff --git a/mysql-test/suite/plugins/r/fulltext_plugin.result b/mysql-test/suite/plugins/r/fulltext_plugin.result
index 69ebbe07e9e..2c104c98676 100644
--- a/mysql-test/suite/plugins/r/fulltext_plugin.result
+++ b/mysql-test/suite/plugins/r/fulltext_plugin.result
@@ -3,3 +3,5 @@ CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
DROP TABLE t1;
UNINSTALL PLUGIN simple_parser;
+show status like 'a%status';
+Variable_name Value
diff --git a/mysql-test/suite/plugins/r/locales.result b/mysql-test/suite/plugins/r/locales.result
new file mode 100644
index 00000000000..45f80353697
--- /dev/null
+++ b/mysql-test/suite/plugins/r/locales.result
@@ -0,0 +1,112 @@
+select * from information_schema.locales;
+ID NAME DESCRIPTION MAX_MONTH_NAME_LENGTH MAX_DAY_NAME_LENGTH DECIMAL_POINT THOUSAND_SEP ERROR_MESSAGE_LANGUAGE
+0 en_US English - United States 9 9 . , english
+1 en_GB English - United Kingdom 9 9 . , english
+2 ja_JP Japanese - Japan 3 3 . , japanese
+3 sv_SE Swedish - Sweden 9 7 , swedish
+4 de_DE German - Germany 9 10 , . german
+5 fr_FR French - France 9 8 , french
+6 ar_AE Arabic - United Arab Emirates 6 8 . , english
+7 ar_BH Arabic - Bahrain 6 8 . , english
+8 ar_JO Arabic - Jordan 12 8 . , english
+9 ar_SA Arabic - Saudi Arabia 12 8 . english
+10 ar_SY Arabic - Syria 12 8 . , english
+11 be_BY Belarusian - Belarus 10 10 , . english
+12 bg_BG Bulgarian - Bulgaria 9 10 , english
+13 ca_ES Catalan - Catalan 8 9 , english
+14 cs_CZ Czech - Czech Republic 8 7 , czech
+15 da_DK Danish - Denmark 9 7 , . danish
+16 de_AT German - Austria 9 10 , german
+17 es_ES Spanish - Spain 10 9 , spanish
+18 et_EE Estonian - Estonia 9 9 , estonian
+19 eu_ES Basque - Basque 9 10 , english
+20 fi_FI Finnish - Finland 9 11 , english
+21 fo_FO Faroese - Faroe Islands 9 12 , . english
+22 gl_ES Galician - Galician 8 8 , english
+23 gu_IN Gujarati - India 10 8 . , english
+24 he_IL Hebrew - Israel 7 5 . , english
+25 hi_IN Hindi - India 7 9 . , english
+26 hr_HR Croatian - Croatia 8 11 , english
+27 hu_HU Hungarian - Hungary 10 9 , . hungarian
+28 id_ID Indonesian - Indonesia 9 6 , . english
+29 is_IS Icelandic - Iceland 9 12 , . english
+30 it_CH Italian - Switzerland 9 9 , ' italian
+31 ko_KR Korean - Korea 3 3 . , korean
+32 lt_LT Lithuanian - Lithuania 9 14 , . english
+33 lv_LV Latvian - Latvia 10 11 , english
+34 mk_MK Macedonian - FYROM 9 10 , english
+35 mn_MN Mongolia - Mongolian 18 6 , . english
+36 ms_MY Malay - Malaysia 9 6 . , english
+37 nb_NO Norwegian(Bokml) - Norway 9 7 , . norwegian
+38 nl_NL Dutch - The Netherlands 9 9 , dutch
+39 pl_PL Polish - Poland 11 12 , polish
+40 pt_BR Portugese - Brazil 9 7 , portuguese
+41 pt_PT Portugese - Portugal 9 7 , portuguese
+42 ro_RO Romanian - Romania 10 8 , . romanian
+43 ru_RU Russian - Russia 8 11 , russian
+44 ru_UA Russian - Ukraine 8 11 , . russian
+45 sk_SK Slovak - Slovakia 9 8 , slovak
+46 sl_SI Slovenian - Slovenia 9 10 , english
+47 sq_AL Albanian - Albania 7 10 , . english
+48 sr_RS Serbian - Serbia 9 10 . serbian
+49 ta_IN Tamil - India 10 8 . , english
+50 te_IN Telugu - India 10 9 . , english
+51 th_TH Thai - Thailand 10 8 . , english
+52 tr_TR Turkish - Turkey 7 9 , . english
+53 uk_UA Ukrainian - Ukraine 8 9 , . ukrainian
+54 ur_PK Urdu - Pakistan 6 6 . , english
+55 vi_VN Vietnamese - Vietnam 16 11 , . english
+56 zh_CN Chinese - Peoples Republic of China 3 3 . , english
+57 zh_TW Chinese - Taiwan 3 2 . , english
+58 ar_DZ Arabic - Algeria 6 8 . , english
+59 ar_EG Arabic - Egypt 6 8 . , english
+60 ar_IN Arabic - Iran 6 8 . , english
+61 ar_IQ Arabic - Iraq 6 8 . , english
+62 ar_KW Arabic - Kuwait 6 8 . , english
+63 ar_LB Arabic - Lebanon 12 8 . , english
+64 ar_LY Arabic - Libya 6 8 . , english
+65 ar_MA Arabic - Morocco 6 8 . , english
+66 ar_OM Arabic - Oman 6 8 . , english
+67 ar_QA Arabic - Qatar 6 8 . , english
+68 ar_SD Arabic - Sudan 6 8 . , english
+69 ar_TN Arabic - Tunisia 6 8 . , english
+70 ar_YE Arabic - Yemen 6 8 . , english
+71 de_BE German - Belgium 9 10 , . german
+72 de_CH German - Switzerland 9 10 . ' german
+73 de_LU German - Luxembourg 9 10 , . german
+74 en_AU English - Australia 9 9 . , english
+75 en_CA English - Canada 9 9 . , english
+76 en_IN English - India 9 9 . , english
+77 en_NZ English - New Zealand 9 9 . , english
+78 en_PH English - Philippines 9 9 . , english
+79 en_ZA English - South Africa 9 9 . , english
+80 en_ZW English - Zimbabwe 9 9 . , english
+81 es_AR Spanish - Argentina 10 9 , . spanish
+82 es_BO Spanish - Bolivia 10 9 , spanish
+83 es_CL Spanish - Chile 10 9 , spanish
+84 es_CO Spanish - Columbia 10 9 , spanish
+85 es_CR Spanish - Costa Rica 10 9 . spanish
+86 es_DO Spanish - Dominican Republic 10 9 . spanish
+87 es_EC Spanish - Ecuador 10 9 , spanish
+88 es_GT Spanish - Guatemala 10 9 . spanish
+89 es_HN Spanish - Honduras 10 9 . spanish
+90 es_MX Spanish - Mexico 10 9 . spanish
+91 es_NI Spanish - Nicaragua 10 9 . spanish
+92 es_PA Spanish - Panama 10 9 . spanish
+93 es_PE Spanish - Peru 10 9 . spanish
+94 es_PR Spanish - Puerto Rico 10 9 . spanish
+95 es_PY Spanish - Paraguay 10 9 , spanish
+96 es_SV Spanish - El Salvador 10 9 . spanish
+97 es_US Spanish - United States 10 9 . , spanish
+98 es_UY Spanish - Uruguay 10 9 , spanish
+99 es_VE Spanish - Venezuela 10 9 , spanish
+100 fr_BE French - Belgium 9 8 , . french
+101 fr_CA French - Canada 9 8 , french
+102 fr_CH French - Switzerland 9 8 , french
+103 fr_LU French - Luxembourg 9 8 , french
+104 it_IT Italian - Italy 9 9 , italian
+105 nl_BE Dutch - Belgium 9 9 , . dutch
+106 no_NO Norwegian - Norway 9 7 , . norwegian
+107 sv_FI Swedish - Finland 9 7 , swedish
+108 zh_HK Chinese - Hong Kong SAR 3 3 . , english
+109 el_GR Greek - Greece 11 9 , . greek
diff --git a/mysql-test/suite/plugins/r/pam_cleartext.result b/mysql-test/suite/plugins/r/pam_cleartext.result
new file mode 100644
index 00000000000..00e0e94618e
--- /dev/null
+++ b/mysql-test/suite/plugins/r/pam_cleartext.result
@@ -0,0 +1,10 @@
+install plugin pam soname 'auth_pam.so';
+create user test_pam identified via pam using 'mariadb_mtr';
+create user pam_test;
+grant proxy on pam_test to test_pam;
+show variables like 'pam%';
+Variable_name Value
+pam_use_cleartext_plugin ON
+drop user test_pam;
+drop user pam_test;
+uninstall plugin pam;
diff --git a/mysql-test/suite/plugins/t/audit_null.test b/mysql-test/suite/plugins/t/audit_null.test
index 60883bbe4f9..3e32154ec3d 100644
--- a/mysql-test/suite/plugins/t/audit_null.test
+++ b/mysql-test/suite/plugins/t/audit_null.test
@@ -38,6 +38,7 @@ drop view v1;
create temporary table t2 (a date);
insert t2 values ('2020-10-09');
select * from t2;
+alter table t2 add column b int; # MDEV-4565 ALTER on a temporary table generates an audit event
drop table t2;
# internal temp table generates no audit events
diff --git a/mysql-test/suite/plugins/t/fulltext_plugin.test b/mysql-test/suite/plugins/t/fulltext_plugin.test
index 0e2f53d5b15..e9b4343e0dc 100644
--- a/mysql-test/suite/plugins/t/fulltext_plugin.test
+++ b/mysql-test/suite/plugins/t/fulltext_plugin.test
@@ -9,3 +9,9 @@ CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
DROP TABLE t1;
UNINSTALL PLUGIN simple_parser;
+
+#
+# Bug #69682 - mysqld crashes after uninstall of plugin with "first" status var
+#
+show status like 'a%status';
+
diff --git a/mysql-test/suite/plugins/t/locales.opt b/mysql-test/suite/plugins/t/locales.opt
new file mode 100644
index 00000000000..594283f8c65
--- /dev/null
+++ b/mysql-test/suite/plugins/t/locales.opt
@@ -0,0 +1,3 @@
+--loose-locale
+--plugin-load=$LOCALES_SO
+
diff --git a/mysql-test/suite/plugins/t/locales.test b/mysql-test/suite/plugins/t/locales.test
new file mode 100644
index 00000000000..5cfbe697384
--- /dev/null
+++ b/mysql-test/suite/plugins/t/locales.test
@@ -0,0 +1,7 @@
+if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'locales' and plugin_status='active'`)
+{
+ --skip LOCALES plugin is not active
+}
+
+select * from information_schema.locales;
+
diff --git a/mysql-test/suite/plugins/t/pam.test b/mysql-test/suite/plugins/t/pam.test
index 68fa349a444..1871e5801a3 100644
--- a/mysql-test/suite/plugins/t/pam.test
+++ b/mysql-test/suite/plugins/t/pam.test
@@ -1,16 +1,5 @@
---source include/not_embedded.inc
-
-if (!$AUTH_PAM_SO) {
- skip No pam auth plugin;
-}
-
-eval install plugin pam soname '$AUTH_PAM_SO';
-create user test_pam identified via pam using 'mariadb_mtr';
-create user pam_test;
-grant proxy on pam_test to test_pam;
-
-let $plugindir=`SELECT @@global.plugin_dir`;
+--source pam_init.inc
--write_file $MYSQLTEST_VARDIR/tmp/pam_good.txt
not very secret challenge
diff --git a/mysql-test/suite/plugins/t/pam_cleartext.opt b/mysql-test/suite/plugins/t/pam_cleartext.opt
new file mode 100644
index 00000000000..aa270885f0e
--- /dev/null
+++ b/mysql-test/suite/plugins/t/pam_cleartext.opt
@@ -0,0 +1 @@
+--loose-pam-use-cleartext-plugin
diff --git a/mysql-test/suite/plugins/t/pam_cleartext.test b/mysql-test/suite/plugins/t/pam_cleartext.test
new file mode 100644
index 00000000000..e80cff5f476
--- /dev/null
+++ b/mysql-test/suite/plugins/t/pam_cleartext.test
@@ -0,0 +1,12 @@
+
+--source pam_init.inc
+
+show variables like 'pam%';
+
+--error 1
+--exec echo FAIL | $MYSQL_TEST -u test_pam --plugin-dir=$plugindir
+
+drop user test_pam;
+drop user pam_test;
+uninstall plugin pam;
+
diff --git a/mysql-test/suite/plugins/t/pam_init.inc b/mysql-test/suite/plugins/t/pam_init.inc
new file mode 100644
index 00000000000..281666d51a6
--- /dev/null
+++ b/mysql-test/suite/plugins/t/pam_init.inc
@@ -0,0 +1,14 @@
+
+--source include/not_embedded.inc
+
+if (!$AUTH_PAM_SO) {
+ skip No pam auth plugin;
+}
+
+eval install plugin pam soname '$AUTH_PAM_SO';
+create user test_pam identified via pam using 'mariadb_mtr';
+create user pam_test;
+grant proxy on pam_test to test_pam;
+
+let $plugindir=`SELECT @@global.plugin_dir`;
+
diff --git a/mysql-test/suite/rpl/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result
index dda578a419e..800a70c8c9b 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_db.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_db.result
@@ -8,12 +8,12 @@ select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
create table mysqltest1.t2 (n int);
create table mysqltest1.t3 (n int);
drop database mysqltest1;
-ERROR HY000: Error dropping database (can't rmdir './mysqltest1/', errno: 17 "File exists")
+ERROR HY000: Error dropping database (can't rmdir './mysqltest1', errno: 39 "Directory not empty")
use mysqltest1;
show tables;
Tables_in_mysqltest1
drop database mysqltest1;
-ERROR HY000: Error dropping database (can't rmdir './mysqltest1/', errno: 17 "File exists")
+ERROR HY000: Error dropping database (can't rmdir './mysqltest1', errno: 39 "Directory not empty")
use mysqltest1;
show tables;
Tables_in_mysqltest1
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
index f98a3bf322d..9c77f203b22 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
@@ -1,4 +1,8 @@
include/rpl_init.inc [topology=1->2->3->4]
+*** GTID position should be empty here ***
+SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
+BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
+
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, "m1");
@@ -8,6 +12,14 @@ BEGIN;
INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
INSERT INTO t2 VALUES (4, "i4");
COMMIT;
+*** GTID position should be non-empty here ***
+SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
+BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
+<GTID_POS_SERVER_1>
+*** GTID position should be the same as on server_1 ***
+SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
+BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
+<GTID_POS_SERVER_1>
SELECT * FROM t1 ORDER BY a;
a b
1 m1
@@ -115,4 +127,39 @@ include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_3;
include/start_slave.inc
DROP TABLE t1,t2;
+*** A few more checks for BINLOG_GTID_POS function ***
+SELECT BINLOG_GTID_POS();
+ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
+SELECT BINLOG_GTID_POS('a');
+ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
+SELECT BINLOG_GTID_POS('a',1,NULL);
+ERROR 42000: Incorrect parameter count in the call to native function 'BINLOG_GTID_POS'
+SELECT BINLOG_GTID_POS(1,'a');
+BINLOG_GTID_POS(1,'a')
+NULL
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'a'
+SELECT BINLOG_GTID_POS(NULL,NULL);
+BINLOG_GTID_POS(NULL,NULL)
+NULL
+SELECT BINLOG_GTID_POS('',1);
+BINLOG_GTID_POS('',1)
+
+SELECT BINLOG_GTID_POS('a',1);
+BINLOG_GTID_POS('a',1)
+NULL
+SELECT BINLOG_GTID_POS('master-bin.000001',-1);
+BINLOG_GTID_POS('master-bin.000001',-1)
+NULL
+SELECT BINLOG_GTID_POS('master-bin.000001',0);
+BINLOG_GTID_POS('master-bin.000001',0)
+
+SELECT BINLOG_GTID_POS('master-bin.000001',18446744073709551615);
+BINLOG_GTID_POS('master-bin.000001',18446744073709551615)
+NULL
+SELECT BINLOG_GTID_POS('master-bin.000001',18446744073709551616);
+BINLOG_GTID_POS('master-bin.000001',18446744073709551616)
+NULL
+Warnings:
+Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated.
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
index 59f288d4afd..7597813bcb1 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
@@ -29,6 +29,29 @@ include/start_slave.inc
SELECT * FROM t1;
a
1
+*** Test that setting @@gtid_domain_id or @@gtid_seq_no is not allowed inside a transaction. ***
+BEGIN;
+INSERT INTO t1 VALUES (100);
+SET SESSION gtid_domain_id= 100;
+ERROR HY000: Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transaction
+SET SESSION gtid_seq_no= 100;
+ERROR HY000: Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transaction
+SET @old_domain= @@GLOBAL.gtid_domain_id;
+SET GLOBAL gtid_domain_id= 100;
+SELECT @@SESSION.gtid_domain_id;
+@@SESSION.gtid_domain_id
+0
+SET GLOBAL gtid_domain_id= @old_domain;
+INSERT INTO t1 VALUES (101);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+100
+101
+ROLLBACK;
+SELECT * FROM t1 ORDER BY a;
+a
+1
*** Test requesting an explicit GTID position that conflicts with newer GTIDs of our own in the binlog. ***
include/stop_slave.inc
RESET MASTER;
@@ -67,9 +90,38 @@ a
2
3
4
+*** MDEV-4688: Empty value of @@GLOBAL.gtid_slave_pos ***
+include/stop_slave.inc
+INSERT INTO t1 VALUES (5);
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
+SET GLOBAL debug_dbug="+d,gtid_fail_after_record_gtid";
+SET sql_log_bin=0;
+CALL mtr.add_suppression('Got error 131 "Command not supported by database" during COMMIT');
+SET sql_log_bin=1;
+START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1180]
+SELECT @@GLOBAL.gtid_slave_pos;
+@@GLOBAL.gtid_slave_pos
+0-1-2
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+SET GLOBAL debug_dbug= @old_dbug;
+START SLAVE SQL_THREAD;
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
*** Test slave requesting a GTID that is not present in the master's binlog ***
include/stop_slave.inc
-SET GLOBAL gtid_slave_pos = "0-1-3";
+SET GLOBAL gtid_slave_pos = "0-1-4";
START SLAVE;
SET sql_log_bin=0;
CALL mtr.add_suppression("Got fatal error .* from master when reading data from binary log: 'Error: connecting slave requested to start from GTID .*, which is not in the master's binlog'");
@@ -77,13 +129,13 @@ SET sql_log_bin=1;
include/wait_for_slave_io_error.inc [errno=1236]
Slave_IO_State = ''
Last_IO_Errno = '1236'
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Error: connecting slave requested to start from GTID 0-1-3, which is not in the master's binlog''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Error: connecting slave requested to start from GTID 0-1-4, which is not in the master's binlog''
Using_Gtid = 'Current_Pos'
include/stop_slave.inc
-SET GLOBAL gtid_slave_pos = "0-1-2";
+SET GLOBAL gtid_slave_pos = "0-1-3";
START SLAVE;
include/wait_for_slave_to_start.inc
-INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
SELECT * FROM t1 ORDER BY a;
a
1
@@ -91,6 +143,7 @@ a
3
4
5
+6
*** MDEV-4278: Slave does not detect that master is not GTID-aware ***
include/stop_slave.inc
SET @old_dbug= @@global.DEBUG_DBUG;
@@ -98,7 +151,7 @@ SET GLOBAL debug_dbug="+d,simulate_non_gtid_aware_master";
START SLAVE;
include/wait_for_slave_io_error.inc [errno=1233]
SET GLOBAL debug_dbug= @old_dbug;
-INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
START SLAVE;
SET sql_log_bin=0;
CALL mtr.add_suppression("The slave I/O thread stops because master does not support MariaDB global transaction id");
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
index 824fe8d879f..5a9acb157c6 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
@@ -1,10 +1,14 @@
include/rpl_init.inc [topology=1->2]
+SET @old_strict= @@GLOBAL.gtid_strict_mode;
+SET GLOBAL gtid_strict_mode= 1;
select @@global.log_slave_updates;
@@global.log_slave_updates
0
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
INSERT INTO t1 VALUES (1, 1);
INSERT INTO t1 VALUES (2, 1);
+SET @old_strict= @@GLOBAL.gtid_strict_mode;
+SET GLOBAL gtid_strict_mode= 1;
select @@global.log_slave_updates;
@@global.log_slave_updates
0
@@ -13,6 +17,10 @@ a b
1 1
2 1
include/stop_slave.inc
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT,
+master_user = 'root', master_use_gtid = current_pos;
+START SLAVE;
+include/wait_for_slave_to_start.inc
INSERT INTO t1 VALUES (3, 2);
INSERT INTO t1 VALUES (4, 2);
include/show_binlog_events.inc
@@ -23,9 +31,6 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4, 2)
slave-bin.000001 # Query # # COMMIT
-CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT,
-master_user = 'root', master_use_gtid = current_pos;
-START SLAVE;
SELECT * FROM t1 ORDER BY a;
a b
1 1
@@ -47,5 +52,7 @@ a b
4 2
5 1
6 1
+SET GLOBAL gtid_strict_mode= @old_strict;
+SET GLOBAL gtid_strict_mode= @old_strict;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result b/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result
index e9f64628e12..001362825f9 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result
@@ -22,6 +22,7 @@ a
include/kill_binlog_dump_threads.inc
INSERT INTO t1 VALUES (10);
SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
@@ -64,6 +65,7 @@ a
13
include/kill_binlog_dump_threads.inc
INSERT INTO t1 VALUES (20);
+SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
@@ -99,6 +101,7 @@ SET gtid_domain_id= 10;
SET gtid_seq_no= 200;
INSERT INTO t1 VALUES (13);
SET gtid_domain_id= 10;
+SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
START SLAVE UNTIL master_gtid_pos="9-1-50,10-1-200";
include/wait_for_slave_to_stop.inc
@@ -129,6 +132,7 @@ SET GLOBAL debug_dbug= @old_debug;
TRUNCATE t1;
RESET MASTER;
include/kill_binlog_dump_threads.inc
+SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,binlog_force_reconnect_after_22_events";
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1);
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
index d226ffa68f7..9be5903b2e9 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
@@ -188,5 +188,41 @@ include/start_slave.inc
SELECT '0-1-2' AS Gtid_Slave_Pos;
Gtid_Slave_Pos
0-1-2
+*** MDEV-4483: Slave loses traditional master coordinates immediately on CHANGE MASTER TO MASTER_USE_GTID = 1 ***
+include/stop_slave.inc
+DROP TABLE t1;
+RESET SLAVE ALL;
+RESET MASTER;
+SET GLOBAL gtid_slave_pos= "";
+CHANGE MASTER TO master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root', master_use_gtid=no, master_log_file="", master_log_pos= 4;
+DROP TABLE t1;
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+include/start_slave.inc
+include/stop_slave.inc
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+START SLAVE UNTIL master_log_file='LOG_FILE1', master_log_pos=LOG_POS1;
+include/wait_for_slave_sql_to_stop.inc
+SELECT * FROM t1;
+a
+1
+include/wait_for_slave_param.inc [Read_Master_Log_Pos]
+include/stop_slave_io.inc
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET GLOBAL gtid_slave_pos="0-42-42";
+SET sql_log_bin=0;
+call mtr.add_suppression("Error: connecting slave requested to start from GTID");
+SET sql_log_bin=1;
+START SLAVE;
+include/wait_for_slave_io_error.inc [errno=1236]
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+CHANGE MASTER TO master_use_gtid=no;
+include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
index b524ab17c23..6d607ff0277 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
@@ -59,6 +59,101 @@ OK
SELECT IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2));
IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2))
OK
+INSERT INTO t1 VALUES (6);
include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+*** MDEV-4490: Old-style master position points at the last GTID event after slave restart ***
+INSERT INTO t1 VALUES (7);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+7
+include/wait_for_slave_to_start.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+7
+*** MDEV-4486: Allow to start old-style replication even if mysql.gtid_slave_pos is unavailable
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid= no;
+include/start_slave.inc
+INSERT INTO t1 VALUES (8);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+7
+8
+include/stop_slave.inc
+SET sql_log_bin= 0;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+SET sql_log_bin= 1;
+SELECT * FROM mysql.gtid_slave_pos;
+ERROR 42000: Unknown storage engine 'InnoDB'
+SET sql_log_bin=0;
+call mtr.add_suppression("Failed to load slave replication state from table");
+call mtr.add_suppression("Unable to load replication GTID slave state");
+SET sql_log_bin=1;
+include/start_slave.inc
+Warnings:
+Error 1286 Unknown storage engine 'InnoDB'
+INSERT INTO t1 VALUES (9);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+7
+8
+9
+SET sql_log_bin= 0;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
+SET sql_log_bin= 1;
+include/start_slave.inc
+INSERT INTO t1 VALUES (10);
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid= slave_pos;
+include/start_slave.inc
+*** MDEV-4692: mysql.gtid_slave_pos accumulates values for a domain ***
+SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+domain_id COUNT(*)
+0 2
+1 2
+INSERT INTO t1 VALUES (11);
+SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+domain_id COUNT(*)
+0 2
+1 2
+include/start_slave.inc
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (13);
+SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+domain_id COUNT(*)
+0 2
+1 2
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
index c34021b1fef..538592f0d43 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
@@ -33,5 +33,5 @@ SELECT COUNT(*) FROM mysqltest.t1;
COUNT(*)
2
DROP DATABASE mysqltest;
-DROP TABLE test.t1;
+DROP TABLE IF EXISTS test.t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result
index c4995a739db..b339188f8b8 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev382.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev382.result
@@ -315,7 +315,7 @@ CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb;
CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL,
FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb;
TRUNCATE `t``1`;
-ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db1``; select 'oops!'`.`t``2`, CONSTRAINT `INNODB_FOREIGN_KEY_NAME` FOREIGN KEY (`c```) REFERENCES `db1``; select 'oops!'`.`t``1` (`a```))
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db1``; select 'oops!'`.`t``2`, CONSTRAINT `t@00602_ibfk_1` FOREIGN KEY (`c```) REFERENCES `db1``; select 'oops!'`.`t``1` (`a```))
DROP TABLE `t``2`;
DROP TABLE `t``1`;
*** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart
diff --git a/mysql-test/suite/rpl/t/rpl_drop_db.test b/mysql-test/suite/rpl/t/rpl_drop_db.test
index c3194f08f52..ac859b4655a 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_db.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_db.test
@@ -13,7 +13,7 @@ insert into mysqltest1.t1 values (1);
select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
create table mysqltest1.t2 (n int);
create table mysqltest1.t3 (n int);
---replace_result \\ /
+--replace_result \\ / 66 39
--error 1010
drop database mysqltest1;
use mysqltest1;
@@ -30,7 +30,7 @@ while ($1)
}
--enable_query_log
---replace_result \\ /
+--replace_result \\ / 66 39
--error 1010
drop database mysqltest1;
use mysqltest1;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
index 070e0daa403..7db9e5390f3 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
@@ -8,6 +8,13 @@
# A -> B -> C -> D
connection server_1;
+--source include/wait_for_binlog_checkpoint.inc
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--echo *** GTID position should be empty here ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
+
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, "m1");
@@ -18,9 +25,22 @@ INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
INSERT INTO t2 VALUES (4, "i4");
COMMIT;
save_master_pos;
+source include/wait_for_binlog_checkpoint.inc;
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--let $gtid_pos_server_1 = `SELECT @@gtid_binlog_pos`
+--echo *** GTID position should be non-empty here ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
connection server_2;
sync_with_master;
+source include/wait_for_binlog_checkpoint.inc;
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--echo *** GTID position should be the same as on server_1 ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
save_master_pos;
@@ -123,4 +143,21 @@ eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_3;
connection server_1;
DROP TABLE t1,t2;
+--echo *** A few more checks for BINLOG_GTID_POS function ***
+--let $valid_binlog_name = query_get_value(SHOW BINARY LOGS,Log_name,1)
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS();
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS('a');
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS('a',1,NULL);
+SELECT BINLOG_GTID_POS(1,'a');
+SELECT BINLOG_GTID_POS(NULL,NULL);
+SELECT BINLOG_GTID_POS('',1);
+SELECT BINLOG_GTID_POS('a',1);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',-1);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',0);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551615);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551616);
+
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
index f36f7fa8010..5743e1e4ec6 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
@@ -52,6 +52,23 @@ ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (domain_id, sub_id);
SELECT * FROM t1;
+--echo *** Test that setting @@gtid_domain_id or @@gtid_seq_no is not allowed inside a transaction. ***
+BEGIN;
+INSERT INTO t1 VALUES (100);
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
+SET SESSION gtid_domain_id= 100;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
+SET SESSION gtid_seq_no= 100;
+SET @old_domain= @@GLOBAL.gtid_domain_id;
+SET GLOBAL gtid_domain_id= 100;
+SELECT @@SESSION.gtid_domain_id;
+SET GLOBAL gtid_domain_id= @old_domain;
+INSERT INTO t1 VALUES (101);
+SELECT * FROM t1 ORDER BY a;
+ROLLBACK;
+SELECT * FROM t1 ORDER BY a;
+
+
--echo *** Test requesting an explicit GTID position that conflicts with newer GTIDs of our own in the binlog. ***
--connection slave
--source include/stop_slave.inc
@@ -97,10 +114,41 @@ START SLAVE;
--source include/wait_condition.inc
SELECT * FROM t1 ORDER BY a;
+--echo *** MDEV-4688: Empty value of @@GLOBAL.gtid_slave_pos ***
+# The problem was that record_gtid() deleted too much of the in-memory state,
+# leaving the state empty until after commit when we add the newly committed
+# GTID. Test this by forcing an error after the delete of the old data but
+# before the add of new data.
+
+--source include/stop_slave.inc
+
+--connection master
+# This will be GTID 0-1-3
+INSERT INTO t1 VALUES (5);
+
+--connection slave
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
+SET GLOBAL debug_dbug="+d,gtid_fail_after_record_gtid";
+SET sql_log_bin=0;
+CALL mtr.add_suppression('Got error 131 "Command not supported by database" during COMMIT');
+SET sql_log_bin=1;
+START SLAVE;
+--let $slave_sql_errno= 1180
+--source include/wait_for_slave_sql_error.inc
+# The bug was that @@GLOBAL.gtid_slave_pos was empty here.
+SELECT @@GLOBAL.gtid_slave_pos;
+SELECT * FROM t1 ORDER BY a;
+SET GLOBAL debug_dbug= @old_dbug;
+START SLAVE SQL_THREAD;
+--let $wait_condition= SELECT COUNT(*) = 5 FROM t1
+--source include/wait_condition.inc
+SELECT * FROM t1 ORDER BY a;
+
--echo *** Test slave requesting a GTID that is not present in the master's binlog ***
--source include/stop_slave.inc
-SET GLOBAL gtid_slave_pos = "0-1-3";
+SET GLOBAL gtid_slave_pos = "0-1-4";
START SLAVE;
SET sql_log_bin=0;
@@ -113,15 +161,15 @@ SET sql_log_bin=1;
--let $rpl_only_running_threads= 1
--source include/stop_slave.inc
-SET GLOBAL gtid_slave_pos = "0-1-2";
+SET GLOBAL gtid_slave_pos = "0-1-3";
START SLAVE;
--source include/wait_for_slave_to_start.inc
--connection master
-INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
--connection slave
---let $wait_condition= SELECT COUNT(*) = 5 FROM t1
+--let $wait_condition= SELECT COUNT(*) = 6 FROM t1
--source include/wait_condition.inc
SELECT * FROM t1 ORDER BY a;
@@ -142,7 +190,7 @@ START SLAVE;
--connection master
SET GLOBAL debug_dbug= @old_dbug;
-INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
--save_master_pos
--connection slave
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
index 9c9c8090eba..1e33520efb5 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
@@ -3,6 +3,8 @@
--source include/have_binlog_format_statement.inc
--connection server_1
+SET @old_strict= @@GLOBAL.gtid_strict_mode;
+SET GLOBAL gtid_strict_mode= 1;
select @@global.log_slave_updates;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
@@ -11,6 +13,8 @@ INSERT INTO t1 VALUES (2, 1);
--save_master_pos
--connection server_2
+SET @old_strict= @@GLOBAL.gtid_strict_mode;
+SET GLOBAL gtid_strict_mode= 1;
select @@global.log_slave_updates;
--sync_with_master
@@ -18,16 +22,20 @@ SELECT * FROM t1 ORDER BY a;
--source include/stop_slave.inc
+--connection server_1
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT,
+ master_user = 'root', master_use_gtid = current_pos;
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+
+--connection server_2
INSERT INTO t1 VALUES (3, 2);
INSERT INTO t1 VALUES (4, 2);
--source include/show_binlog_events.inc
--connection server_1
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT,
- master_user = 'root', master_use_gtid = current_pos;
-START SLAVE;
--let $wait_condition= SELECT COUNT(*) = 4 FROM t1
--source include/wait_condition.inc
@@ -49,8 +57,10 @@ START SLAVE;
SELECT * FROM t1 ORDER BY a;
# Cleanup.
+SET GLOBAL gtid_strict_mode= @old_strict;
--connection server_1
+SET GLOBAL gtid_strict_mode= @old_strict;
DROP TABLE t1;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test b/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test
index 153a04d8918..226c50dbc97 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test
@@ -43,6 +43,7 @@ SELECT * FROM t1 ORDER BY a;
--source include/kill_binlog_dump_threads.inc
INSERT INTO t1 VALUES (10);
SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
--save_master_pos
@@ -88,6 +89,7 @@ SELECT * FROM t1 ORDER BY a;
--connection server_1
--source include/kill_binlog_dump_threads.inc
INSERT INTO t1 VALUES (20);
+SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
--save_master_pos
@@ -127,6 +129,7 @@ SET gtid_seq_no= 200;
INSERT INTO t1 VALUES (13);
SET gtid_domain_id= 10;
+SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
--connection server_2
@@ -158,6 +161,7 @@ TRUNCATE t1;
RESET MASTER;
--source include/kill_binlog_dump_threads.inc
+SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,binlog_force_reconnect_after_22_events";
# 4 events for FD, fake rotate, gtid list, binlog checkpoint.
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
index 8dfb60b1b56..0797eead0ee 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
@@ -249,11 +249,11 @@ SET GLOBAL gtid_slave_pos="";
RESET MASTER;
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES (10); # Will be GTID 0-1-2
---save_master_pos
--connection server_2
--source include/start_slave.inc
---sync_with_master
+--let $wait_condition= SELECT COUNT(*) = 1 FROM t1
+--source include/wait_condition.inc
SELECT * FROM t1;
--let $value= query_get_value(SHOW SLAVE STATUS, "Using_Gtid", 1)
@@ -277,6 +277,75 @@ SET GLOBAL gtid_slave_pos='0-1-2';
--let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Slave_Pos", 1)
eval SELECT '$value' AS Gtid_Slave_Pos;
+
+--echo *** MDEV-4483: Slave loses traditional master coordinates immediately on CHANGE MASTER TO MASTER_USE_GTID = 1 ***
+--connection server_2
+--source include/stop_slave.inc
+DROP TABLE t1;
+RESET SLAVE ALL;
+RESET MASTER;
+SET GLOBAL gtid_slave_pos= "";
+
+# Set up old-style replication. The bug was that CHANGE MASTER would clear
+# out the old-style binlog/relaylog coordinates when it should not.
+
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$MASTER_MYPORT, master_user='root', master_use_gtid=no, master_log_file="", master_log_pos= 4;
+
+--connection server_1
+DROP TABLE t1;
+RESET MASTER;
+
+CREATE TABLE t1 (a INT PRIMARY KEY);
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+
+--source include/stop_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (1);
+--let $log_file1= query_get_value(SHOW MASTER STATUS, "File", 1)
+--let $log_pos1= query_get_value(SHOW MASTER STATUS, "Position", 1)
+INSERT INTO t1 VALUES (2);
+--let $log_file2= query_get_value(SHOW MASTER STATUS, "File", 1)
+--let $log_pos2= query_get_value(SHOW MASTER STATUS, "Position", 1)
+--save_master_pos
+
+--connection server_2
+# Get the slave to a point where the IO thread has fetched one event ahead
+# of the SQL thread (we want to test that CHANGE MASTER does not mess with
+# existing relay logs).
+--replace_result $log_file1 LOG_FILE1 $log_pos1 LOG_POS1
+eval START SLAVE UNTIL master_log_file='$log_file1', master_log_pos=$log_pos1;
+--source include/wait_for_slave_sql_to_stop.inc
+SELECT * FROM t1;
+--let $slave_param= Read_Master_Log_Pos
+--let $slave_param_value= $log_pos2
+--source include/wait_for_slave_param.inc
+--source include/stop_slave_io.inc
+
+# Test that we can change to GTID and back without loosing our
+# old-style slave position.
+CHANGE MASTER TO master_use_gtid=slave_pos;
+# Unknown GTID, so slave will fail to connect.
+SET GLOBAL gtid_slave_pos="0-42-42";
+SET sql_log_bin=0;
+call mtr.add_suppression("Error: connecting slave requested to start from GTID");
+SET sql_log_bin=1;
+START SLAVE;
+--let $slave_io_errno= 1236
+--source include/wait_for_slave_io_error.inc
+STOP SLAVE SQL_THREAD;
+--source include/wait_for_slave_sql_to_stop.inc
+CHANGE MASTER TO master_use_gtid=no;
+
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+
# Clean up.
--connection server_1
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
index cc1da6b3c85..fda310db0da 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
@@ -1,5 +1,6 @@
--let $rpl_topology=1->2
--source include/rpl_init.inc
+--source include/have_innodb.inc
--echo *** Test normal shutdown/restart of slave server configured as a GTID slave. ***
@@ -116,7 +117,160 @@ SET @slave_pos2= @@GLOBAL.gtid_slave_pos;
SET @current_pos2= @@GLOBAL.gtid_current_pos;
SELECT IF(@slave_pos1=@slave_pos2, "OK", CONCAT(@slave_pos1, " != ", @slave_pos2));
SELECT IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2));
+
+--connection server_1
+INSERT INTO t1 VALUES (6);
+--save_master_pos
+
+--connection server_2
--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+
+
+--echo *** MDEV-4490: Old-style master position points at the last GTID event after slave restart ***
+
+--connection server_1
+INSERT INTO t1 VALUES (7);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+
+# Now we restart the slave server. When it restarts, there is nothing new
+# to replicate. Check that the position is nevertheless updated and
+# MASTER_POS_WAIT() works correctly and detects that we are up-to-date.
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--shutdown_server 30
+--source include/wait_until_disconnected.inc
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart: --skip-slave-start=0
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--source include/wait_for_slave_to_start.inc
+
+--connection server_1
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+
+
+--echo *** MDEV-4486: Allow to start old-style replication even if mysql.gtid_slave_pos is unavailable
+
+--connection server_2
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid= no;
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (8);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+--source include/stop_slave.inc
+
+SET sql_log_bin= 0;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+SET sql_log_bin= 1;
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--shutdown_server 30
+--source include/wait_until_disconnected.inc
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart: --skip-slave-start=1 --skip-innodb
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--error ER_UNKNOWN_STORAGE_ENGINE
+SELECT * FROM mysql.gtid_slave_pos;
+SET sql_log_bin=0;
+call mtr.add_suppression("Failed to load slave replication state from table");
+call mtr.add_suppression("Unable to load replication GTID slave state");
+SET sql_log_bin=1;
+
+--source include/start_slave.inc
+--connection server_1
+INSERT INTO t1 VALUES (9);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+
+# Put things back as they were.
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--shutdown_server 30
+--source include/wait_until_disconnected.inc
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart:
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+SET sql_log_bin= 0;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
+SET sql_log_bin= 1;
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (10);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid= slave_pos;
+--source include/start_slave.inc
+
+--echo *** MDEV-4692: mysql.gtid_slave_pos accumulates values for a domain ***
+SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+
+--connection server_1
+INSERT INTO t1 VALUES (11);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--shutdown_server 30
+--source include/wait_until_disconnected.inc
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart:
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (13);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
--connection server_1
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
index 1fe9283ef44..b9dffa3fb80 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_m.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
@@ -44,7 +44,7 @@ SELECT COUNT(*) FROM mysqltest.t1;
# Cleanup
connection master;
DROP DATABASE mysqltest;
-DROP TABLE test.t1;
+DROP TABLE IF EXISTS test.t1;
sync_slave_with_master;
# End of test
diff --git a/mysql-test/suite/rpl/t/rpl_mdev382.test b/mysql-test/suite/rpl/t/rpl_mdev382.test
index 3e4031d989b..3ec877cdb1a 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev382.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev382.test
@@ -182,7 +182,6 @@ use `db1``; select 'oops!'`;
CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb;
CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL,
FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb;
---replace_regex /t@[0-9]+_ibfk_[0-9]+/INNODB_FOREIGN_KEY_NAME/
--error ER_TRUNCATE_ILLEGAL_FK
TRUNCATE `t``1`;
DROP TABLE `t``2`;
diff --git a/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result
index 5f481b0b134..94835829275 100644
--- a/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result
@@ -1,20 +1,20 @@
select @@global.aria_pagecache_buffer_size;
@@global.aria_pagecache_buffer_size
-134217728
+8388608
select @@session.aria_pagecache_buffer_size;
ERROR HY000: Variable 'aria_pagecache_buffer_size' is a GLOBAL variable
show global variables like 'aria_pagecache_buffer_size';
Variable_name Value
-aria_pagecache_buffer_size 134217728
+aria_pagecache_buffer_size 8388608
show session variables like 'aria_pagecache_buffer_size';
Variable_name Value
-aria_pagecache_buffer_size 134217728
+aria_pagecache_buffer_size 8388608
select * from information_schema.global_variables where variable_name='aria_pagecache_buffer_size';
VARIABLE_NAME VARIABLE_VALUE
-ARIA_PAGECACHE_BUFFER_SIZE 134217728
+ARIA_PAGECACHE_BUFFER_SIZE 8388608
select * from information_schema.session_variables where variable_name='aria_pagecache_buffer_size';
VARIABLE_NAME VARIABLE_VALUE
-ARIA_PAGECACHE_BUFFER_SIZE 134217728
+ARIA_PAGECACHE_BUFFER_SIZE 8388608
set global aria_pagecache_buffer_size=1;
ERROR HY000: Variable 'aria_pagecache_buffer_size' is a read only variable
set session aria_pagecache_buffer_size=1;
diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result
index 915a2383435..d83caffb5be 100644
--- a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result
@@ -59,7 +59,7 @@ Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '42949672950'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
-42949668864
+max_binlog_cache_size
'Bug: Errors are not coming on assigning invalid values to variable'
SET @@global.binlog_cache_size = ON;
ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
diff --git a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result
index 8f1e519dab4..94519d3cd23 100644
--- a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result
@@ -59,7 +59,7 @@ Warnings:
Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '42949672950'
SELECT @@global.binlog_stmt_cache_size;
@@global.binlog_stmt_cache_size
-42949668864
+max_binlog_cache_size
'Bug: Errors are not coming on assigning invalid values to variable'
SET @@global.binlog_stmt_cache_size = ON;
ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result
index b332d01f900..1b8e000ad81 100644
--- a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result
@@ -64,7 +64,7 @@ SELECT @@session.bulk_insert_buffer_size;
SET @@global.bulk_insert_buffer_size = 42949672950;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
-42949672950
+max_bulk_insert_buffer_size
SET @@global.bulk_insert_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-1024'
@@ -80,7 +80,7 @@ ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@session.bulk_insert_buffer_size = 42949672950;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
-42949672950
+max_bulk_insert_buffer_size
SET @@session.bulk_insert_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-2'
diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result
index fda265910f9..2aa8b7dd80a 100644
--- a/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result
@@ -73,17 +73,18 @@ Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '42949672951'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-42949672832
+max_join_buffer_size
+SET @@global.join_buffer_size = 1024*1024;
SET @@global.join_buffer_size = 65530.34;
ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-42949672832
+1048576
SET @@global.join_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-42949672832
+1048576
SET @@session.join_buffer_size = 0;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '0'
@@ -107,17 +108,18 @@ Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '42949672951'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-42949672832
+max_join_buffer_size
+SET @@session.join_buffer_size = 1024*1024;
SET @@session.join_buffer_size = 65530.34;
ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-42949672832
+1048576
SET @@session.join_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-42949672832
+1048576
'#------------------FN_DYNVARS_053_06-----------------------#'
SELECT @@global.join_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result
index bb7492ee7ef..d6a7487c162 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result
@@ -1,7 +1,7 @@
SET @start_value = @@global.max_binlog_cache_size;
SELECT @start_value;
@start_value
-18446744073709547520
+max_binlog_cache_size
'#--------------------FN_DYNVARS_072_01------------------------#'
SET @@global.max_binlog_cache_size = 5000;
Warnings:
@@ -9,7 +9,7 @@ Warning 1292 Truncated incorrect max_binlog_cache_size value: '5000'
SET @@global.max_binlog_cache_size = DEFAULT;
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
-18446744073709547520
+max_binlog_cache_size
'#---------------------FN_DYNVARS_072_02-------------------------#'
SET @@global.max_binlog_cache_size = @start_value;
SELECT @@global.max_binlog_cache_size = 4294967295;
@@ -56,12 +56,13 @@ Warnings:
Warning 1292 Truncated incorrect max_binlog_cache_size value: '100000000000'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
-99999997952
+max_binlog_cache_size
+SET @@global.max_binlog_cache_size = 1024*1024;
SET @@global.max_binlog_cache_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
-99999997952
+1048576
SET @@global.max_binlog_cache_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1024'
@@ -77,7 +78,7 @@ SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 4294967296;
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
-4294967296
+max_binlog_cache_size
SET @@global.max_binlog_cache_size = 4095;
Warnings:
Warning 1292 Truncated incorrect max_binlog_cache_size value: '4095'
@@ -149,4 +150,4 @@ ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list'
SET @@global.max_binlog_cache_size = @start_value;
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
-18446744073709547520
+max_binlog_cache_size
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
index 0b2db8eef69..98e595cc4c3 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
@@ -1,7 +1,7 @@
SET @start_value = @@global.max_binlog_stmt_cache_size;
SELECT @start_value;
@start_value
-18446744073709547520
+max_binlog_stmt_cache_size
'#--------------------FN_DYNVARS_072_01------------------------#'
SET @@global.max_binlog_stmt_cache_size = 5000;
Warnings:
@@ -9,7 +9,7 @@ Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '5000'
SET @@global.max_binlog_stmt_cache_size = DEFAULT;
SELECT @@global.max_binlog_stmt_cache_size;
@@global.max_binlog_stmt_cache_size
-18446744073709547520
+max_binlog_stmt_cache_size
'#---------------------FN_DYNVARS_072_02-------------------------#'
SET @@global.max_binlog_stmt_cache_size = @start_value;
SELECT @@global.max_binlog_stmt_cache_size = 4294967295;
@@ -56,12 +56,13 @@ Warnings:
Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '100000000000'
SELECT @@global.max_binlog_stmt_cache_size;
@@global.max_binlog_stmt_cache_size
-99999997952
+max_binlog_stmt_cache_size
+SET @@global.max_binlog_stmt_cache_size = 1024*1024;
SET @@global.max_binlog_stmt_cache_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size'
SELECT @@global.max_binlog_stmt_cache_size;
@@global.max_binlog_stmt_cache_size
-99999997952
+1048576
SET @@global.max_binlog_stmt_cache_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '-1024'
@@ -77,7 +78,7 @@ SELECT @@global.max_binlog_stmt_cache_size;
SET @@global.max_binlog_stmt_cache_size = 4294967296;
SELECT @@global.max_binlog_stmt_cache_size;
@@global.max_binlog_stmt_cache_size
-4294967296
+max_binlog_stmt_cache_size
SET @@global.max_binlog_stmt_cache_size = 4095;
Warnings:
Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4095'
@@ -149,4 +150,4 @@ ERROR 42S22: Unknown column 'max_binlog_stmt_cache_size' in 'field list'
SET @@global.max_binlog_stmt_cache_size = @start_value;
SELECT @@global.max_binlog_stmt_cache_size;
@@global.max_binlog_stmt_cache_size
-18446744073709547520
+max_binlog_stmt_cache_size
diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic.result
index b492a343a9b..04e1514dd13 100644
--- a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic.result
@@ -66,17 +66,18 @@ SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
-4294967296
+max_sort_buffer_size
+SET @@global.sort_buffer_size = 1024*1024;
SET @@global.sort_buffer_size = 65530.34;
ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
-4294967296
+1048576
SET @@global.sort_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
-4294967296
+1048576
SET @@session.sort_buffer_size = 32775;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
@@ -87,10 +88,10 @@ SELECT @@session.sort_buffer_size;
1024
SET @@session.sort_buffer_size = 65530.34;
ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
-SET @@session.sort_buffer_size = 4294967296;
+SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
-4294967296
+4294967295
SET @@session.sort_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
'#------------------FN_DYNVARS_151_06-----------------------#'
diff --git a/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test
index 323e19c4d66..57822ef0b48 100644
--- a/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test
@@ -81,6 +81,7 @@ SET @@global.binlog_cache_size = 10000.01;
SET @@global.binlog_cache_size = -1024;
SELECT @@global.binlog_cache_size;
SET @@global.binlog_cache_size = 42949672950;
+--replace_result 4294963200 max_binlog_cache_size 42949668864 max_binlog_cache_size
SELECT @@global.binlog_cache_size;
echo 'Bug: Errors are not coming on assigning invalid values to variable';
diff --git a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test
index f5df54b7acd..ecde1723c11 100644
--- a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test
@@ -81,6 +81,7 @@ SET @@global.binlog_stmt_cache_size = 10000.01;
SET @@global.binlog_stmt_cache_size = -1024;
SELECT @@global.binlog_stmt_cache_size;
SET @@global.binlog_stmt_cache_size = 42949672950;
+--replace_result 4294963200 max_binlog_cache_size 42949668864 max_binlog_cache_size
SELECT @@global.binlog_stmt_cache_size;
echo 'Bug: Errors are not coming on assigning invalid values to variable';
diff --git a/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test
index a9580028c7e..5796db32565 100644
--- a/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test
@@ -99,7 +99,10 @@ SELECT @@session.bulk_insert_buffer_size;
# Change the value of bulk_insert_buffer_size to an invalid value #
###################################################################
+--disable_warnings
SET @@global.bulk_insert_buffer_size = 42949672950;
+--enable_warnings
+--replace_result 4294967295 max_bulk_insert_buffer_size 42949672950 max_bulk_insert_buffer_size
SELECT @@global.bulk_insert_buffer_size;
SET @@global.bulk_insert_buffer_size = -1024;
SELECT @@global.bulk_insert_buffer_size;
@@ -111,7 +114,10 @@ SET @@global.bulk_insert_buffer_size = ON;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.bulk_insert_buffer_size = 429496.10;
+--disable_warnings
SET @@session.bulk_insert_buffer_size = 42949672950;
+--enable_warnings
+--replace_result 4294967295 max_bulk_insert_buffer_size 42949672950 max_bulk_insert_buffer_size
SELECT @@session.bulk_insert_buffer_size;
SET @@session.bulk_insert_buffer_size = -2;
SELECT @@session.bulk_insert_buffer_size;
diff --git a/mysql-test/suite/sys_vars/t/join_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/join_buffer_size_basic.test
index 618b70f3ac3..6ebaa14ab92 100644
--- a/mysql-test/suite/sys_vars/t/join_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/join_buffer_size_basic.test
@@ -88,7 +88,9 @@ SELECT @@global.join_buffer_size;
SET @@global.join_buffer_size = 127;
SELECT @@global.join_buffer_size;
SET @@global.join_buffer_size = 42949672951;
+--replace_result 42949672832 max_join_buffer_size 4294967168 max_join_buffer_size
SELECT @@global.join_buffer_size;
+SET @@global.join_buffer_size = 1024*1024;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.join_buffer_size = 65530.34;
@@ -104,7 +106,9 @@ SELECT @@session.join_buffer_size;
SET @@session.join_buffer_size = 127;
SELECT @@session.join_buffer_size;
SET @@session.join_buffer_size = 42949672951;
+--replace_result 42949672832 max_join_buffer_size 4294967168 max_join_buffer_size
SELECT @@session.join_buffer_size;
+SET @@session.join_buffer_size = 1024*1024;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.join_buffer_size = 65530.34;
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test
index 158c21a9489..710299f053c 100644
--- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test
@@ -38,6 +38,7 @@
########################################################################
SET @start_value = @@global.max_binlog_cache_size;
+--replace_result 18446744073709547520 max_binlog_cache_size 4294963200 max_binlog_cache_size
SELECT @start_value;
@@ -48,6 +49,7 @@ SELECT @start_value;
SET @@global.max_binlog_cache_size = 5000;
SET @@global.max_binlog_cache_size = DEFAULT;
+--replace_result 18446744073709547520 max_binlog_cache_size 4294963200 max_binlog_cache_size
SELECT @@global.max_binlog_cache_size;
@@ -84,7 +86,9 @@ SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = -1;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 100000000000;
+--replace_result 99999997952 max_binlog_cache_size 4294963200 max_binlog_cache_size
SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = 1024*1024;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_binlog_cache_size = 10000.01;
SELECT @@global.max_binlog_cache_size;
@@ -92,7 +96,10 @@ SET @@global.max_binlog_cache_size = -1024;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 1024;
SELECT @@global.max_binlog_cache_size;
+--disable_warnings
SET @@global.max_binlog_cache_size = 4294967296;
+--enable_warnings
+--replace_result 4294963200 max_binlog_cache_size 4294967296 max_binlog_cache_size
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 4095;
SELECT @@global.max_binlog_cache_size;
@@ -175,6 +182,7 @@ SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
##############################
SET @@global.max_binlog_cache_size = @start_value;
+--replace_result 4294963200 max_binlog_cache_size 18446744073709547520 max_binlog_cache_size
SELECT @@global.max_binlog_cache_size;
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test
index 07a030c35a7..3c2f6f6d391 100644
--- a/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test
@@ -39,6 +39,7 @@
##############################################################################
SET @start_value = @@global.max_binlog_stmt_cache_size;
+--replace_result 18446744073709547520 max_binlog_stmt_cache_size 4294963200 max_binlog_stmt_cache_size
SELECT @start_value;
@@ -49,6 +50,7 @@ SELECT @start_value;
SET @@global.max_binlog_stmt_cache_size = 5000;
SET @@global.max_binlog_stmt_cache_size = DEFAULT;
+--replace_result 18446744073709547520 max_binlog_stmt_cache_size 4294963200 max_binlog_stmt_cache_size
SELECT @@global.max_binlog_stmt_cache_size;
@@ -85,7 +87,9 @@ SELECT @@global.max_binlog_stmt_cache_size;
SET @@global.max_binlog_stmt_cache_size = -1;
SELECT @@global.max_binlog_stmt_cache_size;
SET @@global.max_binlog_stmt_cache_size = 100000000000;
+--replace_result 99999997952 max_binlog_stmt_cache_size 4294963200 max_binlog_stmt_cache_size
SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 1024*1024;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_binlog_stmt_cache_size = 10000.01;
SELECT @@global.max_binlog_stmt_cache_size;
@@ -93,7 +97,10 @@ SET @@global.max_binlog_stmt_cache_size = -1024;
SELECT @@global.max_binlog_stmt_cache_size;
SET @@global.max_binlog_stmt_cache_size = 1024;
SELECT @@global.max_binlog_stmt_cache_size;
+--disable_warnings
SET @@global.max_binlog_stmt_cache_size = 4294967296;
+--enable_warnings
+--replace_result 4294963200 max_binlog_stmt_cache_size 4294967296 max_binlog_stmt_cache_size
SELECT @@global.max_binlog_stmt_cache_size;
SET @@global.max_binlog_stmt_cache_size = 4095;
SELECT @@global.max_binlog_stmt_cache_size;
@@ -176,6 +183,7 @@ SELECT max_binlog_stmt_cache_size = @@session.max_binlog_stmt_cache_size;
##############################
SET @@global.max_binlog_stmt_cache_size = @start_value;
+--replace_result 4294963200 max_binlog_stmt_cache_size 18446744073709547520 max_binlog_stmt_cache_size
SELECT @@global.max_binlog_stmt_cache_size;
diff --git a/mysql-test/suite/sys_vars/t/sort_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic.test
index a88ad65a076..cf3a13dea94 100644
--- a/mysql-test/suite/sys_vars/t/sort_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic.test
@@ -120,7 +120,10 @@ SET @@global.sort_buffer_size = -1024;
eval
SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = 4294967296;
+--replace_result 4294967296 max_sort_buffer_size 4294967295 max_sort_buffer_size
SELECT @@global.sort_buffer_size;
+SET @@global.sort_buffer_size = 1024*1024;
+
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.sort_buffer_size = 65530.34;
SELECT @@global.sort_buffer_size;
@@ -136,7 +139,7 @@ eval
SELECT @@session.sort_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.sort_buffer_size = 65530.34;
-SET @@session.sort_buffer_size = 4294967296;
+SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index 14467b2d630..4929eabb2e9 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -187,7 +187,11 @@ ts TIMESTAMP,
tsv TIMESTAMP AS (ADDDATE(ts, INTERVAL 1 DAY)) VIRTUAL
) ENGINE=MyISAM;
INSERT INTO t1 (tsv) VALUES (DEFAULT);
+Warnings:
+Warning 1292 Incorrect datetime value: '0000-00-00'
INSERT DELAYED INTO t1 (tsv) VALUES (DEFAULT);
+Warnings:
+Warning 1292 Incorrect datetime value: '0000-00-00'
FLUSH TABLES;
SELECT COUNT(*) FROM t1;
COUNT(*)
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index 9cbc941402e..008610569e2 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -450,3 +450,6 @@ drop table t1;
#
SELECT CAST(TIME('10:20:30') AS DATE) + INTERVAL 1 DAY;
+SET SQL_MODE=ALLOW_INVALID_DATES;
+SELECT DATE("foo");
+
diff --git a/mysql-test/t/fulltext_derived_4257.test b/mysql-test/t/fulltext_derived_4257.test
new file mode 100644
index 00000000000..07626b8b557
--- /dev/null
+++ b/mysql-test/t/fulltext_derived_4257.test
@@ -0,0 +1,6 @@
+set optimizer_switch = 'derived_merge=on';
+create table t1 (c1 char(8), c2 char(8)) engine=myisam;
+insert into t1 values ('test1','test2'),('test3','test4');
+select * from (select c1 from t1 where match (c2) against ('hello' in boolean mode)) as alias;
+drop table t1;
+
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 7a72c21d0ff..6f9359e6095 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -1186,3 +1186,11 @@ SELECT 1 FROM DUAL WHERE DAYOFMONTH(TIMEDIFF(NULL, '12:12:12'));
SELECT 1 FROM DUAL WHERE HOUR(TIMEDIFF(NULL, '12:12:12'));
SELECT 1 FROM DUAL WHERE MINUTE(TIMEDIFF(NULL, '12:12:12'));
SELECT 1 FROM DUAL WHERE SECOND(TIMEDIFF(NULL, '12:12:12'));
+
+
+--echo #
+--echo # MDEV-4635 Crash in UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
+--echo #
+SET TIME_ZONE='+02:00';
+SELECT UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'));
+SET TIME_ZONE=DEFAULT;
diff --git a/mysql-test/t/grant_4332.test b/mysql-test/t/grant_4332.test
index f77d3be350f..302624e3873 100644
--- a/mysql-test/t/grant_4332.test
+++ b/mysql-test/t/grant_4332.test
@@ -58,16 +58,38 @@ select user from mysql.tables_priv;
--error ER_COLUMNACCESS_DENIED_ERROR
select user,host from mysql.tables_priv;
+--error ER_DBACCESS_DENIED_ERROR
+use mtr;
+
+--error ER_PROCACCESS_DENIED_ERROR
+drop procedure mtr.add_suppression;
+
create procedure test.p1() select user(), current_user(), user from mysql.tables_priv;
show create procedure test.p1;
+select definer from information_schema.routines;
+
create table test.t1 (a text);
create event e1 on schedule every 1 second
do insert test.t1 values (concat(user(), ' ', current_user()));
+select definer from information_schema.events;
+
+create view v1 as select * from t1;
+select definer from information_schema.views;
+drop view v1;
+
+create trigger tr1 before delete on t1 for each row set @a:=1;
+select definer from information_schema.triggers;
+drop trigger tr1;
+
connection default;
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect (c80bad,localhost,c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0,foobar,);
+
call test.p1();
disconnect a17;
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index 82097c53fe0..034da4eb925 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -1400,3 +1400,50 @@ explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
drop table t1;
--echo # End of test#50539.
+
+--echo #
+--echo # MDEV-4219 A simple select query returns random data (upstream bug#68473)
+--echo #
+
+--disable_warnings
+drop table if exists faulty;
+--enable_warnings
+
+# MySQL's test case
+
+CREATE TABLE faulty (
+a int(11) unsigned NOT NULL AUTO_INCREMENT,
+b int(11) unsigned NOT NULL,
+c datetime NOT NULL,
+PRIMARY KEY (a),
+UNIQUE KEY b_and_c (b,c)
+);
+
+INSERT INTO faulty (b, c) VALUES
+(1801, '2013-02-15 09:00:00'),
+(1802, '2013-02-28 09:00:00'),
+(1802, '2013-03-01 09:00:00'),
+(5, '1990-02-15 09:00:00'),
+(5, '2013-02-15 09:00:00'),
+(5, '2009-02-15 17:00:00');
+
+EXPLAIN
+SELECT DISTINCT b, c FROM faulty WHERE b='1802' ORDER BY c;
+SELECT DISTINCT b, c FROM faulty WHERE b='1802' ORDER BY c;
+
+drop table faulty;
+
+# MariaDB test case
+
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3);
+INSERT INTO t1 SELECT a + 1, b FROM t1;
+INSERT INTO t1 SELECT a + 2, b FROM t1;
+
+CREATE INDEX break_it ON t1 (a, b);
+
+EXPLAIN
+SELECT distinct a, b FROM t1 where a = '3' ORDER BY b;
+SELECT distinct a, b FROM t1 where a = '3' ORDER BY b;
+
+drop table t1;
diff --git a/mysql-test/t/index_merge_myisam.test b/mysql-test/t/index_merge_myisam.test
index 614c6595d61..07f83fa6713 100644
--- a/mysql-test/t/index_merge_myisam.test
+++ b/mysql-test/t/index_merge_myisam.test
@@ -149,5 +149,32 @@ GROUP BY 2;
DROP TABLE t1,t2,t3;
+--echo #
+--echo # MDEV-4556 Server crashes in SEL_ARG::rb_insert with index_merge+index_merge_sort_union, FORCE INDEX
+--echo #
+CREATE TABLE t1 (
+ pk int,
+ code char(2),
+ population_rate int,
+ area_rate int,
+ primary key (pk),
+ index (code),
+ key (population_rate),
+ key (area_rate)
+);
+
+INSERT INTO t1 VALUES (1,'WI',20, 23), (2, 'WA', 13, 18);
+
+EXPLAIN
+SELECT * FROM t1 FORCE INDEX ( PRIMARY, population_rate, area_rate, code )
+WHERE pk = 1 OR population_rate = 1 OR ( area_rate IN ( 1,2 ) OR area_rate IS NULL )
+AND (population_rate = 25 OR area_rate BETWEEN 2 AND 25 OR code BETWEEN 'MA' AND 'TX');
+
+SELECT * FROM t1 FORCE INDEX ( PRIMARY, population_rate, area_rate, code )
+WHERE pk = 1 OR population_rate = 1 OR ( area_rate IN ( 1,2 ) OR area_rate IS NULL )
+AND (population_rate = 25 OR area_rate BETWEEN 2 AND 25 OR code BETWEEN 'MA' AND 'TX');
+
+DROP TABLE t1;
+
set optimizer_switch= @optimizer_switch_save;
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index 33289f77c13..73b40715676 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -1135,6 +1135,13 @@ SET optimizer_switch=@tmp_optimizer_switch;
DROP TABLE t1,t2,t3,t4,t5;
+--echo #
+--echo # MDEV-4752: Segfault during parsing of illegal query
+--echo #
+--error ER_PARSE_ERROR
+SELECT * FROM t5 JOIN (t1 JOIN t2 UNION SELECT * FROM t3 JOIN t4);
+
+
SET optimizer_switch=@save_optimizer_switch;
--echo #
diff --git a/mysql-test/t/mrr_derived_crash_4610.test b/mysql-test/t/mrr_derived_crash_4610.test
new file mode 100644
index 00000000000..88882b57cf7
--- /dev/null
+++ b/mysql-test/t/mrr_derived_crash_4610.test
@@ -0,0 +1,16 @@
+#
+# MDEV-4610 SQL query crashes MariaDB with derived_with_keys
+#
+--source include/have_innodb.inc
+create table t1 (f1 char(4) primary key) engine=innodb charset=utf8 ;
+insert into t1 values ('aaaa');
+create table t2 (f2 text, f3 char(4) not null) engine=innodb charset=utf8 ;
+create table t3 (id int not null) engine=innodb charset=utf8 ;
+create table t4 (val int not null) engine=innodb charset=utf8;
+explain select 1 from
+ (select f2, f3, val, count(id) from t4 join t2 left join t3 on 0) top
+ join t1 on f1 = f3 where f3 = 'aaaa' order by val;
+select 1 from
+ (select f2, f3, val, count(id) from t4 join t2 left join t3 on 0) top
+ join t1 on f1 = f3 where f3 = 'aaaa' order by val;
+drop table t1, t2, t3, t4;
diff --git a/mysql-test/t/mysql_binary_mode.test b/mysql-test/t/mysql_binary_mode.test
new file mode 100644
index 00000000000..d454bfb7624
--- /dev/null
+++ b/mysql-test/t/mysql_binary_mode.test
@@ -0,0 +1,169 @@
+source include/have_binlog_format_mixed_or_statement.inc;
+RESET MASTER;
+
+--echo # Bug#33048 Not able to recover binary/blob data correctly using mysqlbinlog
+--echo # --------------------------------------------------------------------------
+--echo # The test verify that 0x00 and 0x0D0A sequence can be handled correctly by
+--echo # mysql
+--echo
+
+# zero => 0x00, newline => 0x0D0A, A => 0x41, B => 0x42
+
+# 0x410D0A42 => 'A\r\nB'
+let $table_name_right= `SELECT 0x410D0A42`;
+
+# 0x410A42 => 'A\nB'
+let $table_name_wrong= `SELECT 0x410A42`;
+
+# 0x410042 => 'A\0B'
+let $char0= `SELECT 0x410042`;
+
+eval CREATE TABLE `$table_name_right` (c1 CHAR(100));
+
+--echo # It is a faked statement. ASCII 0 is in the original statement, it would
+--echo # make the test result to become a binary file which was difficult to get
+--echo # the diff result if the original query was logged in the result.
+--echo INSERT INTO `A\r\nB` VALUES("A\0B");
+--echo
+--disable_query_log
+eval INSERT INTO `$table_name_right` VALUES("$char0");
+--enable_query_log
+
+let $char0= $table_name_right;
+eval INSERT INTO `$table_name_right` VALUES("$char0");
+
+eval SELECT HEX(c1) FROM `$table_name_right`;
+
+--echo
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+FLUSH LOGS;
+eval DROP TABLE `$table_name_right`;
+
+--echo
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file > $MYSQLTEST_VARDIR/tmp/my.sql
+RESET MASTER;
+
+--echo # '--exec mysql ...' without --binary-mode option
+--echo # It creates the table with a wrong table name and generates an error.
+--echo # (error output was suppressed to make the test case platform agnostic)
+
+## disabling result log because the error message has the
+## table name in the output which is one byte different ('\r')
+## on unixes and windows.
+--disable_result_log
+--error 1
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/my.sql 2>&1
+--enable_result_log
+
+--echo
+--echo # It is not in binary_mode, so table name '0x410D0A42' can be translated to
+--echo # '0x410A42' by mysql depending on the OS - Windows or Unix-like.
+--replace_result $table_name_wrong TABLE_NAME_MASKED $table_name_right TABLE_NAME_MASKED
+if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
+{
+ eval DROP TABLE `$table_name_right`;
+}
+
+if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
+{
+ eval DROP TABLE `$table_name_wrong`;
+}
+
+--echo
+--echo # In binary_mode, table name '0x410D0A42' and string '0x410042' can be
+--echo # handled correctly.
+RESET MASTER;
+--exec $MYSQL --binary-mode test < $MYSQLTEST_VARDIR/tmp/my.sql
+eval SELECT HEX(c1) FROM `$table_name_right`;
+
+--echo
+eval DROP TABLE `$table_name_right`;
+
+#
+# BUG#12794048 - MAIN.MYSQL_BINARY_MODE FAILS ON WINDOWS RELEASE BUILD
+#
+RESET MASTER;
+
+#
+# This test case tests if the table names and their values
+# are handled properly. For that we check
+#
+
+# 0x610D0A62 => 'a\r\nb'
+let $tbl= `SELECT 0x610D0A62`;
+
+--disable_result_log
+--disable_query_log
+
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+
+#### case #1: mysqltest
+#### CREATE table and insert value through regular mysqltest session
+
+--eval CREATE TABLE `$tbl` (c1 CHAR(100))
+--eval INSERT INTO `$tbl` VALUES ("$tbl")
+
+--let $table_name=`SELECT table_name FROM information_schema.tables WHERE table_schema='test'`
+--let $tbl0= `SELECT HEX(table_name) FROM information_schema.tables WHERE table_schema='test'`
+--let $val0= `SELECT HEX(c1) FROM `$table_name` LIMIT 1`
+
+FLUSH LOGS;
+
+--eval DROP TABLE `$table_name`;
+
+#### case #2: mysql --binlog-mode=0
+#### Replay through regular mysql client non-interactive mode
+
+--let $MYSQLD_DATADIR= `SELECT @@datadir`
+--let $prefix=`SELECT UUID()`
+--let $binlog_uuid_filename= $MYSQLTEST_VARDIR/tmp/$prefix-bin.log
+--copy_file $MYSQLD_DATADIR/$binlog_file $binlog_uuid_filename
+RESET MASTER;
+
+--exec $MYSQL_BINLOG $binlog_uuid_filename | $MYSQL
+
+--let $table_name=`SELECT table_name FROM information_schema.tables WHERE table_schema='test'`
+--let $tbl1= `SELECT hex(table_name) FROM information_schema.tables WHERE table_schema='test'`
+--let $val1= `SELECT HEX(c1) FROM `$table_name` LIMIT 1`
+
+--eval DROP TABLE `$table_name`;
+
+#### case #3: mysql --binlog-mode=1
+#### Replay through regular mysql client non-interactive mode and with binary mode set
+
+RESET MASTER;
+--exec $MYSQL_BINLOG $binlog_uuid_filename | $MYSQL --binary-mode
+
+--let $table_name=`SELECT table_name FROM information_schema.tables WHERE table_schema='test'`
+--let $tbl2= `SELECT hex(table_name) FROM information_schema.tables WHERE table_schema='test'`
+--let $val2= `SELECT HEX(c1) FROM `$table_name` LIMIT 1`
+
+--eval DROP TABLE `$table_name`;
+
+--enable_result_log
+--disable_query_log
+
+##### OUTCOME
+
+--let $assert_text= Table and contents created through mysqltest match 0x610D0A62.
+--let $assert_cond= "$tbl0" = "610D0A62" AND "$val0" = "610D0A62"
+--source include/assert.inc
+
+--let $assert_text= Table and contents created while replaying binary log without --binary-mode set match 0x61(0D)0A62.
+if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
+{
+ --let $assert_cond= "$tbl1" = "610D0A62" AND "$val1" = "610D0A62"
+}
+if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
+{
+ --let $assert_cond= "$tbl1" = "610A62" AND "$val1" = "610A62"
+}
+--source include/assert.inc
+
+--let $assert_text= Table and contents created while replaying binary log with --binary-mode set match 0x610D0A62.
+--let $assert_cond= "$tbl2" = "610D0A62" AND "$val2" = "610D0A62"
+--source include/assert.inc
+
+RESET MASTER;
+--remove_file $binlog_uuid_filename
diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test
index 4c5d00ed9b7..efb1551150f 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -50,7 +50,9 @@ DROP USER mysqltest1@'%';
--replace_result $MYSQLTEST_VARDIR var
--replace_regex /.*mysqlcheck.*: Got/mysqlcheck: Got/ /\([0-9|-]*\)/(errno)/
--error 1
---exec $MYSQL_UPGRADE --force --host=not_existing_host 2>&1
+# NC: Added --skip-version-check, as the version check would fail when
+# mysql_upgrade tries to get the server version.
+--exec $MYSQL_UPGRADE --verbose --force --host=not_existing_host --skip-version-check 2>&1
#
# Bug #28401 mysql_upgrade Failed with STRICT_ALL_TABLES, ANSI_QUOTES and NO_ZERO_DATE
diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test
index 17969b65fb5..722f46d6fb3 100644
--- a/mysql-test/t/mysqld--help.test
+++ b/mysql-test/t/mysqld--help.test
@@ -27,7 +27,8 @@ perl;
feedback debug temp-pool ssl des-key-file xtradb sequence
thread-concurrency super-large-pages mutex-deadlock-detector
connect null-audit aria pbxt oqgraph sphinx thread-handling
- test-sql-discovery rpl-semi-sync query-cache-info/;
+ test-sql-discovery rpl-semi-sync query-cache-info
+ query-response-time locales/;
# And substitute the content some environment variables with their
# names:
diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test
index 602b2e3c5c9..94030670d9f 100644
--- a/mysql-test/t/plugin.test
+++ b/mysql-test/t/plugin.test
@@ -174,3 +174,24 @@ SET @@SQL_MODE=@OLD_SQL_MODE;
#
select 1;
UNINSTALL PLUGIN example;
+
+#
+# MDEV-4573 UNINSTALL PLUGIN misleading error message for non-dynamic plugins
+#
+--error ER_PLUGIN_DELETE_BUILTIN
+UNINSTALL PLUGIN MyISAM;
+
+#
+# MDEV-4529 Assertion `tmp->state == 4' fails on mix of INSTALL SONAME / UNINSTALL PLUGIN
+#
+
+select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
+install soname 'ha_example';
+select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
+uninstall plugin example;
+select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
+install soname 'ha_example';
+select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
+uninstall soname 'ha_example';
+select plugin_name from information_schema.plugins where plugin_library like 'ha_example%';
+
diff --git a/mysql-test/t/processlist.test b/mysql-test/t/processlist.test
new file mode 100644
index 00000000000..c7b775cf992
--- /dev/null
+++ b/mysql-test/t/processlist.test
@@ -0,0 +1,35 @@
+#
+# MDEV-4578 information_schema.processlist reports incorrect value for Time (2147483647)
+#
+
+source include/have_debug_sync.inc;
+
+SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time';
+send SELECT 1;
+
+connect (con1,localhost,root,,);
+
+SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed';
+send SELECT INFO,TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO IS NULL;
+
+connection default;
+reap;
+SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
+
+connection con1;
+reap;
+connection default;
+
+#
+# MDEV-4683 query start_time not reset when going to sleep
+#
+
+connection con1;
+select sleep(5); #run a query that will take some time
+connection default;
+
+# verify that the time in COM_SLEEP doesn't include the query run time
+select command, time < 5 from information_schema.processlist where id != connection_id();
+
+disconnect con1;
+
diff --git a/mysql-test/t/servers.test b/mysql-test/t/servers.test
new file mode 100644
index 00000000000..ee0fa637b87
--- /dev/null
+++ b/mysql-test/t/servers.test
@@ -0,0 +1,8 @@
+# Generic tests for servers (do not require FEDERATED)
+
+--echo #
+--echo # MDEV-4594 - CREATE SERVER crashes embedded
+--echo #
+CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(HOST 'localhost');
+SELECT * FROM mysql.servers;
+DROP SERVER s1;
diff --git a/mysql-test/t/shutdown.test b/mysql-test/t/shutdown.test
new file mode 100644
index 00000000000..b12772cfb6b
--- /dev/null
+++ b/mysql-test/t/shutdown.test
@@ -0,0 +1,28 @@
+--source include/not_embedded.inc
+#
+# SHUTDOWN statement
+#
+create user user1@localhost;
+
+connect (c1,localhost,user1,,);
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+shutdown;
+
+connection default;
+disconnect c1;
+
+--let $_server_id= `SELECT @@server_id`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--exec echo "wait" > $_expect_file_name
+
+shutdown;
+
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart" > $_expect_file_name
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+drop user user1@localhost;
+
diff --git a/mysql-test/t/sp_missing_4665.test b/mysql-test/t/sp_missing_4665.test
new file mode 100644
index 00000000000..19e845e58c7
--- /dev/null
+++ b/mysql-test/t/sp_missing_4665.test
@@ -0,0 +1,9 @@
+#
+# MDEV-4665 crash when referencing missing function in a subquery
+#
+create table t (a int);
+create or replace view v as select 1 from t where a;
+--error ER_SP_DOES_NOT_EXIST
+delete from v where (select g());
+drop view v;
+drop table t;
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index f6080de6c2c..c429e9cfe5b 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -188,13 +188,15 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y'));
INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
+# Zero year is not a problem for DATE/DATETIME
+INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
+INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
+
## Test INSERT with STR_TO_DATE into DATE
# All test cases expected to fail should return
# SQLSTATE 22007 <invalid date value>
--error 1411
-INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
---error 1411
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
--error 1411
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
@@ -214,8 +216,6 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
# SQLSTATE 22007 <invalid datetime value>
--error 1411
-INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
---error 1411
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
--error 1411
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
@@ -234,7 +234,7 @@ INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
# All test cases expected to fail should return
# SQLSTATE 22007 <invalid datetime value>
---error 1411
+--error 1292
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
--error 1411
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index fc07a088a15..bd4f3a3c2d8 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -439,4 +439,45 @@ select distinct (1 + (select 1 from `t2` where `a`)) `d2` from `t1`;
drop table t1,t2;
+--echo #
+--echo # MDEV-4042: Assertion `table->key_read == 0' fails in close_thread_table on EXPLAIN with GROUP BY and HAVING in EXISTS SQ,
+--echo # MDEV-4536: ...sql/sql_base.cc:1598: bool close_thread_table(THD*, TABLE**): Assertion `table->key_read == 0' failed.
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (b INT PRIMARY KEY, c INT) ENGINE=InnoDB;
+CREATE TABLE t3 (d INT) ENGINE=InnoDB;
+
+EXPLAIN
+SELECT * FROM t1 WHERE EXISTS ( SELECT b FROM t2, t3 GROUP BY b HAVING b != 3 );
+SELECT * FROM t1 WHERE EXISTS ( SELECT b FROM t2, t3 GROUP BY b HAVING b != 3 );
+
+DROP TABLE t1,t2,t3;
+
+CREATE TABLE t1 (
+ pk int auto_increment primary key,
+ col_int_key int(11),
+ key col_int_key (col_int_key),col_varchar_key varchar(128),
+ key (col_varchar_key)
+) engine=innodb;
+
+EXPLAIN
+SELECT 1 FROM t1 AS alias1
+WHERE EXISTS ( SELECT SQ2_alias1 . col_int_key AS SQ2_field1
+ FROM ( t1 AS SQ2_alias1 RIGHT OUTER JOIN
+ t1 AS SQ2_alias2 ON (SQ2_alias2 . col_int_key = SQ2_alias1 . col_int_key )
+ )
+ GROUP BY SQ2_field1
+ HAVING SQ2_alias1 . col_int_key >= 7
+ );
+
+SELECT 1 FROM t1 AS alias1
+WHERE EXISTS ( SELECT SQ2_alias1 . col_int_key AS SQ2_field1
+ FROM ( t1 AS SQ2_alias1 RIGHT OUTER JOIN
+ t1 AS SQ2_alias2 ON (SQ2_alias2 . col_int_key = SQ2_alias1 . col_int_key )
+ )
+ GROUP BY SQ2_field1
+ HAVING SQ2_alias1 . col_int_key >= 7
+ );
+drop table t1;
+
+
set optimizer_switch=@subselect_innodb_tmp;
diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test
index bfdc6335f1d..cde8d5d0e19 100644
--- a/mysql-test/t/subselect_sj.test
+++ b/mysql-test/t/subselect_sj.test
@@ -2584,5 +2584,43 @@ ORDER BY sm;
DROP TABLE t1,t2;
+--echo #
+--echo # mdev-4173 ignored duplicate value when converting heap to temp table
+--echo # could lead to extra rows in semijoin queries or missing row in union queries
+--echo #
+CREATE TABLE t1 (i1 INT) engine=myisam;
+INSERT INTO t1 VALUES
+(4),(8),(0),(0),(0),(7),(7),(5),(3),(4),(9),(6),(1),(5),(6),(2),(4),(4);
+
+CREATE TABLE t2 (i2 INT, j2 INT) engine=myisam;
+INSERT INTO t2 VALUES
+(7,1),(0,7),(9,4),(3,7),(4,0),(2,2),(5,9),(3,4),
+(1,0),(3,9),(5,8),(1,8),(204,18),(224,84),(9,6);
+
+CREATE TABLE t3 (i3 INT, KEY(i3)) engine=myisam;
+INSERT INTO t3 VALUES
+(0),(8),(1),(8),(9),(24),(6),(1),(6),(2),(4),(2),(1);
+
+select @@max_heap_table_size into @tmp_max_heap_table_size;
+select @@join_buffer_size into @tmp_join_buffer_size;
+set max_heap_table_size=16*1024;
+
+--disable_query_log
+let $n = 8;
+while ($n) {
+ eval set join_buffer_size= 128 + 128*$n;
+ SELECT COUNT(*) FROM t1 outer_t1, t2 outer_t2, t3
+ WHERE outer_t1.i1 IN (
+ SELECT j2 FROM t2 LEFT JOIN t3 ON ( i3 = j2 )
+ WHERE i2 <> outer_t2.j2
+ );
+ dec $n;
+}
+--enable_query_log
+
+DROP TABLE t1, t2, t3;
+set join_buffer_size = @tmp_join_buffer_size;
+set max_heap_table_size = @tmp_max_heap_table_size;
+
# The following command must be the last one the file
set optimizer_switch=@subselect_sj_tmp;
diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test
index 92fc500cf55..0f701cf9624 100644
--- a/mysql-test/t/subselect_sj2.test
+++ b/mysql-test/t/subselect_sj2.test
@@ -1225,5 +1225,34 @@ WHERE alias3.d IN (
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
+
+--source include/have_innodb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3,t4;
+--enable_warnings
+
+--echo #
+--echo # MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
+--echo #
+CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English');
+
+CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (86,'English');
+
+CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron');
+
+create table t4 like t1;
+insert into t4 select * from t1;
+
+SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
+
+explain
+SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
+
+DROP TABLE t1,t2,t3,t4;
+
--echo # This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 3129863ab9b..af8681abff3 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -295,6 +295,15 @@ insert t1 values ('2010-10-10 15:foobar');
drop table t1;
--echo #
+--echo # MDEV-4634 Crash in CONVERT_TZ
+--echo #
+SELECT CONVERT_TZ(GREATEST(DATE('2021-00-00'),DATE('2022-00-00')),'+00:00','+7:5');
+
+--echo #
+--echo # End of 5.3 tests
+--echo #
+
+--echo #
--echo # Bug #33629: last_day function can return null, but has 'not null'
--echo # flag set for result
--echo #
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index 05bc72291cd..a1c0509666a 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -486,6 +486,11 @@ select * from t2 left join t1 on t1.a=t2.c where t1.b is null;
drop table t1,t2;
+--echo #
+--echo # MDEV-4634 Crash in CONVERT_TZ
+--echo #
+SELECT CONVERT_TZ(GREATEST(TIMESTAMP('2021-00-00'),TIMESTAMP('2022-00-00')),'+00:00','+7:5');
+
--echo End of 5.3 tests
--echo #
diff --git a/mysql-test/t/type_datetime_hires.test b/mysql-test/t/type_datetime_hires.test
index 74f686d4157..a62c227f563 100644
--- a/mysql-test/t/type_datetime_hires.test
+++ b/mysql-test/t/type_datetime_hires.test
@@ -69,3 +69,12 @@ alter table t1 modify b datetime, modify a datetime(6);
select * from t1;
drop table t1;
+--echo #
+--echo # MDEV-4651 Crash in my_decimal2decimal in a ORDER BY query
+--echo #
+SET @@time_zone='+00:00';
+CREATE TABLE t1 (a DATETIME(4) NOT NULL);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2000-00-00 00:00:00');
+SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY 1;
+DROP TABLE t1;
+SET @@time_zone=DEFAULT;
diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test
index 2ddb6f9dffc..19e0c45fbc0 100644
--- a/mysql-test/t/type_time.test
+++ b/mysql-test/t/type_time.test
@@ -123,6 +123,15 @@ insert into t1 values ('23:38:57');
select f1, f1 = '2010-10-11 23:38:57' from t1;
drop table t1;
+--echo #
+--echo # MDEV-4634 Crash in CONVERT_TZ
+--echo #
+SELECT CONVERT_TZ(GREATEST(TIME('00:00:00'),TIME('00:00:00')),'+00:00','+7:5');
+
+--echo #
+--echo # End of 5.3 tests
+--echo #
+
#
# Bug#42664 - Sign ignored for TIME types when not comparing as longlong
#
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 244c5f039fa..21112cd7130 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -1212,7 +1212,10 @@ SET GLOBAL server_id = @old_server_id;
SET @old_max_binlog_cache_size = @@GLOBAL.max_binlog_cache_size;
--echo # Set the max_binlog_cache_size to size more than 4GB.
+--disable_warnings
SET GLOBAL max_binlog_cache_size = 5 * 1024 * 1024 * 1024;
+--enable_warnings
+--replace_result 5368709120 max_size 4294963200 max_size
SELECT @@GLOBAL.max_binlog_cache_size;
SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 4569443dbac..db05b917c80 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -4794,6 +4794,20 @@ WHERE a = alias.a );
drop view v1;
drop table t1,t2;
+--echo #
+--echo # MDEV-4593: p_s: crash in simplify_joins with delete using subselect
+--echo # from view
+--echo #
+
+create table `t1`(`a` int);
+create table `t2`(`a` int);
+create or replace view `v1` as select `a` from `t1`;
+prepare s from "delete from `t2` order by (select 1 from `v1`)";
+execute s;
+deallocate prepare s;
+drop view v1;
+drop tables t1,t2;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.3 tests.
--echo # -----------------------------------------------------------------