summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/binlog/r/binlog_commit_wait.result155
-rw-r--r--mysql-test/suite/binlog/r/binlog_database.result69
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result68
-rw-r--r--mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result8
-rw-r--r--mysql-test/suite/binlog/t/binlog_commit_wait.test229
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test13
-rw-r--r--mysql-test/suite/binlog/t/temptable_uservar_disconnect-7938.test17
-rw-r--r--mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test6
-rw-r--r--mysql-test/suite/funcs_1/t/processlist_val_no_prot.test6
-rw-r--r--mysql-test/suite/innodb/r/binlog_consistent.result11
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result50
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-tempfile.result40
-rw-r--r--mysql-test/suite/innodb/r/innodb-bigblob.result7
-rw-r--r--mysql-test/suite/innodb/r/innodb-fk.result109
-rw-r--r--mysql-test/suite/innodb/r/innodb-mdev-7408.result12
-rw-r--r--mysql-test/suite/innodb/r/innodb-mdev-7513.result204
-rw-r--r--mysql-test/suite/innodb/r/innodb-virtual-columns.result322
-rw-r--r--mysql-test/suite/innodb/r/innodb-xa.result17
-rw-r--r--mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result23
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug34300.result2
-rw-r--r--mysql-test/suite/innodb/r/xa_recovery.result17
-rw-r--r--mysql-test/suite/innodb/t/binlog_consistent.test34
-rw-r--r--mysql-test/suite/innodb/t/foreign-keys.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test50
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-tempfile.test75
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb-bigblob.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb-bigblob.test20
-rw-r--r--mysql-test/suite/innodb/t/innodb-fk.test103
-rw-r--r--mysql-test/suite/innodb/t/innodb-mdev-7408.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb-mdev-7408.test16
-rw-r--r--mysql-test/suite/innodb/t/innodb-mdev-7513.test220
-rw-r--r--mysql-test/suite/innodb/t/innodb-mdev7046.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-virtual-columns.test302
-rw-r--r--mysql-test/suite/innodb/t/innodb-xa.test17
-rw-r--r--mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test55
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug34300.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb_corrupt_bit.test9
-rw-r--r--mysql-test/suite/innodb/t/insert_debug.test5
-rw-r--r--mysql-test/suite/innodb/t/sp_temp_table.test5
-rw-r--r--mysql-test/suite/innodb/t/strict_mode.test5
-rw-r--r--mysql-test/suite/innodb/t/xa_recovery.test47
-rw-r--r--mysql-test/suite/manual/r/rpl_replication_delay.result25
-rw-r--r--mysql-test/suite/manual/t/rpl_replication_delay-slave.opt1
-rw-r--r--mysql-test/suite/manual/t/rpl_replication_delay.test63
-rw-r--r--mysql-test/suite/maria/optimize.result11
-rw-r--r--mysql-test/suite/maria/optimize.test10
-rw-r--r--mysql-test/suite/multi_source/multisource.result87
-rw-r--r--mysql-test/suite/multi_source/multisource.test50
-rw-r--r--mysql-test/suite/parts/r/partition_debug_sync_innodb.result11
-rw-r--r--mysql-test/suite/parts/t/partition_debug_sync_innodb.test5
-rw-r--r--mysql-test/suite/percona/innodb_sys_index.result3
-rw-r--r--mysql-test/suite/percona/innodb_sys_index.test1
-rw-r--r--mysql-test/suite/percona/percona_innodb_fake_changes.result2
-rw-r--r--mysql-test/suite/percona/percona_innodb_fake_changes.test2
-rw-r--r--mysql-test/suite/perfschema/include/connection_setup.inc2
-rw-r--r--mysql-test/suite/perfschema/include/digest_setup.inc2
-rw-r--r--mysql-test/suite/perfschema/include/event_aggregate_setup.inc2
-rw-r--r--mysql-test/suite/perfschema/include/no_protocol.inc10
-rw-r--r--mysql-test/suite/perfschema/include/sizing_auto.inc12
-rw-r--r--mysql-test/suite/perfschema/include/socket_event.inc2
-rw-r--r--mysql-test/suite/perfschema/include/stage_setup.inc2
-rw-r--r--mysql-test/suite/perfschema/include/start_server_common.inc4
-rw-r--r--mysql-test/suite/perfschema/include/table_aggregate_load.inc4
-rw-r--r--mysql-test/suite/perfschema/include/table_aggregate_setup.inc2
-rw-r--r--mysql-test/suite/perfschema/r/aggregate.result3
-rw-r--r--mysql-test/suite/perfschema/r/digest_null_literal.result27
-rw-r--r--mysql-test/suite/perfschema/r/digest_table_full.result2
-rw-r--r--mysql-test/suite/perfschema/r/ortho_iter.result30
-rw-r--r--mysql-test/suite/perfschema/r/privilege_table_io.result5
-rw-r--r--mysql-test/suite/perfschema/r/rpl_gtid_func.result4
-rw-r--r--mysql-test/suite/perfschema/r/sizing_default.result162
-rw-r--r--mysql-test/suite/perfschema/r/sizing_high.result162
-rw-r--r--mysql-test/suite/perfschema/r/sizing_low.result162
-rw-r--r--mysql-test/suite/perfschema/r/sizing_med.result162
-rw-r--r--mysql-test/suite/perfschema/r/sizing_off.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_idle.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_stages.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_statements.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_waits.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_innodb.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_digest.result12
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_account.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_class.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_inst.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_class.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_inst.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_host.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_class.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_actors.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_objects.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_class.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_inst.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stage_class.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statement_class.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_hdl.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_inst.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_class.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_inst.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_user.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_nothing.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_off.result5
-rw-r--r--mysql-test/suite/perfschema/r/start_server_on.result5
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest.result63
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_consumers.result63
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_long_query.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_off.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result5
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result5
-rw-r--r--mysql-test/suite/perfschema/r/threads_mysql.result2
-rw-r--r--mysql-test/suite/perfschema/t/aggregate.test7
-rw-r--r--mysql-test/suite/perfschema/t/digest_null_literal.test32
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test2
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test2
-rw-r--r--mysql-test/suite/perfschema/t/nesting.test2
-rw-r--r--mysql-test/suite/perfschema/t/ortho_iter.test5
-rw-r--r--mysql-test/suite/perfschema/t/privilege_table_io.test4
-rw-r--r--mysql-test/suite/perfschema/t/rpl_gtid_func.test2
-rw-r--r--mysql-test/suite/perfschema/t/rpl_statements.test2
-rw-r--r--mysql-test/suite/perfschema/t/sizing_off.test4
-rw-r--r--mysql-test/suite/perfschema/t/socket_instances_func-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test2
-rw-r--r--mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test2
-rw-r--r--mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_low_digest-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/start_server_low_digest.test21
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest_long_query.test2
-rw-r--r--mysql-test/suite/perfschema/t/unary_digest.test2
-rw-r--r--mysql-test/suite/plugins/r/server_audit.result195
-rw-r--r--mysql-test/suite/plugins/r/thread_pool_server_audit.result367
-rw-r--r--mysql-test/suite/plugins/t/server_audit.test67
-rw-r--r--mysql-test/suite/plugins/t/thread_pool_server_audit.opt2
-rw-r--r--mysql-test/suite/plugins/t/thread_pool_server_audit.test144
-rw-r--r--mysql-test/suite/roles/create_and_drop_role.result18
-rw-r--r--mysql-test/suite/roles/create_and_drop_role.test19
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db_fail.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_basic.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_crash.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_misc.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_until.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_master_pos_wait.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_old_decimal.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel.result515
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel2.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result147
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result52
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_partition.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_temptable.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_annotate_do.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_annotate_dont.result36
-rw-r--r--mysql-test/suite/rpl/r/rpl_special_charset.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result11
-rw-r--r--mysql-test/suite/rpl/r/sec_behind_master-5114.result10
-rw-r--r--mysql-test/suite/rpl/r/semisync_future-7591.result19
-rw-r--r--mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result4
-rw-r--r--mysql-test/suite/rpl/t/rpl_000011.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_db_fail.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_basic.test51
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_crash.test71
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_misc.test50
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_until.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_master_pos_wait.test31
-rw-r--r--mysql-test/suite/rpl/t/rpl_old_decimal.test25
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel.test474
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel2.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_mdev6589.test132
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_multilevel2.cnf17
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_multilevel2.test80
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_partition.test81
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_temptable.test23
-rw-r--r--mysql-test/suite/rpl/t/rpl_special_charset.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_special_charset.test26
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_trigger.test13
-rw-r--r--mysql-test/suite/rpl/t/sec_behind_master-5114.test27
-rw-r--r--mysql-test/suite/rpl/t/semisync_future-7591.test31
-rw-r--r--mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test19
-rw-r--r--mysql-test/suite/stress/t/ddl_archive.test5
-rw-r--r--mysql-test/suite/stress/t/ddl_csv.test5
-rw-r--r--mysql-test/suite/stress/t/ddl_innodb.test5
-rw-r--r--mysql-test/suite/stress/t/ddl_memory.test5
-rw-r--r--mysql-test/suite/stress/t/ddl_myisam.test5
-rw-r--r--mysql-test/suite/sys_vars/r/all_vars.result1
-rw-r--r--mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result15
-rw-r--r--mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result28
-rw-r--r--mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf5
-rw-r--r--mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test6
256 files changed, 6027 insertions, 1303 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_commit_wait.result b/mysql-test/suite/binlog/r/binlog_commit_wait.result
new file mode 100644
index 00000000000..07019c12905
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_commit_wait.result
@@ -0,0 +1,155 @@
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+SET @old_count= @@GLOBAL.binlog_commit_wait_count;
+SET GLOBAL binlog_commit_wait_count= 3;
+SET @old_usec= @@GLOBAL.binlog_commit_wait_usec;
+SET GLOBAL binlog_commit_wait_usec= 20000000;
+SELECT variable_value INTO @group_commits FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commits';
+SELECT variable_value INTO @group_commit_trigger_count FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_count';
+SELECT variable_value INTO @group_commit_trigger_timeout FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+SELECT variable_value INTO @group_commit_trigger_lock_wait FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+SET @a= current_timestamp();
+BEGIN;
+INSERT INTO t1 VALUES (1,0);
+COMMIT;
+INSERT INTO t1 VALUES (1,1);
+SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
+SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
+IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
+Ok
+SELECT variable_value - @group_commits FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commits';
+variable_value - @group_commits
+1
+SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_count';
+variable_value - @group_commit_trigger_count
+0
+SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+variable_value - @group_commit_trigger_timeout
+0
+SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+variable_value - @group_commit_trigger_lock_wait
+1
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SET @a= current_timestamp();
+INSERT INTO t1 VALUES (2,0);
+INSERT INTO t1 VALUES (3,0);
+INSERT INTO t1 VALUES (4,0);
+SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
+SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
+IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
+Ok
+SELECT variable_value - @group_commits FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commits';
+variable_value - @group_commits
+2
+SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_count';
+variable_value - @group_commit_trigger_count
+1
+SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+variable_value - @group_commit_trigger_timeout
+0
+SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+variable_value - @group_commit_trigger_lock_wait
+1
+SET @a= current_timestamp();
+INSERT INTO t1 VALUES (6,0);
+BEGIN;
+UPDATE t1 SET b=b+1 WHERE a=1;
+UPDATE t1 SET b=b+10 WHERE a=1;
+SELECT SLEEP(0.25);
+SLEEP(0.25)
+0
+UPDATE t1 SET b=b+1 WHERE a=3;
+COMMIT;
+SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
+SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
+IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
+Ok
+SELECT variable_value - @group_commits FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commits';
+variable_value - @group_commits
+3
+SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_count';
+variable_value - @group_commit_trigger_count
+1
+SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+variable_value - @group_commit_trigger_timeout
+0
+SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+variable_value - @group_commit_trigger_lock_wait
+2
+SET @a= current_timestamp();
+INSERT INTO t1 VALUES (7,0);
+INSERT INTO t1 VALUES (8,0);
+SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
+SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
+IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
+Ok
+SELECT variable_value - @group_commits FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commits';
+variable_value - @group_commits
+4
+SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_count';
+variable_value - @group_commit_trigger_count
+2
+SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+variable_value - @group_commit_trigger_timeout
+0
+SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+variable_value - @group_commit_trigger_lock_wait
+2
+SET @a= current_timestamp();
+SET GLOBAL binlog_commit_wait_usec= 5*1000*1000;
+INSERT INTO t1 VALUES (9,0);
+SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
+SELECT IF(@b < 4, CONCAT("Error: too little time elapsed: ", @b, " seconds < 4"),
+IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")));
+IF(@b < 4, CONCAT("Error: too little time elapsed: ", @b, " seconds < 4"),
+IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")))
+Ok
+SELECT variable_value - @group_commits FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commits';
+variable_value - @group_commits
+5
+SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_count';
+variable_value - @group_commit_trigger_count
+2
+SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+variable_value - @group_commit_trigger_timeout
+1
+SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
+WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+variable_value - @group_commit_trigger_lock_wait
+2
+SELECT * FROM t1 ORDER BY a;
+a b
+1 11
+2 0
+3 1
+4 0
+6 0
+7 0
+8 0
+9 0
+DROP TABLE t1;
+SET GLOBAL binlog_commit_wait_count= @old_count;
+SET GLOBAL binlog_commit_wait_usec= @old_usec;
diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result
index 4f7d2dc7b94..504b3daa206 100644
--- a/mysql-test/suite/binlog/r/binlog_database.result
+++ b/mysql-test/suite/binlog/r/binlog_database.result
@@ -50,10 +50,31 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generate
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
FLUSH STATUS;
+
+# 'DROP TABLE IF EXISTS <deleted tables>' is binlogged
+# when 'DROP DATABASE' fails and at least one table is deleted
+# from the database.
+RESET MASTER;
+CREATE DATABASE testing_1;
+USE testing_1;
+CREATE TABLE t1(c1 INT);
+CREATE TABLE t2(c1 INT);
+# Create a file in the database directory
+SELECT 'hello' INTO OUTFILE 'fake_file.FAKE_FILE';
+
+# 'DROP DATABASE' will fail if there is any other file in the the
+# database directory
+DROP DATABASE testing_1;
+ERROR HY000: Error dropping database (can't rmdir './testing_1', errno: 39 "Directory not empty")
+
+# Remove the fake file.
+# Now we can drop the database.
+DROP DATABASE testing_1;
#
# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
# BASED REPLICATION
#
+USE test;
DROP DATABASE IF EXISTS db1;
DROP TABLE IF EXISTS t3;
CREATE DATABASE db1;
@@ -70,7 +91,7 @@ t2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
+master-bin.000001 # Query # # use `db1`; DROP TABLE IF EXISTS `t1`
DROP TABLE t3;
DROP DATABASE db1;
set binlog_format=mixed;
@@ -125,10 +146,31 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generate
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
FLUSH STATUS;
+
+# 'DROP TABLE IF EXISTS <deleted tables>' is binlogged
+# when 'DROP DATABASE' fails and at least one table is deleted
+# from the database.
+RESET MASTER;
+CREATE DATABASE testing_1;
+USE testing_1;
+CREATE TABLE t1(c1 INT);
+CREATE TABLE t2(c1 INT);
+# Create a file in the database directory
+SELECT 'hello' INTO OUTFILE 'fake_file.FAKE_FILE';
+
+# 'DROP DATABASE' will fail if there is any other file in the the
+# database directory
+DROP DATABASE testing_1;
+ERROR HY000: Error dropping database (can't rmdir './testing_1', errno: 39 "Directory not empty")
+
+# Remove the fake file.
+# Now we can drop the database.
+DROP DATABASE testing_1;
#
# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
# BASED REPLICATION
#
+USE test;
DROP DATABASE IF EXISTS db1;
DROP TABLE IF EXISTS t3;
CREATE DATABASE db1;
@@ -145,7 +187,7 @@ t2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
+master-bin.000001 # Query # # use `db1`; DROP TABLE IF EXISTS `t1`
DROP TABLE t3;
DROP DATABASE db1;
set binlog_format=row;
@@ -200,10 +242,31 @@ master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* gen
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
FLUSH STATUS;
+
+# 'DROP TABLE IF EXISTS <deleted tables>' is binlogged
+# when 'DROP DATABASE' fails and at least one table is deleted
+# from the database.
+RESET MASTER;
+CREATE DATABASE testing_1;
+USE testing_1;
+CREATE TABLE t1(c1 INT);
+CREATE TABLE t2(c1 INT);
+# Create a file in the database directory
+SELECT 'hello' INTO OUTFILE 'fake_file.FAKE_FILE';
+
+# 'DROP DATABASE' will fail if there is any other file in the the
+# database directory
+DROP DATABASE testing_1;
+ERROR HY000: Error dropping database (can't rmdir './testing_1', errno: 39 "Directory not empty")
+
+# Remove the fake file.
+# Now we can drop the database.
+DROP DATABASE testing_1;
#
# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
# BASED REPLICATION
#
+USE test;
DROP DATABASE IF EXISTS db1;
DROP TABLE IF EXISTS t3;
CREATE DATABASE db1;
@@ -220,7 +283,7 @@ t2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
+master-bin.000001 # Query # # use `db1`; DROP TABLE IF EXISTS `t1`
DROP TABLE t3;
DROP DATABASE db1;
show databases;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index f24cd30167c..86c4c68d02b 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -327,6 +327,18 @@ INSERT INTO t2 SET a=1;
INSERT INTO t2 SET b=1;
UPDATE t1, t2 SET t1.a=10, t2.a=20;
DROP TABLE t1,t2;
+INSERT INTO t1dec102 VALUES (-999.99);
+INSERT INTO t1dec102 VALUES (0);
+INSERT INTO t1dec102 VALUES (999.99);
+SELECT * FROM t1dec102 ORDER BY a;
+a
+-999.99
+0.00
+123.45
+123.46
+123.47
+999.99
+DROP TABLE t1dec102;
flush logs;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
@@ -4554,6 +4566,62 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1`,`t2` /* generated by server */
/*!*/;
# at #
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-317
+/*!100001 SET @@session.gtid_seq_no=317*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number #
+#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test`.`t1dec102`
+### SET
+### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-318
+/*!100001 SET @@session.gtid_seq_no=318*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number #
+#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test`.`t1dec102`
+### SET
+### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-319
+/*!100001 SET @@session.gtid_seq_no=319*//*!*/;
+BEGIN
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number #
+#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test`.`t1dec102`
+### SET
+### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-320
+/*!100001 SET @@session.gtid_seq_no=320*//*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1dec102` /* generated by server */
+/*!*/;
+# at #
#010909 4:46:40 server id 1 end_log_pos # Rotate to master-bin.000002 pos: 4
DELIMITER ;
# End of log file
diff --git a/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result b/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result
new file mode 100644
index 00000000000..f09216cb539
--- /dev/null
+++ b/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result
@@ -0,0 +1,8 @@
+create table t1 (i int);
+create trigger tr after insert on t1 for each row set @b=@a;
+create temporary table tmp like t1;
+insert into t1 values (1);
+select * from t1;
+i
+1
+drop table t1;
diff --git a/mysql-test/suite/binlog/t/binlog_commit_wait.test b/mysql-test/suite/binlog/t/binlog_commit_wait.test
new file mode 100644
index 00000000000..7d7af2a90e2
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_commit_wait.test
@@ -0,0 +1,229 @@
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+
+SET @old_count= @@GLOBAL.binlog_commit_wait_count;
+SET GLOBAL binlog_commit_wait_count= 3;
+SET @old_usec= @@GLOBAL.binlog_commit_wait_usec;
+SET GLOBAL binlog_commit_wait_usec= 20000000;
+
+connect(con1,localhost,root,,test);
+connect(con2,localhost,root,,test);
+connect(con3,localhost,root,,test);
+
+# Get Initial status measurements
+--connection default
+SELECT variable_value INTO @group_commits FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commits';
+SELECT variable_value INTO @group_commit_trigger_count FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_count';
+SELECT variable_value INTO @group_commit_trigger_timeout FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+SELECT variable_value INTO @group_commit_trigger_lock_wait FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+
+# Note: binlog_group_commits is counted at the start of the group and group_commit_trigger_* is
+# counted near when the groups its finalised.
+
+# Check that if T2 goes to wait for a row lock of T1 while T1 is waiting for
+# more transactions to arrive for group commit, the commit of T1 will complete
+# immediately.
+# We test this by setting a very high timeout (20 seconds), and testing that
+# that much time does not elapse.
+
+--connection default
+SET @a= current_timestamp();
+
+--connection con1
+BEGIN;
+INSERT INTO t1 VALUES (1,0);
+send COMMIT;
+
+--connection con2
+send INSERT INTO t1 VALUES (1,1);
+
+--connection con1
+reap;
+
+--connection default
+SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
+SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
+
+# All connections are to the same server. One transaction occurs on con1. It is
+# commited before con2 is started. con2 transaction violates the unique key contraint. This
+# type of group commit is binlog_group_commit_trigger_lock_wait so that further con2
+# transactions will occur afterwards as they may be as result of the ER_DUP_ENTRY on the
+# application side.
+# before: binlog_group_commit=0, binlog_group_commit_trigger_count=0
+# before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=0
+# after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_lock_wait+1
+SELECT variable_value - @group_commits FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commits';
+SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_count';
+SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+
+--connection con2
+--error ER_DUP_ENTRY
+reap;
+
+
+# Test that the commit triggers when sufficient commits have queued up.
+--connection default
+SET @a= current_timestamp();
+
+--connection con1
+send INSERT INTO t1 VALUES (2,0);
+
+--connection con2
+send INSERT INTO t1 VALUES (3,0);
+
+--connection con3
+INSERT INTO t1 VALUES (4,0);
+
+--connection con1
+reap;
+--connection con2
+reap;
+
+--connection default
+SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
+SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
+
+# All connections are to the same server. 3 non-conflicting transaction occur
+# on each connection. The binlog_commit_wait_count=3 at the start therefore 1
+# group is committed by virtue of reaching 3 transactions. Hence
+# binlog_group_commit_trigger_count is incremented.
+# before: binlog_group_commit=1, binlog_group_commit_trigger_count=0
+# before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=1
+# after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_count+1
+SELECT variable_value - @group_commits FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commits';
+SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_count';
+SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+
+# Test that commit triggers immediately if there is already a transaction
+# waiting on another transaction that reaches its commit.
+
+--connection default
+SET @a= current_timestamp();
+
+--connection con1
+send INSERT INTO t1 VALUES (6,0);
+
+--connection con2
+BEGIN;
+UPDATE t1 SET b=b+1 WHERE a=1;
+
+--connection con3
+send UPDATE t1 SET b=b+10 WHERE a=1;
+
+--connection con2
+# A small sleep to let con3 have time to wait on con2.
+# The sleep might be too small on loaded host, but that is not a big problem;
+# it only means we will trigger a different code path (con3 waits after con2
+# is ready to commit rather than before); and either path should work the same.
+# So we will not get false positive in case of different timing; at worst false
+# negative.
+SELECT SLEEP(0.25);
+UPDATE t1 SET b=b+1 WHERE a=3;
+COMMIT;
+
+--connection con1
+reap;
+
+--connection default
+SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
+SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
+
+# All connections are to the same server. con2 and con3 updates are aquiring
+# the same row lock for a=1. Either con2 or con3 will be in a lock wait
+# thefore the binlog_group_commit_trigger_lock_wait is incremented.
+# before: binlog_group_commit=2, binlog_group_commit_trigger_count=1
+# before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=1
+# after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_lock_wait+1
+SELECT variable_value - @group_commits FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commits';
+SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_count';
+SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+
+--connection default
+SET @a= current_timestamp();
+
+# Now con3 will be waiting for a following group commit to trigger.
+--connection con1
+send INSERT INTO t1 VALUES (7,0);
+--connection con2
+INSERT INTO t1 VALUES (8,0);
+--connection con3
+reap;
+
+--connection default
+SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
+SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
+
+# The con1 and con2 transactions above are combined with the 'send UPDATE t1 SET b=b+10 WHERE a=1;'
+# on con3 from the previous block. So we have 3 so this is a count based group.
+# before: binlog_group_commit=3, binlog_group_commit_trigger_count=1
+# before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=2
+# after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_count+1
+SELECT variable_value - @group_commits FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commits';
+SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_count';
+SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+
+# Test that when the binlog_commit_wait_usec is reached the tranction gets a group commit
+
+--connection default
+SET @a= current_timestamp();
+SET GLOBAL binlog_commit_wait_usec= 5*1000*1000;
+
+--connection con1
+reap;
+INSERT INTO t1 VALUES (9,0);
+
+--connection default
+SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
+SELECT IF(@b < 4, CONCAT("Error: too little time elapsed: ", @b, " seconds < 4"),
+ IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")));
+
+# con1 pushes 1 transaction. The count was for 3 to occur before a group commit.
+# The timeout is 5 seconds but we allow between 4 and 20 because of the fragile nature
+# of time in test. This is a timeout causing the commit so binlog_group_commit_trigger_timeout
+# is incremented.
+# before: binlog_group_commit=4, binlog_group_commit_trigger_count=2
+# before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=2
+# after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_timeout+1
+SELECT variable_value - @group_commits FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commits';
+SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_count';
+SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_timeout';
+SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
+ WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+
+--connection default
+SELECT * FROM t1 ORDER BY a;
+
+--connection default
+DROP TABLE t1;
+SET GLOBAL binlog_commit_wait_count= @old_count;
+SET GLOBAL binlog_commit_wait_usec= @old_usec;
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
index 9b41c63d195..9609a9af384 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
@@ -438,9 +438,20 @@ INSERT INTO t2 SET b=1;
UPDATE t1, t2 SET t1.a=10, t2.a=20;
DROP TABLE t1,t2;
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
+--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD
+--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI
+
+INSERT INTO t1dec102 VALUES (-999.99);
+INSERT INTO t1dec102 VALUES (0);
+INSERT INTO t1dec102 VALUES (999.99);
+SELECT * FROM t1dec102 ORDER BY a;
+DROP TABLE t1dec102;
+
flush logs;
-let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
diff --git a/mysql-test/suite/binlog/t/temptable_uservar_disconnect-7938.test b/mysql-test/suite/binlog/t/temptable_uservar_disconnect-7938.test
new file mode 100644
index 00000000000..a1d91e2f98f
--- /dev/null
+++ b/mysql-test/suite/binlog/t/temptable_uservar_disconnect-7938.test
@@ -0,0 +1,17 @@
+#
+# MDEV-7938 MariaDB Crashes Suddenly while writing binlogs
+#
+--source include/have_log_bin.inc
+--source include/have_binlog_format_mixed.inc
+
+--connect(con1,localhost,root,,)
+create table t1 (i int);
+create trigger tr after insert on t1 for each row set @b=@a;
+
+create temporary table tmp like t1;
+insert into t1 values (1);
+--disconnect con1
+
+--connection default
+select * from t1;
+drop table t1;
diff --git a/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test b/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test
index d6746d92250..88563b046df 100644
--- a/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test
+++ b/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test
@@ -25,10 +25,6 @@ let $fixed_bug_30395= 0;
# The file with expected results fits only to a run without
# ps-protocol/sp-protocol/cursor-protocol/view-protocol.
-if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
- + $VIEW_PROTOCOL > 0`)
-{
- --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
-}
+--source include/no_protocol.inc
--source suite/funcs_1/datadict/processlist_priv.inc
diff --git a/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test b/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test
index b92c963c79c..a03d3774484 100644
--- a/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test
+++ b/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test
@@ -20,10 +20,6 @@
# The file with expected results fits only to a run without
# ps-protocol/sp-protocol/cursor-protocol/view-protocol.
-if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
- + $VIEW_PROTOCOL > 0`)
-{
- --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
-}
+--source include/no_protocol.inc
--source suite/funcs_1/datadict/processlist_val.inc
diff --git a/mysql-test/suite/innodb/r/binlog_consistent.result b/mysql-test/suite/innodb/r/binlog_consistent.result
index edfa5947eb8..47f9900c449 100644
--- a/mysql-test/suite/innodb/r/binlog_consistent.result
+++ b/mysql-test/suite/innodb/r/binlog_consistent.result
@@ -104,4 +104,13 @@ master-bin.000001 1757 Gtid 1 1795 BEGIN GTID 0-1-9
master-bin.000001 1795 Query 1 1887 use `test`; INSERT INTO t1 VALUES (3, "")
master-bin.000001 1887 Xid 1 1914 COMMIT /* XID */
master-bin.000001 1914 Rotate 1 1958 master-bin.000002;pos=4
-DROP TABLE t1,t2;
+*** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group commit ***
+SET @old_size= @@GLOBAL.max_binlog_size;
+SET GLOBAL max_binlog_size=4096;
+CREATE TABLE t3 (a INT PRIMARY KEY, b VARBINARY(8192)) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (10, '');
+INSERT INTO t3 VALUES (11, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+test_result
+OK
+SET GLOBAL max_binlog_size=@old_size;
+DROP TABLE t1,t2, t3;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result b/mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result
deleted file mode 100644
index ffeacae7951..00000000000
--- a/mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result
+++ /dev/null
@@ -1,50 +0,0 @@
-create table t1(a int not null primary key, b int) engine=innodb;
-create procedure innodb_insert_proc (repeat_count int)
-begin
-declare current_num int;
-set current_num = 0;
-while current_num < repeat_count do
-insert into t1 values(current_num, current_num);
-set current_num = current_num + 1;
-end while;
-end//
-commit;
-set autocommit=0;
-call innodb_insert_proc(10000);
-commit;
-set autocommit=1;
-set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28';
-alter table t1 add testcol int;
-ERROR HY000: The table 't1' is full
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28_2';
-alter table t1 add testcol int;
-ERROR HY000: The table 't1' is full
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-set DEBUG_DBUG=NULL;
-alter table t1 add testcol2 int;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `testcol2` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-select count(1) from t1;
-count(1)
-10000
-drop procedure innodb_insert_proc;
-drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
new file mode 100644
index 00000000000..ce13ad0978b
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
@@ -0,0 +1,40 @@
+#
+# Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS
+#
+# Temporary tablename will be unique. This makes sure that future
+# in-place ALTERs of the same table will not be blocked due to
+# temporary tablename.
+# Crash the server in ha_innobase::commit_inplace_alter_table()
+CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
+SET debug='d,innodb_alter_commit_crash_before_commit';
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+# Write file to make mysql-test-run.pl expect crash
+# Execute the statement that causes the crash
+ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
+ERROR HY000: Lost connection to MySQL server during query
+# Startup the server after the crash
+# Read and remember the temporary table name
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+# Consecutive Alter table does not create same temporary file name
+ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
+# Shutdown the server to allow manual recovery
+# Manual recovery begin. The dictionary was not updated
+# and the files were not renamed. The rebuilt table
+# was left behind on purpose, to faciliate data recovery.
+# Manual recovery end
+# Startup the server after manual recovery
+# Drop the orphaned rebuilt table.
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` int(11) NOT NULL,
+ PRIMARY KEY (`f2`,`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-bigblob.result b/mysql-test/suite/innodb/r/innodb-bigblob.result
new file mode 100644
index 00000000000..314bd3ed088
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-bigblob.result
@@ -0,0 +1,7 @@
+call mtr.add_suppression("Resizing redo log from *");
+call mtr.add_suppression("Starting to delete and rewrite log files.");
+call mtr.add_suppression("New log files created, LSN=*");
+create table foo (id varchar(37) not null, content longblob) engine=INNODB;
+insert into foo (id, content) values('xyz', '');
+update foo set content=repeat('a', 43941888) where id='xyz';
+drop table foo;
diff --git a/mysql-test/suite/innodb/r/innodb-fk.result b/mysql-test/suite/innodb/r/innodb-fk.result
index cf883d83874..956dbce58ed 100644
--- a/mysql-test/suite/innodb/r/innodb-fk.result
+++ b/mysql-test/suite/innodb/r/innodb-fk.result
@@ -33,3 +33,112 @@ select * from fk_29;
f1
29
drop table t1;
+CREATE TABLE t1 (
+id int(11) NOT NULL AUTO_INCREMENT,
+f1 int(11) DEFAULT NULL,
+PRIMARY KEY (id),
+CONSTRAINT fk1 FOREIGN KEY (f1) REFERENCES t1 (id) ON DELETE CASCADE
+) ENGINE=InnoDB;
+CREATE TABLE t2 (
+id int(11) NOT NULL AUTO_INCREMENT,
+f2 int(11) NOT NULL,
+f3 int(11) NOT NULL,
+PRIMARY KEY (`id`),
+CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE,
+CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE
+) ENGINE=InnoDB;
+ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+CREATE TABLE t2 (
+id int(11) NOT NULL AUTO_INCREMENT,
+f2 int(11) NOT NULL,
+f3 int(11) NOT NULL,
+PRIMARY KEY (`id`),
+CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE
+) ENGINE=InnoDB;
+ALTER TABLE t2 ADD CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE;
+ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+drop table t2;
+drop table t1;
+CREATE TABLE `#departaments` (
+`id_depart` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (`id_depart`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+CREATE TABLE `#departaments_tree` (
+`id_depart` INT(10) UNSIGNED NOT NULL,
+`id_depart_in` INT(10) UNSIGNED NOT NULL,
+PRIMARY KEY (`id_depart`,`id_depart_in`),
+CONSTRAINT `#departaments_tree_ibfk_1` FOREIGN KEY (`id_depart`) REFERENCES `#departaments` (`id_depart`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+ALTER TABLE `#departaments_tree`
+ ADD FOREIGN KEY (`id_depart_in`) REFERENCES `#departaments`(`id_depart`);
+SHOW CREATE TABLE `#departaments_tree`;
+Table Create Table
+#departaments_tree CREATE TABLE `#departaments_tree` (
+ `id_depart` int(10) unsigned NOT NULL,
+ `id_depart_in` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`id_depart`,`id_depart_in`),
+ KEY `id_depart_in` (`id_depart_in`),
+ CONSTRAINT `#departaments_tree_ibfk_1` FOREIGN KEY (`id_depart`) REFERENCES `#departaments` (`id_depart`),
+ CONSTRAINT `#departaments_tree_ibfk_2` FOREIGN KEY (`id_depart_in`) REFERENCES `#departaments` (`id_depart`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+DROP TABLE `#departaments_tree`;
+DROP TABLE `#departaments`;
+CREATE TABLE `boroda` (
+`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+`a` INT(11) UNSIGNED DEFAULT NULL,
+`b` INT(11) UNSIGNED DEFAULT NULL,
+PRIMARY KEY (`id`),
+KEY `a` (`a`),
+CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+ALTER TABLE `boroda`
+ ADD FOREIGN KEY (`b`) REFERENCES `boroda`(`id`);
+ALTER TABLE `boroda` DROP FOREIGN KEY `boroda_ibfk_2`;
+RENAME TABLE `boroda` TO `#boroda`;
+ALTER TABLE `#boroda`
+ADD FOREIGN KEY (`b`) REFERENCES `#boroda`(`id`);
+SHOW CREATE TABLE `#boroda`;
+Table Create Table
+#boroda CREATE TABLE `#boroda` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `a` int(11) unsigned DEFAULT NULL,
+ `b` int(11) unsigned DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ KEY `b` (`b`),
+ CONSTRAINT `#boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `#boroda` (`id`),
+ CONSTRAINT `#boroda_ibfk_2` FOREIGN KEY (`b`) REFERENCES `#boroda` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+DROP TABLE `#boroda`;
+CREATE TABLE `boroda` (
+`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+`a` INT(11) UNSIGNED DEFAULT NULL,
+`b` INT(11) UNSIGNED DEFAULT NULL,
+PRIMARY KEY (`id`),
+KEY `a` (`a`),
+CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+RENAME TABLE `boroda` TO `bor#oda`;
+ALTER TABLE `bor#oda`
+ADD FOREIGN KEY (`b`) REFERENCES `bor#oda`(`id`);
+SHOW CREATE TABLE `bor#oda`;
+Table Create Table
+bor#oda CREATE TABLE `bor#oda` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `a` int(11) unsigned DEFAULT NULL,
+ `b` int(11) unsigned DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ KEY `b` (`b`),
+ CONSTRAINT `bor#oda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `bor#oda` (`id`),
+ CONSTRAINT `bor#oda_ibfk_2` FOREIGN KEY (`b`) REFERENCES `bor#oda` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+DROP TABLE `bor#oda`;
diff --git a/mysql-test/suite/innodb/r/innodb-mdev-7408.result b/mysql-test/suite/innodb/r/innodb-mdev-7408.result
new file mode 100644
index 00000000000..8f6ad139192
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-mdev-7408.result
@@ -0,0 +1,12 @@
+select @@global.innodb_ft_server_stopword_table;
+@@global.innodb_ft_server_stopword_table
+NULL
+CREATE TABLE `stop_it-IT` ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
+SET @@global.innodb_ft_server_stopword_table = 'test/stop_it-IT';
+ERROR 42000: Variable 'innodb_ft_server_stopword_table' can't be set to the value of 'test/stop_it-IT'
+SET @@global.innodb_ft_server_stopword_table = 'test/stop_it@002dIT';
+drop table `stop_it-IT`;
+CREATE TABLE stop_it ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
+SET @@global.innodb_ft_server_stopword_table = 'test/stop_it';
+SET @@global.innodb_ft_server_stopword_table = NULL;
+drop table stop_it;
diff --git a/mysql-test/suite/innodb/r/innodb-mdev-7513.result b/mysql-test/suite/innodb/r/innodb-mdev-7513.result
new file mode 100644
index 00000000000..bb3531e3f90
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-mdev-7513.result
@@ -0,0 +1,204 @@
+call mtr.add_suppression("Row size too large (> 8126)*");
+CREATE TABLE t1 ( text1 TEXT,
+text2 TEXT,
+text3 TEXT,
+text4 TEXT,
+text5 TEXT,
+text6 TEXT,
+text7 TEXT,
+text8 TEXT,
+text9 TEXT,
+text10 TEXT,
+text11 TEXT,
+text12 TEXT,
+text13 TEXT,
+text14 TEXT,
+text15 TEXT,
+text16 TEXT,
+text17 TEXT,
+text18 TEXT,
+text19 TEXT,
+text20 TEXT,
+text21 TEXT,
+text22 TEXT,
+text23 TEXT,
+text24 TEXT,
+text25 TEXT,
+text26 TEXT,
+text27 TEXT,
+text28 TEXT,
+text29 TEXT,
+text30 TEXT,
+text31 TEXT,
+text32 TEXT,
+text33 TEXT,
+text34 TEXT,
+text35 TEXT,
+text36 TEXT,
+text37 TEXT,
+text38 TEXT,
+text39 TEXT,
+text40 TEXT,
+text41 TEXT,
+text42 TEXT,
+text43 TEXT,
+text44 TEXT,
+text45 TEXT,
+text46 TEXT,
+text47 TEXT,
+text48 TEXT,
+text49 TEXT,
+text50 TEXT,
+text51 TEXT,
+text52 TEXT,
+text53 TEXT,
+text54 TEXT,
+text55 TEXT,
+text56 TEXT,
+text57 TEXT,
+text58 TEXT,
+text59 TEXT,
+text60 TEXT,
+text61 TEXT,
+text62 TEXT,
+text63 TEXT,
+text64 TEXT,
+text65 TEXT,
+text66 TEXT,
+text67 TEXT,
+text68 TEXT,
+text69 TEXT,
+text70 TEXT,
+text71 TEXT,
+text72 TEXT,
+text73 TEXT,
+text74 TEXT,
+text75 TEXT,
+text76 TEXT,
+text77 TEXT,
+text78 TEXT,
+text79 TEXT,
+text80 TEXT,
+text81 TEXT,
+text82 TEXT,
+text83 TEXT,
+text84 TEXT,
+text85 TEXT,
+text86 TEXT,
+text87 TEXT,
+text88 TEXT,
+text89 TEXT,
+text90 TEXT,
+text91 TEXT,
+text92 TEXT,
+text93 TEXT,
+text94 TEXT,
+text95 TEXT,
+text96 TEXT,
+text97 TEXT,
+text98 TEXT,
+text99 TEXT,
+text100 TEXT,
+text101 TEXT,
+text102 TEXT,
+text103 TEXT,
+text104 TEXT,
+text105 TEXT,
+text106 TEXT,
+text107 TEXT,
+text108 TEXT,
+text109 TEXT,
+text110 TEXT,
+text111 TEXT,
+text112 TEXT,
+text113 TEXT,
+text114 TEXT,
+text115 TEXT,
+text116 TEXT,
+text117 TEXT,
+text118 TEXT,
+text119 TEXT,
+text120 TEXT,
+text121 TEXT,
+text122 TEXT,
+text123 TEXT,
+text124 TEXT,
+text125 TEXT,
+text126 TEXT,
+text127 TEXT,
+text128 TEXT,
+text129 TEXT,
+text130 TEXT,
+text131 TEXT,
+text132 TEXT,
+text133 TEXT,
+text134 TEXT,
+text135 TEXT,
+text136 TEXT,
+text137 TEXT,
+text138 TEXT,
+text139 TEXT,
+text140 TEXT,
+text141 TEXT,
+text142 TEXT,
+text143 TEXT,
+text144 TEXT,
+text145 TEXT,
+text146 TEXT,
+text147 TEXT,
+text148 TEXT,
+text149 TEXT,
+text150 TEXT,
+text151 TEXT,
+text152 TEXT,
+text153 TEXT,
+text154 TEXT,
+text155 TEXT,
+text156 TEXT,
+text157 TEXT,
+text158 TEXT,
+text159 TEXT,
+text160 TEXT,
+text161 TEXT,
+text162 TEXT,
+text163 TEXT,
+text164 TEXT,
+text165 TEXT,
+text166 TEXT,
+text167 TEXT,
+text168 TEXT,
+text169 TEXT,
+text170 TEXT,
+text171 TEXT,
+text172 TEXT,
+text173 TEXT,
+text174 TEXT,
+text175 TEXT,
+text176 TEXT,
+text177 TEXT,
+text178 TEXT,
+text179 TEXT,
+text180 TEXT,
+text181 TEXT,
+text182 TEXT,
+text183 TEXT,
+text184 TEXT,
+text185 TEXT,
+text186 TEXT,
+text187 TEXT,
+text188 TEXT,
+text189 TEXT,
+text190 TEXT,
+text191 TEXT,
+text192 TEXT,
+text193 TEXT,
+text194 TEXT,
+text195 TEXT,
+text196 TEXT,
+text197 TEXT
+) ENGINE = InnoDB;
+INSERT INTO t1 VALUES ('abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef');
+DELETE FROM t1 WHERE text1 = 'abcdef';
+SELECT * from t1;
+text1 text2 text3 text4 text5 text6 text7 text8 text9 text10 text11 text12 text13 text14 text15 text16 text17 text18 text19 text20 text21 text22 text23 text24 text25 text26 text27 text28 text29 text30 text31 text32 text33 text34 text35 text36 text37 text38 text39 text40 text41 text42 text43 text44 text45 text46 text47 text48 text49 text50 text51 text52 text53 text54 text55 text56 text57 text58 text59 text60 text61 text62 text63 text64 text65 text66 text67 text68 text69 text70 text71 text72 text73 text74 text75 text76 text77 text78 text79 text80 text81 text82 text83 text84 text85 text86 text87 text88 text89 text90 text91 text92 text93 text94 text95 text96 text97 text98 text99 text100 text101 text102 text103 text104 text105 text106 text107 text108 text109 text110 text111 text112 text113 text114 text115 text116 text117 text118 text119 text120 text121 text122 text123 text124 text125 text126 text127 text128 text129 text130 text131 text132 text133 text134 text135 text136 text137 text138 text139 text140 text141 text142 text143 text144 text145 text146 text147 text148 text149 text150 text151 text152 text153 text154 text155 text156 text157 text158 text159 text160 text161 text162 text163 text164 text165 text166 text167 text168 text169 text170 text171 text172 text173 text174 text175 text176 text177 text178 text179 text180 text181 text182 text183 text184 text185 text186 text187 text188 text189 text190 text191 text192 text193 text194 text195 text196 text197
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result
new file mode 100644
index 00000000000..558bb23de0a
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-virtual-columns.result
@@ -0,0 +1,322 @@
+CREATE TABLE IF NOT EXISTS gso_grad_supr (
+term char(4) NOT NULL DEFAULT '',
+uw_id int(8) UNSIGNED NOT NULL DEFAULT 0,
+plan varchar(10) NOT NULL DEFAULT '',
+wdraw_rsn varchar(4) NOT NULL DEFAULT '',
+admit_term char(4) NOT NULL DEFAULT '',
+CONSTRAINT gso_grad_supr_pky PRIMARY KEY (uw_id, term)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO `gso_grad_supr` VALUES ('1031',2,'CSM','','1009');
+INSERT INTO `gso_grad_supr` VALUES ('1035',2,'CSM','ACAD','1009');
+CREATE TABLE IF NOT EXISTS grad_degree (
+student_id int(8) UNSIGNED NOT NULL,
+plan varchar(10) NOT NULL,
+admit_term char(4) NOT NULL,
+wdraw_rsn varchar(4) NOT NULL DEFAULT '',
+ofis_deg_status varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
+ ELSE 'Not Completed'
+ END) VIRTUAL,
+deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
+deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term',
+CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
+CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term);
+INSERT IGNORE grad_degree (
+student_id,
+plan,
+admit_term,
+wdraw_rsn,
+deg_start_term,
+deg_as_of_term
+)
+SELECT
+ggs.uw_id AS c_student_id,
+ggs.plan,
+ggs.admit_term,
+ggs.wdraw_rsn,
+IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term,
+ggs.term AS c_as_of_term
+FROM gso_grad_supr AS ggs
+LEFT OUTER JOIN
+grad_degree AS gd
+ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+WHERE
+ggs.term = 1031 AND
+gd.student_id IS NULL
+;
+UPDATE grad_degree AS gd
+INNER JOIN
+gso_grad_supr AS ggs
+ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+SET
+gd.wdraw_rsn = ggs.wdraw_rsn,
+gd.deg_as_of_term = 1035
+WHERE
+gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND
+ggs.term = 1035
+;
+drop table grad_degree;
+CREATE TABLE IF NOT EXISTS grad_degree (
+student_id int(8) UNSIGNED NOT NULL,
+plan varchar(10) NOT NULL,
+admit_term char(4) NOT NULL,
+wdraw_rsn varchar(4) NOT NULL DEFAULT '',
+ofis_deg_status varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
+ ELSE 'Not Completed'
+ END) VIRTUAL,
+ofis_deg_status2 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress2'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2'
+ ELSE 'Not Completed2'
+ END) VIRTUAL,
+ofis_deg_status3 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress3'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3'
+ ELSE 'Not Completed3'
+ END) VIRTUAL,
+ofis_deg_status4 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress4'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4'
+ ELSE 'Not Completed4'
+ END) VIRTUAL,
+ofis_deg_status5 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress5'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5'
+ ELSE 'Not Completed5'
+ END) VIRTUAL,
+ofis_deg_status6 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress6'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6'
+ ELSE 'Not Completed6'
+ END) VIRTUAL,
+ofis_deg_status7 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress7'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7'
+ ELSE 'Not Completed7'
+ END) VIRTUAL,
+ofis_deg_status8 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress8'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8'
+ ELSE 'Not Completed8'
+ END) VIRTUAL,
+deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
+deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term',
+CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
+CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term);
+INSERT IGNORE grad_degree (
+student_id,
+plan,
+admit_term,
+wdraw_rsn,
+deg_start_term,
+deg_as_of_term
+)
+SELECT
+ggs.uw_id AS c_student_id,
+ggs.plan,
+ggs.admit_term,
+ggs.wdraw_rsn,
+IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term,
+ggs.term AS c_as_of_term
+FROM gso_grad_supr AS ggs
+LEFT OUTER JOIN
+grad_degree AS gd
+ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+WHERE
+ggs.term = 1031 AND
+gd.student_id IS NULL
+;
+UPDATE grad_degree AS gd
+INNER JOIN
+gso_grad_supr AS ggs
+ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+SET
+gd.wdraw_rsn = ggs.wdraw_rsn,
+gd.deg_as_of_term = 1035
+WHERE
+gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND
+ggs.term = 1035
+;
+ALTER TABLE grad_degree DROP INDEX grad_degree_wdraw_rsn_ndx;
+ALTER TABLE grad_degree DROP COLUMN deg_start_term;
+SHOW CREATE TABLE grad_degree;
+Table Create Table
+grad_degree CREATE TABLE `grad_degree` (
+ `student_id` int(8) unsigned NOT NULL,
+ `plan` varchar(10) NOT NULL,
+ `admit_term` char(4) NOT NULL,
+ `wdraw_rsn` varchar(4) NOT NULL DEFAULT '',
+ `ofis_deg_status` varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
+ ELSE 'Not Completed'
+ END) VIRTUAL,
+ `ofis_deg_status2` varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress2'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2'
+ ELSE 'Not Completed2'
+ END) VIRTUAL,
+ `ofis_deg_status3` varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress3'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3'
+ ELSE 'Not Completed3'
+ END) VIRTUAL,
+ `ofis_deg_status4` varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress4'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4'
+ ELSE 'Not Completed4'
+ END) VIRTUAL,
+ `ofis_deg_status5` varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress5'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5'
+ ELSE 'Not Completed5'
+ END) VIRTUAL,
+ `ofis_deg_status6` varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress6'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6'
+ ELSE 'Not Completed6'
+ END) VIRTUAL,
+ `ofis_deg_status7` varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress7'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7'
+ ELSE 'Not Completed7'
+ END) VIRTUAL,
+ `ofis_deg_status8` varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress8'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8'
+ ELSE 'Not Completed8'
+ END) VIRTUAL,
+ `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term',
+ PRIMARY KEY (`student_id`,`plan`,`admit_term`),
+ KEY `grad_degree_as_of_term_ndx` (`deg_as_of_term`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+DROP TABLE grad_degree;
+CREATE TABLE IF NOT EXISTS grad_degree (
+student_id int(8) UNSIGNED NOT NULL,
+plan varchar(10) NOT NULL,
+admit_term char(4) NOT NULL,
+wdraw_rsn varchar(4) NOT NULL DEFAULT '',
+ofis_deg_status varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
+ ELSE 'Not Completed'
+ END) VIRTUAL,
+ofis_deg_status2 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress2'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2'
+ ELSE 'Not Completed2'
+ END) VIRTUAL,
+ofis_deg_status3 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress3'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3'
+ ELSE 'Not Completed3'
+ END) VIRTUAL,
+ofis_deg_status4 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress4'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4'
+ ELSE 'Not Completed4'
+ END) VIRTUAL,
+ofis_deg_status5 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress5'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5'
+ ELSE 'Not Completed5'
+ END) VIRTUAL,
+ofis_deg_status6 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress6'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6'
+ ELSE 'Not Completed6'
+ END) VIRTUAL,
+ofis_deg_status7 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress7'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7'
+ ELSE 'Not Completed7'
+ END) VIRTUAL,
+ofis_deg_status8 varchar(15) AS (
+CASE
+WHEN wdraw_rsn = '' THEN 'In progress8'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8'
+ ELSE 'Not Completed8'
+ END) VIRTUAL,
+deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
+deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term',
+CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
+ALTER TABLE grad_degree DROP COLUMN ofis_deg_status2, DROP COLUMN ofis_deg_status3,
+DROP COLUMN ofis_deg_status4, DROP COLUMN ofis_deg_status5, DROP COLUMN ofis_deg_status6,
+DROP COLUMN ofis_deg_status7, DROP COLUMN ofis_deg_status8;
+CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term);
+INSERT IGNORE grad_degree (
+student_id,
+plan,
+admit_term,
+wdraw_rsn,
+deg_start_term,
+deg_as_of_term
+)
+SELECT
+ggs.uw_id AS c_student_id,
+ggs.plan,
+ggs.admit_term,
+ggs.wdraw_rsn,
+IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term,
+ggs.term AS c_as_of_term
+FROM gso_grad_supr AS ggs
+LEFT OUTER JOIN
+grad_degree AS gd
+ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+WHERE
+ggs.term = 1031 AND
+gd.student_id IS NULL
+;
+UPDATE grad_degree AS gd
+INNER JOIN
+gso_grad_supr AS ggs
+ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+SET
+gd.wdraw_rsn = ggs.wdraw_rsn,
+gd.deg_as_of_term = 1035
+WHERE
+gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND
+ggs.term = 1035
+;
+select * from grad_degree;
+student_id plan admit_term wdraw_rsn ofis_deg_status deg_start_term deg_as_of_term
+2 CSM 1009 ACAD Not Completed 1009 1035
+select * from gso_grad_supr;
+term uw_id plan wdraw_rsn admit_term
+1031 2 CSM 1009
+1035 2 CSM ACAD 1009
+drop table grad_degree;
+drop table gso_grad_supr;
diff --git a/mysql-test/suite/innodb/r/innodb-xa.result b/mysql-test/suite/innodb/r/innodb-xa.result
new file mode 100644
index 00000000000..6eae842b14c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-xa.result
@@ -0,0 +1,17 @@
+xa rollback 'xid2';
+ERROR XAE04: XAER_NOTA: Unknown XID
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+create table t1(a int)engine=innodb;
+rollback;
+xa start 'xid2';
+insert into `t1` values (1);
+savepoint `sv1`;
+xa end 'xid2';
+start transaction;
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
+xa prepare 'xid2';
+release savepoint `sv1`;
+xa commit 'xid2';
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result
new file mode 100644
index 00000000000..9f6b7ca6a23
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result
@@ -0,0 +1,23 @@
+call mtr.add_suppression("InnoDB: The total blob data length");
+SET GLOBAL max_allowed_packet = 100*1024*1024;
+# Connection big_packets:
+CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB;
+INSERT INTO t1 (a, b) VALUES (1, '1');
+INSERT INTO t1 (a, b) VALUES (2, '2');
+INSERT INTO t1 (a, b) VALUES (3, '3');
+INSERT INTO t1 (a, b) VALUES (4, '4');
+INSERT INTO t1 (a, b) VALUES (5, '5');
+start transaction;
+INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024));
+ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size.
+# Connection default:
+# Quick shutdown and restart server
+# Connection default:
+SELECT a FROM t1;
+a
+1
+2
+3
+4
+5
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug34300.result b/mysql-test/suite/innodb/r/innodb_bug34300.result
index bf07febca73..09fc0b44579 100644
--- a/mysql-test/suite/innodb/r/innodb_bug34300.result
+++ b/mysql-test/suite/innodb/r/innodb_bug34300.result
@@ -1,3 +1,3 @@
-ERROR 42000: Row size too large (> ####). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size.
f4 f8
f4 f8
diff --git a/mysql-test/suite/innodb/r/xa_recovery.result b/mysql-test/suite/innodb/r/xa_recovery.result
new file mode 100644
index 00000000000..84cb37ef7c9
--- /dev/null
+++ b/mysql-test/suite/innodb/r/xa_recovery.result
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+XA START 'x';
+UPDATE t1 set a=2;
+XA END 'x';
+XA PREPARE 'x';
+call mtr.add_suppression("Found 1 prepared XA transactions");
+SELECT * FROM t1 LOCK IN SHARE MODE;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t1;
+a
+2
+XA ROLLBACK 'x';
+SELECT * FROM t1;
+a
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/binlog_consistent.test b/mysql-test/suite/innodb/t/binlog_consistent.test
index 20023871093..a97bef4cf38 100644
--- a/mysql-test/suite/innodb/t/binlog_consistent.test
+++ b/mysql-test/suite/innodb/t/binlog_consistent.test
@@ -86,4 +86,36 @@ SHOW MASTER STATUS;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS;
-DROP TABLE t1,t2;
+
+--echo *** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group commit ***
+
+SET @old_size= @@GLOBAL.max_binlog_size;
+SET GLOBAL max_binlog_size=4096;
+
+CREATE TABLE t3 (a INT PRIMARY KEY, b VARBINARY(8192)) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (10, '');
+--let $bigdata= `SELECT REPEAT('a', 5000)`
+eval INSERT INTO t3 VALUES (11, '$bigdata');
+
+# The bug was that binlog_snapshot_file pointed to the new file after binlog
+# rotation, but binlog_snapshot_position was the offset in the old file before
+# binlog rotation. So the position was invalid.
+# So here, we check that the values are consistent with SHOW MASTER STATUS,
+# which uses a different code path and did not have the bug.
+
+--source include/wait_for_binlog_checkpoint.inc
+--let $snap_file= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_file', Value, 1)
+--let $snap_pos= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1)
+
+--let $master_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+
+--disable_query_log
+eval SET @errmsg= 'ERROR: ($snap_file, $snap_pos) != ($master_file, $master_pos)';
+eval SELECT IF('$snap_file' = '$master_file' AND $snap_pos = $master_pos, 'OK', @errmsg) AS test_result;
+--enable_query_log
+
+SET GLOBAL max_binlog_size=@old_size;
+
+
+DROP TABLE t1,t2, t3;
diff --git a/mysql-test/suite/innodb/t/foreign-keys.test b/mysql-test/suite/innodb/t/foreign-keys.test
index 8ee96347208..2d586e2d6be 100644
--- a/mysql-test/suite/innodb/t/foreign-keys.test
+++ b/mysql-test/suite/innodb/t/foreign-keys.test
@@ -1,11 +1,6 @@
--source include/have_innodb.inc
--source include/have_debug.inc
-if (`select plugin_auth_version <= "5.5.39-MariaDB-36.0" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in XtraDB as of 5.5.39-MariaDB-36.0 or earlier
-}
-
--echo #
--echo # Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE
--echo # ADD FOREIGN KEY
diff --git a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt b/mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt
deleted file mode 100644
index 9c2ee7846b6..00000000000
--- a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-use-native-aio=0
diff --git a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test b/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test
deleted file mode 100644
index adeb2ef9fd2..00000000000
--- a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test
+++ /dev/null
@@ -1,50 +0,0 @@
-# MDEV-6288: Innodb causes server crash after disk full, then can't ALTER TABLE any more
---source include/have_innodb.inc
---source include/not_windows.inc
---source include/not_valgrind.inc
---source include/not_embedded.inc
-
-# DEBUG_SYNC must be compiled in.
---source include/have_debug_sync.inc
-
-create table t1(a int not null primary key, b int) engine=innodb;
-
-delimiter //;
-create procedure innodb_insert_proc (repeat_count int)
-begin
- declare current_num int;
- set current_num = 0;
- while current_num < repeat_count do
- insert into t1 values(current_num, current_num);
- set current_num = current_num + 1;
- end while;
-end//
-delimiter ;//
-commit;
-
-set autocommit=0;
-call innodb_insert_proc(10000);
-commit;
-set autocommit=1;
-
-# This caused crash earlier
-set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28';
---error 1114
-alter table t1 add testcol int;
-show create table t1;
-
-# This caused crash earlier
-set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28_2';
---error 1114
-alter table t1 add testcol int;
-show create table t1;
-
-set DEBUG_DBUG=NULL;
-alter table t1 add testcol2 int;
-show create table t1;
-
-select count(1) from t1;
-
-drop procedure innodb_insert_proc;
-drop table t1;
-
diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
new file mode 100644
index 00000000000..ec1ea35f1cf
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
@@ -0,0 +1,75 @@
+# Not supported in embedded
+--source include/not_embedded.inc
+
+# This test case needs to crash the server. Needs a debug server.
+--source include/have_debug.inc
+
+# Don't test this under valgrind, memory leaks will occur.
+--source include/not_valgrind.inc
+
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
+
+# InnoDB is required
+--source include/have_innodb.inc
+
+--echo #
+--echo # Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS
+--echo #
+--echo # Temporary tablename will be unique. This makes sure that future
+--echo # in-place ALTERs of the same table will not be blocked due to
+--echo # temporary tablename.
+
+let datadir= `select @@datadir`;
+
+--let $_server_id= `SELECT @@server_id`
+--let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+
+--echo # Crash the server in ha_innobase::commit_inplace_alter_table()
+CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
+SET debug='d,innodb_alter_commit_crash_before_commit';
+
+let $orig_table_id = `SELECT table_id
+ FROM information_schema.innodb_sys_tables
+ WHERE name = 'test/t1'`;
+
+--echo # Write file to make mysql-test-run.pl expect crash
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--echo # Execute the statement that causes the crash
+--error 2013
+ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
+--echo # Startup the server after the crash
+--source include/start_mysqld.inc
+
+--echo # Read and remember the temporary table name
+let $temp_table_name = `SELECT SUBSTRING(name,6)
+ FROM information_schema.innodb_sys_tables
+ WHERE name LIKE "test/#sql-ib$orig_table_id%"`;
+# This second copy is an environment variable for the perl script below.
+let temp_table_name = $temp_table_name;
+show create table t1;
+--echo # Consecutive Alter table does not create same temporary file name
+ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
+--echo # Shutdown the server to allow manual recovery
+--source include/shutdown_mysqld.inc
+
+--echo # Manual recovery begin. The dictionary was not updated
+--echo # and the files were not renamed. The rebuilt table
+--echo # was left behind on purpose, to faciliate data recovery.
+
+perl;
+my @frm_file = glob "$ENV{'datadir'}/test/#sql-*.frm";
+my $target_frm = "$ENV{'datadir'}/test/$ENV{'temp_table_name'}.frm";
+rename($frm_file[0], $target_frm);
+EOF
+--echo # Manual recovery end
+--echo # Startup the server after manual recovery
+--source include/start_mysqld.inc
+
+--echo # Drop the orphaned rebuilt table.
+--disable_query_log
+eval DROP TABLE `#mysql50#$temp_table_name`;
+--enable_query_log
+show create table t1;
+drop table t1;
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test
index fd40b50ebbc..a8dda12cadd 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test
@@ -1,8 +1,3 @@
-if (`select plugin_auth_version <= "5.5.37-MariaDB-34.0" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in XtraDB as of 5.5.37-MariaDB-34.0 or earlier
-}
-
--source include/have_innodb.inc
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
diff --git a/mysql-test/suite/innodb/t/innodb-bigblob.opt b/mysql-test/suite/innodb/t/innodb-bigblob.opt
new file mode 100644
index 00000000000..06cc9e2b979
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-bigblob.opt
@@ -0,0 +1,2 @@
+--max-allowed-packet=128M
+--innodb-log-file-size=210M
diff --git a/mysql-test/suite/innodb/t/innodb-bigblob.test b/mysql-test/suite/innodb/t/innodb-bigblob.test
new file mode 100644
index 00000000000..7665c890316
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-bigblob.test
@@ -0,0 +1,20 @@
+-- source include/have_innodb.inc
+-- source include/big_test.inc
+-- source include/not_embedded.inc
+
+--disable_query_log
+let $status_orig=`SELECT @@innodb_status_output`;
+--enable_query_log
+
+call mtr.add_suppression("Resizing redo log from *");
+call mtr.add_suppression("Starting to delete and rewrite log files.");
+call mtr.add_suppression("New log files created, LSN=*");
+
+create table foo (id varchar(37) not null, content longblob) engine=INNODB;
+insert into foo (id, content) values('xyz', '');
+update foo set content=repeat('a', 43941888) where id='xyz';
+drop table foo;
+
+--disable_query_log
+EVAL SET GLOBAL innodb_status_output = $status_orig;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-fk.test b/mysql-test/suite/innodb/t/innodb-fk.test
index 9839cd2d084..f7bcbe238dd 100644
--- a/mysql-test/suite/innodb/t/innodb-fk.test
+++ b/mysql-test/suite/innodb/t/innodb-fk.test
@@ -84,3 +84,106 @@ while ($i)
drop table t1;
+#
+# MDEV-7672: Crash creating an InnoDB table with foreign keys
+#
+
+CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ f1 int(11) DEFAULT NULL,
+ PRIMARY KEY (id),
+ CONSTRAINT fk1 FOREIGN KEY (f1) REFERENCES t1 (id) ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+--error 1005
+CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ f2 int(11) NOT NULL,
+ f3 int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE,
+ CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+show warnings;
+
+CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ f2 int(11) NOT NULL,
+ f3 int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+--replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/
+--error 1005
+ALTER TABLE t2 ADD CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE;
+
+--replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/
+show warnings;
+
+drop table t2;
+drop table t1;
+
+#
+# MDEV-7627: Some symbols in table name can cause to Error Code: 1050 when created FK
+#
+
+CREATE TABLE `#departaments` (
+ `id_depart` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id_depart`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `#departaments_tree` (
+ `id_depart` INT(10) UNSIGNED NOT NULL,
+ `id_depart_in` INT(10) UNSIGNED NOT NULL,
+ PRIMARY KEY (`id_depart`,`id_depart_in`),
+ CONSTRAINT `#departaments_tree_ibfk_1` FOREIGN KEY (`id_depart`) REFERENCES `#departaments` (`id_depart`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `#departaments_tree`
+ ADD FOREIGN KEY (`id_depart_in`) REFERENCES `#departaments`(`id_depart`);
+
+SHOW CREATE TABLE `#departaments_tree`;
+
+DROP TABLE `#departaments_tree`;
+DROP TABLE `#departaments`;
+
+CREATE TABLE `boroda` (
+ `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `a` INT(11) UNSIGNED DEFAULT NULL,
+ `b` INT(11) UNSIGNED DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `boroda`
+ ADD FOREIGN KEY (`b`) REFERENCES `boroda`(`id`);
+
+ALTER TABLE `boroda` DROP FOREIGN KEY `boroda_ibfk_2`;
+
+RENAME TABLE `boroda` TO `#boroda`;
+
+ALTER TABLE `#boroda`
+ADD FOREIGN KEY (`b`) REFERENCES `#boroda`(`id`);
+
+SHOW CREATE TABLE `#boroda`;
+DROP TABLE `#boroda`;
+
+CREATE TABLE `boroda` (
+ `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `a` INT(11) UNSIGNED DEFAULT NULL,
+ `b` INT(11) UNSIGNED DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+RENAME TABLE `boroda` TO `bor#oda`;
+
+ALTER TABLE `bor#oda`
+ADD FOREIGN KEY (`b`) REFERENCES `bor#oda`(`id`);
+
+SHOW CREATE TABLE `bor#oda`;
+DROP TABLE `bor#oda`;
diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7408.opt b/mysql-test/suite/innodb/t/innodb-mdev-7408.opt
new file mode 100644
index 00000000000..1c256483e10
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-mdev-7408.opt
@@ -0,0 +1,2 @@
+--innodb_ft_default_stopword
+
diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7408.test b/mysql-test/suite/innodb/t/innodb-mdev-7408.test
new file mode 100644
index 00000000000..d1cd1879bb1
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-mdev-7408.test
@@ -0,0 +1,16 @@
+--source include/have_innodb.inc
+
+select @@global.innodb_ft_server_stopword_table;
+CREATE TABLE `stop_it-IT` ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
+--error 1231
+SET @@global.innodb_ft_server_stopword_table = 'test/stop_it-IT';
+--error 0,1231
+SET @@global.innodb_ft_server_stopword_table = 'test/stop_it@002dIT';
+drop table `stop_it-IT`;
+
+CREATE TABLE stop_it ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
+SET @@global.innodb_ft_server_stopword_table = 'test/stop_it';
+
+SET @@global.innodb_ft_server_stopword_table = NULL;
+
+drop table stop_it;
diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7513.test b/mysql-test/suite/innodb/t/innodb-mdev-7513.test
new file mode 100644
index 00000000000..b929ea14781
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-mdev-7513.test
@@ -0,0 +1,220 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+
+# MDEV-7513: ib_warn_row_too_big dereferences null thd
+
+call mtr.add_suppression("Row size too large (> 8126)*");
+
+--disable_warnings
+CREATE TABLE t1 ( text1 TEXT,
+text2 TEXT,
+text3 TEXT,
+text4 TEXT,
+text5 TEXT,
+text6 TEXT,
+text7 TEXT,
+text8 TEXT,
+text9 TEXT,
+text10 TEXT,
+text11 TEXT,
+text12 TEXT,
+text13 TEXT,
+text14 TEXT,
+text15 TEXT,
+text16 TEXT,
+text17 TEXT,
+text18 TEXT,
+text19 TEXT,
+text20 TEXT,
+text21 TEXT,
+text22 TEXT,
+text23 TEXT,
+text24 TEXT,
+text25 TEXT,
+text26 TEXT,
+text27 TEXT,
+text28 TEXT,
+text29 TEXT,
+text30 TEXT,
+text31 TEXT,
+text32 TEXT,
+text33 TEXT,
+text34 TEXT,
+text35 TEXT,
+text36 TEXT,
+text37 TEXT,
+text38 TEXT,
+text39 TEXT,
+text40 TEXT,
+text41 TEXT,
+text42 TEXT,
+text43 TEXT,
+text44 TEXT,
+text45 TEXT,
+text46 TEXT,
+text47 TEXT,
+text48 TEXT,
+text49 TEXT,
+text50 TEXT,
+text51 TEXT,
+text52 TEXT,
+text53 TEXT,
+text54 TEXT,
+text55 TEXT,
+text56 TEXT,
+text57 TEXT,
+text58 TEXT,
+text59 TEXT,
+text60 TEXT,
+text61 TEXT,
+text62 TEXT,
+text63 TEXT,
+text64 TEXT,
+text65 TEXT,
+text66 TEXT,
+text67 TEXT,
+text68 TEXT,
+text69 TEXT,
+text70 TEXT,
+text71 TEXT,
+text72 TEXT,
+text73 TEXT,
+text74 TEXT,
+text75 TEXT,
+text76 TEXT,
+text77 TEXT,
+text78 TEXT,
+text79 TEXT,
+text80 TEXT,
+text81 TEXT,
+text82 TEXT,
+text83 TEXT,
+text84 TEXT,
+text85 TEXT,
+text86 TEXT,
+text87 TEXT,
+text88 TEXT,
+text89 TEXT,
+text90 TEXT,
+text91 TEXT,
+text92 TEXT,
+text93 TEXT,
+text94 TEXT,
+text95 TEXT,
+text96 TEXT,
+text97 TEXT,
+text98 TEXT,
+text99 TEXT,
+text100 TEXT,
+text101 TEXT,
+text102 TEXT,
+text103 TEXT,
+text104 TEXT,
+text105 TEXT,
+text106 TEXT,
+text107 TEXT,
+text108 TEXT,
+text109 TEXT,
+text110 TEXT,
+text111 TEXT,
+text112 TEXT,
+text113 TEXT,
+text114 TEXT,
+text115 TEXT,
+text116 TEXT,
+text117 TEXT,
+text118 TEXT,
+text119 TEXT,
+text120 TEXT,
+text121 TEXT,
+text122 TEXT,
+text123 TEXT,
+text124 TEXT,
+text125 TEXT,
+text126 TEXT,
+text127 TEXT,
+text128 TEXT,
+text129 TEXT,
+text130 TEXT,
+text131 TEXT,
+text132 TEXT,
+text133 TEXT,
+text134 TEXT,
+text135 TEXT,
+text136 TEXT,
+text137 TEXT,
+text138 TEXT,
+text139 TEXT,
+text140 TEXT,
+text141 TEXT,
+text142 TEXT,
+text143 TEXT,
+text144 TEXT,
+text145 TEXT,
+text146 TEXT,
+text147 TEXT,
+text148 TEXT,
+text149 TEXT,
+text150 TEXT,
+text151 TEXT,
+text152 TEXT,
+text153 TEXT,
+text154 TEXT,
+text155 TEXT,
+text156 TEXT,
+text157 TEXT,
+text158 TEXT,
+text159 TEXT,
+text160 TEXT,
+text161 TEXT,
+text162 TEXT,
+text163 TEXT,
+text164 TEXT,
+text165 TEXT,
+text166 TEXT,
+text167 TEXT,
+text168 TEXT,
+text169 TEXT,
+text170 TEXT,
+text171 TEXT,
+text172 TEXT,
+text173 TEXT,
+text174 TEXT,
+text175 TEXT,
+text176 TEXT,
+text177 TEXT,
+text178 TEXT,
+text179 TEXT,
+text180 TEXT,
+text181 TEXT,
+text182 TEXT,
+text183 TEXT,
+text184 TEXT,
+text185 TEXT,
+text186 TEXT,
+text187 TEXT,
+text188 TEXT,
+text189 TEXT,
+text190 TEXT,
+text191 TEXT,
+text192 TEXT,
+text193 TEXT,
+text194 TEXT,
+text195 TEXT,
+text196 TEXT,
+text197 TEXT
+) ENGINE = InnoDB;
+
+INSERT INTO t1 VALUES ('abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef');
+--enable_warnings
+
+DELETE FROM t1 WHERE text1 = 'abcdef';
+
+--source include/restart_mysqld.inc
+
+--disable_warnings
+SELECT * from t1;
+--enable_warnings
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test
index 4033f284e65..b4085228e02 100644
--- a/mysql-test/suite/innodb/t/innodb-mdev7046.test
+++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test
@@ -1,5 +1,7 @@
--source include/have_innodb.inc
--source include/have_partition.inc
+# Test causes OS error printout
+--source include/not_windows.inc
--disable_query_log
--disable_result_log
diff --git a/mysql-test/suite/innodb/t/innodb-virtual-columns.test b/mysql-test/suite/innodb/t/innodb-virtual-columns.test
new file mode 100644
index 00000000000..368c6fc8cb1
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-virtual-columns.test
@@ -0,0 +1,302 @@
+--source include/have_innodb.inc
+
+#
+# MDEV-7367: Updating a virtual column corrupts table which crashes server
+# MySQL table columns contains virtual columns but InnoDB table
+# definition does not.
+#
+CREATE TABLE IF NOT EXISTS gso_grad_supr (
+ term char(4) NOT NULL DEFAULT '',
+ uw_id int(8) UNSIGNED NOT NULL DEFAULT 0,
+ plan varchar(10) NOT NULL DEFAULT '',
+ wdraw_rsn varchar(4) NOT NULL DEFAULT '',
+ admit_term char(4) NOT NULL DEFAULT '',
+ CONSTRAINT gso_grad_supr_pky PRIMARY KEY (uw_id, term)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO `gso_grad_supr` VALUES ('1031',2,'CSM','','1009');
+INSERT INTO `gso_grad_supr` VALUES ('1035',2,'CSM','ACAD','1009');
+
+CREATE TABLE IF NOT EXISTS grad_degree (
+ student_id int(8) UNSIGNED NOT NULL,
+ plan varchar(10) NOT NULL,
+ admit_term char(4) NOT NULL,
+ wdraw_rsn varchar(4) NOT NULL DEFAULT '',
+ ofis_deg_status varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
+ ELSE 'Not Completed'
+ END) VIRTUAL,
+ deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
+ deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term',
+ CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
+CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term);
+
+INSERT IGNORE grad_degree (
+ student_id,
+ plan,
+ admit_term,
+ wdraw_rsn,
+ deg_start_term,
+ deg_as_of_term
+)
+SELECT
+ ggs.uw_id AS c_student_id,
+ ggs.plan,
+ ggs.admit_term,
+ ggs.wdraw_rsn,
+ IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term,
+ ggs.term AS c_as_of_term
+FROM gso_grad_supr AS ggs
+LEFT OUTER JOIN
+ grad_degree AS gd
+ ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+WHERE
+ ggs.term = 1031 AND
+ gd.student_id IS NULL
+;
+
+UPDATE grad_degree AS gd
+INNER JOIN
+ gso_grad_supr AS ggs
+ ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+SET
+ gd.wdraw_rsn = ggs.wdraw_rsn,
+ gd.deg_as_of_term = 1035
+WHERE
+ gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND
+ ggs.term = 1035
+;
+
+drop table grad_degree;
+
+#
+# Test with more virtual columns so that MySQL table has
+# more columns than InnoDB and index definition is out
+# of number of actual InnoDB columns.
+#
+CREATE TABLE IF NOT EXISTS grad_degree (
+ student_id int(8) UNSIGNED NOT NULL,
+ plan varchar(10) NOT NULL,
+ admit_term char(4) NOT NULL,
+ wdraw_rsn varchar(4) NOT NULL DEFAULT '',
+ ofis_deg_status varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
+ ELSE 'Not Completed'
+ END) VIRTUAL,
+ ofis_deg_status2 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress2'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2'
+ ELSE 'Not Completed2'
+ END) VIRTUAL,
+ ofis_deg_status3 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress3'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3'
+ ELSE 'Not Completed3'
+ END) VIRTUAL,
+ ofis_deg_status4 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress4'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4'
+ ELSE 'Not Completed4'
+ END) VIRTUAL,
+ ofis_deg_status5 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress5'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5'
+ ELSE 'Not Completed5'
+ END) VIRTUAL,
+ ofis_deg_status6 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress6'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6'
+ ELSE 'Not Completed6'
+ END) VIRTUAL,
+ ofis_deg_status7 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress7'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7'
+ ELSE 'Not Completed7'
+ END) VIRTUAL,
+ ofis_deg_status8 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress8'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8'
+ ELSE 'Not Completed8'
+ END) VIRTUAL,
+ deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
+ deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term',
+ CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
+CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term);
+
+INSERT IGNORE grad_degree (
+ student_id,
+ plan,
+ admit_term,
+ wdraw_rsn,
+ deg_start_term,
+ deg_as_of_term
+)
+SELECT
+ ggs.uw_id AS c_student_id,
+ ggs.plan,
+ ggs.admit_term,
+ ggs.wdraw_rsn,
+ IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term,
+ ggs.term AS c_as_of_term
+FROM gso_grad_supr AS ggs
+LEFT OUTER JOIN
+ grad_degree AS gd
+ ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+WHERE
+ ggs.term = 1031 AND
+ gd.student_id IS NULL
+;
+
+UPDATE grad_degree AS gd
+INNER JOIN
+ gso_grad_supr AS ggs
+ ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+SET
+ gd.wdraw_rsn = ggs.wdraw_rsn,
+ gd.deg_as_of_term = 1035
+WHERE
+ gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND
+ ggs.term = 1035
+;
+
+#
+# Verify that indexes can be dropped
+#
+ALTER TABLE grad_degree DROP INDEX grad_degree_wdraw_rsn_ndx;
+
+#
+# Verify that we can drop columns
+#
+ALTER TABLE grad_degree DROP COLUMN deg_start_term;
+
+SHOW CREATE TABLE grad_degree;
+
+DROP TABLE grad_degree;
+
+#
+# Verify after dropping virtual columns
+#
+CREATE TABLE IF NOT EXISTS grad_degree (
+ student_id int(8) UNSIGNED NOT NULL,
+ plan varchar(10) NOT NULL,
+ admit_term char(4) NOT NULL,
+ wdraw_rsn varchar(4) NOT NULL DEFAULT '',
+ ofis_deg_status varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
+ ELSE 'Not Completed'
+ END) VIRTUAL,
+ ofis_deg_status2 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress2'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2'
+ ELSE 'Not Completed2'
+ END) VIRTUAL,
+ ofis_deg_status3 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress3'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3'
+ ELSE 'Not Completed3'
+ END) VIRTUAL,
+ ofis_deg_status4 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress4'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4'
+ ELSE 'Not Completed4'
+ END) VIRTUAL,
+ ofis_deg_status5 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress5'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5'
+ ELSE 'Not Completed5'
+ END) VIRTUAL,
+ ofis_deg_status6 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress6'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6'
+ ELSE 'Not Completed6'
+ END) VIRTUAL,
+ ofis_deg_status7 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress7'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7'
+ ELSE 'Not Completed7'
+ END) VIRTUAL,
+ ofis_deg_status8 varchar(15) AS (
+ CASE
+ WHEN wdraw_rsn = '' THEN 'In progress8'
+ WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8'
+ ELSE 'Not Completed8'
+ END) VIRTUAL,
+ deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
+ deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term',
+ CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
+
+ALTER TABLE grad_degree DROP COLUMN ofis_deg_status2, DROP COLUMN ofis_deg_status3,
+DROP COLUMN ofis_deg_status4, DROP COLUMN ofis_deg_status5, DROP COLUMN ofis_deg_status6,
+DROP COLUMN ofis_deg_status7, DROP COLUMN ofis_deg_status8;
+
+CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term);
+
+INSERT IGNORE grad_degree (
+ student_id,
+ plan,
+ admit_term,
+ wdraw_rsn,
+ deg_start_term,
+ deg_as_of_term
+)
+SELECT
+ ggs.uw_id AS c_student_id,
+ ggs.plan,
+ ggs.admit_term,
+ ggs.wdraw_rsn,
+ IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term,
+ ggs.term AS c_as_of_term
+FROM gso_grad_supr AS ggs
+LEFT OUTER JOIN
+ grad_degree AS gd
+ ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+WHERE
+ ggs.term = 1031 AND
+ gd.student_id IS NULL
+;
+
+UPDATE grad_degree AS gd
+INNER JOIN
+ gso_grad_supr AS ggs
+ ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term )
+SET
+ gd.wdraw_rsn = ggs.wdraw_rsn,
+ gd.deg_as_of_term = 1035
+WHERE
+ gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND
+ ggs.term = 1035
+;
+
+select * from grad_degree;
+select * from gso_grad_supr;
+
+drop table grad_degree;
+drop table gso_grad_supr;
diff --git a/mysql-test/suite/innodb/t/innodb-xa.test b/mysql-test/suite/innodb/t/innodb-xa.test
new file mode 100644
index 00000000000..d94cd75aa14
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-xa.test
@@ -0,0 +1,17 @@
+--source include/have_innodb.inc
+
+--disable_abort_on_error
+xa rollback 'xid2';
+drop table if exists t1;
+create table t1(a int)engine=innodb;
+rollback;
+xa start 'xid2';
+insert into `t1` values (1);
+savepoint `sv1`;
+xa end 'xid2';
+start transaction;
+xa prepare 'xid2';
+release savepoint `sv1`;
+xa commit 'xid2';
+drop table t1;
+
diff --git a/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test
new file mode 100644
index 00000000000..16fb570737d
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test
@@ -0,0 +1,55 @@
+--source include/not_embedded.inc
+--source include/not_crashrep.inc
+--source include/have_innodb.inc
+
+call mtr.add_suppression("InnoDB: The total blob data length");
+
+let $old_max_allowed_packet = `select @@max_allowed_packet`;
+SET GLOBAL max_allowed_packet = 100*1024*1024;
+
+--echo # Connection big_packets:
+connect(big_packets,localhost,root,,);
+connection big_packets;
+
+CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB;
+
+# Insert a few rows (it doesn't really matter how many). These transactions
+# are committed once they are acked, so they should not be lost.
+INSERT INTO t1 (a, b) VALUES (1, '1');
+INSERT INTO t1 (a, b) VALUES (2, '2');
+INSERT INTO t1 (a, b) VALUES (3, '3');
+INSERT INTO t1 (a, b) VALUES (4, '4');
+INSERT INTO t1 (a, b) VALUES (5, '5');
+
+# The BLOB insert will fail, and should disappear. However all data committed
+# up to this point should not be lost.
+start transaction;
+--replace_regex /\(> [0-9]*\)/(> ####)/
+--error ER_TOO_BIG_ROWSIZE
+INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024));
+
+--echo # Connection default:
+connection default;
+
+# We expect a restart.
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--echo # Quick shutdown and restart server
+--shutdown_server 0
+
+# Wait for the server to come back up, and reconnect.
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--echo # Connection default:
+connection default;
+
+# We should see (1,2,3,4,5) here.
+SELECT a FROM t1;
+
+# Clean up.
+DROP TABLE t1;
+
+--disable_query_log
+eval set global max_allowed_packet = $old_max_allowed_packet;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_bug34300.test b/mysql-test/suite/innodb/t/innodb_bug34300.test
index 800f326707d..13c708b48d6 100644
--- a/mysql-test/suite/innodb/t/innodb_bug34300.test
+++ b/mysql-test/suite/innodb/t/innodb_bug34300.test
@@ -5,6 +5,11 @@
-- source include/have_innodb.inc
+if (`select plugin_auth_version <= "5.6.22-MariaDB-72.0" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in XtraDB as of 5.6.22-MariaDB-72.0 or earlier
+}
+
-- disable_query_log
-- disable_result_log
diff --git a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
index 12c560934ef..d6d77076b83 100644
--- a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
+++ b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
@@ -4,11 +4,6 @@
-- source include/have_innodb.inc
-- source include/have_innodb_16k.inc
-if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier
-}
-
# Issues with innodb_change_buffering_debug on Windows, so the test scenario
# cannot be created on windows
--source include/not_windows.inc
@@ -30,10 +25,10 @@ SET GLOBAL innodb_change_buffering_debug = 1;
SET UNIQUE_CHECKS=0;
CREATE DATABASE pad;
-let $i=345;
+let $i=338;
while ($i)
{
- --eval CREATE TABLE pad.t$i (a INT PRIMARY KEY) ENGINE=InnoDB;
+--eval CREATE TABLE pad.t$i(a INT PRIMARY KEY)ENGINE=InnoDB;
dec $i;
}
diff --git a/mysql-test/suite/innodb/t/insert_debug.test b/mysql-test/suite/innodb/t/insert_debug.test
index 666b634bef9..36ceba2ee8b 100644
--- a/mysql-test/suite/innodb/t/insert_debug.test
+++ b/mysql-test/suite/innodb/t/insert_debug.test
@@ -2,11 +2,6 @@
--source include/have_debug.inc
--source include/have_partition.inc
-if (`select plugin_auth_version < "5.6.22" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in InnoDB/XtraDB as of 5.6.21 or earlier
-}
-
--echo #
--echo # Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1
--echo # CAUSES INFINITE PAGE SPLIT
diff --git a/mysql-test/suite/innodb/t/sp_temp_table.test b/mysql-test/suite/innodb/t/sp_temp_table.test
index 9a6be85fd7e..b2883f551b9 100644
--- a/mysql-test/suite/innodb/t/sp_temp_table.test
+++ b/mysql-test/suite/innodb/t/sp_temp_table.test
@@ -1,11 +1,6 @@
--source include/have_innodb.inc
--source include/big_test.inc
-if (`select plugin_auth_version < "5.6.22" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in InnoDB/XtraDB as of 5.6.21 or earlier
-}
-
--echo #
--echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE
--echo # CALLED FROM A FUNCTION
diff --git a/mysql-test/suite/innodb/t/strict_mode.test b/mysql-test/suite/innodb/t/strict_mode.test
index 9b115091f84..86b56a09c0e 100644
--- a/mysql-test/suite/innodb/t/strict_mode.test
+++ b/mysql-test/suite/innodb/t/strict_mode.test
@@ -1,10 +1,5 @@
--source include/have_innodb.inc
-if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier
-}
-
--echo #
--echo # Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN
--echo # INNODB_STRICT_MODE = 1
diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test
new file mode 100644
index 00000000000..837b33cb3c4
--- /dev/null
+++ b/mysql-test/suite/innodb/t/xa_recovery.test
@@ -0,0 +1,47 @@
+if (`select plugin_auth_version <= "5.6.24" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in InnoDB as of 5.6.24 or earlier
+}
+--source include/have_innodb.inc
+# Embedded server does not support restarting.
+--source include/not_embedded.inc
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+connect (con1,localhost,root);
+XA START 'x'; UPDATE t1 set a=2; XA END 'x'; XA PREPARE 'x';
+connection default;
+
+call mtr.add_suppression("Found 1 prepared XA transactions");
+
+# Kill and restart the server.
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- shutdown_server 0
+-- source include/wait_until_disconnected.inc
+
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
+-- disable_reconnect
+
+disconnect con1;
+connect (con1,localhost,root);
+--send SELECT * FROM t1 LOCK IN SHARE MODE
+
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = 'Sending data' and
+ info = 'SELECT * FROM t1 LOCK IN SHARE MODE';
+--source include/wait_condition.inc
+
+--source include/restart_mysqld.inc
+
+disconnect con1;
+
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t1;
+XA ROLLBACK 'x';
+SELECT * FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/manual/r/rpl_replication_delay.result b/mysql-test/suite/manual/r/rpl_replication_delay.result
deleted file mode 100644
index 73dd77cc647..00000000000
--- a/mysql-test/suite/manual/r/rpl_replication_delay.result
+++ /dev/null
@@ -1,25 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-# Second_behind reports 0
-Seconds_Behind_Master 0
-drop table if exists t1;
-Warnings:
-Note 1051 Unknown table 't1'
-create table t1 (f1 int);
-flush logs /* contaminate rli->last_master_timestamp */;
-lock table t1 write;
-insert into t1 values (1);
-# bug emulated: reports slave threads starting time about 3*3 not 3 secs
-Seconds_Behind_Master 9
-unlock tables;
-flush logs /* this time rli->last_master_timestamp is not affected */;
-lock table t1 write;
-insert into t1 values (2);
-# reports the correct diff with master query time about 3+3 secs
-Seconds_Behind_Master 7
-unlock tables;
-drop table t1;
diff --git a/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt b/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt
deleted file mode 100644
index 24a4c5952fe..00000000000
--- a/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-debug=d,let_first_flush_log_change_timestamp
diff --git a/mysql-test/suite/manual/t/rpl_replication_delay.test b/mysql-test/suite/manual/t/rpl_replication_delay.test
deleted file mode 100644
index f2b2da6f53c..00000000000
--- a/mysql-test/suite/manual/t/rpl_replication_delay.test
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Testing replication delay reporting (bug#29309)
-# there is an unavoidable non-determinism in the test
-# please compare the results with the comments
-#
-
-
-source include/master-slave.inc;
-
-connection slave;
-
---echo # Second_behind reports 0
-let $status_items= Seconds_Behind_Master;
-source include/show_slave_status.inc;
-sleep 3;
-
-### bug emulation
-
-connection master;
-drop table if exists t1;
-create table t1 (f1 int);
-sleep 3;
-
-#connection slave;
-sync_slave_with_master;
-flush logs /* contaminate rli->last_master_timestamp */;
-
-connection slave;
-lock table t1 write;
-
-connection master;
-insert into t1 values (1);
-
-sleep 3;
-
-connection slave;
---echo # bug emulated: reports slave threads starting time about 3*3 not 3 secs
-source include/show_slave_status.inc;
-unlock tables;
-
-connection master;
-sync_slave_with_master;
-
-### bugfix
-
-
-connection slave;
-flush logs /* this time rli->last_master_timestamp is not affected */;
-lock table t1 write;
-
-connection master;
-insert into t1 values (2);
-sleep 3;
-
-connection slave;
---echo # reports the correct diff with master query time about 3+3 secs
-source include/show_slave_status.inc;
-unlock tables;
-
-connection master;
-drop table t1;
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/maria/optimize.result b/mysql-test/suite/maria/optimize.result
index 9cce55d6199..a78e8e469aa 100644
--- a/mysql-test/suite/maria/optimize.result
+++ b/mysql-test/suite/maria/optimize.result
@@ -6,3 +6,14 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
drop table t1;
+#
+# MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with
+# disabled keys
+#
+CREATE TABLE t1 (a INT, KEY(a)) ENGINE=Aria;
+INSERT INTO t1 VALUES (4),(3),(1),(0);
+ALTER TABLE t1 DISABLE KEYS;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+DROP TABLE t1;
diff --git a/mysql-test/suite/maria/optimize.test b/mysql-test/suite/maria/optimize.test
index 6b310b1d1a6..b1fc250cd29 100644
--- a/mysql-test/suite/maria/optimize.test
+++ b/mysql-test/suite/maria/optimize.test
@@ -160,3 +160,13 @@ INSERT /*! IGNORE */ INTO t1 VALUES ('urxjxqvwabikpugvexxbxdpxjkeqiuhhuadbcuhoz
check table t1;
OPTIMIZE TABLE t1;
drop table t1;
+
+--echo #
+--echo # MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with
+--echo # disabled keys
+--echo #
+CREATE TABLE t1 (a INT, KEY(a)) ENGINE=Aria;
+INSERT INTO t1 VALUES (4),(3),(1),(0);
+ALTER TABLE t1 DISABLE KEYS;
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result
index 94677e84cc8..d9689f759bf 100644
--- a/mysql-test/suite/multi_source/multisource.result
+++ b/mysql-test/suite/multi_source/multisource.result
@@ -9,15 +9,36 @@ master_user='root';
start slave 'master1';
set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
-show slave 'master1' status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos
-Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No
-show slave status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos
-Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No
-show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
-master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No 0 1073741824 7 0 60.000
+#
+# Checking SHOW SLAVE 'master1' STATUS
+#
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+#
+# Checking SHOW SLAVE STATUS
+#
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+#
drop database if exists db1;
create database db1;
use db1;
@@ -74,10 +95,26 @@ master_host='127.0.0.1',
master_user='root';
start slave;
include/wait_for_slave_to_start.inc
-show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin.000002 601 master-bin.000001 Yes Yes 0 0 313 899 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000 0-1-4
-master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 988 mysqld-relay-bin-master1.000002 1276 master-bin.000001 Yes Yes 0 0 988 1582 None 0 No 0 No 0 0 1 No 0 1073741824 17 0 60.000 0-1-4
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = ''
+Connection_name = 'master1'
+Master_Port = 'MYPORT_2'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin.000002'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+Slave_heartbeat_period = '60.000'
+#
insert into t1 (f1) values ('three');
drop database if exists db2;
create database db2;
@@ -104,10 +141,26 @@ Log_name File_size
master-bin.000002 367
insert into t1 (f1) values ('four');
create table db1.t3 (f1 int) engine=InnoDB;
-show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 921 mysqld-relay-bin.000002 1209 master-bin.000001 Yes Yes 0 0 921 1507 None 0 No 0 No 0 0 2 No 0 1073741824 17 0 60.000 0-1-7
-master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000002 740 mysqld-relay-bin-master1.000004 1028 master-bin.000002 Yes Yes 0 0 740 1378 None 0 No 0 No 0 0 1 No 0 1073741824 37 0 60.000 0-1-7
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = ''
+Connection_name = 'master1'
+Master_Port = 'MYPORT_2'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin.000002'
+Relay_Log_File = 'mysqld-relay-bin-master1.000004'
+Slave_IO_Running = 'Yes'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+Slave_heartbeat_period = '60.000'
+#
select * from db1.t1;
i f1
1 one
diff --git a/mysql-test/suite/multi_source/multisource.test b/mysql-test/suite/multi_source/multisource.test
index 754dc9fa650..c99db802981 100644
--- a/mysql-test/suite/multi_source/multisource.test
+++ b/mysql-test/suite/multi_source/multisource.test
@@ -49,12 +49,28 @@ let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
---replace_result $SERVER_MYPORT_1 MYPORT_1
-show slave 'master1' status;
---replace_result $SERVER_MYPORT_1 MYPORT_1
-show slave status;
---replace_result $SERVER_MYPORT_1 MYPORT_1
-show all slaves status;
+--echo #
+--echo # Checking SHOW SLAVE 'master1' STATUS
+--echo #
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--source include/show_slave_status.inc
+--let $slave_name=
+
+--echo #
+--echo # Checking SHOW SLAVE STATUS
+--echo #
+--source include/show_slave_status.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
# Check that replication actually works
@@ -144,8 +160,15 @@ let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
-show all slaves status;
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
# Check that replication from two servers actually works
@@ -214,8 +237,15 @@ let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
-show all slaves status;
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
--sorted_result
select * from db1.t1;
diff --git a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result
index 268db30bda0..77129d6bebb 100644
--- a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result
+++ b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result
@@ -58,7 +58,10 @@ t1.frm
t1.par
SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open';
SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish';
-SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
+SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION,
+PARTITION_DESCRIPTION, TABLE_ROWS
+FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
SET DEBUG_SYNC = 'now WAIT_FOR parked';
# When waiting for the name lock in get_all_tables in sql_show.cc
# this will not be concurrent any more, thus the TIMEOUT
@@ -70,9 +73,9 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
PARTITION p10 VALUES LESS THAN MAXVALUE);
Warnings:
Warning 1639 debug sync point wait timed out
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-def test t1 p0 NULL 1 NULL RANGE NULL a NULL 10 1 16384 16384 NULL 0 0 NULL NULL NULL NULL default NULL
-def test t1 p10 NULL 2 NULL RANGE NULL a NULL MAXVALUE 3 5461 16384 NULL 0 0 NULL NULL NULL NULL default NULL
+TABLE_SCHEMA TABLE_NAME PARTITION_NAME PARTITION_ORDINAL_POSITION PARTITION_DESCRIPTION TABLE_ROWS
+test t1 p0 1 10 1
+test t1 p10 2 MAXVALUE 3
t1#P#p0.ibd
t1#P#p10.ibd
t1.frm
diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
index fce26132030..df9c06011c2 100644
--- a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
+++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
@@ -62,7 +62,10 @@ SHOW CREATE TABLE t1;
SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open';
SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish';
send
-SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
+SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION,
+ PARTITION_DESCRIPTION, TABLE_ROWS
+FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
connect (con1, localhost, root,,);
SET DEBUG_SYNC = 'now WAIT_FOR parked';
diff --git a/mysql-test/suite/percona/innodb_sys_index.result b/mysql-test/suite/percona/innodb_sys_index.result
index 67604236366..7573720f5ee 100644
--- a/mysql-test/suite/percona/innodb_sys_index.result
+++ b/mysql-test/suite/percona/innodb_sys_index.result
@@ -1,9 +1,6 @@
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
-select @@version_comment limit 1 ;
-@@version_comment
-Source distribution
SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ;
CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ;
SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ;
diff --git a/mysql-test/suite/percona/innodb_sys_index.test b/mysql-test/suite/percona/innodb_sys_index.test
index 212baeda663..d8c22e7f5f9 100644
--- a/mysql-test/suite/percona/innodb_sys_index.test
+++ b/mysql-test/suite/percona/innodb_sys_index.test
@@ -5,7 +5,6 @@ drop table if exists t1;
#
# test for bug LP#875797 "Using 'innodb_sys_indexes' causes core dump"
#
-select @@version_comment limit 1 ;
--disable_result_log
SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ;
CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ;
diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes.result b/mysql-test/suite/percona/percona_innodb_fake_changes.result
index 95f0c07cd11..1b870fdbb92 100644
--- a/mysql-test/suite/percona/percona_innodb_fake_changes.result
+++ b/mysql-test/suite/percona/percona_innodb_fake_changes.result
@@ -45,7 +45,7 @@ BEGIN;
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
ERROR HY000: Can't create table `test`.`t2` (errno: 131 "Command not supported by database")
DROP TABLE t1;
-ERROR 42S02: Unknown table 'test.t1'
+ERROR HY000: Storage engine InnoDB of the table `test`.`t1` doesn't have this option
TRUNCATE TABLE t1;
ERROR HY000: Got error 131 "Command not supported by database" during COMMIT
ALTER TABLE t1 ENGINE=MyISAM;
diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes.test b/mysql-test/suite/percona/percona_innodb_fake_changes.test
index 5fa3ecc7b63..67f5450ba45 100644
--- a/mysql-test/suite/percona/percona_innodb_fake_changes.test
+++ b/mysql-test/suite/percona/percona_innodb_fake_changes.test
@@ -38,7 +38,7 @@ SET innodb_fake_changes=1;
BEGIN;
--error 1005
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
---error 1051
+--error 1031
DROP TABLE t1;
--error 1180
TRUNCATE TABLE t1;
diff --git a/mysql-test/suite/perfschema/include/connection_setup.inc b/mysql-test/suite/perfschema/include/connection_setup.inc
index da57b6dd388..a661d43d063 100644
--- a/mysql-test/suite/perfschema/include/connection_setup.inc
+++ b/mysql-test/suite/perfschema/include/connection_setup.inc
@@ -48,7 +48,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
--source ../include/wait_for_pfs_thread_count.inc
--disable_query_log
diff --git a/mysql-test/suite/perfschema/include/digest_setup.inc b/mysql-test/suite/perfschema/include/digest_setup.inc
index ed463f58d04..6efab880d32 100644
--- a/mysql-test/suite/perfschema/include/digest_setup.inc
+++ b/mysql-test/suite/perfschema/include/digest_setup.inc
@@ -1,5 +1,5 @@
# Making sure not to run when ps-protocol is set.
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
--echo ####################################
--echo # SETUP
diff --git a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
index 769ba5f8607..ec35e60d463 100644
--- a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
+++ b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
@@ -62,7 +62,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
--source ../include/wait_for_pfs_thread_count.inc
--disable_query_log
diff --git a/mysql-test/suite/perfschema/include/no_protocol.inc b/mysql-test/suite/perfschema/include/no_protocol.inc
deleted file mode 100644
index 451c22f62e3..00000000000
--- a/mysql-test/suite/perfschema/include/no_protocol.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-# Tests for the performance schema
-
-# The file with expected results fits only to a run without
-# ps-protocol/sp-protocol/cursor-protocol/view-protocol.
-if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
- + $VIEW_PROTOCOL > 0`)
-{
- --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
-}
-
diff --git a/mysql-test/suite/perfschema/include/sizing_auto.inc b/mysql-test/suite/perfschema/include/sizing_auto.inc
index 4c3451ce8b5..3bb4db2276f 100644
--- a/mysql-test/suite/perfschema/include/sizing_auto.inc
+++ b/mysql-test/suite/perfschema/include/sizing_auto.inc
@@ -4,13 +4,21 @@ show variables like "table_open_cache";
show variables like "max_connections";
# open_files_limit depends on OS configuration (ulimit -n)
#show variables like "open_files_limit";
-show variables like "%performance_schema%";
+show variables where
+ `Variable_name` != "performance_schema_max_statement_classes" and
+ `Variable_name` like "performance_schema%";
show status like "%performance_schema%";
# Each test script should provide a different test.cnf file,
# with different settings.
# This output will show the sizes computed automatically.
# Note that this output is very dependent on the platform.
+# The output of SHOW ENGINE PERFORMANCE_SCHEMA STATUS
+# is very dependent on the platform,
+# so it is not printed here to ensure stability of the .results files.
+# To troubleshoot the performance schema memory consumption at different
+# configuration settings, comment the following line.
+# Debug only:
-show engine performance_schema status;
+# show engine performance_schema status;
diff --git a/mysql-test/suite/perfschema/include/socket_event.inc b/mysql-test/suite/perfschema/include/socket_event.inc
index ba81c37d5df..96c61045986 100644
--- a/mysql-test/suite/perfschema/include/socket_event.inc
+++ b/mysql-test/suite/perfschema/include/socket_event.inc
@@ -126,7 +126,7 @@ if($is_connect)
# Connect is visible.
# We hope that sleep 1 is long enough so that PERFORMANCE_SCHEMA
# can remove this row before we collect the after action state.
- let $wait_timeou= 5;
+ let $wait_timeout= 5;
let $wait_condition=
SELECT COUNT(*) = 0
$part;
diff --git a/mysql-test/suite/perfschema/include/stage_setup.inc b/mysql-test/suite/perfschema/include/stage_setup.inc
index 3558e43652e..639b1df8c02 100644
--- a/mysql-test/suite/perfschema/include/stage_setup.inc
+++ b/mysql-test/suite/perfschema/include/stage_setup.inc
@@ -24,7 +24,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
--disable_query_log
diff --git a/mysql-test/suite/perfschema/include/start_server_common.inc b/mysql-test/suite/perfschema/include/start_server_common.inc
index d15c3d48ded..41dcfd8ecb5 100644
--- a/mysql-test/suite/perfschema/include/start_server_common.inc
+++ b/mysql-test/suite/perfschema/include/start_server_common.inc
@@ -68,7 +68,9 @@ select * from performance_schema.users;
--enable_result_log
# This has a stable output, printing the result:
-show variables like "performance_schema%";
+show variables where
+ `Variable_name` != "performance_schema_max_statement_classes" and
+ `Variable_name` like "performance_schema%";
# This has an unrepeatable output, it does depends too much on
# - the platform hardware (sizeof structures, padding)
diff --git a/mysql-test/suite/perfschema/include/table_aggregate_load.inc b/mysql-test/suite/perfschema/include/table_aggregate_load.inc
index 242768ead9e..f42ebe1fc76 100644
--- a/mysql-test/suite/perfschema/include/table_aggregate_load.inc
+++ b/mysql-test/suite/perfschema/include/table_aggregate_load.inc
@@ -29,7 +29,9 @@ truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
# Check the configuration is ok
-show variables like "performance_schema%";
+show variables where
+ `Variable_name` != "performance_schema_max_statement_classes" and
+ `Variable_name` like "performance_schema%";
show status like "performance_schema%";
echo "================== Step 1 ==================";
diff --git a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc
index 8efdc8d2f24..522cdb9346d 100644
--- a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc
+++ b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc
@@ -67,7 +67,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
--source ../include/wait_for_pfs_thread_count.inc
--disable_query_log
diff --git a/mysql-test/suite/perfschema/r/aggregate.result b/mysql-test/suite/perfschema/r/aggregate.result
index ab927f544cf..c8fa1cc2b24 100644
--- a/mysql-test/suite/perfschema/r/aggregate.result
+++ b/mysql-test/suite/perfschema/r/aggregate.result
@@ -1,4 +1,6 @@
"General cleanup"
+set @aria_checkpoint_interval_save= @@global.aria_checkpoint_interval;
+set @@global.aria_checkpoint_interval= 0;
drop table if exists t1;
update performance_schema.setup_instruments set enabled = 'NO';
update performance_schema.setup_consumers set enabled = 'NO';
@@ -116,3 +118,4 @@ update performance_schema.setup_consumers set enabled = 'YES';
update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
drop table test.t1;
+set @@global.aria_checkpoint_interval= @aria_checkpoint_interval_save;
diff --git a/mysql-test/suite/perfschema/r/digest_null_literal.result b/mysql-test/suite/perfschema/r/digest_null_literal.result
new file mode 100644
index 00000000000..b0cefbbbaaf
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/digest_null_literal.result
@@ -0,0 +1,27 @@
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+NULL
+NULL
+NULL
+NULL
+NULL NULL
+NULL NULL
+NULL NULL NULL 1 2 3 NULL NULL
+NULL NULL NULL 1 2 3 NULL NULL
+1 IS NULL
+0
+2 IS NOT NULL
+1
+1 IS NULL 2 IS NULL 3 IS NOT NULL 4 IS NOT NULL
+0 0 1 1
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
+FROM performance_schema.events_statements_summary_by_digest;
+SCHEMA_NAME DIGEST_TEXT COUNT_STAR
+test TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1
+test SELECT ? 1
+test SELECT ? FROM DUAL 1
+test SELECT ?, ... 2
+test SELECT ? IS NULL 1
+test SELECT ? IS NOT NULL 1
+test SELECT ? IS NULL , ? IS NULL , ? IS NOT NULL , ? IS NOT NULL 1
+test CREATE TABLE foo ( a INTEGER DEFAULT ? , b INTEGER NOT NULL DEFAULT ? , c INTEGER NOT NULL ) 1
+test DROP TABLE foo 1
diff --git a/mysql-test/suite/perfschema/r/digest_table_full.result b/mysql-test/suite/perfschema/r/digest_table_full.result
index 9c0efb7b1ca..d910f29c91e 100644
--- a/mysql-test/suite/perfschema/r/digest_table_full.result
+++ b/mysql-test/suite/perfschema/r/digest_table_full.result
@@ -113,7 +113,7 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARN
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
NULL NULL NULL 55 32 1 2
-statements_digest 0e98ee6a98e296530ec59c12dbc08dfe TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
+statements_digest 8de787d0e3e3a062aea121ff528fcfce TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
SHOW VARIABLES LIKE "performance_schema_digests_size";
Variable_name Value
performance_schema_digests_size 2
diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result
index dafce4bf573..9081bfe5882 100644
--- a/mysql-test/suite/perfschema/r/ortho_iter.result
+++ b/mysql-test/suite/perfschema/r/ortho_iter.result
@@ -94,7 +94,9 @@ close pfs_cursor;
signal sqlstate '01000' set message_text='Done', mysql_errno=12000;
end
$
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -118,7 +120,6 @@ 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 180
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
@@ -127,31 +128,6 @@ performance_schema_session_connect_attrs_size 2048
performance_schema_setup_actors_size 100
performance_schema_setup_objects_size 100
performance_schema_users_size 100
-show status like "performance_schema%";
-Variable_name Value
-Performance_schema_accounts_lost 0
-Performance_schema_cond_classes_lost 0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost 0
-Performance_schema_file_handles_lost 0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost 0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost 0
-Performance_schema_mutex_instances_lost 0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost 0
-Performance_schema_session_connect_attrs_lost 0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost 0
-Performance_schema_stage_classes_lost 0
-Performance_schema_statement_classes_lost 0
-Performance_schema_table_handles_lost 0
-Performance_schema_table_instances_lost 0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost 0
-Performance_schema_users_lost 0
call check_instrument("wait/synch/mutex/");
instr_name is_wait is_stage is_statement
wait/synch/mutex/ 1 0 0
diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result
index 838d17e61fe..126b2a58fae 100644
--- a/mysql-test/suite/perfschema/r/privilege_table_io.result
+++ b/mysql-test/suite/perfschema/r/privilege_table_io.result
@@ -22,7 +22,9 @@ flush privileges;
insert into test.marker set a = 1;
insert into test.marker set a = 1;
insert into test.marker set a = 1;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -46,7 +48,6 @@ 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 180
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/rpl_gtid_func.result b/mysql-test/suite/perfschema/r/rpl_gtid_func.result
index 98342bc4869..bfe4e08a3c1 100644
--- a/mysql-test/suite/perfschema/r/rpl_gtid_func.result
+++ b/mysql-test/suite/perfschema/r/rpl_gtid_func.result
@@ -37,7 +37,7 @@ select digest, digest_text, count_star
from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
digest digest_text count_star
-e315485f9cbc06befb4e59970905a034 SELECT ? AS in_master_digest 1
+f1cd3e758822a4ef0e1502ec30818476 SELECT ? AS in_master_digest 1
insert into test.marker values (2);
**** On Slave ****
select * from test.marker;
@@ -64,7 +64,7 @@ select digest, digest_text, count_star
from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
digest digest_text count_star
-bd2f53b41efcd037df41a3dd8bf3312a SELECT ? AS in_slave_digest 1
+c1cef2eb67ca48bb5d81d2e5e68aaf35 SELECT ? AS in_slave_digest 1
**** On Master ****
delete from performance_schema.setup_objects
where object_schema='master';
diff --git a/mysql-test/suite/perfschema/r/sizing_default.result b/mysql-test/suite/perfschema/r/sizing_default.result
index ef7f7069c19..d7c4e321204 100644
--- a/mysql-test/suite/perfschema/r/sizing_default.result
+++ b/mysql-test/suite/perfschema/r/sizing_default.result
@@ -7,7 +7,9 @@ table_open_cache 2000
show variables like "max_connections";
Variable_name Value
max_connections 151
-show variables like "%performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -31,7 +33,6 @@ performance_schema_max_rwlock_instances 9102
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 322
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 168
performance_schema_max_table_handles 4000
performance_schema_max_table_instances 12500
performance_schema_max_thread_classes 50
@@ -65,160 +66,3 @@ Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
-show engine performance_schema status;
-Type Name Status
-performance_schema events_waits_current.row_size 184
-performance_schema events_waits_current.row_count 2412
-performance_schema events_waits_history.row_size 184
-performance_schema events_waits_history.row_count 4020
-performance_schema events_waits_history.memory 739680
-performance_schema events_waits_history_long.row_size 184
-performance_schema events_waits_history_long.row_count 10000
-performance_schema events_waits_history_long.memory 1840000
-performance_schema (pfs_mutex_class).row_size 256
-performance_schema (pfs_mutex_class).row_count 200
-performance_schema (pfs_mutex_class).memory 51200
-performance_schema (pfs_rwlock_class).row_size 320
-performance_schema (pfs_rwlock_class).row_count 40
-performance_schema (pfs_rwlock_class).memory 12800
-performance_schema (pfs_cond_class).row_size 256
-performance_schema (pfs_cond_class).row_count 80
-performance_schema (pfs_cond_class).memory 20480
-performance_schema (pfs_thread_class).row_size 192
-performance_schema (pfs_thread_class).row_count 50
-performance_schema (pfs_thread_class).memory 9600
-performance_schema (pfs_file_class).row_size 320
-performance_schema (pfs_file_class).row_count 50
-performance_schema (pfs_file_class).memory 16000
-performance_schema mutex_instances.row_size 128
-performance_schema mutex_instances.row_count 15906
-performance_schema mutex_instances.memory 2035968
-performance_schema rwlock_instances.row_size 192
-performance_schema rwlock_instances.row_count 9102
-performance_schema rwlock_instances.memory 1747584
-performance_schema cond_instances.row_size 128
-performance_schema cond_instances.row_count 3504
-performance_schema cond_instances.memory 448512
-performance_schema threads.row_size 2816
-performance_schema threads.row_count 402
-performance_schema threads.memory 1132032
-performance_schema file_instances.row_size 704
-performance_schema file_instances.row_count 7693
-performance_schema file_instances.memory 5415872
-performance_schema (pfs_file_handle).row_size 8
-performance_schema (pfs_file_handle).row_count 32768
-performance_schema (pfs_file_handle).memory 262144
-performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
-performance_schema events_waits_summary_by_thread_by_event_name.row_count 153966
-performance_schema events_waits_summary_by_thread_by_event_name.memory 4926912
-performance_schema (pfs_table_share).row_size 22208
-performance_schema (pfs_table_share).row_count 12500
-performance_schema (pfs_table_share).memory 277600000
-performance_schema (pfs_table).row_size 9280
-performance_schema (pfs_table).row_count 4000
-performance_schema (pfs_table).memory 37120000
-performance_schema setup_actors.row_size 256
-performance_schema setup_actors.row_count 100
-performance_schema setup_actors.memory 25600
-performance_schema setup_objects.row_size 448
-performance_schema setup_objects.row_count 100
-performance_schema setup_objects.memory 44800
-performance_schema (pfs_account).row_size 256
-performance_schema (pfs_account).row_count 100
-performance_schema (pfs_account).memory 25600
-performance_schema events_waits_summary_by_account_by_event_name.row_size 32
-performance_schema events_waits_summary_by_account_by_event_name.row_count 38300
-performance_schema events_waits_summary_by_account_by_event_name.memory 1225600
-performance_schema events_waits_summary_by_user_by_event_name.row_size 32
-performance_schema events_waits_summary_by_user_by_event_name.row_count 38300
-performance_schema events_waits_summary_by_user_by_event_name.memory 1225600
-performance_schema events_waits_summary_by_host_by_event_name.row_size 32
-performance_schema events_waits_summary_by_host_by_event_name.row_count 38300
-performance_schema events_waits_summary_by_host_by_event_name.memory 1225600
-performance_schema (pfs_user).row_size 128
-performance_schema (pfs_user).row_count 100
-performance_schema (pfs_user).memory 12800
-performance_schema (pfs_host).row_size 128
-performance_schema (pfs_host).row_count 100
-performance_schema (pfs_host).memory 12800
-performance_schema (pfs_stage_class).row_size 256
-performance_schema (pfs_stage_class).row_count 150
-performance_schema (pfs_stage_class).memory 38400
-performance_schema events_stages_history.row_size 88
-performance_schema events_stages_history.row_count 4020
-performance_schema events_stages_history.memory 353760
-performance_schema events_stages_history_long.row_size 88
-performance_schema events_stages_history_long.row_count 10000
-performance_schema events_stages_history_long.memory 880000
-performance_schema events_stages_summary_by_thread_by_event_name.row_size 32
-performance_schema events_stages_summary_by_thread_by_event_name.row_count 60300
-performance_schema events_stages_summary_by_thread_by_event_name.memory 1929600
-performance_schema events_stages_summary_global_by_event_name.row_size 32
-performance_schema events_stages_summary_global_by_event_name.row_count 150
-performance_schema events_stages_summary_global_by_event_name.memory 4800
-performance_schema events_stages_summary_by_account_by_event_name.row_size 32
-performance_schema events_stages_summary_by_account_by_event_name.row_count 15000
-performance_schema events_stages_summary_by_account_by_event_name.memory 480000
-performance_schema events_stages_summary_by_user_by_event_name.row_size 32
-performance_schema events_stages_summary_by_user_by_event_name.row_count 15000
-performance_schema events_stages_summary_by_user_by_event_name.memory 480000
-performance_schema events_stages_summary_by_host_by_event_name.row_size 32
-performance_schema events_stages_summary_by_host_by_event_name.row_count 15000
-performance_schema events_stages_summary_by_host_by_event_name.memory 480000
-performance_schema (pfs_statement_class).row_size 192
-performance_schema (pfs_statement_class).row_count 168
-performance_schema (pfs_statement_class).memory 32256
-performance_schema events_statements_history.row_size 3024
-performance_schema events_statements_history.row_count 4020
-performance_schema events_statements_history.memory 12156480
-performance_schema events_statements_history_long.row_size 3024
-performance_schema events_statements_history_long.row_count 10000
-performance_schema events_statements_history_long.memory 30240000
-performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
-performance_schema events_statements_summary_by_thread_by_event_name.row_count 67536
-performance_schema events_statements_summary_by_thread_by_event_name.memory 12426624
-performance_schema events_statements_summary_global_by_event_name.row_size 184
-performance_schema events_statements_summary_global_by_event_name.row_count 168
-performance_schema events_statements_summary_global_by_event_name.memory 30912
-performance_schema events_statements_summary_by_account_by_event_name.row_size 184
-performance_schema events_statements_summary_by_account_by_event_name.row_count 16800
-performance_schema events_statements_summary_by_account_by_event_name.memory 3091200
-performance_schema events_statements_summary_by_user_by_event_name.row_size 184
-performance_schema events_statements_summary_by_user_by_event_name.row_count 16800
-performance_schema events_statements_summary_by_user_by_event_name.memory 3091200
-performance_schema events_statements_summary_by_host_by_event_name.row_size 184
-performance_schema events_statements_summary_by_host_by_event_name.row_count 16800
-performance_schema events_statements_summary_by_host_by_event_name.memory 3091200
-performance_schema events_statements_current.row_size 3024
-performance_schema events_statements_current.row_count 402
-performance_schema events_statements_current.memory 1215648
-performance_schema (pfs_socket_class).row_size 320
-performance_schema (pfs_socket_class).row_count 10
-performance_schema (pfs_socket_class).memory 3200
-performance_schema socket_instances.row_size 320
-performance_schema socket_instances.row_count 322
-performance_schema socket_instances.memory 103040
-performance_schema events_statements_summary_by_digest.row_size 1472
-performance_schema events_statements_summary_by_digest.row_count 10000
-performance_schema events_statements_summary_by_digest.memory 14720000
-performance_schema session_connect_attrs.row_size 402
-performance_schema session_connect_attrs.row_count 512
-performance_schema session_connect_attrs.memory 205824
-performance_schema (account_hash).count 2
-performance_schema (account_hash).size 100
-performance_schema (digest_hash).count 0
-performance_schema (digest_hash).size 10000
-performance_schema (filename_hash).count 0
-performance_schema (filename_hash).size 7693
-performance_schema (host_hash).count 2
-performance_schema (host_hash).size 100
-performance_schema (setup_actor_hash).count 1
-performance_schema (setup_actor_hash).size 100
-performance_schema (setup_object_hash).count 4
-performance_schema (setup_object_hash).size 100
-performance_schema (table_share_hash).count 80
-performance_schema (table_share_hash).size 12500
-performance_schema (user_hash).count 2
-performance_schema (user_hash).size 100
-performance_schema host_cache.size 336
-performance_schema performance_schema.memory 422231328
diff --git a/mysql-test/suite/perfschema/r/sizing_high.result b/mysql-test/suite/perfschema/r/sizing_high.result
index 4d63c970782..c7c7b065992 100644
--- a/mysql-test/suite/perfschema/r/sizing_high.result
+++ b/mysql-test/suite/perfschema/r/sizing_high.result
@@ -7,7 +7,9 @@ table_open_cache 400
show variables like "max_connections";
Variable_name Value
max_connections 200
-show variables like "%performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -31,7 +33,6 @@ performance_schema_max_rwlock_instances 30800
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 420
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 168
performance_schema_max_table_handles 800
performance_schema_max_table_instances 12500
performance_schema_max_thread_classes 50
@@ -65,160 +66,3 @@ Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
-show engine performance_schema status;
-Type Name Status
-performance_schema events_waits_current.row_size 184
-performance_schema events_waits_current.row_count 3000
-performance_schema events_waits_history.row_size 184
-performance_schema events_waits_history.row_count 5000
-performance_schema events_waits_history.memory 920000
-performance_schema events_waits_history_long.row_size 184
-performance_schema events_waits_history_long.row_count 10000
-performance_schema events_waits_history_long.memory 1840000
-performance_schema (pfs_mutex_class).row_size 256
-performance_schema (pfs_mutex_class).row_count 200
-performance_schema (pfs_mutex_class).memory 51200
-performance_schema (pfs_rwlock_class).row_size 320
-performance_schema (pfs_rwlock_class).row_count 40
-performance_schema (pfs_rwlock_class).memory 12800
-performance_schema (pfs_cond_class).row_size 256
-performance_schema (pfs_cond_class).row_count 80
-performance_schema (pfs_cond_class).memory 20480
-performance_schema (pfs_thread_class).row_size 192
-performance_schema (pfs_thread_class).row_count 50
-performance_schema (pfs_thread_class).memory 9600
-performance_schema (pfs_file_class).row_size 320
-performance_schema (pfs_file_class).row_count 50
-performance_schema (pfs_file_class).memory 16000
-performance_schema mutex_instances.row_size 128
-performance_schema mutex_instances.row_count 52200
-performance_schema mutex_instances.memory 6681600
-performance_schema rwlock_instances.row_size 192
-performance_schema rwlock_instances.row_count 30800
-performance_schema rwlock_instances.memory 5913600
-performance_schema cond_instances.row_size 128
-performance_schema cond_instances.row_count 10900
-performance_schema cond_instances.memory 1395200
-performance_schema threads.row_size 2816
-performance_schema threads.row_count 500
-performance_schema threads.memory 1408000
-performance_schema file_instances.row_size 704
-performance_schema file_instances.row_count 23385
-performance_schema file_instances.memory 16463040
-performance_schema (pfs_file_handle).row_size 8
-performance_schema (pfs_file_handle).row_count 32768
-performance_schema (pfs_file_handle).memory 262144
-performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
-performance_schema events_waits_summary_by_thread_by_event_name.row_count 191500
-performance_schema events_waits_summary_by_thread_by_event_name.memory 6128000
-performance_schema (pfs_table_share).row_size 22208
-performance_schema (pfs_table_share).row_count 12500
-performance_schema (pfs_table_share).memory 277600000
-performance_schema (pfs_table).row_size 9280
-performance_schema (pfs_table).row_count 800
-performance_schema (pfs_table).memory 7424000
-performance_schema setup_actors.row_size 256
-performance_schema setup_actors.row_count 100
-performance_schema setup_actors.memory 25600
-performance_schema setup_objects.row_size 448
-performance_schema setup_objects.row_count 100
-performance_schema setup_objects.memory 44800
-performance_schema (pfs_account).row_size 256
-performance_schema (pfs_account).row_count 100
-performance_schema (pfs_account).memory 25600
-performance_schema events_waits_summary_by_account_by_event_name.row_size 32
-performance_schema events_waits_summary_by_account_by_event_name.row_count 38300
-performance_schema events_waits_summary_by_account_by_event_name.memory 1225600
-performance_schema events_waits_summary_by_user_by_event_name.row_size 32
-performance_schema events_waits_summary_by_user_by_event_name.row_count 38300
-performance_schema events_waits_summary_by_user_by_event_name.memory 1225600
-performance_schema events_waits_summary_by_host_by_event_name.row_size 32
-performance_schema events_waits_summary_by_host_by_event_name.row_count 38300
-performance_schema events_waits_summary_by_host_by_event_name.memory 1225600
-performance_schema (pfs_user).row_size 128
-performance_schema (pfs_user).row_count 100
-performance_schema (pfs_user).memory 12800
-performance_schema (pfs_host).row_size 128
-performance_schema (pfs_host).row_count 100
-performance_schema (pfs_host).memory 12800
-performance_schema (pfs_stage_class).row_size 256
-performance_schema (pfs_stage_class).row_count 150
-performance_schema (pfs_stage_class).memory 38400
-performance_schema events_stages_history.row_size 88
-performance_schema events_stages_history.row_count 5000
-performance_schema events_stages_history.memory 440000
-performance_schema events_stages_history_long.row_size 88
-performance_schema events_stages_history_long.row_count 10000
-performance_schema events_stages_history_long.memory 880000
-performance_schema events_stages_summary_by_thread_by_event_name.row_size 32
-performance_schema events_stages_summary_by_thread_by_event_name.row_count 75000
-performance_schema events_stages_summary_by_thread_by_event_name.memory 2400000
-performance_schema events_stages_summary_global_by_event_name.row_size 32
-performance_schema events_stages_summary_global_by_event_name.row_count 150
-performance_schema events_stages_summary_global_by_event_name.memory 4800
-performance_schema events_stages_summary_by_account_by_event_name.row_size 32
-performance_schema events_stages_summary_by_account_by_event_name.row_count 15000
-performance_schema events_stages_summary_by_account_by_event_name.memory 480000
-performance_schema events_stages_summary_by_user_by_event_name.row_size 32
-performance_schema events_stages_summary_by_user_by_event_name.row_count 15000
-performance_schema events_stages_summary_by_user_by_event_name.memory 480000
-performance_schema events_stages_summary_by_host_by_event_name.row_size 32
-performance_schema events_stages_summary_by_host_by_event_name.row_count 15000
-performance_schema events_stages_summary_by_host_by_event_name.memory 480000
-performance_schema (pfs_statement_class).row_size 192
-performance_schema (pfs_statement_class).row_count 168
-performance_schema (pfs_statement_class).memory 32256
-performance_schema events_statements_history.row_size 3024
-performance_schema events_statements_history.row_count 5000
-performance_schema events_statements_history.memory 15120000
-performance_schema events_statements_history_long.row_size 3024
-performance_schema events_statements_history_long.row_count 10000
-performance_schema events_statements_history_long.memory 30240000
-performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
-performance_schema events_statements_summary_by_thread_by_event_name.row_count 84000
-performance_schema events_statements_summary_by_thread_by_event_name.memory 15456000
-performance_schema events_statements_summary_global_by_event_name.row_size 184
-performance_schema events_statements_summary_global_by_event_name.row_count 168
-performance_schema events_statements_summary_global_by_event_name.memory 30912
-performance_schema events_statements_summary_by_account_by_event_name.row_size 184
-performance_schema events_statements_summary_by_account_by_event_name.row_count 16800
-performance_schema events_statements_summary_by_account_by_event_name.memory 3091200
-performance_schema events_statements_summary_by_user_by_event_name.row_size 184
-performance_schema events_statements_summary_by_user_by_event_name.row_count 16800
-performance_schema events_statements_summary_by_user_by_event_name.memory 3091200
-performance_schema events_statements_summary_by_host_by_event_name.row_size 184
-performance_schema events_statements_summary_by_host_by_event_name.row_count 16800
-performance_schema events_statements_summary_by_host_by_event_name.memory 3091200
-performance_schema events_statements_current.row_size 3024
-performance_schema events_statements_current.row_count 500
-performance_schema events_statements_current.memory 1512000
-performance_schema (pfs_socket_class).row_size 320
-performance_schema (pfs_socket_class).row_count 10
-performance_schema (pfs_socket_class).memory 3200
-performance_schema socket_instances.row_size 320
-performance_schema socket_instances.row_count 420
-performance_schema socket_instances.memory 134400
-performance_schema events_statements_summary_by_digest.row_size 1472
-performance_schema events_statements_summary_by_digest.row_count 10000
-performance_schema events_statements_summary_by_digest.memory 14720000
-performance_schema session_connect_attrs.row_size 500
-performance_schema session_connect_attrs.row_count 512
-performance_schema session_connect_attrs.memory 256000
-performance_schema (account_hash).count 2
-performance_schema (account_hash).size 100
-performance_schema (digest_hash).count 0
-performance_schema (digest_hash).size 10000
-performance_schema (filename_hash).count 0
-performance_schema (filename_hash).size 23385
-performance_schema (host_hash).count 2
-performance_schema (host_hash).size 100
-performance_schema (setup_actor_hash).count 1
-performance_schema (setup_actor_hash).size 100
-performance_schema (setup_object_hash).count 4
-performance_schema (setup_object_hash).size 100
-performance_schema (table_share_hash).count 80
-performance_schema (table_share_hash).size 12500
-performance_schema (user_hash).count 2
-performance_schema (user_hash).size 100
-performance_schema host_cache.size 336
-performance_schema performance_schema.memory 421925632
diff --git a/mysql-test/suite/perfschema/r/sizing_low.result b/mysql-test/suite/perfschema/r/sizing_low.result
index d5aab2c2df3..213cc0b5f74 100644
--- a/mysql-test/suite/perfschema/r/sizing_low.result
+++ b/mysql-test/suite/perfschema/r/sizing_low.result
@@ -7,7 +7,9 @@ table_open_cache 100
show variables like "max_connections";
Variable_name Value
max_connections 50
-show variables like "%performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 10
@@ -31,7 +33,6 @@ performance_schema_max_rwlock_instances 1612
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 67
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 168
performance_schema_max_table_handles 112
performance_schema_max_table_instances 445
performance_schema_max_thread_classes 50
@@ -65,160 +66,3 @@ Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
-show engine performance_schema status;
-Type Name Status
-performance_schema events_waits_current.row_size 184
-performance_schema events_waits_current.row_count 672
-performance_schema events_waits_history.row_size 184
-performance_schema events_waits_history.row_count 560
-performance_schema events_waits_history.memory 103040
-performance_schema events_waits_history_long.row_size 184
-performance_schema events_waits_history_long.row_count 100
-performance_schema events_waits_history_long.memory 18400
-performance_schema (pfs_mutex_class).row_size 256
-performance_schema (pfs_mutex_class).row_count 200
-performance_schema (pfs_mutex_class).memory 51200
-performance_schema (pfs_rwlock_class).row_size 320
-performance_schema (pfs_rwlock_class).row_count 40
-performance_schema (pfs_rwlock_class).memory 12800
-performance_schema (pfs_cond_class).row_size 256
-performance_schema (pfs_cond_class).row_count 80
-performance_schema (pfs_cond_class).memory 20480
-performance_schema (pfs_thread_class).row_size 192
-performance_schema (pfs_thread_class).row_count 50
-performance_schema (pfs_thread_class).memory 9600
-performance_schema (pfs_file_class).row_size 320
-performance_schema (pfs_file_class).row_count 50
-performance_schema (pfs_file_class).memory 16000
-performance_schema mutex_instances.row_size 128
-performance_schema mutex_instances.row_count 2945
-performance_schema mutex_instances.memory 376960
-performance_schema rwlock_instances.row_size 192
-performance_schema rwlock_instances.row_count 1612
-performance_schema rwlock_instances.memory 309504
-performance_schema cond_instances.row_size 128
-performance_schema cond_instances.row_count 612
-performance_schema cond_instances.memory 78336
-performance_schema threads.row_size 2816
-performance_schema threads.row_count 112
-performance_schema threads.memory 315392
-performance_schema file_instances.row_size 704
-performance_schema file_instances.row_count 1556
-performance_schema file_instances.memory 1095424
-performance_schema (pfs_file_handle).row_size 8
-performance_schema (pfs_file_handle).row_count 32768
-performance_schema (pfs_file_handle).memory 262144
-performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
-performance_schema events_waits_summary_by_thread_by_event_name.row_count 42896
-performance_schema events_waits_summary_by_thread_by_event_name.memory 1372672
-performance_schema (pfs_table_share).row_size 22208
-performance_schema (pfs_table_share).row_count 445
-performance_schema (pfs_table_share).memory 9882560
-performance_schema (pfs_table).row_size 9280
-performance_schema (pfs_table).row_count 112
-performance_schema (pfs_table).memory 1039360
-performance_schema setup_actors.row_size 256
-performance_schema setup_actors.row_count 100
-performance_schema setup_actors.memory 25600
-performance_schema setup_objects.row_size 448
-performance_schema setup_objects.row_count 100
-performance_schema setup_objects.memory 44800
-performance_schema (pfs_account).row_size 256
-performance_schema (pfs_account).row_count 10
-performance_schema (pfs_account).memory 2560
-performance_schema events_waits_summary_by_account_by_event_name.row_size 32
-performance_schema events_waits_summary_by_account_by_event_name.row_count 3830
-performance_schema events_waits_summary_by_account_by_event_name.memory 122560
-performance_schema events_waits_summary_by_user_by_event_name.row_size 32
-performance_schema events_waits_summary_by_user_by_event_name.row_count 1915
-performance_schema events_waits_summary_by_user_by_event_name.memory 61280
-performance_schema events_waits_summary_by_host_by_event_name.row_size 32
-performance_schema events_waits_summary_by_host_by_event_name.row_count 7660
-performance_schema events_waits_summary_by_host_by_event_name.memory 245120
-performance_schema (pfs_user).row_size 128
-performance_schema (pfs_user).row_count 5
-performance_schema (pfs_user).memory 640
-performance_schema (pfs_host).row_size 128
-performance_schema (pfs_host).row_count 20
-performance_schema (pfs_host).memory 2560
-performance_schema (pfs_stage_class).row_size 256
-performance_schema (pfs_stage_class).row_count 150
-performance_schema (pfs_stage_class).memory 38400
-performance_schema events_stages_history.row_size 88
-performance_schema events_stages_history.row_count 560
-performance_schema events_stages_history.memory 49280
-performance_schema events_stages_history_long.row_size 88
-performance_schema events_stages_history_long.row_count 100
-performance_schema events_stages_history_long.memory 8800
-performance_schema events_stages_summary_by_thread_by_event_name.row_size 32
-performance_schema events_stages_summary_by_thread_by_event_name.row_count 16800
-performance_schema events_stages_summary_by_thread_by_event_name.memory 537600
-performance_schema events_stages_summary_global_by_event_name.row_size 32
-performance_schema events_stages_summary_global_by_event_name.row_count 150
-performance_schema events_stages_summary_global_by_event_name.memory 4800
-performance_schema events_stages_summary_by_account_by_event_name.row_size 32
-performance_schema events_stages_summary_by_account_by_event_name.row_count 1500
-performance_schema events_stages_summary_by_account_by_event_name.memory 48000
-performance_schema events_stages_summary_by_user_by_event_name.row_size 32
-performance_schema events_stages_summary_by_user_by_event_name.row_count 750
-performance_schema events_stages_summary_by_user_by_event_name.memory 24000
-performance_schema events_stages_summary_by_host_by_event_name.row_size 32
-performance_schema events_stages_summary_by_host_by_event_name.row_count 3000
-performance_schema events_stages_summary_by_host_by_event_name.memory 96000
-performance_schema (pfs_statement_class).row_size 192
-performance_schema (pfs_statement_class).row_count 168
-performance_schema (pfs_statement_class).memory 32256
-performance_schema events_statements_history.row_size 3024
-performance_schema events_statements_history.row_count 560
-performance_schema events_statements_history.memory 1693440
-performance_schema events_statements_history_long.row_size 3024
-performance_schema events_statements_history_long.row_count 100
-performance_schema events_statements_history_long.memory 302400
-performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
-performance_schema events_statements_summary_by_thread_by_event_name.row_count 18816
-performance_schema events_statements_summary_by_thread_by_event_name.memory 3462144
-performance_schema events_statements_summary_global_by_event_name.row_size 184
-performance_schema events_statements_summary_global_by_event_name.row_count 168
-performance_schema events_statements_summary_global_by_event_name.memory 30912
-performance_schema events_statements_summary_by_account_by_event_name.row_size 184
-performance_schema events_statements_summary_by_account_by_event_name.row_count 1680
-performance_schema events_statements_summary_by_account_by_event_name.memory 309120
-performance_schema events_statements_summary_by_user_by_event_name.row_size 184
-performance_schema events_statements_summary_by_user_by_event_name.row_count 840
-performance_schema events_statements_summary_by_user_by_event_name.memory 154560
-performance_schema events_statements_summary_by_host_by_event_name.row_size 184
-performance_schema events_statements_summary_by_host_by_event_name.row_count 3360
-performance_schema events_statements_summary_by_host_by_event_name.memory 618240
-performance_schema events_statements_current.row_size 3024
-performance_schema events_statements_current.row_count 112
-performance_schema events_statements_current.memory 338688
-performance_schema (pfs_socket_class).row_size 320
-performance_schema (pfs_socket_class).row_count 10
-performance_schema (pfs_socket_class).memory 3200
-performance_schema socket_instances.row_size 320
-performance_schema socket_instances.row_count 67
-performance_schema socket_instances.memory 21440
-performance_schema events_statements_summary_by_digest.row_size 1472
-performance_schema events_statements_summary_by_digest.row_count 1000
-performance_schema events_statements_summary_by_digest.memory 1472000
-performance_schema session_connect_attrs.row_size 112
-performance_schema session_connect_attrs.row_count 512
-performance_schema session_connect_attrs.memory 57344
-performance_schema (account_hash).count 2
-performance_schema (account_hash).size 10
-performance_schema (digest_hash).count 0
-performance_schema (digest_hash).size 1000
-performance_schema (filename_hash).count 0
-performance_schema (filename_hash).size 1556
-performance_schema (host_hash).count 2
-performance_schema (host_hash).size 20
-performance_schema (setup_actor_hash).count 1
-performance_schema (setup_actor_hash).size 100
-performance_schema (setup_object_hash).count 4
-performance_schema (setup_object_hash).size 100
-performance_schema (table_share_hash).count 80
-performance_schema (table_share_hash).size 445
-performance_schema (user_hash).count 2
-performance_schema (user_hash).size 5
-performance_schema host_cache.size 336
-performance_schema performance_schema.memory 24771616
diff --git a/mysql-test/suite/perfschema/r/sizing_med.result b/mysql-test/suite/perfschema/r/sizing_med.result
index c2e7a4df4bf..fbe703c5ff5 100644
--- a/mysql-test/suite/perfschema/r/sizing_med.result
+++ b/mysql-test/suite/perfschema/r/sizing_med.result
@@ -7,7 +7,9 @@ table_open_cache 401
show variables like "max_connections";
Variable_name Value
max_connections 152
-show variables like "%performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -31,7 +33,6 @@ performance_schema_max_rwlock_instances 2222
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 232
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 168
performance_schema_max_table_handles 573
performance_schema_max_table_instances 556
performance_schema_max_thread_classes 50
@@ -65,160 +66,3 @@ Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
-show engine performance_schema status;
-Type Name Status
-performance_schema events_waits_current.row_size 184
-performance_schema events_waits_current.row_count 1734
-performance_schema events_waits_history.row_size 184
-performance_schema events_waits_history.row_count 2890
-performance_schema events_waits_history.memory 531760
-performance_schema events_waits_history_long.row_size 184
-performance_schema events_waits_history_long.row_count 1000
-performance_schema events_waits_history_long.memory 184000
-performance_schema (pfs_mutex_class).row_size 256
-performance_schema (pfs_mutex_class).row_count 200
-performance_schema (pfs_mutex_class).memory 51200
-performance_schema (pfs_rwlock_class).row_size 320
-performance_schema (pfs_rwlock_class).row_count 40
-performance_schema (pfs_rwlock_class).memory 12800
-performance_schema (pfs_cond_class).row_size 256
-performance_schema (pfs_cond_class).row_count 80
-performance_schema (pfs_cond_class).memory 20480
-performance_schema (pfs_thread_class).row_size 192
-performance_schema (pfs_thread_class).row_count 50
-performance_schema (pfs_thread_class).memory 9600
-performance_schema (pfs_file_class).row_size 320
-performance_schema (pfs_file_class).row_count 50
-performance_schema (pfs_file_class).memory 16000
-performance_schema mutex_instances.row_size 128
-performance_schema mutex_instances.row_count 4230
-performance_schema mutex_instances.memory 541440
-performance_schema rwlock_instances.row_size 192
-performance_schema rwlock_instances.row_count 2222
-performance_schema rwlock_instances.memory 426624
-performance_schema cond_instances.row_size 128
-performance_schema cond_instances.row_count 1079
-performance_schema cond_instances.memory 138112
-performance_schema threads.row_size 2816
-performance_schema threads.row_count 289
-performance_schema threads.memory 813824
-performance_schema file_instances.row_size 704
-performance_schema file_instances.row_count 1754
-performance_schema file_instances.memory 1234816
-performance_schema (pfs_file_handle).row_size 8
-performance_schema (pfs_file_handle).row_count 32768
-performance_schema (pfs_file_handle).memory 262144
-performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
-performance_schema events_waits_summary_by_thread_by_event_name.row_count 110687
-performance_schema events_waits_summary_by_thread_by_event_name.memory 3541984
-performance_schema (pfs_table_share).row_size 22208
-performance_schema (pfs_table_share).row_count 556
-performance_schema (pfs_table_share).memory 12347648
-performance_schema (pfs_table).row_size 9280
-performance_schema (pfs_table).row_count 573
-performance_schema (pfs_table).memory 5317440
-performance_schema setup_actors.row_size 256
-performance_schema setup_actors.row_count 100
-performance_schema setup_actors.memory 25600
-performance_schema setup_objects.row_size 448
-performance_schema setup_objects.row_count 100
-performance_schema setup_objects.memory 44800
-performance_schema (pfs_account).row_size 256
-performance_schema (pfs_account).row_count 100
-performance_schema (pfs_account).memory 25600
-performance_schema events_waits_summary_by_account_by_event_name.row_size 32
-performance_schema events_waits_summary_by_account_by_event_name.row_count 38300
-performance_schema events_waits_summary_by_account_by_event_name.memory 1225600
-performance_schema events_waits_summary_by_user_by_event_name.row_size 32
-performance_schema events_waits_summary_by_user_by_event_name.row_count 38300
-performance_schema events_waits_summary_by_user_by_event_name.memory 1225600
-performance_schema events_waits_summary_by_host_by_event_name.row_size 32
-performance_schema events_waits_summary_by_host_by_event_name.row_count 38300
-performance_schema events_waits_summary_by_host_by_event_name.memory 1225600
-performance_schema (pfs_user).row_size 128
-performance_schema (pfs_user).row_count 100
-performance_schema (pfs_user).memory 12800
-performance_schema (pfs_host).row_size 128
-performance_schema (pfs_host).row_count 100
-performance_schema (pfs_host).memory 12800
-performance_schema (pfs_stage_class).row_size 256
-performance_schema (pfs_stage_class).row_count 150
-performance_schema (pfs_stage_class).memory 38400
-performance_schema events_stages_history.row_size 88
-performance_schema events_stages_history.row_count 2890
-performance_schema events_stages_history.memory 254320
-performance_schema events_stages_history_long.row_size 88
-performance_schema events_stages_history_long.row_count 1000
-performance_schema events_stages_history_long.memory 88000
-performance_schema events_stages_summary_by_thread_by_event_name.row_size 32
-performance_schema events_stages_summary_by_thread_by_event_name.row_count 43350
-performance_schema events_stages_summary_by_thread_by_event_name.memory 1387200
-performance_schema events_stages_summary_global_by_event_name.row_size 32
-performance_schema events_stages_summary_global_by_event_name.row_count 150
-performance_schema events_stages_summary_global_by_event_name.memory 4800
-performance_schema events_stages_summary_by_account_by_event_name.row_size 32
-performance_schema events_stages_summary_by_account_by_event_name.row_count 15000
-performance_schema events_stages_summary_by_account_by_event_name.memory 480000
-performance_schema events_stages_summary_by_user_by_event_name.row_size 32
-performance_schema events_stages_summary_by_user_by_event_name.row_count 15000
-performance_schema events_stages_summary_by_user_by_event_name.memory 480000
-performance_schema events_stages_summary_by_host_by_event_name.row_size 32
-performance_schema events_stages_summary_by_host_by_event_name.row_count 15000
-performance_schema events_stages_summary_by_host_by_event_name.memory 480000
-performance_schema (pfs_statement_class).row_size 192
-performance_schema (pfs_statement_class).row_count 168
-performance_schema (pfs_statement_class).memory 32256
-performance_schema events_statements_history.row_size 3024
-performance_schema events_statements_history.row_count 2890
-performance_schema events_statements_history.memory 8739360
-performance_schema events_statements_history_long.row_size 3024
-performance_schema events_statements_history_long.row_count 1000
-performance_schema events_statements_history_long.memory 3024000
-performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
-performance_schema events_statements_summary_by_thread_by_event_name.row_count 48552
-performance_schema events_statements_summary_by_thread_by_event_name.memory 8933568
-performance_schema events_statements_summary_global_by_event_name.row_size 184
-performance_schema events_statements_summary_global_by_event_name.row_count 168
-performance_schema events_statements_summary_global_by_event_name.memory 30912
-performance_schema events_statements_summary_by_account_by_event_name.row_size 184
-performance_schema events_statements_summary_by_account_by_event_name.row_count 16800
-performance_schema events_statements_summary_by_account_by_event_name.memory 3091200
-performance_schema events_statements_summary_by_user_by_event_name.row_size 184
-performance_schema events_statements_summary_by_user_by_event_name.row_count 16800
-performance_schema events_statements_summary_by_user_by_event_name.memory 3091200
-performance_schema events_statements_summary_by_host_by_event_name.row_size 184
-performance_schema events_statements_summary_by_host_by_event_name.row_count 16800
-performance_schema events_statements_summary_by_host_by_event_name.memory 3091200
-performance_schema events_statements_current.row_size 3024
-performance_schema events_statements_current.row_count 289
-performance_schema events_statements_current.memory 873936
-performance_schema (pfs_socket_class).row_size 320
-performance_schema (pfs_socket_class).row_count 10
-performance_schema (pfs_socket_class).memory 3200
-performance_schema socket_instances.row_size 320
-performance_schema socket_instances.row_count 232
-performance_schema socket_instances.memory 74240
-performance_schema events_statements_summary_by_digest.row_size 1472
-performance_schema events_statements_summary_by_digest.row_count 5000
-performance_schema events_statements_summary_by_digest.memory 7360000
-performance_schema session_connect_attrs.row_size 289
-performance_schema session_connect_attrs.row_count 512
-performance_schema session_connect_attrs.memory 147968
-performance_schema (account_hash).count 2
-performance_schema (account_hash).size 100
-performance_schema (digest_hash).count 0
-performance_schema (digest_hash).size 5000
-performance_schema (filename_hash).count 0
-performance_schema (filename_hash).size 1754
-performance_schema (host_hash).count 2
-performance_schema (host_hash).size 100
-performance_schema (setup_actor_hash).count 1
-performance_schema (setup_actor_hash).size 100
-performance_schema (setup_object_hash).count 4
-performance_schema (setup_object_hash).size 100
-performance_schema (table_share_hash).count 80
-performance_schema (table_share_hash).size 556
-performance_schema (user_hash).count 2
-performance_schema (user_hash).size 100
-performance_schema host_cache.size 336
-performance_schema performance_schema.memory 70954032
diff --git a/mysql-test/suite/perfschema/r/sizing_off.result b/mysql-test/suite/perfschema/r/sizing_off.result
index 0d95a8c0f1b..614ad7d2475 100644
--- a/mysql-test/suite/perfschema/r/sizing_off.result
+++ b/mysql-test/suite/perfschema/r/sizing_off.result
@@ -1,4 +1,6 @@
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema OFF
performance_schema_accounts_size -1
@@ -22,7 +24,6 @@ performance_schema_max_rwlock_instances -1
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances -1
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 168
performance_schema_max_table_handles -1
performance_schema_max_table_instances -1
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 b27ecd52226..9e0b9209b89 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 0b8e00a5653..99b18e851a4 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 8e8d1498b9f..5217f16a32f 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 d4b02dedc2c..86c25348cd5 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 0d7ea7d6294..d03c20a5878 100644
--- a/mysql-test/suite/perfschema/r/start_server_innodb.result
+++ b/mysql-test/suite/perfschema/r/start_server_innodb.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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_low_digest.result b/mysql-test/suite/perfschema/r/start_server_low_digest.result
new file mode 100644
index 00000000000..aff444250e0
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_low_digest.result
@@ -0,0 +1,12 @@
+USE performance_schema;
+truncate table events_statements_history_long;
+SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1;
+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
+74
+####################################
+# QUERYING PS STATEMENT DIGEST
+####################################
+SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long;
+event_name digest digest_text sql_text
+statement/sql/truncate e1c917a43f978456fab15240f89372ca TRUNCATE TABLE truncate table events_statements_history_long
+statement/sql/select 4cc1c447d79877c4e8df0423fd0cde9a SELECT ? + ? + SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
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 b9ec719ed58..3e0324868a7 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_account.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_account.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 0
@@ -93,7 +95,6 @@ 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 180
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 4fac77bc0cc..158dfb81ebe 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 75cd54776eb..3673600a078 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 9922fcaa016..1e819d26265 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 6e8735f6a1f..b439af66f8d 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 f5dae7c61d9..abb8a157ec6 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_host.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_host.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 4b3c8790b58..c5fe555b749 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 92ec4cf61fc..d88d808a9ab 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 e4ac0d0fa8b..1155993e60c 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 3bba543f3b8..4d419817b0a 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 2c3ef382fb9..281ca17491c 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 0b49b4d055a..1e5578daddc 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 9cf73c2b78d..ef1050d9fde 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 6da66d6ee75..97cbc807f3c 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 532935bb0ff..a173447632d 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 360571bc326..6de6cc3187e 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 d458e3da9b1..fc0e680ebb7 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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_statement_class.result b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
index 78fe9223ef4..fca5ab82238 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 0
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 2682ea22f88..1fc13bf6ce3 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 9568e9ad56b..d51d3acf343 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 c189d9a5024..784ed74e33c 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 a440cfe3302..da73df5c419 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 d9c945ea8cb..a84f0f3c0ef 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 f5ce5bebb51..3be29053b33 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 53cb0051f97..d80a9a4a2c4 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_user.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_user.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 125274550eb..928307123d8 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 50212863574..d8ada5f9da5 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
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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_nothing.result b/mysql-test/suite/perfschema/r/start_server_nothing.result
index 4e6994d670e..bf84848641c 100644
--- a/mysql-test/suite/perfschema/r/start_server_nothing.result
+++ b/mysql-test/suite/perfschema/r/start_server_nothing.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 0
@@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 0
performance_schema_max_socket_classes 0
performance_schema_max_socket_instances 0
performance_schema_max_stage_classes 0
-performance_schema_max_statement_classes 0
performance_schema_max_table_handles 0
performance_schema_max_table_instances 0
performance_schema_max_thread_classes 0
diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result
index 08847829579..293607c41e9 100644
--- a/mysql-test/suite/perfschema/r/start_server_off.result
+++ b/mysql-test/suite/perfschema/r/start_server_off.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema OFF
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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 0d7ea7d6294..d03c20a5878 100644
--- a/mysql-test/suite/perfschema/r/start_server_on.result
+++ b/mysql-test/suite/perfschema/r/start_server_on.result
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -93,7 +95,6 @@ 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 180
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/statement_digest.result b/mysql-test/suite/perfschema/r/statement_digest.result
index 41cba435cb6..e3df74a70d9 100644
--- a/mysql-test/suite/perfschema/r/statement_digest.result
+++ b/mysql-test/suite/perfschema/r/statement_digest.result
@@ -112,43 +112,42 @@ DROP TRIGGER trg;
SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
-statements_digest 0e98ee6a98e296530ec59c12dbc08dfe TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
-statements_digest 954f43425c3234acc8e194afd97e8a0a SELECT ? FROM t1 1 0 0 0
-statements_digest fc365a54bc19d746bd24c27aba46b990 SELECT ? FROM `t1` 1 0 0 0
-statements_digest 27ba28f6252e4ae0e9b14b36da536fbe SELECT ?, ... FROM t1 2 0 0 0
-statements_digest 81d03922612900032ec4b81934ab4841 SELECT ? FROM t2 1 0 0 0
-statements_digest adce8aec12b6b5046cd4bf55951014c7 SELECT ?, ... FROM t2 2 0 0 0
-statements_digest 59a1bd93c424b10802fe66bb6dcd94d2 INSERT INTO t1 VALUES (?) 1 1 0 0
-statements_digest 91b2da58b0eb49c35a38fbc49f5e491d INSERT INTO t2 VALUES (?) 1 1 0 0
-statements_digest 967114adbf91d8a4a99ec5e49e909ff4 INSERT INTO t3 VALUES (...) 4 4 0 0
-statements_digest 8f25e7a48487e0aa7377e816816bb658 INSERT INTO t4 VALUES (...) 1 1 0 0
-statements_digest 4e51253af793867fba66166de1f314f7 INSERT INTO t5 VALUES (...) 1 1 0 0
-statements_digest fa47b3109e117216cd10209690d28596 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0
-statements_digest 72409f84bc236e6fe9f2f7b4d727f2d3 INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0
-statements_digest d40aaddb41ed794d65dd8273f0c75700 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0
-statements_digest 57a82b28388e52e99fc64339dd30edde INSERT INTO t1 VALUES ( NULL ) 1 1 0 0
-statements_digest 6a56b694106442474cb0e5fb7575c8b9 INSERT INTO t6 VALUES (...) 5 5 0 0
-statements_digest c9abf55e296c4317dbaf2d14ef907ad7 SELECT ? + ? 3 0 0 0
-statements_digest 156304a0851a3e3626b39fb3da841a82 SELECT ? 1 0 0 0
+statements_digest 8de787d0e3e3a062aea121ff528fcfce TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
+statements_digest a871edd1a65606b404c0b6e65c1f142c SELECT ? FROM t1 1 0 0 0
+statements_digest d60830f376a7724280dfc422224bb475 SELECT ? FROM `t1` 1 0 0 0
+statements_digest 09309c60c199a727b7ebed40975e8764 SELECT ?, ... FROM t1 2 0 0 0
+statements_digest dc0dcaefa9a12455ffed04ac6f89e65d SELECT ? FROM t2 1 0 0 0
+statements_digest d274a288509eae2cd7febf2f7fe36274 SELECT ?, ... FROM t2 2 0 0 0
+statements_digest ec913f89e0d8be99014bf78e73228c48 INSERT INTO t1 VALUES (?) 2 2 0 0
+statements_digest b919ecf2d5544bcdf95e76eb22231c42 INSERT INTO t2 VALUES (?) 1 1 0 0
+statements_digest d9030eddb8dca8ee5fcaf79e6f254b41 INSERT INTO t3 VALUES (...) 4 4 0 0
+statements_digest 2ad6d8279781b0fb40bdc8647dc94216 INSERT INTO t4 VALUES (...) 1 1 0 0
+statements_digest 3248c16dc70111225fcffa99641e312b INSERT INTO t5 VALUES (...) 1 1 0 0
+statements_digest 152b6c84a0cbfadcbecde01050eddd66 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0
+statements_digest c4cbce33b636e448c29e041b1d5c0eb1 INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0
+statements_digest 0bfac9fb577995b116e52ff4aaeaa5b8 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0
+statements_digest 819acce11785e12f2f73964115632db6 INSERT INTO t6 VALUES (...) 5 5 0 0
+statements_digest aeb185ab9b6e9d5a49e47c8741b8acdf SELECT ? + ? 3 0 0 0
+statements_digest d3804664eeee11407f3fcbd5c29a1f73 SELECT ? 1 0 0 0
statements_digest 3b085ab0d2063dfca1a39212e3ea1831 CREATE SCHEMA statements_digest_temp 2 2 0 0
statements_digest 09f9fabef2feb9a54ba01455e5ae83b9 DROP SCHEMA statements_digest_temp 2 0 0 0
-statements_digest 7910a63ffd31cbcb742e15270c8958c8 SELECT ? FROM no_such_table 1 0 0 1
-statements_digest fa34540a438bc672478b1162505ee28c CREATE TABLE dup_table ( c CHARACTER (?) ) 2 0 0 1
-statements_digest 2c720f176bb7c8510ff8aca8921b9945 DROP TABLE dup_table 1 0 0 0
-statements_digest 0c7d9fd8c27ab067511da41ca3bcdff3 INSERT INTO t11 VALUES (?) 1 1 1 0
-statements_digest 81681ff345065ed72bcd1e9407ab85e4 SHOW WARNINGS 1 0 0 0
-statements_digest d766f5823ae5d8e4cf4602b8e7a3fb80 PREPARE stmt FROM ? 1 0 0 0
+statements_digest ff0bb1dfc399aa3bef6a0f3fccd3ef94 SELECT ? FROM no_such_table 1 0 0 1
+statements_digest 590a245c84e63eb100e1ef463f477f1a CREATE TABLE dup_table ( c CHARACTER (?) ) 2 0 0 1
+statements_digest 74078b0776d8333e356b271551587d53 DROP TABLE dup_table 1 0 0 0
+statements_digest f23641c5ab7e1dd6e0146f66b3fff5c4 INSERT INTO t11 VALUES (?) 1 1 1 0
+statements_digest d3eda26b379bd56340ce84fe395dfff7 SHOW WARNINGS 1 0 0 0
+statements_digest 6bb42dec3094486d5a9e8b0bf460e382 PREPARE stmt FROM ? 1 0 0 0
statements_digest 3ab1e87eabd9688edf919754cce6348b EXECUTE stmt 2 0 0 0
-statements_digest 470094469d250b9f45cab45bf610efe8 DEALLOCATE PREPARE stmt 1 0 0 0
-statements_digest 1b4d25358e08b35ad54e49dfe5eaf3e4 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 0 0 0
+statements_digest f9438ab7b8eec604338c28a04e5d650f DEALLOCATE PREPARE stmt 1 0 0 0
+statements_digest 072d6c57d3fe4f0c6a7dabba96f0ccf8 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 0 0 0
statements_digest 84554971243e91106214dcb8f4eaa89b CALL p1 ( ) 2 0 0 0
-statements_digest 77206e4bf30979c56752a7ed9150213a DROP PROCEDURE p1 1 0 0 0
-statements_digest 03b91dcdba6b0e29f7fb240ae4bcd97f CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 0 0 0
-statements_digest 72bc532f308f2dca62f5291df8c50e6f SELECT func (...) 2 0 0 0
+statements_digest 2bd1e1e6eb445f32e1d4b290c1961e6b DROP PROCEDURE p1 1 0 0 0
+statements_digest 5799522044ce9a4fa48dce5f4a3b047a CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 0 0 0
+statements_digest 59cbdd7ffc78a23bc2f650f8158067c6 SELECT func (...) 2 0 0 0
statements_digest 0b5a5297689c5036def6af8e8a8ce113 DROP FUNCTION func 1 0 0 0
-statements_digest d08331e42c67555ece50e46eef0f2b47 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1 0 0 0
-statements_digest 754a49a4de995c5a729e9ab52f135f59 INSERT INTO t12 VALUES (?) 2 2 0 0
-statements_digest 68df17752bca7c2c8ee2a6a19a0674e7 DROP TRIGGER trg 1 0 0 0
+statements_digest 10c7a2262748aa15496375d99f876fb2 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @? := ? 1 0 0 0
+statements_digest bb0154f3d32233f696b95d4127d29a3b INSERT INTO t12 VALUES (?) 2 2 0 0
+statements_digest a975545baf024e8a173be77032d8fd01 DROP TRIGGER trg 1 0 0 0
####################################
# CLEANUP
####################################
diff --git a/mysql-test/suite/perfschema/r/statement_digest_consumers.result b/mysql-test/suite/perfschema/r/statement_digest_consumers.result
index 21e62e13b19..355905f71d8 100644
--- a/mysql-test/suite/perfschema/r/statement_digest_consumers.result
+++ b/mysql-test/suite/perfschema/r/statement_digest_consumers.result
@@ -125,43 +125,42 @@ DROP TRIGGER trg;
####################################
SELECT schema_name, digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
schema_name digest digest_text count_star
-statements_digest 0e98ee6a98e296530ec59c12dbc08dfe TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1
-statements_digest 954f43425c3234acc8e194afd97e8a0a SELECT ? FROM t1 1
-statements_digest fc365a54bc19d746bd24c27aba46b990 SELECT ? FROM `t1` 1
-statements_digest 27ba28f6252e4ae0e9b14b36da536fbe SELECT ?, ... FROM t1 2
-statements_digest 81d03922612900032ec4b81934ab4841 SELECT ? FROM t2 1
-statements_digest adce8aec12b6b5046cd4bf55951014c7 SELECT ?, ... FROM t2 2
-statements_digest 59a1bd93c424b10802fe66bb6dcd94d2 INSERT INTO t1 VALUES (?) 1
-statements_digest 91b2da58b0eb49c35a38fbc49f5e491d INSERT INTO t2 VALUES (?) 1
-statements_digest 967114adbf91d8a4a99ec5e49e909ff4 INSERT INTO t3 VALUES (...) 4
-statements_digest 8f25e7a48487e0aa7377e816816bb658 INSERT INTO t4 VALUES (...) 1
-statements_digest 4e51253af793867fba66166de1f314f7 INSERT INTO t5 VALUES (...) 1
-statements_digest fa47b3109e117216cd10209690d28596 INSERT INTO t1 VALUES (?) /* , ... */ 2
-statements_digest 72409f84bc236e6fe9f2f7b4d727f2d3 INSERT INTO t3 VALUES (...) /* , ... */ 1
-statements_digest d40aaddb41ed794d65dd8273f0c75700 INSERT INTO t5 VALUES (...) /* , ... */ 1
-statements_digest 57a82b28388e52e99fc64339dd30edde INSERT INTO t1 VALUES ( NULL ) 1
-statements_digest 6a56b694106442474cb0e5fb7575c8b9 INSERT INTO t6 VALUES (...) 5
-statements_digest c9abf55e296c4317dbaf2d14ef907ad7 SELECT ? + ? 3
-statements_digest 156304a0851a3e3626b39fb3da841a82 SELECT ? 1
+statements_digest 8de787d0e3e3a062aea121ff528fcfce TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1
+statements_digest a871edd1a65606b404c0b6e65c1f142c SELECT ? FROM t1 1
+statements_digest d60830f376a7724280dfc422224bb475 SELECT ? FROM `t1` 1
+statements_digest 09309c60c199a727b7ebed40975e8764 SELECT ?, ... FROM t1 2
+statements_digest dc0dcaefa9a12455ffed04ac6f89e65d SELECT ? FROM t2 1
+statements_digest d274a288509eae2cd7febf2f7fe36274 SELECT ?, ... FROM t2 2
+statements_digest ec913f89e0d8be99014bf78e73228c48 INSERT INTO t1 VALUES (?) 2
+statements_digest b919ecf2d5544bcdf95e76eb22231c42 INSERT INTO t2 VALUES (?) 1
+statements_digest d9030eddb8dca8ee5fcaf79e6f254b41 INSERT INTO t3 VALUES (...) 4
+statements_digest 2ad6d8279781b0fb40bdc8647dc94216 INSERT INTO t4 VALUES (...) 1
+statements_digest 3248c16dc70111225fcffa99641e312b INSERT INTO t5 VALUES (...) 1
+statements_digest 152b6c84a0cbfadcbecde01050eddd66 INSERT INTO t1 VALUES (?) /* , ... */ 2
+statements_digest c4cbce33b636e448c29e041b1d5c0eb1 INSERT INTO t3 VALUES (...) /* , ... */ 1
+statements_digest 0bfac9fb577995b116e52ff4aaeaa5b8 INSERT INTO t5 VALUES (...) /* , ... */ 1
+statements_digest 819acce11785e12f2f73964115632db6 INSERT INTO t6 VALUES (...) 5
+statements_digest aeb185ab9b6e9d5a49e47c8741b8acdf SELECT ? + ? 3
+statements_digest d3804664eeee11407f3fcbd5c29a1f73 SELECT ? 1
statements_digest 3b085ab0d2063dfca1a39212e3ea1831 CREATE SCHEMA statements_digest_temp 2
statements_digest 09f9fabef2feb9a54ba01455e5ae83b9 DROP SCHEMA statements_digest_temp 2
-statements_digest 7910a63ffd31cbcb742e15270c8958c8 SELECT ? FROM no_such_table 1
-statements_digest fa34540a438bc672478b1162505ee28c CREATE TABLE dup_table ( c CHARACTER (?) ) 2
-statements_digest 2c720f176bb7c8510ff8aca8921b9945 DROP TABLE dup_table 1
-statements_digest 0c7d9fd8c27ab067511da41ca3bcdff3 INSERT INTO t11 VALUES (?) 1
-statements_digest 81681ff345065ed72bcd1e9407ab85e4 SHOW WARNINGS 1
-statements_digest d766f5823ae5d8e4cf4602b8e7a3fb80 PREPARE stmt FROM ? 1
+statements_digest ff0bb1dfc399aa3bef6a0f3fccd3ef94 SELECT ? FROM no_such_table 1
+statements_digest 590a245c84e63eb100e1ef463f477f1a CREATE TABLE dup_table ( c CHARACTER (?) ) 2
+statements_digest 74078b0776d8333e356b271551587d53 DROP TABLE dup_table 1
+statements_digest f23641c5ab7e1dd6e0146f66b3fff5c4 INSERT INTO t11 VALUES (?) 1
+statements_digest d3eda26b379bd56340ce84fe395dfff7 SHOW WARNINGS 1
+statements_digest 6bb42dec3094486d5a9e8b0bf460e382 PREPARE stmt FROM ? 1
statements_digest 3ab1e87eabd9688edf919754cce6348b EXECUTE stmt 2
-statements_digest 470094469d250b9f45cab45bf610efe8 DEALLOCATE PREPARE stmt 1
-statements_digest 1b4d25358e08b35ad54e49dfe5eaf3e4 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1
+statements_digest f9438ab7b8eec604338c28a04e5d650f DEALLOCATE PREPARE stmt 1
+statements_digest 072d6c57d3fe4f0c6a7dabba96f0ccf8 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1
statements_digest 84554971243e91106214dcb8f4eaa89b CALL p1 ( ) 2
-statements_digest 77206e4bf30979c56752a7ed9150213a DROP PROCEDURE p1 1
-statements_digest 03b91dcdba6b0e29f7fb240ae4bcd97f CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1
-statements_digest 72bc532f308f2dca62f5291df8c50e6f SELECT func (...) 2
+statements_digest 2bd1e1e6eb445f32e1d4b290c1961e6b DROP PROCEDURE p1 1
+statements_digest 5799522044ce9a4fa48dce5f4a3b047a CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1
+statements_digest 59cbdd7ffc78a23bc2f650f8158067c6 SELECT func (...) 2
statements_digest 0b5a5297689c5036def6af8e8a8ce113 DROP FUNCTION func 1
-statements_digest d08331e42c67555ece50e46eef0f2b47 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1
-statements_digest 754a49a4de995c5a729e9ab52f135f59 INSERT INTO t12 VALUES (?) 2
-statements_digest 68df17752bca7c2c8ee2a6a19a0674e7 DROP TRIGGER trg 1
+statements_digest 10c7a2262748aa15496375d99f876fb2 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @? := ? 1
+statements_digest bb0154f3d32233f696b95d4127d29a3b INSERT INTO t12 VALUES (?) 2
+statements_digest a975545baf024e8a173be77032d8fd01 DROP TRIGGER trg 1
SELECT digest, digest_text FROM performance_schema.events_statements_current;
digest digest_text
####################################
diff --git a/mysql-test/suite/perfschema/r/statement_digest_long_query.result b/mysql-test/suite/perfschema/r/statement_digest_long_query.result
index bb355304537..f9943060c83 100644
--- a/mysql-test/suite/perfschema/r/statement_digest_long_query.result
+++ b/mysql-test/suite/perfschema/r/statement_digest_long_query.result
@@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
####################################
SELECT schema_name, digest, digest_text, count_star FROM events_statements_summary_by_digest;
schema_name digest digest_text count_star
-performance_schema 9d35ff74210c6b30efa4559d627ed0f7 TRUNCATE TABLE events_statements_summary_by_digest 1
-performance_schema d78a04c1c42765b8552e0483c50ae9ff SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ... 1
+performance_schema 7536ab4a65b991a0b1a8b9851e8457c3 TRUNCATE TABLE events_statements_summary_by_digest 1
+performance_schema 63f9aaeed7859671c6a42c75fcd43785 SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? 1
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 ea2980e5755..2613737a3da 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
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -63,7 +65,6 @@ 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 180
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 f51e8383019..e5aaf207820 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
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -62,7 +64,6 @@ 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 180
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 a7844b6b0e6..637d923ebdb 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
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -63,7 +65,6 @@ 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 180
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 4d089c810a1..a41ae765a77 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
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -62,7 +64,6 @@ 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 180
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 23bd1294445..2278744621e 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
@@ -37,7 +37,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -61,7 +63,6 @@ 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 180
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 7edfc3824bb..b3ada0d638a 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
@@ -36,7 +36,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -60,7 +62,6 @@ 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 180
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 99d2e7d4655..361a8a700d0 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
@@ -37,7 +37,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -61,7 +63,6 @@ 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 180
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 f8c660bd932..97bb0e34e0d 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
@@ -36,7 +36,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -60,7 +62,6 @@ 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 180
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 73ed3550a77..f28f374c5dd 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_off.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -62,7 +64,6 @@ 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 180
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 3906c6f6b84..f7760043ddd 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
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -63,7 +65,6 @@ 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 180
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 0b579f54a66..0ee5eaddcaf 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
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -62,7 +64,6 @@ 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 180
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 e137525e5b0..025a7f27738 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
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -63,7 +65,6 @@ 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 180
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 799555b685e..f655cd5bb93 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
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -62,7 +64,6 @@ 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 180
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 bf920a30af3..55bb5a6a71f 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
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -65,7 +67,6 @@ 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 180
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 d100f2a5e08..7f9f9e99359 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
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -64,7 +66,6 @@ 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 180
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 a5d046f154c..7aa15b6a01d 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
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -65,7 +67,6 @@ 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 180
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 413a566fefb..0732fce5853 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
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -64,7 +66,6 @@ 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 180
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 4a5e7aeede1..c1f6fd56a97 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
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -63,7 +65,6 @@ 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 180
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 25ba676993a..705e6ca7021 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
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -62,7 +64,6 @@ 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 180
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 41292e5913e..04b7c7979c4 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
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -63,7 +65,6 @@ 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 180
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 fc7c523ed8c..ef1f31b19a4 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
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -62,7 +64,6 @@ 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 180
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 210928a0c04..a7ac4fa860f 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
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -65,7 +67,6 @@ 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 180
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 9df65066d45..28bdcfb1d82 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
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -64,7 +66,6 @@ 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 180
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 a9109fa42d2..683dd9cc4a6 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
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -65,7 +67,6 @@ 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 180
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 542b020f77a..d488066dd7f 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
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -64,7 +66,6 @@ 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 180
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 ece0dadebd0..d3a4416fdfd 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
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -65,7 +67,6 @@ 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 180
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 956540b9327..c69fc8a37d3 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
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -64,7 +66,6 @@ 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 180
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 72f0240c6be..91110a94be5 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
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -65,7 +67,6 @@ 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 180
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 a93cc1b6499..b443ac28c17 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
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -64,7 +66,6 @@ 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 180
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 0e1b7032af6..08a107acb2a 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
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -63,7 +65,6 @@ 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 180
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 fb1fd8fb207..07272c6e204 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
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -62,7 +64,6 @@ 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 180
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 f97272634b9..77c52780ae9 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
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -63,7 +65,6 @@ 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 180
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 ddf8ef7bf9d..6d7192285e3 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
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -62,7 +64,6 @@ 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 180
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 588a378024a..160be444e7c 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
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -65,7 +67,6 @@ 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 180
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 76c466d48cc..e915a8dfa95 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
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -64,7 +66,6 @@ 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 180
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 2450456355a..82c1b65acff 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
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -65,7 +67,6 @@ 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 180
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 72b46a2820b..9023a4b0a69 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
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_accounts_size 100
@@ -64,7 +66,6 @@ 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 180
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/threads_mysql.result b/mysql-test/suite/perfschema/r/threads_mysql.result
index 4da857f83fc..6ab0b0641b0 100644
--- a/mysql-test/suite/perfschema/r/threads_mysql.result
+++ b/mysql-test/suite/perfschema/r/threads_mysql.result
@@ -13,7 +13,7 @@ processlist_user NULL
processlist_host NULL
processlist_db NULL
processlist_command NULL
-processlist_info INTERNAL DDL LOG RECOVER IN PROGRESS
+processlist_info NULL
unified_parent_thread_id NULL
role NULL
instrumented YES
diff --git a/mysql-test/suite/perfschema/t/aggregate.test b/mysql-test/suite/perfschema/t/aggregate.test
index 672737ae2a7..fe30a7b8697 100644
--- a/mysql-test/suite/perfschema/t/aggregate.test
+++ b/mysql-test/suite/perfschema/t/aggregate.test
@@ -6,6 +6,10 @@
--echo "General cleanup"
+# MDEV-7187 - test fails sporadically in buildbot
+set @aria_checkpoint_interval_save= @@global.aria_checkpoint_interval;
+set @@global.aria_checkpoint_interval= 0;
+
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -188,3 +192,6 @@ update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
drop table test.t1;
+
+set @@global.aria_checkpoint_interval= @aria_checkpoint_interval_save;
+
diff --git a/mysql-test/suite/perfschema/t/digest_null_literal.test b/mysql-test/suite/perfschema/t/digest_null_literal.test
new file mode 100644
index 00000000000..91f1eec1f95
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/digest_null_literal.test
@@ -0,0 +1,32 @@
+# ----------------------------------------------------
+# Tests for the performance schema statement Digests.
+# ----------------------------------------------------
+
+# Test case to show behavior of statements digest when
+# parsing a NULL literal
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/no_protocol.inc
+
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+
+--disable_query_log
+
+select NULL;
+select NULL FROM DUAL;
+select NULL, NULL;
+select NULL, NULL, NULL, 1, 2, 3, NULL, NULL;
+
+select 1 IS NULL;
+select 2 IS NOT NULL;
+select 1 IS NULL, 2 IS NULL, 3 IS NOT NULL, 4 IS NOT NULL;
+
+create table foo (a int DEFAULT NULL, b int NOT NULL DEFAULT 1, c int NOT NULL);
+drop table foo;
+
+--enable_query_log
+
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
+ FROM performance_schema.events_statements_summary_by_digest;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test
index ae58f4089ed..c1af8516b79 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved:
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test
index 8c408b160a6..a5ac18a8818 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved:
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test
index ccd0ae383ee..ae1de4f032e 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] Hostname 'santa.claus.ipv6.example.com' does not resolve to '2001:db8::6:6'.
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test
index 72d5d693a1b..361a3ce6bd1 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] Hostname 'santa.claus.ipv6.example.com' does not resolve to '2001:db8::6:6'.
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test
index c253e4b77d5..9dbd682681e 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] IP address '192.0.2.4' could not be resolved:
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test
index 096b4b11eb4..4836dfc2d36 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# Enforce a clean state
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test
index 575dab9a337..b675b5089a8 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved:
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test
index f6e5fa118df..9ce4fb926e6 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved:
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test
index 0e0e900405a..9c8168e573a 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test
@@ -10,7 +10,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
--source include/have_plugin_auth.inc
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
index 9d4707dc027..cd78087dad1 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
@@ -10,7 +10,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# Enforce a clean state
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
index d4adc3e0d00..0ced79544a3 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
@@ -10,7 +10,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# Enforce a clean state
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test
index e396dbbad3c..983a6e80ff7 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] IP address '2001:db8::6:6' could not be resolved:
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test
index cc7eb0b566f..3cdd87e4cf9 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] IP address '2001:db8::6:6' could not be resolved:
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test
index 80f07989212..3a30030413f 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] IP address '2001:db8::6:6' could not be resolved:
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test
index 0d11e433b58..054940e4a02 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test
@@ -8,7 +8,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# [Warning] IP address '2001:db8::6:6' could not be resolved:
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test
index 6dd33b9bb5b..811c5c51c26 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test
@@ -7,7 +7,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# Enforce a clean state
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test
index 2b30a4eaf41..c11922624c6 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test
@@ -7,7 +7,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
---source include/have_ipv6.inc
+--source include/check_ipv6.inc
--source include/have_perfschema.inc
# Enforce a clean state
diff --git a/mysql-test/suite/perfschema/t/nesting.test b/mysql-test/suite/perfschema/t/nesting.test
index 21e7260222a..29819770645 100644
--- a/mysql-test/suite/perfschema/t/nesting.test
+++ b/mysql-test/suite/perfschema/t/nesting.test
@@ -5,7 +5,7 @@
# On windows, the socket instrumentation collects an extra "opt"
# event, which changes the test output.
--source include/not_windows.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
--source ../include/wait_for_pfs_thread_count.inc
--disable_query_log
diff --git a/mysql-test/suite/perfschema/t/ortho_iter.test b/mysql-test/suite/perfschema/t/ortho_iter.test
index a9990e17409..0a90831ae70 100644
--- a/mysql-test/suite/perfschema/t/ortho_iter.test
+++ b/mysql-test/suite/perfschema/t/ortho_iter.test
@@ -126,8 +126,9 @@ $
delimiter ;$
# Check the configuration is ok
-show variables like "performance_schema%";
-show status like "performance_schema%";
+show variables where
+ `Variable_name` != "performance_schema_max_statement_classes" and
+ `Variable_name` like "performance_schema%";
call check_instrument("wait/synch/mutex/");
call check_instrument("wait/synch/rwlock/");
diff --git a/mysql-test/suite/perfschema/t/privilege_table_io.test b/mysql-test/suite/perfschema/t/privilege_table_io.test
index dc17fbcf67e..833fe85e8bb 100644
--- a/mysql-test/suite/perfschema/t/privilege_table_io.test
+++ b/mysql-test/suite/perfschema/t/privilege_table_io.test
@@ -36,7 +36,9 @@ insert into test.marker set a = 1;
# This will not, the ACL cache is already loaded
insert into test.marker set a = 1;
insert into test.marker set a = 1;
-show variables like "performance_schema%";
+show variables where
+ `Variable_name` != "performance_schema_max_statement_classes" and
+ `Variable_name` like "performance_schema%";
show status like "performance_schema%";
# Stop recording events + pull results
let $schema_to_dump= "test", "mysql";
diff --git a/mysql-test/suite/perfschema/t/rpl_gtid_func.test b/mysql-test/suite/perfschema/t/rpl_gtid_func.test
index 27837572bff..5a3fe0b7894 100644
--- a/mysql-test/suite/perfschema/t/rpl_gtid_func.test
+++ b/mysql-test/suite/perfschema/t/rpl_gtid_func.test
@@ -1,7 +1,7 @@
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
-- source include/master-slave.inc
diff --git a/mysql-test/suite/perfschema/t/rpl_statements.test b/mysql-test/suite/perfschema/t/rpl_statements.test
index fa429cd2aa3..1aa52efd937 100644
--- a/mysql-test/suite/perfschema/t/rpl_statements.test
+++ b/mysql-test/suite/perfschema/t/rpl_statements.test
@@ -4,7 +4,7 @@
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc
diff --git a/mysql-test/suite/perfschema/t/sizing_off.test b/mysql-test/suite/perfschema/t/sizing_off.test
index 83b49572cb4..32729918bd1 100644
--- a/mysql-test/suite/perfschema/t/sizing_off.test
+++ b/mysql-test/suite/perfschema/t/sizing_off.test
@@ -2,5 +2,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
-show variables like "performance_schema%";
+show variables where
+ `Variable_name` != "performance_schema_max_statement_classes" and
+ `Variable_name` like "performance_schema%";
show status like "performance_schema%";
diff --git a/mysql-test/suite/perfschema/t/socket_instances_func-master.opt b/mysql-test/suite/perfschema/t/socket_instances_func-master.opt
index ab6ca1731f5..b12a8b3b70e 100644
--- a/mysql-test/suite/perfschema/t/socket_instances_func-master.opt
+++ b/mysql-test/suite/perfschema/t/socket_instances_func-master.opt
@@ -1 +1 @@
---skip-name-resolve
+--skip-name-resolve --bind-address=*
diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test
index 5ba3af1e408..c6860eb3213 100644
--- a/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test
+++ b/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test
@@ -26,7 +26,7 @@
# happens per SQL statement within our MTR tests. And there is a significant
# difference between standard statement execution and execution via
# prepared statement.
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
# Set this to enable debugging output
let $my_socket_debug_dbug= 0;
diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
index ef5096d85ff..d06edb0d78f 100644
--- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
+++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
@@ -36,7 +36,7 @@
# happens per SQL statement within our MTR tests. And there is a significant
# difference between standard statement execution and execution via
# prepared statement.
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
#===================================
diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test
index 5d4b4209b6e..cefaf1de549 100644
--- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test
+++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test
@@ -38,7 +38,7 @@
# happens per SQL statement within our MTR tests. And there is a significant
# difference between standard statement execution and execution via
# prepared statement.
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
#===================================
diff --git a/mysql-test/suite/perfschema/t/start_server_low_digest-master.opt b/mysql-test/suite/perfschema/t/start_server_low_digest-master.opt
new file mode 100644
index 00000000000..fc5065f9ae9
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_low_digest-master.opt
@@ -0,0 +1 @@
+--max_digest_length=10
diff --git a/mysql-test/suite/perfschema/t/start_server_low_digest.test b/mysql-test/suite/perfschema/t/start_server_low_digest.test
new file mode 100644
index 00000000000..6f06def169b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_low_digest.test
@@ -0,0 +1,21 @@
+# -----------------------------------------------------------------------
+# Tests for the performance schema statement Digests.
+# -----------------------------------------------------------------------
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/no_protocol.inc
+
+USE performance_schema;
+truncate table events_statements_history_long;
+
+# -----------------------------------------------------------------------
+# Test to show how the digest behaves with low value of
+# - performance_schema_max_digest_length
+# -----------------------------------------------------------------------
+SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1;
+
+--echo ####################################
+--echo # QUERYING PS STATEMENT DIGEST
+--echo ####################################
+SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long;
diff --git a/mysql-test/suite/perfschema/t/statement_digest_long_query.test b/mysql-test/suite/perfschema/t/statement_digest_long_query.test
index 3969383a6fb..b7ba18ef2cb 100644
--- a/mysql-test/suite/perfschema/t/statement_digest_long_query.test
+++ b/mysql-test/suite/perfschema/t/statement_digest_long_query.test
@@ -4,7 +4,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
USE performance_schema;
truncate table events_statements_summary_by_digest;
diff --git a/mysql-test/suite/perfschema/t/unary_digest.test b/mysql-test/suite/perfschema/t/unary_digest.test
index c4583484f36..d8daea70d38 100644
--- a/mysql-test/suite/perfschema/t/unary_digest.test
+++ b/mysql-test/suite/perfschema/t/unary_digest.test
@@ -7,7 +7,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result
index cc474ceb970..bf71e518f97 100644
--- a/mysql-test/suite/plugins/r/server_audit.result
+++ b/mysql-test/suite/plugins/r/server_audit.result
@@ -11,10 +11,13 @@ server_audit_incl_users
server_audit_logging OFF
server_audit_mode 0
server_audit_output_type file
+server_audit_query_log_limit 1024
server_audit_syslog_facility LOG_USER
server_audit_syslog_ident mysql-server_auditing
server_audit_syslog_info
server_audit_syslog_priority LOG_INFO
+set global server_audit_file_path=null;
+set global server_audit_incl_users=null;
set global server_audit_file_path='server_audit.log';
set global server_audit_output_type=file;
set global server_audit_logging=on;
@@ -42,6 +45,11 @@ id
2
alter table t1 rename renamed_t1;
set global server_audit_events='connect,query';
+select 1,
+2,
+3;
+1 2 3
+1 2 3
insert into t2 values (1), (2);
select * from t2;
id
@@ -66,6 +74,7 @@ server_audit_incl_users odin, root, dva, tri
server_audit_logging ON
server_audit_mode 0
server_audit_output_type file
+server_audit_query_log_limit 1024
server_audit_syslog_facility LOG_USER
server_audit_syslog_ident mysql-server_auditing
server_audit_syslog_info
@@ -85,6 +94,101 @@ create table sa_t1(id int);
insert into sa_t1 values (1), (2);
drop table sa_t1;
drop database sa_db;
+create database sa_db;
+use sa_db;
+CREATE USER u1 IDENTIFIED BY 'pwd-123';
+GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
+SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+CREATE USER u3 IDENTIFIED BY '';
+drop user u1, u2, u3;
+set global server_audit_events='query_ddl';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+id
+1
+2
+select 2;
+2
+2
+(select 2);
+2
+2
+/*! select 2*/;
+2
+2
+/*comment*/ select 2;
+2
+2
+drop table t1;
+set global server_audit_events='query_ddl,query_dml';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+id
+1
+2
+select 2;
+2
+2
+drop table t1;
+set global server_audit_events='query_dml';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+id
+1
+2
+select 2;
+2
+2
+(select 2);
+2
+2
+/*! select 2*/;
+2
+2
+/*comment*/ select 2;
+2
+2
+drop table t1;
+set global server_audit_events='query_dcl';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+id
+1
+2
+CREATE USER u1 IDENTIFIED BY 'pwd-123';
+GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
+SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+SET PASSWORD FOR u1=<secret>;
+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 '=<secret>' at line 1
+CREATE USER u3 IDENTIFIED BY '';
+drop user u1, u2, u3;
+select 2;
+2
+2
+(select 2);
+2
+2
+/*! select 2*/;
+2
+2
+/*comment*/ select 2;
+2
+2
+drop table t1;
+set global server_audit_events='';
+set global server_audit_query_log_limit= 15;
+select (1), (2), (3), (4);
+1 2 3 4
+1 2 3 4
+select 'A', 'B', 'C', 'D';
+A B C D
+A B C D
+set global server_audit_query_log_limit= 1024;
+drop database sa_db;
set global server_audit_file_path='.';
show status like 'server_audit_current_log';
Variable_name Value
@@ -115,6 +219,7 @@ server_audit_incl_users odin, root, dva, tri
server_audit_logging ON
server_audit_mode 1
server_audit_output_type file
+server_audit_query_log_limit 1024
server_audit_syslog_facility LOG_USER
server_audit_syslog_ident mysql-server_auditing
server_audit_syslog_info
@@ -148,6 +253,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats,
TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID
@@ -184,19 +290,78 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc,
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0
TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,sa_db,,0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'.\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'.\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show status like \'server_audit_current_log\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show status like \'server_audit_current_log\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\' \'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\' \'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show status like \'server_audit_current_log\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'nonexisting_dir/\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'nonexisting_dir/\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'SHOW WARNINGS',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show status like \'server_audit_current_log\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show variables like \'server_audit%\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'(select 2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select \'A\', ',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_query_log_limit= 1024',0
+TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SHOW WARNINGS',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show variables like \'server_audit%\'',0
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,plugin,
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'uninstall plugin server_audit',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'uninstall plugin server_audit',0
diff --git a/mysql-test/suite/plugins/r/thread_pool_server_audit.result b/mysql-test/suite/plugins/r/thread_pool_server_audit.result
new file mode 100644
index 00000000000..bf71e518f97
--- /dev/null
+++ b/mysql-test/suite/plugins/r/thread_pool_server_audit.result
@@ -0,0 +1,367 @@
+install plugin server_audit soname 'server_audit';
+show variables like 'server_audit%';
+Variable_name Value
+server_audit_events
+server_audit_excl_users
+server_audit_file_path server_audit.log
+server_audit_file_rotate_now OFF
+server_audit_file_rotate_size 1000000
+server_audit_file_rotations 9
+server_audit_incl_users
+server_audit_logging OFF
+server_audit_mode 0
+server_audit_output_type file
+server_audit_query_log_limit 1024
+server_audit_syslog_facility LOG_USER
+server_audit_syslog_ident mysql-server_auditing
+server_audit_syslog_info
+server_audit_syslog_priority LOG_INFO
+set global server_audit_file_path=null;
+set global server_audit_incl_users=null;
+set global server_audit_file_path='server_audit.log';
+set global server_audit_output_type=file;
+set global server_audit_logging=on;
+connect(localhost,no_such_user,,mysql,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'no_such_user'@'localhost' (using password: NO)
+set global server_audit_incl_users='odin, dva, tri';
+create table t1 (id int);
+set global server_audit_incl_users='odin, root, dva, tri';
+create table t2 (id int);
+set global server_audit_excl_users='odin, dva, tri';
+Warnings:
+Warning 1 User 'odin' is in the server_audit_incl_users, so wasn't added.
+Warning 1 User 'dva' is in the server_audit_incl_users, so wasn't added.
+Warning 1 User 'tri' is in the server_audit_incl_users, so wasn't added.
+insert into t1 values (1), (2);
+select * from t1;
+id
+1
+2
+set global server_audit_incl_users='odin, root, dva, tri';
+insert into t2 values (1), (2);
+select * from t2;
+id
+1
+2
+alter table t1 rename renamed_t1;
+set global server_audit_events='connect,query';
+select 1,
+2,
+3;
+1 2 3
+1 2 3
+insert into t2 values (1), (2);
+select * from t2;
+id
+1
+2
+1
+2
+select * from t_doesnt_exist;
+ERROR 42S02: Table 'test.t_doesnt_exist' doesn't exist
+syntax_error_query;
+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 'syntax_error_query' at line 1
+drop table renamed_t1, t2;
+show variables like 'server_audit%';
+Variable_name Value
+server_audit_events CONNECT,QUERY
+server_audit_excl_users
+server_audit_file_path server_audit.log
+server_audit_file_rotate_now OFF
+server_audit_file_rotate_size 1000000
+server_audit_file_rotations 9
+server_audit_incl_users odin, root, dva, tri
+server_audit_logging ON
+server_audit_mode 0
+server_audit_output_type file
+server_audit_query_log_limit 1024
+server_audit_syslog_facility LOG_USER
+server_audit_syslog_ident mysql-server_auditing
+server_audit_syslog_info
+server_audit_syslog_priority LOG_INFO
+set global server_audit_mode=1;
+set global server_audit_events='';
+create database sa_db;
+create table t1 (id2 int);
+insert into t1 values (1), (2);
+select * from t1;
+id2
+1
+2
+drop table t1;
+use sa_db;
+create table sa_t1(id int);
+insert into sa_t1 values (1), (2);
+drop table sa_t1;
+drop database sa_db;
+create database sa_db;
+use sa_db;
+CREATE USER u1 IDENTIFIED BY 'pwd-123';
+GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
+SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+CREATE USER u3 IDENTIFIED BY '';
+drop user u1, u2, u3;
+set global server_audit_events='query_ddl';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+id
+1
+2
+select 2;
+2
+2
+(select 2);
+2
+2
+/*! select 2*/;
+2
+2
+/*comment*/ select 2;
+2
+2
+drop table t1;
+set global server_audit_events='query_ddl,query_dml';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+id
+1
+2
+select 2;
+2
+2
+drop table t1;
+set global server_audit_events='query_dml';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+id
+1
+2
+select 2;
+2
+2
+(select 2);
+2
+2
+/*! select 2*/;
+2
+2
+/*comment*/ select 2;
+2
+2
+drop table t1;
+set global server_audit_events='query_dcl';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+id
+1
+2
+CREATE USER u1 IDENTIFIED BY 'pwd-123';
+GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
+SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+SET PASSWORD FOR u1=<secret>;
+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 '=<secret>' at line 1
+CREATE USER u3 IDENTIFIED BY '';
+drop user u1, u2, u3;
+select 2;
+2
+2
+(select 2);
+2
+2
+/*! select 2*/;
+2
+2
+/*comment*/ select 2;
+2
+2
+drop table t1;
+set global server_audit_events='';
+set global server_audit_query_log_limit= 15;
+select (1), (2), (3), (4);
+1 2 3 4
+1 2 3 4
+select 'A', 'B', 'C', 'D';
+A B C D
+A B C D
+set global server_audit_query_log_limit= 1024;
+drop database sa_db;
+set global server_audit_file_path='.';
+show status like 'server_audit_current_log';
+Variable_name Value
+Server_audit_current_log HOME_DIR/server_audit.log
+set global server_audit_file_path='';
+show status like 'server_audit_current_log';
+Variable_name Value
+Server_audit_current_log server_audit.log
+set global server_audit_file_path=' ';
+show status like 'server_audit_current_log';
+Variable_name Value
+Server_audit_current_log server_audit.log
+set global server_audit_file_path='nonexisting_dir/';
+Warnings:
+Warning 1 SERVER AUDIT plugin can't create file 'nonexisting_dir/'.
+show status like 'server_audit_current_log';
+Variable_name Value
+Server_audit_current_log server_audit.log
+show variables like 'server_audit%';
+Variable_name Value
+server_audit_events
+server_audit_excl_users
+server_audit_file_path
+server_audit_file_rotate_now OFF
+server_audit_file_rotate_size 1000000
+server_audit_file_rotations 9
+server_audit_incl_users odin, root, dva, tri
+server_audit_logging ON
+server_audit_mode 1
+server_audit_output_type file
+server_audit_query_log_limit 1024
+server_audit_syslog_facility LOG_USER
+server_audit_syslog_ident mysql-server_auditing
+server_audit_syslog_info
+server_audit_syslog_priority LOG_INFO
+uninstall plugin server_audit;
+Warnings:
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_logging=on',0
+TIME,HOSTNAME,root,localhost,ID,0,CONNECT,mysql,,0
+TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,mysql,,0
+TIME,HOSTNAME,no_such_user,localhost,ID,0,FAILED_CONNECT,,,ID
+TIME,HOSTNAME,no_such_user,localhost,ID,0,DISCONNECT,,,0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_incl_users=\'odin, root, dva, tri\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,CREATE,test,t2,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create table t2 (id int)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_excl_users=\'odin, dva, tri\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'SHOW WARNINGS',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t1,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t1 values (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t1,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_incl_users=\'odin, root, dva, tri\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t2,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t2,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0
+TIME,HOSTNAME,root,localhost,ID,ID,ALTER,test,t1,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,table_stats,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,column_stats,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats,
+TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'syntax_error_query',ID
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'drop table renamed_t1, t2',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show variables like \'server_audit%\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_mode=1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0
+TIME,HOSTNAME,root,localhost,ID,0,CONNECT,test,,0
+TIME,HOSTNAME,root,localhost,ID,ID,CREATE,test,t1,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create table t1 (id2 int)',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t1,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t1 values (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t1,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,table_stats,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,column_stats,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats,
+TIME,HOSTNAME,root,localhost,ID,ID,DROP,test,t1,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'drop table t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0
+TIME,HOSTNAME,root,localhost,ID,ID,CREATE,sa_db,sa_t1,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table sa_t1(id int)',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,sa_db,sa_t1,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into sa_t1 values (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,table_stats,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,column_stats,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats,
+TIME,HOSTNAME,root,localhost,ID,ID,DROP,sa_db,sa_t1,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table sa_t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0
+TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,sa_db,,0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'(select 2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select \'A\', ',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_query_log_limit= 1024',0
+TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SHOW WARNINGS',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show variables like \'server_audit%\'',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,plugin,
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'uninstall plugin server_audit',0
diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test
index 869fd944d51..52428909c3b 100644
--- a/mysql-test/suite/plugins/t/server_audit.test
+++ b/mysql-test/suite/plugins/t/server_audit.test
@@ -8,13 +8,17 @@ if (!$SERVER_AUDIT_SO) {
install plugin server_audit soname 'server_audit';
show variables like 'server_audit%';
+set global server_audit_file_path=null;
+set global server_audit_incl_users=null;
set global server_audit_file_path='server_audit.log';
set global server_audit_output_type=file;
set global server_audit_logging=on;
+--sleep 2
connect (con1,localhost,root,,mysql);
connection default;
disconnect con1;
--sleep 2
+--sleep 2
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR
connect (con1,localhost,no_such_user,,mysql);
@@ -32,6 +36,9 @@ insert into t2 values (1), (2);
select * from t2;
alter table t1 rename renamed_t1;
set global server_audit_events='connect,query';
+select 1,
+ 2,
+ 3;
insert into t2 values (1), (2);
select * from t2;
--error ER_NO_SUCH_TABLE
@@ -46,6 +53,8 @@ create database sa_db;
--sleep 2
connect (con1,localhost,root,,test);
connection con1;
+--sleep 2
+--sleep 2
create table t1 (id2 int);
insert into t1 values (1), (2);
select * from t1;
@@ -57,8 +66,64 @@ drop table sa_t1;
drop database sa_db;
connection default;
disconnect con1;
-
--sleep 2
+--sleep 2
+create database sa_db;
+use sa_db;
+CREATE USER u1 IDENTIFIED BY 'pwd-123';
+GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
+SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+CREATE USER u3 IDENTIFIED BY '';
+drop user u1, u2, u3;
+
+set global server_audit_events='query_ddl';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+select 2;
+(select 2);
+/*! select 2*/;
+/*comment*/ select 2;
+drop table t1;
+set global server_audit_events='query_ddl,query_dml';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+select 2;
+drop table t1;
+set global server_audit_events='query_dml';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+select 2;
+(select 2);
+/*! select 2*/;
+/*comment*/ select 2;
+drop table t1;
+set global server_audit_events='query_dcl';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+CREATE USER u1 IDENTIFIED BY 'pwd-123';
+GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
+SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+--error 1064
+SET PASSWORD FOR u1=<secret>;
+CREATE USER u3 IDENTIFIED BY '';
+drop user u1, u2, u3;
+select 2;
+(select 2);
+/*! select 2*/;
+/*comment*/ select 2;
+drop table t1;
+set global server_audit_events='';
+
+set global server_audit_query_log_limit= 15;
+select (1), (2), (3), (4);
+select 'A', 'B', 'C', 'D';
+set global server_audit_query_log_limit= 1024;
+drop database sa_db;
+
set global server_audit_file_path='.';
--replace_regex /\.[\\\/]/HOME_DIR\//
show status like 'server_audit_current_log';
diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.opt b/mysql-test/suite/plugins/t/thread_pool_server_audit.opt
new file mode 100644
index 00000000000..30953d0c574
--- /dev/null
+++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.opt
@@ -0,0 +1,2 @@
+--thread_handling=pool-of-threads
+
diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.test b/mysql-test/suite/plugins/t/thread_pool_server_audit.test
new file mode 100644
index 00000000000..626d4136c47
--- /dev/null
+++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.test
@@ -0,0 +1,144 @@
+--source include/not_embedded.inc
+--source include/have_pool_of_threads.inc
+
+if (!$SERVER_AUDIT_SO) {
+ skip No SERVER_AUDIT plugin;
+}
+
+install plugin server_audit soname 'server_audit';
+
+show variables like 'server_audit%';
+set global server_audit_file_path=null;
+set global server_audit_incl_users=null;
+set global server_audit_file_path='server_audit.log';
+set global server_audit_output_type=file;
+set global server_audit_logging=on;
+--sleep 2
+connect (con1,localhost,root,,mysql);
+connection default;
+disconnect con1;
+--sleep 2
+--sleep 2
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect (con1,localhost,no_such_user,,mysql);
+connection default;
+--sleep 2
+set global server_audit_incl_users='odin, dva, tri';
+create table t1 (id int);
+set global server_audit_incl_users='odin, root, dva, tri';
+create table t2 (id int);
+set global server_audit_excl_users='odin, dva, tri';
+insert into t1 values (1), (2);
+select * from t1;
+set global server_audit_incl_users='odin, root, dva, tri';
+insert into t2 values (1), (2);
+select * from t2;
+alter table t1 rename renamed_t1;
+set global server_audit_events='connect,query';
+select 1,
+ 2,
+ 3;
+insert into t2 values (1), (2);
+select * from t2;
+--error ER_NO_SUCH_TABLE
+select * from t_doesnt_exist;
+--error 1064
+syntax_error_query;
+drop table renamed_t1, t2;
+show variables like 'server_audit%';
+set global server_audit_mode=1;
+set global server_audit_events='';
+create database sa_db;
+--sleep 2
+connect (con1,localhost,root,,test);
+connection con1;
+--sleep 2
+--sleep 2
+create table t1 (id2 int);
+insert into t1 values (1), (2);
+select * from t1;
+drop table t1;
+use sa_db;
+create table sa_t1(id int);
+insert into sa_t1 values (1), (2);
+drop table sa_t1;
+drop database sa_db;
+connection default;
+disconnect con1;
+--sleep 2
+--sleep 2
+create database sa_db;
+use sa_db;
+CREATE USER u1 IDENTIFIED BY 'pwd-123';
+GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
+SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+CREATE USER u3 IDENTIFIED BY '';
+drop user u1, u2, u3;
+
+set global server_audit_events='query_ddl';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+select 2;
+(select 2);
+/*! select 2*/;
+/*comment*/ select 2;
+drop table t1;
+set global server_audit_events='query_ddl,query_dml';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+select 2;
+drop table t1;
+set global server_audit_events='query_dml';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+select 2;
+(select 2);
+/*! select 2*/;
+/*comment*/ select 2;
+drop table t1;
+set global server_audit_events='query_dcl';
+create table t1(id int);
+insert into t1 values (1), (2);
+select * from t1;
+CREATE USER u1 IDENTIFIED BY 'pwd-123';
+GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
+SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+--error 1064
+SET PASSWORD FOR u1=<secret>;
+CREATE USER u3 IDENTIFIED BY '';
+drop user u1, u2, u3;
+select 2;
+(select 2);
+/*! select 2*/;
+/*comment*/ select 2;
+drop table t1;
+set global server_audit_events='';
+
+set global server_audit_query_log_limit= 15;
+select (1), (2), (3), (4);
+select 'A', 'B', 'C', 'D';
+set global server_audit_query_log_limit= 1024;
+drop database sa_db;
+
+set global server_audit_file_path='.';
+--replace_regex /\.[\\\/]/HOME_DIR\//
+show status like 'server_audit_current_log';
+set global server_audit_file_path='';
+show status like 'server_audit_current_log';
+set global server_audit_file_path=' ';
+show status like 'server_audit_current_log';
+set global server_audit_file_path='nonexisting_dir/';
+show status like 'server_audit_current_log';
+show variables like 'server_audit%';
+uninstall plugin server_audit;
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+# replace the timestamp and the hostname with constant values
+--replace_regex /[0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\,[^,]*\,/TIME,HOSTNAME,/ /\,[1-9][0-9]*\,/,1,/ /\,[1-9][0-9]*/,ID/
+cat_file $MYSQLD_DATADIR/server_audit.log;
+remove_file $MYSQLD_DATADIR/server_audit.log;
+
diff --git a/mysql-test/suite/roles/create_and_drop_role.result b/mysql-test/suite/roles/create_and_drop_role.result
index 2974dd20e22..79c6f412111 100644
--- a/mysql-test/suite/roles/create_and_drop_role.result
+++ b/mysql-test/suite/roles/create_and_drop_role.result
@@ -46,3 +46,21 @@ Note 1449 The user specified as a definer ('u1'@'%') does not exist
create user foo@bar;
drop user foo@bar;
drop role r1;
+CREATE USER u1;
+CREATE ROLE r1;
+CREATE USER r1@localhost;
+CREATE ROLE r2;
+GRANT r2 to r1;
+GRANT r2 to r1@localhost;
+DROP ROLE r1;
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+localhost r1 r2 N
+localhost root r2 Y
+SHOW GRANTS FOR r1@localhost;
+Grants for r1@localhost
+GRANT r2 TO 'r1'@'localhost'
+GRANT USAGE ON *.* TO 'r1'@'localhost'
+DROP USER u1;
+DROP ROLE r2;
+DROP USER r1@localhost;
diff --git a/mysql-test/suite/roles/create_and_drop_role.test b/mysql-test/suite/roles/create_and_drop_role.test
index 38f040789e0..0bf5b744e6b 100644
--- a/mysql-test/suite/roles/create_and_drop_role.test
+++ b/mysql-test/suite/roles/create_and_drop_role.test
@@ -68,3 +68,22 @@ create user foo@bar;
drop user foo@bar;
drop role r1;
+#
+# MDEV-7774 Assertion `status == 0' fails when dropping in this order:
+#
+CREATE USER u1;
+CREATE ROLE r1;
+CREATE USER r1@localhost;
+CREATE ROLE r2;
+GRANT r2 to r1;
+GRANT r2 to r1@localhost;
+# MDEV-7774: Dropping in this order caused the crash.
+DROP ROLE r1;
+--sorted_result
+SELECT * FROM mysql.roles_mapping;
+SHOW GRANTS FOR r1@localhost; # Related to MDEV-7774, also caused a crash, by
+ # not updating the internal acl_roles_mapping
+ # data structure correctly;
+DROP USER u1;
+DROP ROLE r2;
+DROP USER r1@localhost;
diff --git a/mysql-test/suite/rpl/r/rpl_drop_db_fail.result b/mysql-test/suite/rpl/r/rpl_drop_db_fail.result
new file mode 100644
index 00000000000..1be90338493
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_drop_db_fail.result
@@ -0,0 +1,16 @@
+include/master-slave.inc
+[connection master]
+CREATE DATABASE IF NOT EXISTS db1;
+CREATE DATABASE IF NOT EXISTS db2;
+use db1;
+CREATE TABLE a(id INT);
+CREATE VIEW v AS SELECT * FROM a;
+CREATE TABLE table_father(id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20)) ENGINE=INNODB;
+use db2;
+CREATE TABLE table_child(id INT PRIMARY KEY, info VARCHAR(20), father_id INT) ENGINE=INNODB;
+ALTER TABLE table_child ADD CONSTRAINT aaa FOREIGN KEY (father_id) REFERENCES db1.table_father(id);
+DROP DATABASE db1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+DROP DATABASE db2;
+DROP DATABASE db1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
index 465cc875af0..f3b52d89eb4 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
@@ -310,7 +310,7 @@ master_gtid_wait('2-1-10')
0
master_gtid_wait('2-1-10')
0
-*** Test sql_gtid_slave_pos when used with GTID ***
+*** Test gtid_slave_pos when used with GTID ***
include/stop_slave.inc
SET gtid_domain_id=2;
SET gtid_seq_no=1000;
@@ -413,5 +413,26 @@ SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! ex
status
Ok
SET GLOBAL slave_ddl_exec_mode= @saved_mode;
+*** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (31);
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (32);
+INSERT INTO t1 VALUES (33);
+include/stop_slave.inc
+INSERT INTO t1 VALUES (34);
+include/start_slave.inc
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a
+31
+32
+33
+34
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a
+31
+32
+33
+34
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
index 75bd9d0cbb1..0c2249f2dce 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
@@ -267,5 +267,55 @@ a
24
26
27
+*** MDEV-6391: GTID binlog state not recovered if mariadb-bin.state is removed ***
+include/stop_slave.inc
+INSERT INTO t1 VALUES (30);
+SET @old_server_id= @@server_id;
+SET @old_domain_id= @@gtid_domain_id;
+SET SESSION server_id= 10;
+INSERT INTO t1 VALUES (31);
+INSERT INTO t1 VALUES (32);
+SET SESSION gtid_domain_id= 1;
+SET SESSION server_id=11;
+INSERT INTO t1 VALUES (33);
+SET SESSION gtid_domain_id= 2;
+INSERT INTO t1 VALUES (34);
+SET SESSION server_id= 10;
+INSERT INTO t1 VALUES (35);
+INSERT INTO t1 VALUES (36);
+SET SESSION gtid_domain_id= 0;
+SET SESSION server_id= 12;
+INSERT INTO t1 VALUES (37);
+SET SESSION gtid_domain_id= @old_domain_id;
+SET SESSION server_id= @old_server_id;
+INSERT INTO t1 VALUES (38);
+INSERT INTO t1 VALUES (39);
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
DROP TABLE t1;
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 385a374888c..a2bf8b567e8 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
@@ -179,7 +179,7 @@ a
SET sql_log_bin=0;
CALL mtr.add_suppression("Slave: Could not update replication slave gtid state");
SET sql_log_bin=1;
-*** MDEV-4906: When event apply fails, next SQL thread start errorneously commits the failing GTID to gtid_slave_pos ***
+*** MDEV-4906: When event apply fails, next SQL thread start erroneously commits the failing GTID to gtid_slave_pos ***
include/stop_slave.inc
SET sql_log_bin=0;
DELETE FROM t2;
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_misc.result b/mysql-test/suite/rpl/r/rpl_gtid_misc.result
new file mode 100644
index 00000000000..cdaac1b1d34
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_gtid_misc.result
@@ -0,0 +1,25 @@
+include/master-slave.inc
+[connection master]
+*** MDEV-6403: Temporary tables lost at STOP SLAVE in GTID mode if master has not rotated binlog since restart ***
+CREATE TABLE t1 (a INT PRIMARY KEY);
+include/stop_slave.inc
+SET sql_log_bin= 0;
+INSERT INTO t1 VALUES (1);
+SET sql_log_bin= 1;
+CHANGE MASTER TO master_use_gtid= current_pos;
+CREATE TEMPORARY TABLE t2 LIKE t1;
+INSERT INTO t2 VALUE (1);
+INSERT INTO t1 SELECT * FROM t2;
+DROP TEMPORARY TABLE t2;
+START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1062]
+STOP SLAVE IO_THREAD;
+SET sql_log_bin= 0;
+DELETE FROM t1 WHERE a=1;
+SET sql_log_bin= 1;
+include/start_slave.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_until.result b/mysql-test/suite/rpl/r/rpl_gtid_until.result
index d86b5cac78c..c23faecc674 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_until.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_until.result
@@ -44,14 +44,14 @@ a
1
2
include/stop_slave.inc
-START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200";
+START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200,0-1-300";
include/wait_for_slave_to_start.inc
Using_Gtid = 'Current_Pos'
Until_Condition = 'Gtid'
+INSERT INTO t1 VALUES (3);
+DELETE FROM t1 WHERE a=3;
include/stop_slave.inc
-include/start_slave.inc
*** Test UNTIL condition in an earlier binlog than the start GTID. ***
-include/stop_slave.inc
SET gtid_domain_id = 1;
INSERT INTO t1 VALUES (3);
SET gtid_domain_id = 2;
diff --git a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
index bf4347757f7..78bda5a1c6f 100644
--- a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
+++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
@@ -18,4 +18,26 @@ show slave status;
select master_pos_wait('foo', 98);
master_pos_wait('foo', 98)
NULL
+*** MDEV-7130: MASTER_POS_WAIT(log_name,log_pos,timeout,"connection_name") hangs, does not respect the timeout ***
+include/stop_slave.inc
+reset slave all;
+change master 'my_slave' to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+set default_master_connection = 'my_slave';
+include/start_slave.inc
+# Call without connection name -- works (expected -1)
+select master_pos_wait('master-bin.000001',1000000,1);
+master_pos_wait('master-bin.000001',1000000,1)
+-1
+set default_master_connection = '';
+# Call for non-existing anonymous connection -- works (expected NULL)
+select master_pos_wait('master-bin.000001',1000000,1);
+master_pos_wait('master-bin.000001',1000000,1)
+NULL
+# Call with a valid connection name -- hangs before MDEV-7130 fix (expected -1)
+select master_pos_wait('master-bin.000001',1000000,1,"my_slave");
+master_pos_wait('master-bin.000001',1000000,1,"my_slave")
+-1
+STOP SLAVE 'my_slave';
+RESET SLAVE 'my_slave' ALL;
+change master to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_old_decimal.result b/mysql-test/suite/rpl/r/rpl_old_decimal.result
new file mode 100644
index 00000000000..3e2fa3bf241
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_old_decimal.result
@@ -0,0 +1,9 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1dec102 (a DECIMAL(10,2));
+INSERT INTO t1dec102 VALUES(999.99);
+call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1dec102' cannot be converted from type 'decimal(0,?)/*old*/' to type 'decimal(10,2)''
+DROP TABLE t1dec102;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result
index 7ceb5ee6622..124b7c9a029 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel.result
@@ -4,8 +4,22 @@ SET GLOBAL slave_parallel_threads=10;
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
CHANGE MASTER TO master_use_gtid=slave_pos;
include/start_slave.inc
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*)))
+OK
+include/stop_slave.inc
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
+include/start_slave.inc
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*)))
+OK
*** Test long-running query in domain 1 can run in parallel with short queries in domain 0 ***
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
@@ -1136,11 +1150,510 @@ SET GLOBAL debug_dbug=@old_dbug;
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
+*** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption ***
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=1;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
+INSERT INTO t2 VALUES (101);
+INSERT INTO t2 VALUES (102);
+INSERT INTO t2 VALUES (103);
+INSERT INTO t2 VALUES (104);
+INSERT INTO t2 VALUES (105);
+SET gtid_seq_no=1000;
+INSERT INTO t2 VALUES (106);
+INSERT INTO t2 VALUES (107);
+INSERT INTO t2 VALUES (108);
+INSERT INTO t2 VALUES (109);
+INSERT INTO t2 VALUES (110);
+INSERT INTO t2 VALUES (111);
+INSERT INTO t2 VALUES (112);
+INSERT INTO t2 VALUES (113);
+INSERT INTO t2 VALUES (114);
+INSERT INTO t2 VALUES (115);
+INSERT INTO t2 VALUES (116);
+INSERT INTO t2 VALUES (117);
+INSERT INTO t2 VALUES (118);
+INSERT INTO t2 VALUES (119);
+INSERT INTO t2 VALUES (120);
+INSERT INTO t2 VALUES (121);
+INSERT INTO t2 VALUES (122);
+INSERT INTO t2 VALUES (123);
+INSERT INTO t2 VALUES (124);
+INSERT INTO t2 VALUES (125);
+INSERT INTO t2 VALUES (126);
+INSERT INTO t2 VALUES (127);
+INSERT INTO t2 VALUES (128);
+INSERT INTO t2 VALUES (129);
+INSERT INTO t2 VALUES (130);
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t2 WHERE a >= 100 ORDER BY a;
+a
+101
+102
+103
+104
+105
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging ***
+*** MDEV-7882: Excessive transaction retry in parallel replication ***
+CREATE TABLE t7 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t8 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=40;
+SELECT @old_retries:=@@GLOBAL.slave_transaction_retries;
+@old_retries:=@@GLOBAL.slave_transaction_retries
+10
+SET GLOBAL slave_transaction_retries= 5;
+INSERT INTO t7 VALUES (1,1), (2,2), (3,3), (4,4), (5,5);
+SET @old_dbug= @@SESSION.debug_dbug;
+SET @commit_id= 42;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+INSERT INTO t8 VALUES (1,1);
+INSERT INTO t8 VALUES (2,2);
+INSERT INTO t8 VALUES (3,3);
+INSERT INTO t8 VALUES (4,4);
+INSERT INTO t8 VALUES (5,5);
+INSERT INTO t8 VALUES (6,6);
+INSERT INTO t8 VALUES (7,7);
+INSERT INTO t8 VALUES (8,8);
+UPDATE t7 SET b=9 WHERE a=3;
+UPDATE t7 SET b=10 WHERE a=3;
+UPDATE t7 SET b=11 WHERE a=3;
+INSERT INTO t8 VALUES (12,12);
+INSERT INTO t8 VALUES (13,13);
+UPDATE t7 SET b=14 WHERE a=3;
+UPDATE t7 SET b=15 WHERE a=3;
+INSERT INTO t8 VALUES (16,16);
+UPDATE t7 SET b=17 WHERE a=3;
+INSERT INTO t8 VALUES (18,18);
+INSERT INTO t8 VALUES (19,19);
+UPDATE t7 SET b=20 WHERE a=3;
+INSERT INTO t8 VALUES (21,21);
+UPDATE t7 SET b=22 WHERE a=3;
+INSERT INTO t8 VALUES (23,24);
+INSERT INTO t8 VALUES (24,24);
+UPDATE t7 SET b=25 WHERE a=3;
+INSERT INTO t8 VALUES (26,26);
+UPDATE t7 SET b=27 WHERE a=3;
+BEGIN;
+INSERT INTO t8 VALUES (28,28);
+INSERT INTO t8 VALUES (29,28), (30,28);
+INSERT INTO t8 VALUES (31,28);
+INSERT INTO t8 VALUES (32,28);
+INSERT INTO t8 VALUES (33,28);
+INSERT INTO t8 VALUES (34,28);
+INSERT INTO t8 VALUES (35,28);
+INSERT INTO t8 VALUES (36,28);
+INSERT INTO t8 VALUES (37,28);
+INSERT INTO t8 VALUES (38,28);
+INSERT INTO t8 VALUES (39,28);
+INSERT INTO t8 VALUES (40,28);
+INSERT INTO t8 VALUES (41,28);
+INSERT INTO t8 VALUES (42,28);
+COMMIT;
+SET @commit_id=43;
+INSERT INTO t8 VALUES (43,43);
+INSERT INTO t8 VALUES (44,44);
+UPDATE t7 SET b=45 WHERE a=3;
+INSERT INTO t8 VALUES (46,46);
+INSERT INTO t8 VALUES (47,47);
+UPDATE t7 SET b=48 WHERE a=3;
+INSERT INTO t8 VALUES (49,49);
+INSERT INTO t8 VALUES (50,50);
+SET @commit_id=44;
+INSERT INTO t8 VALUES (51,51);
+INSERT INTO t8 VALUES (52,52);
+UPDATE t7 SET b=53 WHERE a=3;
+INSERT INTO t8 VALUES (54,54);
+INSERT INTO t8 VALUES (55,55);
+UPDATE t7 SET b=56 WHERE a=3;
+INSERT INTO t8 VALUES (57,57);
+UPDATE t7 SET b=58 WHERE a=3;
+INSERT INTO t8 VALUES (58,58);
+INSERT INTO t8 VALUES (59,59);
+INSERT INTO t8 VALUES (60,60);
+INSERT INTO t8 VALUES (61,61);
+UPDATE t7 SET b=62 WHERE a=3;
+INSERT INTO t8 VALUES (63,63);
+INSERT INTO t8 VALUES (64,64);
+INSERT INTO t8 VALUES (65,65);
+INSERT INTO t8 VALUES (66,66);
+UPDATE t7 SET b=67 WHERE a=3;
+INSERT INTO t8 VALUES (68,68);
+UPDATE t7 SET b=69 WHERE a=3;
+UPDATE t7 SET b=70 WHERE a=3;
+UPDATE t7 SET b=71 WHERE a=3;
+INSERT INTO t8 VALUES (72,72);
+UPDATE t7 SET b=73 WHERE a=3;
+UPDATE t7 SET b=74 WHERE a=3;
+UPDATE t7 SET b=75 WHERE a=3;
+UPDATE t7 SET b=76 WHERE a=3;
+INSERT INTO t8 VALUES (77,77);
+UPDATE t7 SET b=78 WHERE a=3;
+INSERT INTO t8 VALUES (79,79);
+UPDATE t7 SET b=80 WHERE a=3;
+INSERT INTO t8 VALUES (81,81);
+UPDATE t7 SET b=82 WHERE a=3;
+INSERT INTO t8 VALUES (83,83);
+UPDATE t7 SET b=84 WHERE a=3;
+SET @commit_id=45;
+INSERT INTO t8 VALUES (85,85);
+UPDATE t7 SET b=86 WHERE a=3;
+INSERT INTO t8 VALUES (87,87);
+SET @commit_id=46;
+INSERT INTO t8 VALUES (88,88);
+INSERT INTO t8 VALUES (89,89);
+INSERT INTO t8 VALUES (90,90);
+SET SESSION debug_dbug=@old_dbug;
+INSERT INTO t8 VALUES (91,91);
+INSERT INTO t8 VALUES (92,92);
+INSERT INTO t8 VALUES (93,93);
+INSERT INTO t8 VALUES (94,94);
+INSERT INTO t8 VALUES (95,95);
+INSERT INTO t8 VALUES (96,96);
+INSERT INTO t8 VALUES (97,97);
+INSERT INTO t8 VALUES (98,98);
+INSERT INTO t8 VALUES (99,99);
+SELECT * FROM t7 ORDER BY a;
+a b
+1 1
+2 2
+3 86
+4 4
+5 5
+SELECT * FROM t8 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+12 12
+13 13
+16 16
+18 18
+19 19
+21 21
+23 24
+24 24
+26 26
+28 28
+29 28
+30 28
+31 28
+32 28
+33 28
+34 28
+35 28
+36 28
+37 28
+38 28
+39 28
+40 28
+41 28
+42 28
+43 43
+44 44
+46 46
+47 47
+49 49
+50 50
+51 51
+52 52
+54 54
+55 55
+57 57
+58 58
+59 59
+60 60
+61 61
+63 63
+64 64
+65 65
+66 66
+68 68
+72 72
+77 77
+79 79
+81 81
+83 83
+85 85
+87 87
+88 88
+89 89
+90 90
+91 91
+92 92
+93 93
+94 94
+95 95
+96 96
+97 97
+98 98
+99 99
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t7 ORDER BY a;
+a b
+1 1
+2 2
+3 86
+4 4
+5 5
+SELECT * FROM t8 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+12 12
+13 13
+16 16
+18 18
+19 19
+21 21
+23 24
+24 24
+26 26
+28 28
+29 28
+30 28
+31 28
+32 28
+33 28
+34 28
+35 28
+36 28
+37 28
+38 28
+39 28
+40 28
+41 28
+42 28
+43 43
+44 44
+46 46
+47 47
+49 49
+50 50
+51 51
+52 52
+54 54
+55 55
+57 57
+58 58
+59 59
+60 60
+61 61
+63 63
+64 64
+65 65
+66 66
+68 68
+72 72
+77 77
+79 79
+81 81
+83 83
+85 85
+87 87
+88 88
+89 89
+90 90
+91 91
+92 92
+93 93
+94 94
+95 95
+96 96
+97 97
+98 98
+99 99
+include/stop_slave.inc
+SET GLOBAL slave_transaction_retries= @old_retries;
+SET GLOBAL slave_parallel_threads=10;
+include/start_slave.inc
+*** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET @commit_id= 10000;
+ANALYZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+INSERT INTO t3 VALUES (120, 0);
+SET @commit_id= 10001;
+INSERT INTO t3 VALUES (121, 0);
+SET SESSION debug_dbug=@old_dbug;
+SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
+a b
+120 0
+121 0
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
+a b
+120 0
+121 0
+include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+include/start_slave.inc
+*** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. ***
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET @old_server_id= @@SESSION.server_id;
+SET SESSION server_id= 100;
+SET @commit_id= 10010;
+ALTER TABLE t1 COMMENT "Hulubulu!";
+SET SESSION server_id= @old_server_id;
+INSERT INTO t3 VALUES (130, 0);
+SET @commit_id= 10011;
+INSERT INTO t3 VALUES (131, 0);
+SET SESSION debug_dbug=@old_dbug;
+SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
+a b
+130 0
+131 0
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
+a b
+130 0
+131 0
+include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+include/start_slave.inc
+*** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) ***
+INSERT INTO t3 VALUES (201,0), (202,0);
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_mdev8031';
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET @commit_id= 10200;
+INSERT INTO t3 VALUES (203, 1);
+INSERT INTO t3 VALUES (204, 1);
+INSERT INTO t3 VALUES (205, 1);
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=205;
+UPDATE t3 SET b=b+1 WHERE a=205;
+SET SESSION debug_dbug=@old_dbug;
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+a b
+201 3
+202 4
+203 4
+204 4
+205 3
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+a b
+201 3
+202 4
+203 4
+204 4
+205 3
+include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+include/start_slave.inc
+*** Check getting deadlock killed inside open_binlog() during retry. ***
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill';
+SET @old_max= @@GLOBAL.max_relay_log_size;
+SET GLOBAL max_relay_log_size= 4096;
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET @commit_id= 10210;
+Omit long queries that cause relaylog rotations and transaction retries...
+SET SESSION debug_dbug=@old_dbug;
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+a b
+201 6
+202 8
+203 7
+204 7
+205 5
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+a b
+201 6
+202 8
+203 7
+204 7
+205 5
+include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_debg;
+SET GLOBAL max_relay_log_size= @old_max;
+include/start_slave.inc
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
SET DEBUG_SYNC= 'RESET';
DROP function foo;
-DROP TABLE t1,t2,t3,t4,t5,t6;
+DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8;
SET DEBUG_SYNC= 'RESET';
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel2.result b/mysql-test/suite/rpl/r/rpl_parallel2.result
index 8bf8b9caf3b..de90bcd158f 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel2.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel2.result
@@ -12,6 +12,23 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc
include/wait_for_slave_param.inc [Seconds_Behind_Master]
Seconds_Behind_Master should be zero here because the slave is fully caught up and idle.
Seconds_Behind_Master = '0'
+*** MDEV-8294: Inconsistent behavior of slave parallel threads at runtime ***
+INSERT INTO t1 VALUES (10,0);
+SET sql_log_bin= 0;
+DELETE FROM t1 WHERE a=10;
+SET sql_log_bin= 1;
+INSERT INTO t1 VALUES (10,0);
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+a b
+10 0
+include/wait_for_slave_sql_error.inc [errno=1062]
+SET GLOBAL slave_parallel_threads=8;
+STOP SLAVE;
+SET GLOBAL sql_slave_skip_counter= 1;
+include/start_slave.inc
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+a b
+10 0
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result b/mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result
new file mode 100644
index 00000000000..d681fd7546d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result
@@ -0,0 +1,147 @@
+include/master-slave.inc
+[connection master]
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=current_pos;
+include/start_slave.inc
+*** MDEV-6589: Incorrect relay log start position when restarting SQL thread after error in parallel replication ***
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+SELECT * FROM t1;
+a
+1
+SELECT * FROM t2;
+a
+1
+SET sql_log_bin=0;
+BEGIN;
+INSERT INTO t2 VALUES (5);
+SET gtid_domain_id=0;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t2 VALUES (3);
+FLUSH LOGS;
+INSERT INTO t1 VALUES (4);
+SET gtid_domain_id=1;
+INSERT INTO t2 VALUES (5);
+SET gtid_domain_id=0;
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+SET gtid_domain_id=2;
+INSERT INTO t2 VALUES (8);
+INSERT INTO t1 VALUES (9);
+FLUSH LOGS;
+SET gtid_domain_id=3;
+INSERT INTO t2 VALUES (10);
+INSERT INTO t1 VALUES (11);
+SET gtid_domain_id=1;
+INSERT INTO t1 VALUES (12);
+INSERT INTO t2 VALUES (13);
+SET gtid_domain_id=0;
+INSERT INTO t2 VALUES (14);
+FLUSH LOGS;
+SET gtid_domain_id=3;
+INSERT INTO t2 VALUES (15);
+SET gtid_domain_id=2;
+INSERT INTO t2 VALUES (16);
+SET gtid_domain_id=0;
+INSERT INTO t1 VALUES (17);
+SET @gtid0 = @@last_gtid;
+SET gtid_domain_id=2;
+INSERT INTO t1 VALUES (18);
+SET @gtid2 = @@last_gtid;
+SET gtid_domain_id=3;
+INSERT INTO t1 VALUES (19);
+SET @gtid3 = @@last_gtid;
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+4
+6
+7
+9
+11
+12
+17
+18
+19
+SELECT * FROM t2 ORDER BY a;
+a
+1
+3
+5
+8
+10
+13
+14
+15
+16
+include/save_master_gtid.inc
+SELECT MASTER_GTID_WAIT('WAIT_POS');
+MASTER_GTID_WAIT('WAIT_POS')
+0
+COMMIT;
+SET sql_log_bin=1;
+include/wait_for_slave_sql_error.inc [errno=1062]
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+4
+6
+7
+9
+11
+17
+18
+19
+SELECT * FROM t2 ORDER BY a;
+a
+1
+3
+5
+8
+10
+14
+15
+16
+SET sql_log_bin=0;
+DELETE FROM t2 WHERE a=5;
+SET sql_log_bin=1;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+4
+6
+7
+9
+11
+12
+17
+18
+19
+SELECT * FROM t2 ORDER BY a;
+a
+1
+3
+5
+8
+10
+13
+14
+15
+16
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+include/start_slave.inc
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t1,t2;
+SET DEBUG_SYNC= 'RESET';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result b/mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result
new file mode 100644
index 00000000000..47bf2ff887f
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result
@@ -0,0 +1,52 @@
+include/rpl_init.inc [topology=1->2->3]
+*** MDEV-7668: Intermediate master groups CREATE with INSERT, causing parallel replication failure ***
+SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
+SET GLOBAL binlog_direct_non_transactional_updates=OFF;
+SET SESSION binlog_direct_non_transactional_updates=OFF;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+include/stop_slave.inc
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+SET GLOBAL slave_parallel_threads=10;
+SET @old_commit_count=@@GLOBAL.binlog_commit_wait_count;
+SET GLOBAL binlog_commit_wait_count=2;
+SET @old_commit_usec=@@GLOBAL.binlog_commit_wait_usec;
+SET GLOBAL binlog_commit_wait_usec=2000000;
+SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
+SET GLOBAL binlog_direct_non_transactional_updates=OFF;
+SET SESSION binlog_direct_non_transactional_updates=OFF;
+CHANGE MASTER TO master_use_gtid=current_pos;
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=current_pos;
+BEGIN;
+CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=MEMORY;
+COMMIT;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 SELECT a, a*10 FROM t2;
+DROP TABLE t2;
+include/save_master_gtid.inc
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 10
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 10
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+SET GLOBAL binlog_commit_wait_count=@old_commit_count;
+SET GLOBAL binlog_commit_wait_usec=@old_commit_usec;
+SET GLOBAL binlog_direct_non_transactional_updates= @old_updates;
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+include/start_slave.inc
+SET GLOBAL binlog_direct_non_transactional_updates= @old_updates;
+CALL mtr.add_suppression("Statement accesses nontransactional table as well as transactional or temporary table");
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_partition.result b/mysql-test/suite/rpl/r/rpl_parallel_partition.result
new file mode 100644
index 00000000000..e0cfe9882d2
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_parallel_partition.result
@@ -0,0 +1,42 @@
+include/master-slave.inc
+[connection master]
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,inject_wakeup_subsequent_commits_sleep";
+SET GLOBAL slave_parallel_threads=8;
+*** MDEV-8147: Assertion `m_lock_type == 2' failed in handler::ha_close() during parallel replication ***
+CREATE TABLE E (
+pk INTEGER AUTO_INCREMENT,
+col_int_nokey INTEGER /*! NULL */,
+col_int_key INTEGER /*! NULL */,
+col_date_key DATE /*! NULL */,
+col_date_nokey DATE /*! NULL */,
+col_time_key TIME /*! NULL */,
+col_time_nokey TIME /*! NULL */,
+col_datetime_key DATETIME /*! NULL */,
+col_datetime_nokey DATETIME /*! NULL */,
+col_varchar_key VARCHAR(1) /*! NULL */,
+col_varchar_nokey VARCHAR(1) /*! NULL */,
+PRIMARY KEY (pk),
+KEY (col_int_key),
+KEY (col_date_key),
+KEY (col_time_key),
+KEY (col_datetime_key),
+KEY (col_varchar_key, col_int_key)
+) ENGINE=InnoDB;
+ALTER TABLE `E` PARTITION BY KEY() PARTITIONS 5;
+ALTER TABLE `E` REMOVE PARTITIONING;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=8;
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+include/start_slave.inc
+DROP TABLE `E`;
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_temptable.result b/mysql-test/suite/rpl/r/rpl_parallel_temptable.result
index 61eba2cab2f..da2cf42f870 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_temptable.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_temptable.result
@@ -116,6 +116,26 @@ SHOW STATUS LIKE 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
FLUSH LOGS;
+*** MDEV-7936: Assertion `!table || table->in_use == _current_thd()' failed on parallel replication in optimistic mode ***
+CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB;
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET @commit_id= 10000;
+INSERT INTO t4 VALUES (30);
+INSERT INTO t4 VALUES (31);
+SET SESSION debug_dbug= @old_dbug;
+INSERT INTO t1 SELECT a, "conservative" FROM t4;
+DROP TEMPORARY TABLE t4;
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a b
+30 conservative
+31 conservative
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+a b
+30 conservative
+31 conservative
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result
index 7d9f7de8fa9..9aeef98d091 100644
--- a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result
@@ -52,6 +52,20 @@ a b
# - DELETE xt1, t2 FROM <...>
# - INSERT INTO t5(b) VALUES <...> (3 instances)
########################################################################
+# Ensure that a replication failure doesn't segfault - MDEV-7864
+########################################################################
+DELETE FROM t3 WHERE a=2;
+INSERT INTO t5 (a) SELECT a.a*10000+b.a*1000+c.a*100+d.a*10 FROM t5 a, t5 b, t5 c, t5 d;
+INSERT INTO t3 (a) SELECT a FROM t5 WHERE a > 10;
+DELETE t3 FROM t3 INNER JOIN t5 ON t3.a=t5.a;
+---- Wait until slave stops with an error ----
+include/wait_for_slave_sql_error.inc [errno=1032]
+Last_SQL_Error (expected "Delete_rows_v1 event on table test1.t3; Can't find record in 't3'" error)
+Could not execute Delete_rows_v1 event on table test1.t3; Can't find record in 't3', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log master-bin.000002, end_log_pos END_LOG_POS
+call mtr.add_suppression("Slave: Can't find record in 't3' Error_code: 1032");
+SET GLOBAL sql_slave_skip_counter=1;
+START SLAVE;
+########################################################################
FLUSH LOGS;
show binlog events in 'slave-bin.000001' from <start_pos>;
Log_name Pos Event_type Server_id End_log_pos Info
@@ -131,6 +145,30 @@ slave-bin.000001 # Annotate_rows 1 # INSERT INTO t5(b) VALUES ('gås')
slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
+slave-bin.000001 # Gtid 2 # BEGIN GTID 0-2-25
+slave-bin.000001 # Table_map 2 # table_id: # (test1.t3)
+slave-bin.000001 # Delete_rows_v1 2 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 2 # COMMIT
+slave-bin.000001 # Gtid 1 # BEGIN GTID 0-1-25
+slave-bin.000001 # Annotate_rows 1 # INSERT INTO t5 (a) SELECT a.a*10000+b.a*1000+c.a*100+d.a*10 FROM t5 a, t5 b, t5 c, t5 d
+slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 1 # COMMIT
+slave-bin.000001 # Gtid 1 # BEGIN GTID 0-1-26
+slave-bin.000001 # Annotate_rows 1 # INSERT INTO t3 (a) SELECT a FROM t5 WHERE a > 10
+slave-bin.000001 # Table_map 1 # table_id: # (test1.t3)
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 1 # COMMIT
+slave-bin.000001 # Gtid 2 # BEGIN GTID 0-2-27
+slave-bin.000001 # Table_map 2 # table_id: # (mtr.test_suppressions)
+slave-bin.000001 # Write_rows_v1 2 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 2 # COMMIT
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
#
########################################################################
diff --git a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result
index 36d906f54be..ceaf8c878c8 100644
--- a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result
+++ b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result
@@ -44,6 +44,20 @@ a b
# EVENTS ON SLAVE
# No Annotate_rows events should appear below
########################################################################
+# Ensure that a replication failure doesn't segfault - MDEV-7864
+########################################################################
+DELETE FROM t3 WHERE a=2;
+INSERT INTO t5 (a) SELECT a.a*10000+b.a*1000+c.a*100+d.a*10 FROM t5 a, t5 b, t5 c, t5 d;
+INSERT INTO t3 (a) SELECT a FROM t5 WHERE a > 10;
+DELETE t3 FROM t3 INNER JOIN t5 ON t3.a=t5.a;
+---- Wait until slave stops with an error ----
+include/wait_for_slave_sql_error.inc [errno=1032]
+Last_SQL_Error (expected "Delete_rows_v1 event on table test1.t3; Can't find record in 't3'" error)
+Could not execute Delete_rows_v1 event on table test1.t3; Can't find record in 't3', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log master-bin.000002, end_log_pos END_LOG_POS
+call mtr.add_suppression("Slave: Can't find record in 't3' Error_code: 1032");
+SET GLOBAL sql_slave_skip_counter=1;
+START SLAVE;
+########################################################################
FLUSH LOGS;
show binlog events in 'slave-bin.000001' from <start_pos>;
Log_name Pos Event_type Server_id End_log_pos Info
@@ -113,6 +127,28 @@ slave-bin.000001 # Gtid 1 # BEGIN GTID 0-1-24
slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
+slave-bin.000001 # Gtid 2 # BEGIN GTID 0-2-25
+slave-bin.000001 # Table_map 2 # table_id: # (test1.t3)
+slave-bin.000001 # Delete_rows_v1 2 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 2 # COMMIT
+slave-bin.000001 # Gtid 1 # BEGIN GTID 0-1-25
+slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 1 # COMMIT
+slave-bin.000001 # Gtid 1 # BEGIN GTID 0-1-26
+slave-bin.000001 # Table_map 1 # table_id: # (test1.t3)
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: #
+slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 1 # COMMIT
+slave-bin.000001 # Gtid 2 # BEGIN GTID 0-2-27
+slave-bin.000001 # Table_map 2 # table_id: # (mtr.test_suppressions)
+slave-bin.000001 # Write_rows_v1 2 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 2 # COMMIT
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
#
########################################################################
diff --git a/mysql-test/suite/rpl/r/rpl_special_charset.result b/mysql-test/suite/rpl/r/rpl_special_charset.result
new file mode 100644
index 00000000000..99b8d3a21d1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_special_charset.result
@@ -0,0 +1,8 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Cannot use utf16 as character_set_client");
+CREATE TABLE t1(i VARCHAR(20));
+INSERT INTO t1 VALUES (0xFFFF);
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temp_table.result b/mysql-test/suite/rpl/r/rpl_temp_table.result
index 504b0471748..08504ce175d 100644
--- a/mysql-test/suite/rpl/r/rpl_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table.result
@@ -39,7 +39,12 @@ sum(n)
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+*** MDEV-8016: Replication aborts on DROP /*!40005 TEMPORARY */ TABLE IF EXISTS ***
+INSERT INTO t2 VALUES (2000), (2001);
+CREATE FUNCTION f() RETURNS INTEGER RETURN 1;
+CREATE TEMPORARY TABLE t3 AS SELECT f() AS col FROM t2;
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 'test.t1'
+drop function f;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
index 550b3f596e5..0264c9421fc 100644
--- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
+++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
@@ -182,6 +182,11 @@ DROP USER test_3@localhost;
ERROR HY000: Table 'user' was not locked with LOCK TABLES
INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked");
UNLOCK TABLE;
+CREATE DATABASE db;
+CREATE TABLE db.t1 LIKE t2;
+CREATE TABLE t3 LIKE t2;
+DROP TABLE t3;
+DROP DATABASE db;
DROP USER test_3@localhost;
DROP FUNCTION f2;
DROP PROCEDURE p2;
diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
index ac6d9155f4b..c0e35274594 100644
--- a/mysql-test/suite/rpl/r/rpl_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
@@ -986,4 +986,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:log, slave:log]
drop table t1, log;
+drop trigger if exists notexistent;
+Warnings:
+Note 1360 Trigger does not exist
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; drop trigger if exists notexistent
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; drop trigger if exists notexistent
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/sec_behind_master-5114.result b/mysql-test/suite/rpl/r/sec_behind_master-5114.result
new file mode 100644
index 00000000000..5554b17347d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/sec_behind_master-5114.result
@@ -0,0 +1,10 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Unsafe statement written to the binary log");
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES(SLEEP(2));
+Seconds_Behind_Master: 1
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/semisync_future-7591.result b/mysql-test/suite/rpl/r/semisync_future-7591.result
new file mode 100644
index 00000000000..732ae09daaf
--- /dev/null
+++ b/mysql-test/suite/rpl/r/semisync_future-7591.result
@@ -0,0 +1,19 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Timeout waiting for reply of binlog*");
+create table t1 (i int);
+set global rpl_semi_sync_master_enabled = ON;
+include/stop_slave.inc
+set global rpl_semi_sync_slave_enabled = ON;
+change master to master_log_file='master-bin.000002', master_log_pos = 320;
+start slave;
+include/wait_for_slave_io_error.inc [errno=1236]
+insert into t1 values (1);
+reset master;
+include/stop_slave.inc
+reset slave;
+include/start_slave.inc
+set global rpl_semi_sync_slave_enabled = OFF;
+drop table t1;
+set global rpl_semi_sync_master_enabled = OFF;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
new file mode 100644
index 00000000000..c2a0498509b
--- /dev/null
+++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
@@ -0,0 +1,4 @@
+include/master-slave.inc
+[connection master]
+start slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_000011.test b/mysql-test/suite/rpl/t/rpl_000011.test
index faad2242235..216e568fc42 100644
--- a/mysql-test/suite/rpl/t/rpl_000011.test
+++ b/mysql-test/suite/rpl/t/rpl_000011.test
@@ -11,6 +11,12 @@ insert into t1 values(1);
sync_slave_with_master;
show global status like 'com_insert';
stop slave;
+# Temporary work-around for bug MDEV-8301. There is a small window during
+# thread exit where the local status values of a thread are counted twice
+# in the global status. Remove this wait_condition.inc once MDEV-8301 is
+# fixed.
+--let $wait_condition= SELECT variable_value=1 FROM information_schema.global_status WHERE variable_name="Com_insert";
+--source include/wait_condition.inc
show global status like 'com_insert';
--source include/wait_for_slave_to_stop.inc
start slave;
diff --git a/mysql-test/suite/rpl/t/rpl_drop_db_fail.test b/mysql-test/suite/rpl/t/rpl_drop_db_fail.test
new file mode 100644
index 00000000000..f4482064d7b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_drop_db_fail.test
@@ -0,0 +1,34 @@
+###############################################################################
+# Bug#20041860: SLAVE ERROR WHEN DROP DATABASE
+#
+# Test:
+# =====
+# Create two databases such that one database has a dependency over the other
+# database and try to drop the database which has a dependency. This should
+# not cause slave to break.
+###############################################################################
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+connection master;
+CREATE DATABASE IF NOT EXISTS db1;
+CREATE DATABASE IF NOT EXISTS db2;
+
+use db1;
+CREATE TABLE a(id INT);
+CREATE VIEW v AS SELECT * FROM a;
+CREATE TABLE table_father(id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20)) ENGINE=INNODB;
+--sync_slave_with_master
+
+connection master;
+use db2;
+CREATE TABLE table_child(id INT PRIMARY KEY, info VARCHAR(20), father_id INT) ENGINE=INNODB;
+ALTER TABLE table_child ADD CONSTRAINT aaa FOREIGN KEY (father_id) REFERENCES db1.table_father(id);
+
+--error ER_ROW_IS_REFERENCED
+DROP DATABASE db1;
+DROP DATABASE db2;
+--sync_slave_with_master
+--connection master
+DROP DATABASE db1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
index 19f90fce197..4c4a9063a0b 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
@@ -367,7 +367,7 @@ reap;
reap;
---echo *** Test sql_gtid_slave_pos when used with GTID ***
+--echo *** Test gtid_slave_pos when used with GTID ***
--connection server_2
--source include/stop_slave.inc
@@ -481,6 +481,55 @@ SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! ex
SET GLOBAL slave_ddl_exec_mode= @saved_mode;
+
+--echo *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
+
+# Create an out-of-order binlog on server 2.
+# Let server 3 replicate to an out-of-order point, stop it, restart it,
+# and check that it replicates correctly despite the out-of-order.
+
+--connection server_1
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (31);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (32);
+
+--connection server_1
+INSERT INTO t1 VALUES (33);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--save_master_pos
+
+--connection server_3
+--sync_with_master
+--source include/stop_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (34);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--save_master_pos
+
+--connection server_3
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+--save_master_pos
+
+--connection server_4
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+
+
+# Clean up.
--connection server_1
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test
index 90b4e454a74..df3ba9a3420 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test
@@ -587,6 +587,77 @@ eval SELECT IF(INSTR(@@gtid_current_pos, '$saved_gtid'), "Current pos ok", CONCA
SELECT * from t1 WHERE a > 10 ORDER BY a;
+--echo *** MDEV-6391: GTID binlog state not recovered if mariadb-bin.state is removed ***
+
+--connection server_2
+--source include/stop_slave.inc
+
+# Do some misc. transactions, stop the master, drop the master-bin.state file.
+# Start the master back up, check that binlog state is correct.
+
+--connection server_1
+
+INSERT INTO t1 VALUES (30);
+SET @old_server_id= @@server_id;
+SET @old_domain_id= @@gtid_domain_id;
+
+SET SESSION server_id= 10;
+INSERT INTO t1 VALUES (31);
+INSERT INTO t1 VALUES (32);
+SET SESSION gtid_domain_id= 1;
+SET SESSION server_id=11;
+INSERT INTO t1 VALUES (33);
+SET SESSION gtid_domain_id= 2;
+INSERT INTO t1 VALUES (34);
+SET SESSION server_id= 10;
+INSERT INTO t1 VALUES (35);
+INSERT INTO t1 VALUES (36);
+SET SESSION gtid_domain_id= 0;
+SET SESSION server_id= 12;
+INSERT INTO t1 VALUES (37);
+SET SESSION gtid_domain_id= @old_domain_id;
+SET SESSION server_id= @old_server_id;
+INSERT INTO t1 VALUES (38);
+INSERT INTO t1 VALUES (39);
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--let OLD_STATE= `SELECT @@gtid_binlog_state`
+
+--let $datadir= `SELECT @@datadir`
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait
+EOF
+shutdown_server 10;
+--source include/wait_until_disconnected.inc
+
+--remove_file $datadir/master-bin.state
+
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--let NEW_STATE= `SELECT @@gtid_binlog_state`
+
+--perl
+my $old= $ENV{'OLD_STATE'};
+my $new= $ENV{'NEW_STATE'};
+# Make them order-independent, for easy comparison.
+$old= join(",", sort(split(",", $old)));
+$new= join(",", sort(split(",", $new)));
+die "ERROR: new binlog state '$new' differs from old '$old'\n"
+ unless $old eq $new;
+EOF
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+
+
--connection server_1
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
index 31492b7c096..9739ba8bc43 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
@@ -230,7 +230,7 @@ CALL mtr.add_suppression("Slave: Could not update replication slave gtid state")
SET sql_log_bin=1;
---echo *** MDEV-4906: When event apply fails, next SQL thread start errorneously commits the failing GTID to gtid_slave_pos ***
+--echo *** MDEV-4906: When event apply fails, next SQL thread start erroneously commits the failing GTID to gtid_slave_pos ***
--connection slave
--source include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_misc.test b/mysql-test/suite/rpl/t/rpl_gtid_misc.test
new file mode 100644
index 00000000000..66d98ec8025
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_misc.test
@@ -0,0 +1,50 @@
+--source include/master-slave.inc
+
+--echo *** MDEV-6403: Temporary tables lost at STOP SLAVE in GTID mode if master has not rotated binlog since restart ***
+
+--connection master
+CREATE TABLE t1 (a INT PRIMARY KEY);
+--sync_slave_with_master
+
+--connection slave
+--source include/stop_slave.inc
+# Inject a duplicate key error that will make the slave stop in the middle of
+# a sequence of transactions that use a temporary table.
+SET sql_log_bin= 0;
+INSERT INTO t1 VALUES (1);
+SET sql_log_bin= 1;
+CHANGE MASTER TO master_use_gtid= current_pos;
+
+--connection master
+
+# Make some queries that use a temporary table.
+CREATE TEMPORARY TABLE t2 LIKE t1;
+INSERT INTO t2 VALUE (1);
+INSERT INTO t1 SELECT * FROM t2;
+DROP TEMPORARY TABLE t2;
+--save_master_pos
+
+--connection slave
+START SLAVE;
+--let $slave_sql_errno=1062
+--source include/wait_for_slave_sql_error.inc
+
+# Restart the slave.
+# The bug was that the IO thread would receive again the restart
+# format_description event at the start of the master's binlog, and this
+# event would cause the SQL thread to discard all active temporary tables.
+
+STOP SLAVE IO_THREAD;
+
+SET sql_log_bin= 0;
+DELETE FROM t1 WHERE a=1;
+SET sql_log_bin= 1;
+
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+
+--connection master
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_until.test b/mysql-test/suite/rpl/t/rpl_gtid_until.test
index 4dde7da38a5..20d4510ccc8 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_until.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_until.test
@@ -73,19 +73,29 @@ SELECT * FROM t1 ORDER BY a;
# Test showing the UNTIL condition in SHOW SLAVE STATUS.
--source include/stop_slave.inc
-START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200";
+START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200,0-1-300";
--source include/wait_for_slave_to_start.inc
--let $status_items= Using_Gtid,Until_Condition
--source include/show_slave_status.inc
# Clear the UNTIL condition.
+# Note that we need to wait for a transaction to get through from the master.
+# Otherwise the IO thread may still be in get_master_version_and_clock()
+# (wait_for_slave_to_start.inc returns as soon as the IO thread is connected),
+# and we can get test failures from warnings in the log about IO thread being
+# killed in the middle of setting @@gtid_strict_mode or similar (MDEV-7940).
+--connection server_1
+INSERT INTO t1 VALUES (3);
+DELETE FROM t1 WHERE a=3;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
--source include/stop_slave.inc
---source include/start_slave.inc
--echo *** Test UNTIL condition in an earlier binlog than the start GTID. ***
--connection server_2
---source include/stop_slave.inc
--connection server_1
SET gtid_domain_id = 1;
diff --git a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
index 25e27f62d0a..a3f3ff56464 100644
--- a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
+++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
@@ -25,5 +25,36 @@ echo "*** must be NULL ***";
select master_pos_wait('foo', 98);
# End of 4.1 tests
+
+
+--echo *** MDEV-7130: MASTER_POS_WAIT(log_name,log_pos,timeout,"connection_name") hangs, does not respect the timeout ***
+
+--connection slave
+--source include/stop_slave.inc
+reset slave all;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval change master 'my_slave' to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+set default_master_connection = 'my_slave';
+--source include/start_slave.inc
+
+--echo # Call without connection name -- works (expected -1)
+select master_pos_wait('master-bin.000001',1000000,1);
+
+set default_master_connection = '';
+
+--echo # Call for non-existing anonymous connection -- works (expected NULL)
+select master_pos_wait('master-bin.000001',1000000,1);
+
+--echo # Call with a valid connection name -- hangs before MDEV-7130 fix (expected -1)
+select master_pos_wait('master-bin.000001',1000000,1,"my_slave");
+
+STOP SLAVE 'my_slave';
+RESET SLAVE 'my_slave' ALL;
+
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval change master to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+
+# End of 10.0 tests
+
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_old_decimal.test b/mysql-test/suite/rpl/t/rpl_old_decimal.test
new file mode 100644
index 00000000000..79fd2754079
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_old_decimal.test
@@ -0,0 +1,25 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+
+--connection slave
+CREATE TABLE t1dec102 (a DECIMAL(10,2));
+
+--connection master
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
+--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD
+--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI
+INSERT INTO t1dec102 VALUES(999.99);
+
+--let $slave_sql_errno=1677
+--let $show_slave_sql_error= 1
+call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677");
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--connection master
+DROP TABLE t1dec102;
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test
index d4b99d4b0f7..feac32b1454 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel.test
@@ -12,9 +12,20 @@ SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=10;
--source include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
+
+# Check that we do not spawn any worker threads when no slave is running.
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+
CHANGE MASTER TO master_use_gtid=slave_pos;
--source include/start_slave.inc
+# Check that worker threads get spawned when slave starts.
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+# ... and that worker threads get removed when slave stops.
+--source include/stop_slave.inc
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+--source include/start_slave.inc
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
--echo *** Test long-running query in domain 1 can run in parallel with short queries in domain 0 ***
@@ -1843,6 +1854,467 @@ SET GLOBAL slave_parallel_threads=10;
--source include/start_slave.inc
+--echo *** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=1;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
+
+--connection server_1
+INSERT INTO t2 VALUES (101);
+INSERT INTO t2 VALUES (102);
+INSERT INTO t2 VALUES (103);
+INSERT INTO t2 VALUES (104);
+INSERT INTO t2 VALUES (105);
+# Inject a partial event group (missing XID at the end). The bug was that such
+# partial group was not handled appropriately, leading to server deadlock.
+SET gtid_seq_no=1000;
+INSERT INTO t2 VALUES (106);
+INSERT INTO t2 VALUES (107);
+INSERT INTO t2 VALUES (108);
+INSERT INTO t2 VALUES (109);
+INSERT INTO t2 VALUES (110);
+INSERT INTO t2 VALUES (111);
+INSERT INTO t2 VALUES (112);
+INSERT INTO t2 VALUES (113);
+INSERT INTO t2 VALUES (114);
+INSERT INTO t2 VALUES (115);
+INSERT INTO t2 VALUES (116);
+INSERT INTO t2 VALUES (117);
+INSERT INTO t2 VALUES (118);
+INSERT INTO t2 VALUES (119);
+INSERT INTO t2 VALUES (120);
+INSERT INTO t2 VALUES (121);
+INSERT INTO t2 VALUES (122);
+INSERT INTO t2 VALUES (123);
+INSERT INTO t2 VALUES (124);
+INSERT INTO t2 VALUES (125);
+INSERT INTO t2 VALUES (126);
+INSERT INTO t2 VALUES (127);
+INSERT INTO t2 VALUES (128);
+INSERT INTO t2 VALUES (129);
+INSERT INTO t2 VALUES (130);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+# The partial event group (a=106) should be rolled back and thus missing.
+SELECT * FROM t2 WHERE a >= 100 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging ***
+--echo *** MDEV-7882: Excessive transaction retry in parallel replication ***
+
+--connection server_1
+CREATE TABLE t7 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+CREATE TABLE t8 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=40;
+SELECT @old_retries:=@@GLOBAL.slave_transaction_retries;
+SET GLOBAL slave_transaction_retries= 5;
+
+
+# Using dbug error injection, we artificially create event groups with a lot of
+# conflicting transactions in each event group. The bugs were originally seen
+# "in the wild" with transactions that did not conflict on the master, and only
+# conflicted very rarely on the slave (maybe some edge case with InnoDB btree
+# page splits or something like that). The event groups here loosely reflect
+# the structure of the original failure's group commits.
+
+
+--connection server_1
+INSERT INTO t7 VALUES (1,1), (2,2), (3,3), (4,4), (5,5);
+SET @old_dbug= @@SESSION.debug_dbug;
+SET @commit_id= 42;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+INSERT INTO t8 VALUES (1,1);
+INSERT INTO t8 VALUES (2,2);
+INSERT INTO t8 VALUES (3,3);
+INSERT INTO t8 VALUES (4,4);
+INSERT INTO t8 VALUES (5,5);
+INSERT INTO t8 VALUES (6,6);
+INSERT INTO t8 VALUES (7,7);
+INSERT INTO t8 VALUES (8,8);
+
+UPDATE t7 SET b=9 WHERE a=3;
+UPDATE t7 SET b=10 WHERE a=3;
+UPDATE t7 SET b=11 WHERE a=3;
+
+INSERT INTO t8 VALUES (12,12);
+INSERT INTO t8 VALUES (13,13);
+
+UPDATE t7 SET b=14 WHERE a=3;
+UPDATE t7 SET b=15 WHERE a=3;
+
+INSERT INTO t8 VALUES (16,16);
+
+UPDATE t7 SET b=17 WHERE a=3;
+
+INSERT INTO t8 VALUES (18,18);
+INSERT INTO t8 VALUES (19,19);
+
+UPDATE t7 SET b=20 WHERE a=3;
+
+INSERT INTO t8 VALUES (21,21);
+
+UPDATE t7 SET b=22 WHERE a=3;
+
+INSERT INTO t8 VALUES (23,24);
+INSERT INTO t8 VALUES (24,24);
+
+UPDATE t7 SET b=25 WHERE a=3;
+
+INSERT INTO t8 VALUES (26,26);
+
+UPDATE t7 SET b=27 WHERE a=3;
+
+BEGIN;
+INSERT INTO t8 VALUES (28,28);
+INSERT INTO t8 VALUES (29,28), (30,28);
+INSERT INTO t8 VALUES (31,28);
+INSERT INTO t8 VALUES (32,28);
+INSERT INTO t8 VALUES (33,28);
+INSERT INTO t8 VALUES (34,28);
+INSERT INTO t8 VALUES (35,28);
+INSERT INTO t8 VALUES (36,28);
+INSERT INTO t8 VALUES (37,28);
+INSERT INTO t8 VALUES (38,28);
+INSERT INTO t8 VALUES (39,28);
+INSERT INTO t8 VALUES (40,28);
+INSERT INTO t8 VALUES (41,28);
+INSERT INTO t8 VALUES (42,28);
+COMMIT;
+
+
+SET @commit_id=43;
+INSERT INTO t8 VALUES (43,43);
+INSERT INTO t8 VALUES (44,44);
+
+UPDATE t7 SET b=45 WHERE a=3;
+
+INSERT INTO t8 VALUES (46,46);
+INSERT INTO t8 VALUES (47,47);
+
+UPDATE t7 SET b=48 WHERE a=3;
+
+INSERT INTO t8 VALUES (49,49);
+INSERT INTO t8 VALUES (50,50);
+
+
+SET @commit_id=44;
+INSERT INTO t8 VALUES (51,51);
+INSERT INTO t8 VALUES (52,52);
+
+UPDATE t7 SET b=53 WHERE a=3;
+
+INSERT INTO t8 VALUES (54,54);
+INSERT INTO t8 VALUES (55,55);
+
+UPDATE t7 SET b=56 WHERE a=3;
+
+INSERT INTO t8 VALUES (57,57);
+
+UPDATE t7 SET b=58 WHERE a=3;
+
+INSERT INTO t8 VALUES (58,58);
+INSERT INTO t8 VALUES (59,59);
+INSERT INTO t8 VALUES (60,60);
+INSERT INTO t8 VALUES (61,61);
+
+UPDATE t7 SET b=62 WHERE a=3;
+
+INSERT INTO t8 VALUES (63,63);
+INSERT INTO t8 VALUES (64,64);
+INSERT INTO t8 VALUES (65,65);
+INSERT INTO t8 VALUES (66,66);
+
+UPDATE t7 SET b=67 WHERE a=3;
+
+INSERT INTO t8 VALUES (68,68);
+
+UPDATE t7 SET b=69 WHERE a=3;
+UPDATE t7 SET b=70 WHERE a=3;
+UPDATE t7 SET b=71 WHERE a=3;
+
+INSERT INTO t8 VALUES (72,72);
+
+UPDATE t7 SET b=73 WHERE a=3;
+UPDATE t7 SET b=74 WHERE a=3;
+UPDATE t7 SET b=75 WHERE a=3;
+UPDATE t7 SET b=76 WHERE a=3;
+
+INSERT INTO t8 VALUES (77,77);
+
+UPDATE t7 SET b=78 WHERE a=3;
+
+INSERT INTO t8 VALUES (79,79);
+
+UPDATE t7 SET b=80 WHERE a=3;
+
+INSERT INTO t8 VALUES (81,81);
+
+UPDATE t7 SET b=82 WHERE a=3;
+
+INSERT INTO t8 VALUES (83,83);
+
+UPDATE t7 SET b=84 WHERE a=3;
+
+
+SET @commit_id=45;
+INSERT INTO t8 VALUES (85,85);
+UPDATE t7 SET b=86 WHERE a=3;
+INSERT INTO t8 VALUES (87,87);
+
+
+SET @commit_id=46;
+INSERT INTO t8 VALUES (88,88);
+INSERT INTO t8 VALUES (89,89);
+INSERT INTO t8 VALUES (90,90);
+
+SET SESSION debug_dbug=@old_dbug;
+
+INSERT INTO t8 VALUES (91,91);
+INSERT INTO t8 VALUES (92,92);
+INSERT INTO t8 VALUES (93,93);
+INSERT INTO t8 VALUES (94,94);
+INSERT INTO t8 VALUES (95,95);
+INSERT INTO t8 VALUES (96,96);
+INSERT INTO t8 VALUES (97,97);
+INSERT INTO t8 VALUES (98,98);
+INSERT INTO t8 VALUES (99,99);
+
+
+SELECT * FROM t7 ORDER BY a;
+SELECT * FROM t8 ORDER BY a;
+--source include/save_master_gtid.inc
+
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t7 ORDER BY a;
+SELECT * FROM t8 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL slave_transaction_retries= @old_retries;
+SET GLOBAL slave_parallel_threads=10;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
+
+--connection server_1
+# Inject two group commits. The bug was that ANALYZE TABLE would call
+# wakeup_subsequent_commits() too early, allowing the following transaction
+# in the same group to run ahead and binlog and free the GCO. Then we get
+# wrong binlog order and later access freed GCO, which causes lost wakeup
+# of following GCO and thus replication hang.
+# We injected a small sleep in ANALYZE to make the race easier to hit (this
+# can only cause false negatives in versions with the bug, not false positives,
+# so sleep is ok here. And it's in general not possible to trigger reliably
+# the race with debug_sync, since the bugfix makes the race impossible).
+
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+# Group commit with cid=10000, two event groups.
+SET @commit_id= 10000;
+ANALYZE TABLE t2;
+INSERT INTO t3 VALUES (120, 0);
+
+# Group commit with cid=10001, one event group.
+SET @commit_id= 10001;
+INSERT INTO t3 VALUES (121, 0);
+
+SET SESSION debug_dbug=@old_dbug;
+
+SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
+
+--connection server_1
+# Inject two group commits. The bug was that record_gtid for a
+# non-transactional event group would commit its own transaction, which would
+# cause ha_commit_trans() to call wakeup_subsequent_commits() too early. This
+# in turn lead to access to freed group_commit_orderer object, losing a wakeup
+# and causing slave threads to hang.
+# We inject a small sleep in the corresponding record_gtid() to make the race
+# easier to hit.
+
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+# Group commit with cid=10010, two event groups.
+SET @old_server_id= @@SESSION.server_id;
+SET SESSION server_id= 100;
+SET @commit_id= 10010;
+ALTER TABLE t1 COMMENT "Hulubulu!";
+SET SESSION server_id= @old_server_id;
+INSERT INTO t3 VALUES (130, 0);
+
+# Group commit with cid=10011, one event group.
+SET @commit_id= 10011;
+INSERT INTO t3 VALUES (131, 0);
+
+SET SESSION debug_dbug=@old_dbug;
+
+SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
+
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) ***
+
+--connection server_1
+INSERT INTO t3 VALUES (201,0), (202,0);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_mdev8031';
+
+--connection server_1
+# We artificially create a situation that hopefully resembles the original
+# bug which was only seen "in the wild", and only once.
+# Setup a fake group commit with lots of conflicts that will lead to deadloc
+# kill. The slave DBUG injection causes the slave to be deadlock killed at
+# a particular point during the retry, and then later do a small sleep at
+# another critical point where the prior transaction then has a chance to
+# complete. Finally an extra KILL check catches an unhandled, lingering
+# deadlock kill. So rather artificial, but at least it exercises the
+# relevant code paths.
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+SET @commit_id= 10200;
+INSERT INTO t3 VALUES (203, 1);
+INSERT INTO t3 VALUES (204, 1);
+INSERT INTO t3 VALUES (205, 1);
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=201;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=202;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=204;
+UPDATE t3 SET b=b+1 WHERE a=203;
+UPDATE t3 SET b=b+1 WHERE a=205;
+UPDATE t3 SET b=b+1 WHERE a=205;
+SET SESSION debug_dbug=@old_dbug;
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_dbug;
+--source include/start_slave.inc
+
+
+--echo *** Check getting deadlock killed inside open_binlog() during retry. ***
+
+--connection server_2
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill';
+SET @old_max= @@GLOBAL.max_relay_log_size;
+SET GLOBAL max_relay_log_size= 4096;
+
+--connection server_1
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+
+--let $large= `SELECT REPEAT("*", 8192)`
+SET @commit_id= 10210;
+--echo Omit long queries that cause relaylog rotations and transaction retries...
+--disable_query_log
+eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */;
+eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */;
+--enable_query_log
+SET SESSION debug_dbug=@old_dbug;
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t3 WHERE a>=200 ORDER BY a;
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug= @old_debg;
+SET GLOBAL max_relay_log_size= @old_max;
+--source include/start_slave.inc
+
+
+
# Clean up.
--connection server_2
--source include/stop_slave.inc
@@ -1852,7 +2324,7 @@ SET DEBUG_SYNC= 'RESET';
--connection server_1
DROP function foo;
-DROP TABLE t1,t2,t3,t4,t5,t6;
+DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8;
SET DEBUG_SYNC= 'RESET';
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel2.test b/mysql-test/suite/rpl/t/rpl_parallel2.test
index 51c9e39a26a..47b0e87a6b6 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel2.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel2.test
@@ -37,6 +37,48 @@ INSERT INTO t1 VALUES (1,sleep(2));
--source include/show_slave_status.inc
+--echo *** MDEV-8294: Inconsistent behavior of slave parallel threads at runtime ***
+
+--connection server_1
+INSERT INTO t1 VALUES (10,0);
+# Force a duplicate key error on the slave.
+SET sql_log_bin= 0;
+DELETE FROM t1 WHERE a=10;
+SET sql_log_bin= 1;
+INSERT INTO t1 VALUES (10,0);
+--save_master_pos
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+
+--connection server_2
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+# At this point, the worker threads should have stopped also.
+--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.processlist WHERE User = "system user" AND State = "Waiting for work from SQL thread";
+--source include/wait_condition.inc
+
+# Check that the pool can still be resized, but remains inactive as no slave
+# SQL thread is running.
+SET GLOBAL slave_parallel_threads=8;
+--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.processlist WHERE User = "system user" AND State = "Waiting for work from SQL thread";
+--source include/wait_condition.inc
+
+STOP SLAVE;
+# At this point, the worker threads should have stopped.
+--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.processlist WHERE User = "system user" AND State = "Waiting for work from SQL thread";
+--source include/wait_condition.inc
+
+
+SET GLOBAL sql_slave_skip_counter= 1;
+--source include/start_slave.inc
+# At this point, the worker threads should have been spawned.
+--let $wait_condition= SELECT COUNT(*)=8 FROM information_schema.processlist WHERE User = "system user" AND State = "Waiting for work from SQL thread";
+--source include/wait_condition.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+
+
+# Clean up
--connection server_2
--source include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_mdev6589.test b/mysql-test/suite/rpl/t/rpl_parallel_mdev6589.test
new file mode 100644
index 00000000000..5929fad71df
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_mdev6589.test
@@ -0,0 +1,132 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/master-slave.inc
+
+--connection server_2
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=current_pos;
+--source include/start_slave.inc
+
+
+--echo *** MDEV-6589: Incorrect relay log start position when restarting SQL thread after error in parallel replication ***
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+# Block one domain, which we will later cause to give an error. And let some
+# other domains proceed so we can check that after restart, the slave is able
+# to correctly restart each domain in a separate position.
+
+--connect (con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+SET sql_log_bin=0;
+BEGIN;
+INSERT INTO t2 VALUES (5);
+
+--connection server_1
+SET gtid_domain_id=0;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t2 VALUES (3);
+FLUSH LOGS;
+INSERT INTO t1 VALUES (4);
+
+SET gtid_domain_id=1;
+# This query will be blocked on the slave, and later give a duplicate key error.
+INSERT INTO t2 VALUES (5);
+
+SET gtid_domain_id=0;
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+
+SET gtid_domain_id=2;
+INSERT INTO t2 VALUES (8);
+INSERT INTO t1 VALUES (9);
+FLUSH LOGS;
+
+SET gtid_domain_id=3;
+INSERT INTO t2 VALUES (10);
+INSERT INTO t1 VALUES (11);
+
+# These cannot be replicated before the error, as a prior commit is blocked.
+SET gtid_domain_id=1;
+INSERT INTO t1 VALUES (12);
+INSERT INTO t2 VALUES (13);
+
+SET gtid_domain_id=0;
+INSERT INTO t2 VALUES (14);
+FLUSH LOGS;
+
+SET gtid_domain_id=3;
+INSERT INTO t2 VALUES (15);
+
+SET gtid_domain_id=2;
+INSERT INTO t2 VALUES (16);
+
+SET gtid_domain_id=0;
+INSERT INTO t1 VALUES (17);
+SET @gtid0 = @@last_gtid;
+SET gtid_domain_id=2;
+INSERT INTO t1 VALUES (18);
+SET @gtid2 = @@last_gtid;
+SET gtid_domain_id=3;
+INSERT INTO t1 VALUES (19);
+SET @gtid3 = @@last_gtid;
+--let $wait_pos= `SELECT CONCAT(@gtid0, ",", @gtid2, ",", @gtid3)`
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+--source include/save_master_gtid.inc
+
+
+--connection server_2
+# First wait for domains 0, 2, and 3 to complete.
+--replace_result $wait_pos WAIT_POS
+eval SELECT MASTER_GTID_WAIT('$wait_pos');
+
+# Then release the row lock, and wait for the domain 1 to fail with
+# duplicate key error.
+--connection con_temp1
+COMMIT;
+SET sql_log_bin=1;
+
+--connection server_2
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+SET sql_log_bin=0;
+DELETE FROM t2 WHERE a=5;
+SET sql_log_bin=1;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+
+# Clean up.
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+--source include/start_slave.inc
+SET DEBUG_SYNC= 'RESET';
+
+--connection server_1
+DROP TABLE t1,t2;
+SET DEBUG_SYNC= 'RESET';
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.cnf b/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.cnf
new file mode 100644
index 00000000000..4e1d3878f03
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.cnf
@@ -0,0 +1,17 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-slave-updates
+loose-innodb
+
+[mysqld.2]
+log-slave-updates
+loose-innodb
+
+[mysqld.3]
+log-slave-updates
+loose-innodb
+
+[ENV]
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.test b/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.test
new file mode 100644
index 00000000000..4125394ef80
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.test
@@ -0,0 +1,80 @@
+--source include/have_innodb.inc
+--let $rpl_topology=1->2->3
+--source include/rpl_init.inc
+
+--echo *** MDEV-7668: Intermediate master groups CREATE with INSERT, causing parallel replication failure ***
+
+--connection server_1
+SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
+SET GLOBAL binlog_direct_non_transactional_updates=OFF;
+SET SESSION binlog_direct_non_transactional_updates=OFF;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--save_master_pos
+--source include/stop_slave.inc
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+SET GLOBAL slave_parallel_threads=10;
+SET @old_commit_count=@@GLOBAL.binlog_commit_wait_count;
+SET GLOBAL binlog_commit_wait_count=2;
+SET @old_commit_usec=@@GLOBAL.binlog_commit_wait_usec;
+SET GLOBAL binlog_commit_wait_usec=2000000;
+SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
+SET GLOBAL binlog_direct_non_transactional_updates=OFF;
+SET SESSION binlog_direct_non_transactional_updates=OFF;
+CHANGE MASTER TO master_use_gtid=current_pos;
+
+--connection server_3
+--sync_with_master
+--save_master_pos
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+CHANGE MASTER TO master_use_gtid=current_pos;
+
+
+--connection server_1
+
+BEGIN;
+CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=MEMORY;
+COMMIT;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 SELECT a, a*10 FROM t2;
+DROP TABLE t2;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+
+--connection server_3
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 ORDER BY a;
+
+
+# Clean up
+
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+SET GLOBAL binlog_commit_wait_count=@old_commit_count;
+SET GLOBAL binlog_commit_wait_usec=@old_commit_usec;
+SET GLOBAL binlog_direct_non_transactional_updates= @old_updates;
+--source include/start_slave.inc
+
+--connection server_3
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+--source include/start_slave.inc
+
+--connection server_1
+SET GLOBAL binlog_direct_non_transactional_updates= @old_updates;
+CALL mtr.add_suppression("Statement accesses nontransactional table as well as transactional or temporary table");
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_partition.test b/mysql-test/suite/rpl/t/rpl_parallel_partition.test
new file mode 100644
index 00000000000..37dce9fef80
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_partition.test
@@ -0,0 +1,81 @@
+--source include/have_partition.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+--connection server_2
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,inject_wakeup_subsequent_commits_sleep";
+SET GLOBAL slave_parallel_threads=8;
+
+--echo *** MDEV-8147: Assertion `m_lock_type == 2' failed in handler::ha_close() during parallel replication ***
+--connection server_1
+CREATE TABLE E (
+ pk INTEGER AUTO_INCREMENT,
+ col_int_nokey INTEGER /*! NULL */,
+ col_int_key INTEGER /*! NULL */,
+
+ col_date_key DATE /*! NULL */,
+ col_date_nokey DATE /*! NULL */,
+
+ col_time_key TIME /*! NULL */,
+ col_time_nokey TIME /*! NULL */,
+
+ col_datetime_key DATETIME /*! NULL */,
+ col_datetime_nokey DATETIME /*! NULL */,
+
+ col_varchar_key VARCHAR(1) /*! NULL */,
+ col_varchar_nokey VARCHAR(1) /*! NULL */,
+
+ PRIMARY KEY (pk),
+ KEY (col_int_key),
+ KEY (col_date_key),
+ KEY (col_time_key),
+ KEY (col_datetime_key),
+ KEY (col_varchar_key, col_int_key)
+ ) ENGINE=InnoDB;
+
+ALTER TABLE `E` PARTITION BY KEY() PARTITIONS 5;
+ALTER TABLE `E` REMOVE PARTITIONING;
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait
+EOF
+--shutdown_server 30
+--source include/wait_until_disconnected.inc
+--connection default
+--source include/wait_until_disconnected.inc
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart:
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--connection server_1
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+CREATE TABLE t1 (a INT PRIMARY KEY);
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+
+# Re-spawn worker threads to clear dbug injection.
+--source include/stop_slave.inc
+SET GLOBAL debug_dbug=@old_dbug;
+SET GLOBAL slave_parallel_threads=0;
+SET GLOBAL slave_parallel_threads=8;
+--source include/start_slave.inc
+
+
+# Clean up.
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+--source include/start_slave.inc
+
+--connection server_1
+DROP TABLE `E`;
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_temptable.test b/mysql-test/suite/rpl/t/rpl_parallel_temptable.test
index b13fa5a01b1..feae29e7a9e 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_temptable.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_temptable.test
@@ -213,6 +213,29 @@ SHOW STATUS LIKE 'Slave_open_temp_tables';
FLUSH LOGS;
+--echo *** MDEV-7936: Assertion `!table || table->in_use == _current_thd()' failed on parallel replication in optimistic mode ***
+
+--connection server_1
+CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB;
+SET @old_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,binlog_force_commit_id";
+SET @commit_id= 10000;
+INSERT INTO t4 VALUES (30);
+INSERT INTO t4 VALUES (31);
+SET SESSION debug_dbug= @old_dbug;
+INSERT INTO t1 SELECT a, "conservative" FROM t4;
+DROP TEMPORARY TABLE t4;
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+
+
+# Clean up.
+
--connection server_2
--source include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.opt b/mysql-test/suite/rpl/t/rpl_special_charset.opt
new file mode 100644
index 00000000000..b071fb20845
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_special_charset.opt
@@ -0,0 +1 @@
+--character-set-server=utf16
diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.test b/mysql-test/suite/rpl/t/rpl_special_charset.test
new file mode 100644
index 00000000000..8ccb1b4183f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_special_charset.test
@@ -0,0 +1,26 @@
+################################################################################
+# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS
+# Problem: IO thread fails to connect to master if servers are configured with
+# special character sets like utf16, utf32, ucs2.
+#
+# Analysis: MySQL server does not support few special character sets like
+# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2).
+# When IO thread is trying to connect to Master, it sets server's character
+# set as client's character set. When Slave server is started with these
+# special character sets, IO thread (a connection to Master) fails because
+# of the above said reason.
+#
+# Fix: If server's character set is not supported as client's character set,
+# then set default's client character set(latin1) as client's character set.
+###############################################################################
+--source include/master-slave.inc
+call mtr.add_suppression("Cannot use utf16 as character_set_client");
+CREATE TABLE t1(i VARCHAR(20));
+INSERT INTO t1 VALUES (0xFFFF);
+--sync_slave_with_master
+--let diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+# Cleanup
+--connection master
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_temp_table.test b/mysql-test/suite/rpl/t/rpl_temp_table.test
index 92f8cef9c10..8b3af5d51cd 100644
--- a/mysql-test/suite/rpl/t/rpl_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table.test
@@ -57,12 +57,28 @@ select count(*) from t2;
select sum(n) from t2;
show status like 'Slave_open_temp_tables';
+--echo *** MDEV-8016: Replication aborts on DROP /*!40005 TEMPORARY */ TABLE IF EXISTS ***
+connect (master2,localhost,root,,);
+INSERT INTO t2 VALUES (2000), (2001);
+CREATE FUNCTION f() RETURNS INTEGER RETURN 1;
+CREATE TEMPORARY TABLE t3 AS SELECT f() AS col FROM t2;
+--let $gtid=`SELECT @@gtid_binlog_pos`
+--disconnect master2
+--connection default
+# Wait for implicit DROP TEMPORARY TABLE tmp to be binlogged.
+--let $wait_condition= SELECT @@gtid_binlog_pos != '$gtid'
+--source include/wait_condition.inc
+
+--sync_slave_with_master
+
+
#
# Clean up
#
connect (master2,localhost,root,,);
connection master2;
drop table if exists t1,t2;
+drop function f;
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
index e9cc098857e..bc4119f332f 100644
--- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
+++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
@@ -150,6 +150,16 @@ DROP USER test_3@localhost;
INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked");
UNLOCK TABLE;
+
+# Bug #20439913 CREATE TABLE DB.TABLE LIKE TMPTABLE IS
+# BINLOGGED INCORRECTLY - BREAKS A SLAVE
+CREATE DATABASE db;
+CREATE TABLE db.t1 LIKE t2;
+CREATE TABLE t3 LIKE t2;
+DROP TABLE t3;
+DROP DATABASE db;
+# end of Bug #20439913 test
+
DROP USER test_3@localhost;
DROP FUNCTION f2;
DROP PROCEDURE p2;
diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test
index 723fa3e44e2..e062e821a25 100644
--- a/mysql-test/suite/rpl/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
@@ -533,6 +533,19 @@ drop table t1, log;
sync_slave_with_master;
#
+# MDEV-6769 DROP TRIGGER IF NOT EXIST binlogged on master but not on slave
+#
+let $slave_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+connection master;
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+drop trigger if exists notexistent;
+source include/show_binlog_events.inc;
+sync_slave_with_master;
+let $binlog_start= $slave_pos;
+source include/show_binlog_events.inc;
+connection master;
+
+#
# End of tests
#
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/sec_behind_master-5114.test b/mysql-test/suite/rpl/t/sec_behind_master-5114.test
new file mode 100644
index 00000000000..8c70da4f0a8
--- /dev/null
+++ b/mysql-test/suite/rpl/t/sec_behind_master-5114.test
@@ -0,0 +1,27 @@
+source include/master-slave.inc;
+source include/have_binlog_format_statement.inc;
+
+call mtr.add_suppression("Unsafe statement written to the binary log");
+
+CREATE TABLE t1 (a int);
+send INSERT INTO t1 VALUES(SLEEP(2));
+
+connection slave;
+let $run = 10;
+while ($run)
+{
+ dec $run;
+ let $sbm=query_get_value(SHOW SLAVE STATUS, Seconds_Behind_Master, 1);
+ # for debugging uncomment echo and remove the if()
+ #echo Seconds_Behind_Master: $sbm;
+ if ($sbm)
+ {
+ let $run = 0;
+ }
+ sleep 0.5;
+}
+echo Seconds_Behind_Master: $sbm;
+connection master;
+reap;
+drop table t1;
+source include/rpl_end.inc;
diff --git a/mysql-test/suite/rpl/t/semisync_future-7591.test b/mysql-test/suite/rpl/t/semisync_future-7591.test
new file mode 100644
index 00000000000..772a36b5632
--- /dev/null
+++ b/mysql-test/suite/rpl/t/semisync_future-7591.test
@@ -0,0 +1,31 @@
+--source include/have_semisync.inc
+--source include/master-slave.inc
+
+call mtr.add_suppression("Timeout waiting for reply of binlog*");
+create table t1 (i int);
+
+set global rpl_semi_sync_master_enabled = ON;
+
+--connection slave
+--source include/stop_slave.inc
+set global rpl_semi_sync_slave_enabled = ON;
+change master to master_log_file='master-bin.000002', master_log_pos = 320;
+
+start slave;
+--let $slave_io_errno=1236
+--source include/wait_for_slave_io_error.inc
+
+--connection master
+insert into t1 values (1);
+reset master;
+
+--connection slave
+--source include/stop_slave.inc
+reset slave;
+--source include/start_slave.inc
+
+set global rpl_semi_sync_slave_enabled = OFF;
+--connection master
+drop table t1;
+set global rpl_semi_sync_master_enabled = OFF;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test
new file mode 100644
index 00000000000..38759c9b16a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test
@@ -0,0 +1,19 @@
+#
+# MDEV-7126 replication slave - deadlock in terminate_slave_thread with stop slave and show variables of replication filters and show global status
+#
+--source include/master-slave.inc
+
+--connection slave
+
+# If everything is okay, the test will end in several seconds; maybe a minute.
+# If the problem shows up, it will hang until testcase timeout is exceeded.
+--exec $MYSQL_SLAP --silent --socket=$SLAVE_MYSOCK -q "START SLAVE; STOP SLAVE; SHOW GLOBAL STATUS" -c 2 --number-of-queries=100 --create-schema=test
+
+# All done.
+
+--connection slave
+start slave;
+
+--connection master
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/stress/t/ddl_archive.test b/mysql-test/suite/stress/t/ddl_archive.test
index 0c47b5fcdd5..c688ae192d0 100644
--- a/mysql-test/suite/stress/t/ddl_archive.test
+++ b/mysql-test/suite/stress/t/ddl_archive.test
@@ -12,11 +12,8 @@
--source include/have_archive.inc
let $engine_type= ARCHIVE;
+--source include/no_protocol.inc
-if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
-{
- --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
-}
let $run= `SELECT '$BIG_TEST' = '1'`;
if ($run)
{
diff --git a/mysql-test/suite/stress/t/ddl_csv.test b/mysql-test/suite/stress/t/ddl_csv.test
index 9f6185c76be..3e0f8acb1d8 100644
--- a/mysql-test/suite/stress/t/ddl_csv.test
+++ b/mysql-test/suite/stress/t/ddl_csv.test
@@ -12,11 +12,8 @@
--source include/have_csv.inc
let $engine_type= CSV;
+--source include/no_protocol.inc
-if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
-{
- --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
-}
let $run= `SELECT '$BIG_TEST' = '1'`;
if ($run)
{
diff --git a/mysql-test/suite/stress/t/ddl_innodb.test b/mysql-test/suite/stress/t/ddl_innodb.test
index 784ba8ff003..083ec43e7d7 100644
--- a/mysql-test/suite/stress/t/ddl_innodb.test
+++ b/mysql-test/suite/stress/t/ddl_innodb.test
@@ -12,11 +12,8 @@
--source include/have_innodb.inc
let $engine_type= InnoDB;
+--source include/no_protocol.inc
-if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
-{
- --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
-}
let $run= `SELECT '$BIG_TEST' = '1'`;
if ($run)
{
diff --git a/mysql-test/suite/stress/t/ddl_memory.test b/mysql-test/suite/stress/t/ddl_memory.test
index 5178439bff1..bcca77a74d9 100644
--- a/mysql-test/suite/stress/t/ddl_memory.test
+++ b/mysql-test/suite/stress/t/ddl_memory.test
@@ -11,11 +11,8 @@
# Storage engine to be used in CREATE TABLE
let $engine_type= MEMORY;
+--source include/no_protocol.inc
-if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
-{
- --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
-}
let $run= `SELECT '$BIG_TEST' = '1'`;
if ($run)
{
diff --git a/mysql-test/suite/stress/t/ddl_myisam.test b/mysql-test/suite/stress/t/ddl_myisam.test
index 8d6226e573b..a9b14690c42 100644
--- a/mysql-test/suite/stress/t/ddl_myisam.test
+++ b/mysql-test/suite/stress/t/ddl_myisam.test
@@ -11,11 +11,8 @@
# Storage engine to be used in CREATE TABLE
let $engine_type= MyISAM;
+--source include/no_protocol.inc
-if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
-{
- --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
-}
let $run= `SELECT '$BIG_TEST' = '1'`;
if ($run)
{
diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result
index 1bd4e394f6a..7f75b731255 100644
--- a/mysql-test/suite/sys_vars/r/all_vars.result
+++ b/mysql-test/suite/sys_vars/r/all_vars.result
@@ -10,5 +10,6 @@ there should be *no* long test name listed below:
select distinct variable_name as `there should be *no* variables listed below:` from t2
left join t1 on variable_name=test_name where test_name is null;
there should be *no* variables listed below:
+max_digest_length
drop table t1;
drop table t2;
diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result b/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result
index 2956d04c065..56aa5976f91 100644
--- a/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result
@@ -1,13 +1,22 @@
SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
-SELECT @@GLOBAL.slave_parallel_threads as 'must be zero because of default';
-must be zero because of default
-0
+SELECT IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 20 because of .cnf';
+must be 20 because of .cnf
+20
SELECT @@SESSION.slave_parallel_threads as 'no session var';
ERROR HY000: Variable 'slave_parallel_threads' is a GLOBAL variable
SET GLOBAL slave_parallel_threads= 0;
SET GLOBAL slave_parallel_threads= DEFAULT;
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 0 because of default';
+must be 0 because of default
+0
SET GLOBAL slave_parallel_threads= 10;
SELECT @@GLOBAL.slave_parallel_threads;
@@GLOBAL.slave_parallel_threads
10
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
SET GLOBAL slave_parallel_threads = @save_slave_parallel_threads;
diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result
index a7afc334ba1..719adb67573 100644
--- a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result
@@ -41,23 +41,11 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '60020'
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
59392
-SET @@global.transaction_alloc_block_size = 4294967295;
-Warnings:
-Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-4294966272
'#--------------------FN_DYNVARS_005_04-------------------------#'
SET @@session.transaction_alloc_block_size = 1024;
SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
1024
-SET @@session.transaction_alloc_block_size =4294967295;
-Warnings:
-Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-4294966272
SET @@session.transaction_alloc_block_size = 65535;
Warnings:
Warning 1292 Truncated incorrect transaction_alloc_block_size value: '65535'
@@ -77,12 +65,12 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '-1024'
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
1024
-SET @@global.transaction_alloc_block_size = 123456789201;
+SET @@global.transaction_alloc_block_size = 135217728;
Warnings:
-Warning 1292 Truncated incorrect transaction_alloc_block_size value: '123456789201'
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '135217728'
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
-4294966272
+134217728
SET @@global.transaction_alloc_block_size = ON;
ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
SET @@global.transaction_alloc_block_size = OFF;
@@ -109,12 +97,12 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1000'
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
1024
-SET @@session.transaction_alloc_block_size = 12345678901;
+SET @@session.transaction_alloc_block_size = 135217728;
Warnings:
-Warning 1292 Truncated incorrect transaction_alloc_block_size value: '12345678901'
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '135217728'
SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
-4294966272
+134217728
SET @@session.transaction_alloc_block_size = ON;
ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
SET @@session.transaction_alloc_block_size = OFF;
@@ -149,9 +137,7 @@ WHERE VARIABLE_NAME='transaction_alloc_block_size';
1
'#---------------------FN_DYNVARS_001_08----------------------#'
SET @@transaction_alloc_block_size = 1024;
-SET @@global.transaction_alloc_block_size = 4294967295;
-Warnings:
-Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295'
+SET @@global.transaction_alloc_block_size = 134217728;
SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
@@transaction_alloc_block_size = @@global.transaction_alloc_block_size
0
diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result
index cbd25426408..be54302689d 100644
--- a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result
@@ -109,6 +109,12 @@ SELECT @@session.transaction_prealloc_size;
1024
SET @@session.transaction_prealloc_size = "Test";
ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@session.transaction_prealloc_size = 135217728;
+Warnings:
+Warning 1292 Truncated incorrect transaction_prealloc_size value: '135217728'
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+134217728
'#------------------FN_DYNVARS_005_06-----------------------#'
SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -128,7 +134,7 @@ Warnings:
Warning 1292 Truncated incorrect transaction_prealloc_size value: '10'
SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
@@transaction_prealloc_size = @@global.transaction_prealloc_size
-1
+0
'#---------------------FN_DYNVARS_001_10----------------------#'
SET @@transaction_prealloc_size = 100;
Warnings:
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test
index f988292b21e..11634e1e0c7 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test
@@ -2,11 +2,6 @@
# This is a debug variable for now
-- source include/have_debug.inc
-if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in InnoDB 5.6.10 or earlier
-}
-
SELECT @@global.innodb_buffer_pool_evict;
SET GLOBAL innodb_buffer_pool_evict = 'uncompressed';
diff --git a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test
index 782fb475140..85ae2358db5 100644
--- a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test
@@ -1,8 +1,3 @@
-if (`select plugin_auth_version <= "5.5.37-MariaDB-34.0" from information_schema.plugins where plugin_name='innodb'`)
-{
- --skip Not fixed in XtraDB as of 5.5.37-MariaDB-34.0 or earlier
-}
-
#
# 2010-01-27 - Added
#
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf
new file mode 100644
index 00000000000..02bdb44e1de
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf
@@ -0,0 +1,5 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld.1]
+slave_parallel_threads=20
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test
index 8e987489d86..b567b7f8854 100644
--- a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test
@@ -2,13 +2,20 @@
SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
-SELECT @@GLOBAL.slave_parallel_threads as 'must be zero because of default';
+# Check that we don't spawn worker threads at server startup, when no
+# slave is configured (MDEV-5289).
+SELECT IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 20 because of .cnf';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.slave_parallel_threads as 'no session var';
SET GLOBAL slave_parallel_threads= 0;
SET GLOBAL slave_parallel_threads= DEFAULT;
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 0 because of default';
SET GLOBAL slave_parallel_threads= 10;
SELECT @@GLOBAL.slave_parallel_threads;
+# Check that we don't spawn worker threads when no slave is started.
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
SET GLOBAL slave_parallel_threads = @save_slave_parallel_threads;
diff --git a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test
index 4a69bbcdb01..0faa95c8fe6 100644
--- a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test
@@ -5,7 +5,7 @@
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 8192 #
-# Range: 1024-4294967295 #
+# Range: 1024-134217728 #
# #
# #
# Creation Date: 2008-02-14 #
@@ -80,9 +80,6 @@ SELECT @@global.transaction_alloc_block_size;
SET @@global.transaction_alloc_block_size = 60020;
SELECT @@global.transaction_alloc_block_size;
-SET @@global.transaction_alloc_block_size = 4294967295;
-SELECT @@global.transaction_alloc_block_size;
-
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
###################################################################
# Change the value of variable to a valid value for SESSION Scope #
@@ -91,9 +88,6 @@ SELECT @@global.transaction_alloc_block_size;
SET @@session.transaction_alloc_block_size = 1024;
SELECT @@session.transaction_alloc_block_size;
-SET @@session.transaction_alloc_block_size =4294967295;
-SELECT @@session.transaction_alloc_block_size;
-
SET @@session.transaction_alloc_block_size = 65535;
SELECT @@session.transaction_alloc_block_size;
@@ -110,7 +104,7 @@ SET @@global.transaction_alloc_block_size = -1024;
SELECT @@global.transaction_alloc_block_size;
-SET @@global.transaction_alloc_block_size = 123456789201;
+SET @@global.transaction_alloc_block_size = 135217728;
SELECT @@global.transaction_alloc_block_size;
-- Error ER_WRONG_TYPE_FOR_VAR
@@ -136,7 +130,7 @@ SET @@global.transaction_alloc_block_size ="Test";
SET @@global.transaction_alloc_block_size = 1000;
SELECT @@global.transaction_alloc_block_size;
-SET @@session.transaction_alloc_block_size = 12345678901;
+SET @@session.transaction_alloc_block_size = 135217728;
SELECT @@session.transaction_alloc_block_size;
-- Error ER_WRONG_TYPE_FOR_VAR
@@ -185,7 +179,7 @@ WHERE VARIABLE_NAME='transaction_alloc_block_size';
###########################################################################
SET @@transaction_alloc_block_size = 1024;
-SET @@global.transaction_alloc_block_size = 4294967295;
+SET @@global.transaction_alloc_block_size = 134217728;
SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test
index 5eabf457a0c..9d0c20a37b4 100644
--- a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test
@@ -5,7 +5,7 @@
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 4096 #
-# Range: #
+# Range: 1024-134217728 #
# #
# #
# Creation Date: 2008-02-14 #
@@ -137,6 +137,10 @@ SELECT @@session.transaction_prealloc_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.transaction_prealloc_size = "Test";
+SET @@session.transaction_prealloc_size = 135217728;
+SELECT @@session.transaction_prealloc_size;
+
+
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #