summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-08-14 17:23:34 +0300
committerMichael Widenius <monty@askmonty.org>2012-08-14 17:23:34 +0300
commit60589aeee03949033c66da5c1eae70d4342179fc (patch)
tree1cd399dbed17c5c7b4ed16eb7b872dc979af1c93
parentb39e6e3d093b45f792959ef06fea1c175263ae1a (diff)
downloadmariadb-git-60589aeee03949033c66da5c1eae70d4342179fc.tar.gz
Next part of merge. See TODO for details
-rw-r--r--TODO17
-rw-r--r--client/client_priv.h1
-rw-r--r--client/mysql.cc4
-rw-r--r--client/mysqladmin.cc4
-rw-r--r--client/mysqlcheck.c4
-rw-r--r--client/mysqldump.c4
-rw-r--r--client/mysqlimport.c4
-rw-r--r--client/mysqlshow.c4
-rw-r--r--client/mysqlslap.c6
-rw-r--r--client/mysqltest.cc4
-rw-r--r--extra/yassl/include/cert_wrapper.hpp2
-rw-r--r--extra/yassl/include/openssl/prefix_ssl.h1
-rw-r--r--extra/yassl/include/openssl/ssl.h17
-rw-r--r--extra/yassl/include/openssl/transport_types.h26
-rw-r--r--extra/yassl/include/socket_wrapper.hpp15
-rw-r--r--extra/yassl/include/yassl_int.hpp4
-rw-r--r--extra/yassl/src/cert_wrapper.cpp36
-rw-r--r--extra/yassl/src/handshake.cpp6
-rw-r--r--extra/yassl/src/socket_wrapper.cpp76
-rw-r--r--extra/yassl/src/ssl.cpp41
-rw-r--r--extra/yassl/src/yassl_int.cpp21
-rw-r--r--extra/yassl/taocrypt/include/asn.hpp9
-rw-r--r--extra/yassl/taocrypt/src/asn.cpp90
-rw-r--r--include/CMakeLists.txt1
-rw-r--r--include/my_global.h19
-rw-r--r--include/my_net.h10
-rw-r--r--include/my_sys.h6
-rw-r--r--include/mysql.h8
-rw-r--r--include/mysql.h.pp8
-rw-r--r--include/mysql_com_server.h41
-rw-r--r--include/sql_common.h2
-rw-r--r--include/sslopt-case.h7
-rw-r--r--include/sslopt-longopts.h7
-rw-r--r--include/sslopt-vars.h14
-rw-r--r--include/violite.h88
-rw-r--r--mysql-test/include/check-testcase.test4
-rw-r--r--mysql-test/include/have_openssl.inc4
-rw-r--r--mysql-test/r/openssl.require2
-rw-r--r--mysql-test/r/ssl-crl-revoked-crl.result1
-rw-r--r--mysql-test/r/ssl.result6
-rw-r--r--mysql-test/r/ssl_crl.result23
-rw-r--r--mysql-test/r/ssl_crl_clients-valid.result24
-rw-r--r--mysql-test/r/ssl_crl_clients.result7
-rw-r--r--mysql-test/r/ssl_crl_clients_valid.result16
-rw-r--r--mysql-test/r/ssl_crl_clrpath.result23
-rw-r--r--mysql-test/r/variables.result4
-rw-r--r--mysql-test/std_data/crl-client-revoked.crl10
-rw-r--r--mysql-test/std_data/crldir/fc725416.r010
-rw-r--r--mysql-test/suite/perfschema/disabled.def19
-rw-r--r--mysql-test/suite/perfschema/include/connection_cleanup.inc27
-rw-r--r--mysql-test/suite/perfschema/include/connection_load.inc210
-rw-r--r--mysql-test/suite/perfschema/include/connection_setup.inc109
-rw-r--r--mysql-test/suite/perfschema/include/digest_cleanup.inc11
-rw-r--r--mysql-test/suite/perfschema/include/digest_execution.inc86
-rw-r--r--mysql-test/suite/perfschema/include/digest_setup.inc21
-rw-r--r--mysql-test/suite/perfschema/include/event_aggregate_cleanup.inc57
-rw-r--r--mysql-test/suite/perfschema/include/event_aggregate_load.inc883
-rw-r--r--mysql-test/suite/perfschema/include/event_aggregate_setup.inc347
-rw-r--r--mysql-test/suite/perfschema/include/hostcache_dump.inc39
-rw-r--r--mysql-test/suite/perfschema/include/no_protocol.inc10
-rw-r--r--mysql-test/suite/perfschema/include/pfs_upgrade.inc112
-rw-r--r--mysql-test/suite/perfschema/include/schema.inc60
-rw-r--r--mysql-test/suite/perfschema/include/socket_check1.inc129
-rw-r--r--mysql-test/suite/perfschema/include/socket_event.inc236
-rw-r--r--mysql-test/suite/perfschema/include/socket_event_dbg.inc130
-rw-r--r--mysql-test/suite/perfschema/include/socket_ipv6.inc113
-rw-r--r--mysql-test/suite/perfschema/include/socket_summary_check.inc227
-rw-r--r--mysql-test/suite/perfschema/include/socket_summary_check_dbg.inc236
-rw-r--r--mysql-test/suite/perfschema/include/stage_cleanup.inc31
-rw-r--r--mysql-test/suite/perfschema/include/stage_setup.inc134
-rw-r--r--mysql-test/suite/perfschema/include/start_server_common.inc37
-rw-r--r--mysql-test/suite/perfschema/include/table_aggregate_cleanup.inc53
-rw-r--r--mysql-test/suite/perfschema/include/table_aggregate_load.inc540
-rw-r--r--mysql-test/suite/perfschema/include/table_aggregate_setup.inc267
-rw-r--r--mysql-test/suite/perfschema/include/table_io_basic_dml.inc36
-rw-r--r--mysql-test/suite/perfschema/include/table_io_cleanup_helper.inc10
-rw-r--r--mysql-test/suite/perfschema/include/table_io_result_helper.inc22
-rw-r--r--mysql-test/suite/perfschema/include/table_io_setup_helper.inc58
-rw-r--r--mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc20
-rw-r--r--mysql-test/suite/perfschema/include/wait_till_sleep.inc19
-rw-r--r--mysql-test/suite/perfschema/r/aggregate.result16
-rw-r--r--mysql-test/suite/perfschema/r/all_instances.result161
-rw-r--r--mysql-test/suite/perfschema/r/all_tests.result21
-rw-r--r--mysql-test/suite/perfschema/r/binlog_mix.result10
-rw-r--r--mysql-test/suite/perfschema/r/binlog_row.result10
-rw-r--r--mysql-test/suite/perfschema/r/binlog_stmt.result4
-rw-r--r--mysql-test/suite/perfschema/r/checksum.result56
-rw-r--r--mysql-test/suite/perfschema/r/column_privilege.result2
-rw-r--r--mysql-test/suite/perfschema/r/connection.result875
-rw-r--r--mysql-test/suite/perfschema/r/connection_3a.result820
-rw-r--r--mysql-test/suite/perfschema/r/connection_3a_3u.result762
-rw-r--r--mysql-test/suite/perfschema/r/connection_3u.result817
-rw-r--r--mysql-test/suite/perfschema/r/csv_table_io.result145
-rw-r--r--mysql-test/suite/perfschema/r/ddl_accounts.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esgs_by_account_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esgs_by_host_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esgs_by_thread_by_event_name.result9
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esgs_by_user_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esgs_global_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esms_by_account_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esms_by_digest.result9
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esms_by_host_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esms_by_thread_by_event_name.result9
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esms_by_user_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_esms_global_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_stages_current.result7
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_stages_history.result7
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result7
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_statements_current.result7
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_statements_history.result7
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_statements_history_long.result7
-rw-r--r--mysql-test/suite/perfschema/r/ddl_ews_by_account_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_ews_by_host_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_ews_by_user_by_event_name.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_host_cache.result7
-rw-r--r--mysql-test/suite/perfschema/r/ddl_hosts.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_os_global_by_type.result10
-rw-r--r--mysql-test/suite/perfschema/r/ddl_setup_actors.result16
-rw-r--r--mysql-test/suite/perfschema/r/ddl_setup_objects.result16
-rw-r--r--mysql-test/suite/perfschema/r/ddl_socket_instances.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_socket_summary_by_event_name.result7
-rw-r--r--mysql-test/suite/perfschema/r/ddl_socket_summary_by_instance.result7
-rw-r--r--mysql-test/suite/perfschema/r/ddl_threads.result4
-rw-r--r--mysql-test/suite/perfschema/r/ddl_tiws_by_index_usage.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_tiws_by_table.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_tlws_by_table.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_users.result8
-rw-r--r--mysql-test/suite/perfschema/r/digest_table_full.result94
-rw-r--r--mysql-test/suite/perfschema/r/dml_accounts.result25
-rw-r--r--mysql-test/suite/perfschema/r/dml_cond_instances.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_esgs_by_account_by_event_name.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_esgs_by_host_by_event_name.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_esgs_by_thread_by_event_name.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_esgs_by_user_by_event_name.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_esgs_global_by_event_name.result25
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_by_account_by_event_name.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_by_digest.result27
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_by_host_by_event_name.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_by_thread_by_event_name.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_by_user_by_event_name.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_global_by_event_name.result25
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_stages_current.result25
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_stages_history.result29
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_stages_history_long.result29
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_statements_current.result25
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_statements_history.result29
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_statements_history_long.result29
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_waits_current.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_waits_history.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_waits_history_long.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_account_by_event_name.result29
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_host_by_event_name.result29
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_instance.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_user_by_event_name.result29
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_file_instances.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_fs_by_event_name.result (renamed from mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result)4
-rw-r--r--mysql-test/suite/perfschema/r/dml_fs_by_instance.result (renamed from mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result)4
-rw-r--r--mysql-test/suite/perfschema/r/dml_handler.result162
-rw-r--r--mysql-test/suite/perfschema/r/dml_host_cache.result27
-rw-r--r--mysql-test/suite/perfschema/r/dml_hosts.result25
-rw-r--r--mysql-test/suite/perfschema/r/dml_mutex_instances.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_os_global_by_type.result45
-rw-r--r--mysql-test/suite/perfschema/r/dml_performance_timers.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_rwlock_instances.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_actors.result60
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_consumers.result28
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_instruments.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_objects.result67
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_timers.result28
-rw-r--r--mysql-test/suite/perfschema/r/dml_socket_instances.result20
-rw-r--r--mysql-test/suite/perfschema/r/dml_socket_summary_by_event_name.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_socket_summary_by_instance.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_threads.result20
-rw-r--r--mysql-test/suite/perfschema/r/dml_tiws_by_index_usage.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_tiws_by_table.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_tlws_by_table.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_users.result25
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate.result5271
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a.result3992
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result3589
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result2661
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result2258
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_h.result4868
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_u.result3940
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result3537
-rw-r--r--mysql-test/suite/perfschema/r/func_file_io.result23
-rw-r--r--mysql-test/suite/perfschema/r/func_mutex.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result85
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result72
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result85
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result72
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result85
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result72
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result88
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result72
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result180
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result198
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_format.result72
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result645
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result157
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result131
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result85
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result72
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result195
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result141
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result85
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result72
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result85
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result72
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result85
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result71
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result88
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result72
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result180
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result198
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result645
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result157
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result131
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result85
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result72
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result195
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result141
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_peer_addr.result50
-rw-r--r--mysql-test/suite/perfschema/r/indexed_table_io.result158
-rw-r--r--mysql-test/suite/perfschema/r/information_schema.result301
-rw-r--r--mysql-test/suite/perfschema/r/innodb_table_io.result149
-rw-r--r--mysql-test/suite/perfschema/r/memory_table_io.result147
-rw-r--r--mysql-test/suite/perfschema/r/merge_table_io.result177
-rw-r--r--mysql-test/suite/perfschema/r/misc.result69
-rw-r--r--mysql-test/suite/perfschema/r/multi_table_io.result108
-rw-r--r--mysql-test/suite/perfschema/r/myisam_file_io.result8
-rw-r--r--mysql-test/suite/perfschema/r/myisam_table_io.result145
-rw-r--r--mysql-test/suite/perfschema/r/nesting.result233
-rw-r--r--mysql-test/suite/perfschema/r/no_threads.result1
-rw-r--r--mysql-test/suite/perfschema/r/ortho_iter.result745
-rw-r--r--mysql-test/suite/perfschema/r/part_table_io.result177
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade.result355
-rw-r--r--mysql-test/suite/perfschema/r/privilege.result85
-rw-r--r--mysql-test/suite/perfschema/r/privilege_table_io.result138
-rw-r--r--mysql-test/suite/perfschema/r/query_cache.result4
-rw-r--r--mysql-test/suite/perfschema/r/relaylog.result39
-rw-r--r--mysql-test/suite/perfschema/r/rollback_table_io.result88
-rw-r--r--mysql-test/suite/perfschema/r/schema.result861
-rw-r--r--mysql-test/suite/perfschema/r/selects.result3
-rw-r--r--mysql-test/suite/perfschema/r/server_init.result22
-rw-r--r--mysql-test/suite/perfschema/r/setup_actors.result135
-rw-r--r--mysql-test/suite/perfschema/r/setup_consumers_defaults.result20
-rw-r--r--mysql-test/suite/perfschema/r/setup_instruments_defaults.result36
-rw-r--r--mysql-test/suite/perfschema/r/setup_objects.result207
-rw-r--r--mysql-test/suite/perfschema/r/short_option_1.result2
-rw-r--r--mysql-test/suite/perfschema/r/socket_connect.result177
-rw-r--r--mysql-test/suite/perfschema/r/socket_instances_func.result208
-rw-r--r--mysql-test/suite/perfschema/r/socket_instances_func_win.result144
-rw-r--r--mysql-test/suite/perfschema/r/socket_summary_by_event_name_func.result121
-rw-r--r--mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result205
-rw-r--r--mysql-test/suite/perfschema/r/socket_summary_by_instance_func_win.result208
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_function.result34
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_global.result24
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_procedure.result42
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_table.result37
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_idle.result120
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_stages.result120
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_statements.result120
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_waits.result120
-rw-r--r--mysql-test/suite/perfschema/r/start_server_innodb.result126
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_account.result112
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_class.result60
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_inst.result60
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_digests.result92
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_class.result60
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_inst.result60
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_host.result112
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_class.result60
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result58
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result60
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result58
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_actors.result108
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_objects.result108
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_class.result119
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_inst.result122
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stage_class.result128
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history.result109
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result109
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statement_class.result128
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history.result109
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result109
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_hdl.result124
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_inst.result124
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_class.result60
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_inst.result58
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_user.result112
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history.result109
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result109
-rw-r--r--mysql-test/suite/perfschema/r/start_server_nothing.result251
-rw-r--r--mysql-test/suite/perfschema/r/start_server_off.result94
-rw-r--r--mysql-test/suite/perfschema/r/start_server_on.result68
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest.result108
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_consumers.result123
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_consumers2.result102
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_long_query.result12
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result1742
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result1741
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result1742
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result1741
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result1816
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result1853
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result1816
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result1853
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_off.result1741
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result1742
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result1741
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result1742
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result1741
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result1744
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result1743
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result1744
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result1743
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result1780
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result1798
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result1780
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result1798
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result1744
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result1743
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result1744
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result1743
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result1744
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result1743
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result1744
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result1743
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result1780
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result1798
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result1780
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result1798
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result1744
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result1743
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result1744
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result1743
-rw-r--r--mysql-test/suite/perfschema/r/table_schema.result815
-rw-r--r--mysql-test/suite/perfschema/r/tampered_perfschema_table1.result2
-rw-r--r--mysql-test/suite/perfschema/r/temp_table_io.result118
-rw-r--r--mysql-test/suite/perfschema/r/threads_innodb.result14
-rw-r--r--mysql-test/suite/perfschema/r/threads_insert_delayed.result19
-rw-r--r--mysql-test/suite/perfschema/r/threads_mysql.result108
-rw-r--r--mysql-test/suite/perfschema/r/trigger_table_io.result205
-rw-r--r--mysql-test/suite/perfschema/r/view_table_io.result154
-rw-r--r--mysql-test/suite/perfschema/t/aggregate.test16
-rw-r--r--mysql-test/suite/perfschema/t/all_instances.test31
-rw-r--r--mysql-test/suite/perfschema/t/all_tests.test64
-rw-r--r--mysql-test/suite/perfschema/t/checksum.test56
-rw-r--r--mysql-test/suite/perfschema/t/column_privilege.test2
-rw-r--r--mysql-test/suite/perfschema/t/connection.test7
-rw-r--r--mysql-test/suite/perfschema/t/connection_3a-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/connection_3a.test7
-rw-r--r--mysql-test/suite/perfschema/t/connection_3a_3u-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/connection_3a_3u.test7
-rw-r--r--mysql-test/suite/perfschema/t/connection_3u-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/connection_3u.test7
-rw-r--r--mysql-test/suite/perfschema/t/csv_table_io.test28
-rw-r--r--mysql-test/suite/perfschema/t/ddl_accounts.test17
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esgs_by_account_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esgs_by_host_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esgs_by_thread_by_event_name.test18
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esgs_by_user_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esgs_global_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esms_by_account_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esms_by_digest.test33
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esms_by_host_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esms_by_thread_by_event_name.test18
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esms_by_user_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esms_global_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_events_stages_current.test16
-rw-r--r--mysql-test/suite/perfschema/t/ddl_events_stages_history.test16
-rw-r--r--mysql-test/suite/perfschema/t/ddl_events_stages_history_long.test16
-rw-r--r--mysql-test/suite/perfschema/t/ddl_events_statements_current.test16
-rw-r--r--mysql-test/suite/perfschema/t/ddl_events_statements_history.test16
-rw-r--r--mysql-test/suite/perfschema/t/ddl_events_statements_history_long.test16
-rw-r--r--mysql-test/suite/perfschema/t/ddl_ews_by_account_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_ews_by_host_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_ews_by_user_by_event_name.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_host_cache.test16
-rw-r--r--mysql-test/suite/perfschema/t/ddl_hosts.test17
-rw-r--r--mysql-test/suite/perfschema/t/ddl_os_global_by_type.test19
-rw-r--r--mysql-test/suite/perfschema/t/ddl_setup_actors.test29
-rw-r--r--mysql-test/suite/perfschema/t/ddl_setup_objects.test29
-rw-r--r--mysql-test/suite/perfschema/t/ddl_socket_instances.test17
-rw-r--r--mysql-test/suite/perfschema/t/ddl_socket_summary_by_event_name.test16
-rw-r--r--mysql-test/suite/perfschema/t/ddl_socket_summary_by_instance.test16
-rw-r--r--mysql-test/suite/perfschema/t/ddl_threads.test4
-rw-r--r--mysql-test/suite/perfschema/t/ddl_tiws_by_index_usage.test17
-rw-r--r--mysql-test/suite/perfschema/t/ddl_tiws_by_table.test17
-rw-r--r--mysql-test/suite/perfschema/t/ddl_tlws_by_table.test17
-rw-r--r--mysql-test/suite/perfschema/t/ddl_users.test17
-rw-r--r--mysql-test/suite/perfschema/t/digest_table_full-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/digest_table_full.test32
-rw-r--r--mysql-test/suite/perfschema/t/disabled.def11
-rw-r--r--mysql-test/suite/perfschema/t/dml_accounts.test41
-rw-r--r--mysql-test/suite/perfschema/t/dml_esgs_by_account_by_event_name.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_esgs_by_host_by_event_name.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_esgs_by_thread_by_event_name.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_esgs_by_user_by_event_name.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_esgs_global_by_event_name.test41
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_account_by_event_name.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_digest.test56
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_host_by_event_name.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_thread_by_event_name.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_user_by_event_name.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_global_by_event_name.test41
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_stages_current.test41
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_stages_history.test47
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_stages_history_long.test47
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_statements_current.test41
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_statements_history.test47
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_statements_history_long.test47
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_by_account_by_event_name.test41
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_by_host_by_event_name.test41
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_by_user_by_event_name.test41
-rw-r--r--mysql-test/suite/perfschema/t/dml_fs_by_event_name.test (renamed from mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test)0
-rw-r--r--mysql-test/suite/perfschema/t/dml_fs_by_instance.test (renamed from mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test)0
-rw-r--r--mysql-test/suite/perfschema/t/dml_handler.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_host_cache.test43
-rw-r--r--mysql-test/suite/perfschema/t/dml_hosts.test41
-rw-r--r--mysql-test/suite/perfschema/t/dml_os_global_by_type.test57
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_actors.test72
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_objects.test93
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_timers.test23
-rw-r--r--mysql-test/suite/perfschema/t/dml_socket_instances.test35
-rw-r--r--mysql-test/suite/perfschema/t/dml_socket_summary_by_event_name.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_socket_summary_by_instance.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_threads.test20
-rw-r--r--mysql-test/suite/perfschema/t/dml_tiws_by_index_usage.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_tiws_by_table.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_tlws_by_table.test42
-rw-r--r--mysql-test/suite/perfschema/t/dml_users.test41
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate.test7
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a.test7
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h-master.opt4
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h.test7
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u-master.opt4
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u.test7
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h-master.opt5
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h.test7
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_h-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_h.test7
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_u-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_u.test7
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h-master.opt4
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h.test7
-rw-r--r--mysql-test/suite/perfschema/t/func_file_io.test41
-rw-r--r--mysql-test/suite/perfschema/t/func_mutex.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test51
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test46
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test53
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test48
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test51
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test46
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test54
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test46
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test89
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test90
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_format.test45
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test250
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test72
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test64
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test51
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test46
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test86
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test74
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test52
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test47
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test54
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test50
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test52
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test43
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test55
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test47
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test91
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test91
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test232
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test73
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test65
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test52
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test47
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test87
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test75
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_peer_addr.test47
-rw-r--r--mysql-test/suite/perfschema/t/indexed_table_io.test112
-rw-r--r--mysql-test/suite/perfschema/t/innodb_table_io.test28
-rw-r--r--mysql-test/suite/perfschema/t/memory_table_io.test28
-rw-r--r--mysql-test/suite/perfschema/t/merge_table_io.test46
-rw-r--r--mysql-test/suite/perfschema/t/misc.test100
-rw-r--r--mysql-test/suite/perfschema/t/multi_table_io.test53
-rw-r--r--mysql-test/suite/perfschema/t/myisam_table_io.test28
-rw-r--r--mysql-test/suite/perfschema/t/nesting.test188
-rw-r--r--mysql-test/suite/perfschema/t/no_threads-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/no_threads.test2
-rw-r--r--mysql-test/suite/perfschema/t/ortho_iter.test146
-rw-r--r--mysql-test/suite/perfschema/t/part_table_io.test30
-rw-r--r--mysql-test/suite/perfschema/t/pfs_upgrade.test109
-rw-r--r--mysql-test/suite/perfschema/t/privilege.test6
-rw-r--r--mysql-test/suite/perfschema/t/privilege_table_io.test43
-rw-r--r--mysql-test/suite/perfschema/t/rollback_table_io.test47
-rw-r--r--mysql-test/suite/perfschema/t/schema.test27
-rw-r--r--mysql-test/suite/perfschema/t/selects.test9
-rw-r--r--mysql-test/suite/perfschema/t/server_init.test14
-rw-r--r--mysql-test/suite/perfschema/t/setup_actors.test246
-rw-r--r--mysql-test/suite/perfschema/t/setup_consumers_defaults-master.opt11
-rw-r--r--mysql-test/suite/perfschema/t/setup_consumers_defaults.test18
-rw-r--r--mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt21
-rw-r--r--mysql-test/suite/perfschema/t/setup_instruments_defaults.test40
-rw-r--r--mysql-test/suite/perfschema/t/setup_objects.test197
-rw-r--r--mysql-test/suite/perfschema/t/short_option_1-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/short_option_1.test3
-rw-r--r--mysql-test/suite/perfschema/t/socket_connect.test290
-rw-r--r--mysql-test/suite/perfschema/t/socket_instances_func-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/socket_instances_func.test447
-rw-r--r--mysql-test/suite/perfschema/t/socket_instances_func_win-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/socket_instances_func_win.test339
-rw-r--r--mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test333
-rw-r--r--mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test1710
-rw-r--r--mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test1722
-rw-r--r--mysql-test/suite/perfschema/t/stage_mdl_function.test63
-rw-r--r--mysql-test/suite/perfschema/t/stage_mdl_global.test54
-rw-r--r--mysql-test/suite/perfschema/t/stage_mdl_procedure.test79
-rw-r--r--mysql-test/suite/perfschema/t/stage_mdl_table.test59
-rw-r--r--mysql-test/suite/perfschema/t/start_server_disable_idle-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/start_server_disable_idle.test28
-rw-r--r--mysql-test/suite/perfschema/t/start_server_disable_stages-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/start_server_disable_stages.test28
-rw-r--r--mysql-test/suite/perfschema/t/start_server_disable_statements-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/start_server_disable_statements.test28
-rw-r--r--mysql-test/suite/perfschema/t/start_server_disable_waits-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/start_server_disable_waits.test28
-rw-r--r--mysql-test/suite/perfschema/t/start_server_innodb-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/start_server_innodb.test11
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_account-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_account.test16
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_cond_class-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_cond_inst-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_digests-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_digests.test32
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_file_class-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_file_inst-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_host-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_host.test16
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_mutex_class-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_mutex_inst-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_rwlock_class-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_rwlock_inst-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_setup_actors-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_setup_actors.test13
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_setup_objects-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_setup_objects.test13
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_socket_class-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_socket_class.test23
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_socket_inst-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_socket_inst.test26
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_stage_class-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_stage_class.test26
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_stages_history-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_stages_history.test14
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_stages_history_long-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_stages_history_long.test14
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_statement_class-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_statement_class.test26
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_statements_history-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_statements_history.test14
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_statements_history_long-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_statements_history_long.test14
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_table_hdl-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_table_hdl.test30
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_table_inst-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_table_inst.test30
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_thread_class-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_thread_inst-master.opt3
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_user-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_user.test16
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_waits_history-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_waits_history.test14
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_waits_history_long-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_waits_history_long.test14
-rw-r--r--mysql-test/suite/perfschema/t/start_server_nothing-master.opt37
-rw-r--r--mysql-test/suite/perfschema/t/start_server_nothing.test58
-rw-r--r--mysql-test/suite/perfschema/t/start_server_off.test11
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest.test23
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest_consumers-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest_consumers.test35
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest_consumers2-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest_consumers2.test37
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest_long_query-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/statement_digest_long_query.test23
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_global_2u_2t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_global_2u_3t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_global_4u_2t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_global_4u_3t.test17
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_hist_2u_2t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_hist_2u_3t.test17
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_hist_4u_2t.test17
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_hist_4u_3t.test15
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_off.test13
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_thread_2u_2t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_thread_2u_3t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_thread_4u_2t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_aggregate_thread_4u_3t.test17
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_global_2u_2t.test23
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_global_2u_3t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_global_4u_2t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_global_4u_3t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_hist_2u_2t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_hist_2u_3t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_hist_4u_2t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_hist_4u_3t.test17
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_thread_2u_2t.test23
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_thread_2u_3t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_thread_4u_2t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_io_aggregate_thread_4u_3t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_global_2u_2t.test23
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_global_2u_3t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_global_4u_2t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_global_4u_3t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_hist_2u_2t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_hist_2u_3t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_hist_4u_2t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_hist_4u_3t.test17
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_thread_2u_2t.test23
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_thread_2u_3t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_thread_4u_2t.test21
-rw-r--r--mysql-test/suite/perfschema/t/table_lock_aggregate_thread_4u_3t.test19
-rw-r--r--mysql-test/suite/perfschema/t/table_schema.test57
-rw-r--r--mysql-test/suite/perfschema/t/tampered_perfschema_table1.test6
-rw-r--r--mysql-test/suite/perfschema/t/temp_table_io.test28
-rw-r--r--mysql-test/suite/perfschema/t/thread_cache-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/thread_cache.test22
-rw-r--r--mysql-test/suite/perfschema/t/threads_innodb.test20
-rw-r--r--mysql-test/suite/perfschema/t/threads_insert_delayed.test40
-rw-r--r--mysql-test/suite/perfschema/t/threads_mysql-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/threads_mysql.test128
-rw-r--r--mysql-test/suite/perfschema/t/trigger_table_io.test74
-rw-r--r--mysql-test/suite/perfschema/t/view_table_io.test39
-rw-r--r--mysql-test/t/ssl.test4
-rw-r--r--mysql-test/t/ssl_crl-master.opt4
-rw-r--r--mysql-test/t/ssl_crl.test23
-rw-r--r--mysql-test/t/ssl_crl_clients-master.opt4
-rw-r--r--mysql-test/t/ssl_crl_clients.test48
-rw-r--r--mysql-test/t/ssl_crl_clients_valid-master.opt4
-rw-r--r--mysql-test/t/ssl_crl_clients_valid.test30
-rw-r--r--mysql-test/t/ssl_crl_clrpath-master.opt4
-rw-r--r--mysql-test/t/ssl_crl_clrpath.test23
-rw-r--r--mysys/charset.c11
-rw-r--r--mysys/psi_noop.c1
-rw-r--r--scripts/mysql_system_tables_fix.sql3
-rw-r--r--sql-common/client.c168
-rw-r--r--sql/CMakeLists.txt2
-rw-r--r--sql/lex.h2
-rw-r--r--sql/mysqld.cc952
-rw-r--r--sql/mysqld.h131
-rw-r--r--sql/rpl_mi.cc1
-rw-r--r--sql/rpl_mi.h1
-rw-r--r--sql/set_var.h3
-rw-r--r--sql/sql_class.cc205
-rw-r--r--sql/sql_class.h81
-rw-r--r--sql/sql_cmd.h161
-rw-r--r--sql/sql_cursor.cc4
-rw-r--r--sql/sql_lex.cc7
-rw-r--r--sql/sql_lex.h86
-rw-r--r--sql/sql_parse.cc67
-rw-r--r--sql/sql_prepare.cc8
-rw-r--r--sql/sql_yacc.yy12
-rw-r--r--sql/sys_vars.cc218
-rw-r--r--sql/sys_vars.h2
-rw-r--r--sql/threadpool_unix.cc4
-rwxr-xr-xstorage/perfschema/gen_pfs_lex_tokenbin159972 -> 160124 bytes
-rw-r--r--storage/perfschema/pfs_lex_token.h670
-rw-r--r--vio/CMakeLists.txt4
-rw-r--r--vio/vio.c248
-rw-r--r--vio/vio_priv.h27
-rw-r--r--vio/viopipe.c168
-rw-r--r--vio/vioshm.c217
-rw-r--r--vio/viosocket.c1080
-rw-r--r--vio/viossl.c260
-rw-r--r--vio/viosslfactories.c45
701 files changed, 138234 insertions, 2250 deletions
diff --git a/TODO b/TODO
index a8fd6247c60..716cecc7ed8 100644
--- a/TODO
+++ b/TODO
@@ -4,10 +4,17 @@ Featured copied/merged
- storage/innodb/*
- storage/perfschema
- sql/share/errmsg-utf8.txt
+- mysqltest/suite/perfschema
- All CF_XXX states in sql_class.h.
- handler error messages.
- Removed timestamp handling from all handler::write and handler::update
methods.
+- Added PSI_CALLS to handler.cc
+- Added thd->m_statement_psi
+- Added variables Sys_ssl_crl & Sys_ssl_crlpath
+ (Including support in all clients)
+- Added Ssl_server_not_before & Ssl_server_not_after variables
+ (Including changes to yassl)
Features recoded
- Better error messages
@@ -16,6 +23,7 @@ Features recoded
Fetures half done:
- Support for TRANSACTION READ ONLY | READ WRITE
- CF_XXX states added to init_update_queries() but not otherwise used.
+- Merge sql/rpl_mi.cc (To get Sys_ssl_crl ? crlpath)
Short time TODO:
- Add support for TRANSACTION READ ONLY | READ WRITE in sql_yacc.yy
@@ -27,3 +35,12 @@ Short time TODO:
- Enable performance_schema.host_cache in scripts/mysql_system_tables.sql
- Add full support for timestamp. (remove timestamp handling from ha_write())
+
+- Add Sys_my_bind_addr(); Needed for perfschema
+
+- Add THD_STAGE_INFO everywhere.
+
+- mysql_socket_shutdown() was removed from vio/viosocket.cc.
+ It was replaced with inline function in include/mysql/psi/mysql_socket.h
+ but this doesn't call DisconnectEx(). We should check if we need to
+ add this to the inline function...
diff --git a/client/client_priv.h b/client/client_priv.h
index 607bd3997c1..8c713d73200 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -91,6 +91,7 @@ enum options_client
OPT_REWRITE_DB,
OPT_REPORT_PROGRESS,
OPT_SKIP_ANNOTATE_ROWS_EVENTS,
+ OPT_SSL_CRL, OPT_SSL_CRLPATH,
OPT_MAX_CLIENT_OPTION /* should be always the last */
};
diff --git a/client/mysql.cc b/client/mysql.cc
index d39e765a99a..5f205791b8e 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -4402,8 +4402,12 @@ sql_real_connect(char *host,char *database,char *user,char *password,
mysql_options(&mysql,MYSQL_OPT_LOCAL_INFILE, (char*) &opt_local_infile);
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (opt_use_ssl)
+ {
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(&mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(&mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
+ }
mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index c36c8a16881..e2c96d35c73 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -341,8 +341,12 @@ int main(int argc,char *argv[])
}
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
+ {
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(&mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(&mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
+ }
mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 39ceb423968..1fa1ae2fef5 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -908,8 +908,12 @@ static int dbConnect(char *host, char *user, char *passwd)
mysql_options(&mysql_connection, MYSQL_OPT_COMPRESS, NullS);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
+ {
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
+ }
#endif
if (opt_protocol)
mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index f91c480bc80..572537ac3f9 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1528,8 +1528,12 @@ static int connect_to_db(char *host, char *user,char *passwd)
mysql_options(&mysql_connection,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
+ {
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
+ }
mysql_options(&mysql_connection,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index e4e34f786d7..35fb7c2e0a4 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -432,8 +432,12 @@ static MYSQL *db_connect(char *host, char *database,
(char*) &opt_local_file);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
+ {
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
+ }
mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index d0db2020998..61dfd8e9bb8 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -116,8 +116,12 @@ int main(int argc, char **argv)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
+ {
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(&mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(&mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
+ }
mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index e3da44e2fc5..45846948b21 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -66,7 +66,7 @@ TODO:
*/
-#define SLAP_VERSION "1.0"
+#define SLAP_VERSION "1.1"
#define HUGE_STRING_LENGTH 8196
#define RAND_STRING_SIZE 126
@@ -299,8 +299,12 @@ void set_mysql_connect_options(MYSQL *mysql)
mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
+ {
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
+ }
#endif
if (opt_protocol)
mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 3bae2bfbc9d..fe481020574 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -5920,6 +5920,8 @@ void do_connect(struct st_command *command)
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
mysql_ssl_set(con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(con_slot->mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(con_slot->mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
#if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost");
@@ -8954,6 +8956,8 @@ int main(int argc, char **argv)
{
mysql_ssl_set(con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(con->mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(con->mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
#if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= opt_host && !strcmp(opt_host, "localhost");
diff --git a/extra/yassl/include/cert_wrapper.hpp b/extra/yassl/include/cert_wrapper.hpp
index d07e5b627b0..10634692713 100644
--- a/extra/yassl/include/cert_wrapper.hpp
+++ b/extra/yassl/include/cert_wrapper.hpp
@@ -79,6 +79,7 @@ class CertManager {
CertList peerList_; // peer
input_buffer peerPublicKey_;
X509* peerX509_; // peer's openSSL X509
+ X509* selfX509_; // our own openSSL X509
SignatureAlgorithm keyType_; // self key type
SignatureAlgorithm peerKeyType_; // peer's key type
@@ -105,6 +106,7 @@ public:
const opaque* get_peerKey() const;
const opaque* get_privateKey() const;
X509* get_peerX509() const;
+ X509* get_selfX509() const;
SignatureAlgorithm get_keyType() const;
SignatureAlgorithm get_peerKeyType() const;
diff --git a/extra/yassl/include/openssl/prefix_ssl.h b/extra/yassl/include/openssl/prefix_ssl.h
index 024cb0a9aff..dbe8ac27ad0 100644
--- a/extra/yassl/include/openssl/prefix_ssl.h
+++ b/extra/yassl/include/openssl/prefix_ssl.h
@@ -179,6 +179,7 @@
#define SSL_get1_session yaSSL_get1_session
#define X509_get_notBefore yaX509_get_notBefore
#define X509_get_notAfter yaX509_get_notAfter
+#define yaSSL_ASN1_TIME_to_string ya_SSL_ASN1_TIME_to_string
#define MD4_Init yaMD4_Init
#define MD4_Update yaMD4_Update
#define MD4_Final yaMD4_Final
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index 0d99888da88..9104a2f501c 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
- Use is subject to license terms.
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -539,11 +538,23 @@ void MD5_Final(unsigned char*, MD5_CTX*);
#define SSL_DEFAULT_CIPHER_LIST "" /* default all */
-/* yaSSL adds */
+/* yaSSL extensions */
int SSL_set_compression(SSL*); /* turn on yaSSL zlib compression */
+char *yaSSL_ASN1_TIME_to_string(ASN1_TIME *time, char *buf, size_t len);
+#include "transport_types.h"
+/*
+ Set functions for yaSSL to use in order to send and receive data.
+
+ These hooks are offered in order to enable non-blocking I/O. If
+ not set, yaSSL defaults to using send() and recv().
+ @todo Remove hooks and accompanying code when yaSSL is fixed.
+*/
+void yaSSL_transport_set_ptr(SSL *, void *);
+void yaSSL_transport_set_recv_function(SSL *, yaSSL_recv_func_t);
+void yaSSL_transport_set_send_function(SSL *, yaSSL_send_func_t);
#if defined(__cplusplus) && !defined(YASSL_MYSQL_COMPATIBLE)
} /* namespace */
diff --git a/extra/yassl/include/openssl/transport_types.h b/extra/yassl/include/openssl/transport_types.h
new file mode 100644
index 00000000000..229d7c14eb3
--- /dev/null
+++ b/extra/yassl/include/openssl/transport_types.h
@@ -0,0 +1,26 @@
+/*
+ Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
+#ifndef yaSSL_transport_types_h__
+#define yaSSL_transport_types_h__
+
+/* Type of transport functions used for sending and receiving data. */
+typedef long (*yaSSL_recv_func_t) (void *, void *, size_t, int);
+typedef long (*yaSSL_send_func_t) (void *, const void *, size_t, int);
+
+#endif
diff --git a/extra/yassl/include/socket_wrapper.hpp b/extra/yassl/include/socket_wrapper.hpp
index 2372e64e56c..4c61698e7e3 100644
--- a/extra/yassl/include/socket_wrapper.hpp
+++ b/extra/yassl/include/socket_wrapper.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -54,7 +54,9 @@ typedef unsigned int uint;
const int SOCKET_ERROR = -1;
#endif
-
+ extern "C" {
+ #include "openssl/transport_types.h"
+ }
typedef unsigned char byte;
@@ -64,6 +66,9 @@ class Socket {
socket_t socket_; // underlying socket descriptor
bool wouldBlock_; // if non-blocking data, for last read
bool nonBlocking_; // is option set
+ void *ptr_; // Argument to transport function
+ yaSSL_send_func_t send_func_; // Function to send data
+ yaSSL_recv_func_t recv_func_; // Function to receive data
public:
explicit Socket(socket_t s = INVALID_SOCKET);
~Socket();
@@ -72,11 +77,15 @@ public:
uint get_ready() const;
socket_t get_fd() const;
+ void set_transport_ptr(void *ptr);
+ void set_transport_recv_function(yaSSL_recv_func_t recv_func);
+ void set_transport_send_function(yaSSL_send_func_t send_func);
+
uint send(const byte* buf, unsigned int len, unsigned int& sent,
int flags = 0);
uint receive(byte* buf, unsigned int len, int flags = 0);
-
bool wait();
+
bool WouldBlock() const;
bool IsNonBlocking() const;
diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp
index e5ee00bc21c..82cadb37c30 100644
--- a/extra/yassl/include/yassl_int.hpp
+++ b/extra/yassl/include/yassl_int.hpp
@@ -187,7 +187,7 @@ private:
class StringHolder {
ASN1_STRING asnString_;
public:
- StringHolder(const char* str, int sz);
+ StringHolder(const char* str, int sz, byte type= 0);
~StringHolder();
ASN1_STRING* GetString();
@@ -205,7 +205,7 @@ class X509 {
StringHolder afterDate_; // not valid after
public:
X509(const char* i, size_t, const char* s, size_t,
- const char* b, int, const char* a, int);
+ ASN1_STRING *b, ASN1_STRING *a);
~X509() {}
X509_NAME* GetIssuer();
diff --git a/extra/yassl/src/cert_wrapper.cpp b/extra/yassl/src/cert_wrapper.cpp
index 7e73464001a..e293b80ec04 100644
--- a/extra/yassl/src/cert_wrapper.cpp
+++ b/extra/yassl/src/cert_wrapper.cpp
@@ -91,7 +91,7 @@ opaque* x509::use_buffer()
//CertManager
CertManager::CertManager()
- : peerX509_(0), verifyPeer_(false), verifyNone_(false), failNoCert_(false),
+ : peerX509_(0), selfX509_(0), verifyPeer_(false), verifyNone_(false), failNoCert_(false),
sendVerify_(false), verifyCallback_(0)
{}
@@ -99,6 +99,7 @@ CertManager::CertManager()
CertManager::~CertManager()
{
ysDelete(peerX509_);
+ ysDelete(selfX509_);
STL::for_each(signers_.begin(), signers_.end(), del_ptr_zero()) ;
@@ -210,6 +211,12 @@ X509* CertManager::get_peerX509() const
}
+X509* CertManager::get_selfX509() const
+{
+ return selfX509_;
+}
+
+
SignatureAlgorithm CertManager::get_peerKeyType() const
{
return peerKeyType_;
@@ -281,11 +288,15 @@ int CertManager::Validate()
size_t iSz = strlen(cert.GetIssuer()) + 1;
size_t sSz = strlen(cert.GetCommonName()) + 1;
- int bSz = (int)strlen(cert.GetBeforeDate()) + 1;
- int aSz = (int)strlen(cert.GetAfterDate()) + 1;
+ ASN1_STRING beforeDate, afterDate;
+ beforeDate.data= (unsigned char *) cert.GetBeforeDate();
+ beforeDate.type= cert.GetBeforeDateType();
+ beforeDate.length= strlen((char *) beforeDate.data) + 1;
+ afterDate.data= (unsigned char *) cert.GetAfterDate();
+ afterDate.type= cert.GetAfterDateType();
+ afterDate.length= strlen((char *) afterDate.data) + 1;
peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(),
- sSz, cert.GetBeforeDate(), bSz,
- cert.GetAfterDate(), aSz);
+ sSz, &beforeDate, &afterDate);
if (err == TaoCrypt::SIG_OTHER_E && verifyCallback_) {
X509_STORE_CTX store;
@@ -320,6 +331,18 @@ int CertManager::SetPrivateKey(const x509& key)
keyType_ = rsa_sa_algo;
else
keyType_ = dsa_sa_algo;
+
+ size_t iSz = strlen(cd.GetIssuer()) + 1;
+ size_t sSz = strlen(cd.GetCommonName()) + 1;
+ ASN1_STRING beforeDate, afterDate;
+ beforeDate.data= (unsigned char *) cd.GetBeforeDate();
+ beforeDate.type= cd.GetBeforeDateType();
+ beforeDate.length= strlen((char *) beforeDate.data) + 1;
+ afterDate.data= (unsigned char *) cd.GetAfterDate();
+ afterDate.type= cd.GetAfterDateType();
+ afterDate.length= strlen((char *) afterDate.data) + 1;
+ selfX509_ = NEW_YS X509(cd.GetIssuer(), iSz, cd.GetCommonName(),
+ sSz, &beforeDate, &afterDate);
}
return 0;
}
@@ -336,8 +359,7 @@ void CertManager::setPeerX509(X509* x)
ASN1_STRING* after = x->GetAfter();
peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(),
- subject->GetName(), subject->GetLength(), (const char*) before->data,
- before->length, (const char*) after->data, after->length);
+ subject->GetName(), subject->GetLength(), before, after);
}
diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp
index c1ee61d043e..fb342a10fd5 100644
--- a/extra/yassl/src/handshake.cpp
+++ b/extra/yassl/src/handshake.cpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2008 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -712,7 +711,8 @@ int DoProcessReply(SSL& ssl)
return 0;
}
uint ready = ssl.getSocket().get_ready();
- if (!ready) return 1;
+ if (!ready)
+ ready= 64;
// add buffered data if its there
input_buffer* buffered = ssl.useBuffers().TakeRawInput();
diff --git a/extra/yassl/src/socket_wrapper.cpp b/extra/yassl/src/socket_wrapper.cpp
index d88df13c08e..cf761d912e6 100644
--- a/extra/yassl/src/socket_wrapper.cpp
+++ b/extra/yassl/src/socket_wrapper.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -52,11 +52,33 @@
#endif // _WIN32
+namespace {
+
+
+extern "C" long system_recv(void *ptr, void *buf, size_t count, int flags)
+{
+ yaSSL::socket_t *socket = (yaSSL::socket_t *) ptr;
+ return ::recv(*socket, reinterpret_cast<char *>(buf), count, flags);
+}
+
+
+extern "C" long system_send(void *ptr, const void *buf, size_t count,
+ int flags)
+{
+ yaSSL::socket_t *socket = (yaSSL::socket_t *) ptr;
+ return ::send(*socket, reinterpret_cast<const char *>(buf), count, flags);
+}
+
+
+}
+
+
namespace yaSSL {
Socket::Socket(socket_t s)
- : socket_(s), wouldBlock_(false), nonBlocking_(false)
+ : socket_(s), wouldBlock_(false), nonBlocking_(false),
+ ptr_(&socket_), send_func_(system_send), recv_func_(system_recv)
{}
@@ -108,8 +130,25 @@ uint Socket::get_ready() const
return ready;
}
+void Socket::set_transport_ptr(void *ptr)
+{
+ ptr_ = ptr;
+}
+
-uint Socket::send(const byte* buf, unsigned int sz, unsigned int& written,
+void Socket::set_transport_recv_function(yaSSL_recv_func_t recv_func)
+{
+ recv_func_ = recv_func;
+}
+
+
+void Socket::set_transport_send_function(yaSSL_send_func_t send_func)
+{
+ send_func_ = send_func;
+}
+
+
+uint Socket::send(const byte* buf, unsigned int sz, unsigned int &written,
int flags)
{
const byte* pos = buf;
@@ -117,22 +156,23 @@ uint Socket::send(const byte* buf, unsigned int sz, unsigned int& written,
wouldBlock_ = false;
- while (pos != end) {
- int sent = ::send(socket_, reinterpret_cast<const char *>(pos),
- static_cast<int>(end - pos), flags);
- if (sent == -1) {
- if (get_lastError() == SOCKET_EWOULDBLOCK ||
- get_lastError() == SOCKET_EAGAIN) {
- wouldBlock_ = true; // would have blocked this time only
- nonBlocking_ = true; // nonblocking, win32 only way to tell
- return 0;
- }
- return static_cast<uint>(-1);
+ while (pos != end)
+ {
+ int sent = send_func_(ptr_, pos, static_cast<int>(end - pos), flags);
+ if (sent == -1)
+ {
+ if (get_lastError() == SOCKET_EWOULDBLOCK ||
+ get_lastError() == SOCKET_EAGAIN)
+ {
+ wouldBlock_ = true; // would have blocked this time only
+ nonBlocking_ = true; // nonblocking, win32 only way to tell
+ return 0;
}
- pos += sent;
- written += sent;
+ return static_cast<uint>(-1);
+ }
+ pos += sent;
+ written += sent;
}
-
return sz;
}
@@ -141,7 +181,7 @@ uint Socket::receive(byte* buf, unsigned int sz, int flags)
{
wouldBlock_ = false;
- int recvd = ::recv(socket_, reinterpret_cast<char *>(buf), sz, flags);
+ int recvd = recv_func_(ptr_, buf, sz, flags);
// idea to seperate error from would block by arnetheduck@gmail.com
if (recvd == -1) {
diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 8401798534b..54cfdbba83c 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2008-2010 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,6 +39,7 @@
#include "coding.hpp" // HexDecoder
#include "helpers.hpp" // for placement new hack
#include <stdio.h>
+#include <time.h>
#ifdef _WIN32
#include <windows.h> // FindFirstFile etc..
@@ -1196,8 +1196,7 @@ void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX* ctx, void* userdata)
X509* SSL_get_certificate(SSL* ssl)
{
- // only used to pass to get_privatekey which isn't used
- return 0;
+ return ssl->getCrypto().get_certManager().get_selfX509();
}
@@ -1671,7 +1670,6 @@ unsigned long ERR_get_error()
// TODO:
}
-
SSL_CIPHER* SSL_get_current_cipher(SSL*)
{
// TODO:
@@ -1685,10 +1683,41 @@ unsigned long ERR_get_error()
return 0;
}
+ // end stunnel needs
+
+ char *yaSSL_ASN1_TIME_to_string(ASN1_TIME *time, char *buf, size_t len)
+ {
+ tm t;
+ static const char *month_names[12]=
+ {
+ "Jan","Feb","Mar","Apr","May","Jun",
+ "Jul","Aug","Sep","Oct","Nov","Dec"
+ };
+
+ TaoCrypt::ASN1_TIME_extract(time->data, time->type, &t);
+ snprintf(buf, len, "%s %2d %02d:%02d:%02d %d GMT",
+ month_names[t.tm_mon], t.tm_mday, t.tm_hour, t.tm_min,
+ t.tm_sec, t.tm_year + 1900);
+ return buf;
+ }
- // end stunnel needs
+ void yaSSL_transport_set_ptr(SSL *ssl, void *ptr)
+ {
+ ssl->useSocket().set_transport_ptr(ptr);
+ }
+
+
+ void yaSSL_transport_set_recv_function(SSL *ssl, yaSSL_recv_func_t func)
+ {
+ ssl->useSocket().set_transport_recv_function(func);
+ }
+
+ void yaSSL_transport_set_send_function(SSL *ssl, yaSSL_send_func_t func)
+ {
+ ssl->useSocket().set_transport_send_function(func);
+ }
} // extern "C"
} // namespace
diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp
index 65e17b01544..8de24850223 100644
--- a/extra/yassl/src/yassl_int.cpp
+++ b/extra/yassl/src/yassl_int.cpp
@@ -1459,12 +1459,12 @@ void SSL_SESSION::CopyX509(X509* x)
X509_NAME* issuer = x->GetIssuer();
X509_NAME* subject = x->GetSubject();
- ASN1_STRING* before = x->GetBefore();
- ASN1_STRING* after = x->GetAfter();
+ ASN1_TIME* before = x->GetBefore();
+ ASN1_TIME* after = x->GetAfter();
peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(),
- subject->GetName(), subject->GetLength(), (const char*) before->data,
- before->length, (const char*) after->data, after->length);
+ subject->GetName(), subject->GetLength(),
+ before, after);
}
@@ -2412,9 +2412,10 @@ size_t X509_NAME::GetLength() const
X509::X509(const char* i, size_t iSz, const char* s, size_t sSz,
- const char* b, int bSz, const char* a, int aSz)
+ ASN1_STRING *b, ASN1_STRING *a)
: issuer_(i, iSz), subject_(s, sSz),
- beforeDate_(b, bSz), afterDate_(a, aSz)
+ beforeDate_((char *) b->data, b->length, b->type),
+ afterDate_((char *) a->data, a->length, a->type)
{}
@@ -2430,13 +2431,13 @@ X509_NAME* X509::GetSubject()
}
-ASN1_STRING* X509::GetBefore()
+ASN1_TIME* X509::GetBefore()
{
return beforeDate_.GetString();
}
-ASN1_STRING* X509::GetAfter()
+ASN1_TIME* X509::GetAfter()
{
return afterDate_.GetString();
}
@@ -2464,12 +2465,12 @@ ASN1_STRING* X509_NAME::GetEntry(int i)
}
-StringHolder::StringHolder(const char* str, int sz)
+StringHolder::StringHolder(const char* str, int sz, byte type)
{
asnString_.length = sz;
asnString_.data = NEW_YS byte[sz + 1];
memcpy(asnString_.data, str, sz);
- asnString_.type = 0; // not used for now
+ asnString_.type = type;
}
diff --git a/extra/yassl/taocrypt/include/asn.hpp b/extra/yassl/taocrypt/include/asn.hpp
index c20387d86c7..d52413b504c 100644
--- a/extra/yassl/taocrypt/include/asn.hpp
+++ b/extra/yassl/taocrypt/include/asn.hpp
@@ -33,7 +33,7 @@
#else
#include "list.hpp"
#endif
-
+#include <time.h>
namespace STL = STL_NAMESPACE;
@@ -280,7 +280,9 @@ public:
const char* GetCommonName() const { return subject_; }
const byte* GetHash() const { return subjectHash_; }
const char* GetBeforeDate() const { return beforeDate_; }
+ byte GetBeforeDateType() const { return beforeDateType_; }
const char* GetAfterDate() const { return afterDate_; }
+ byte GetAfterDateType() const { return afterDateType_; }
void DecodeToKey();
private:
@@ -296,7 +298,9 @@ private:
char issuer_[ASN_NAME_MAX]; // Names
char subject_[ASN_NAME_MAX]; // Names
char beforeDate_[MAX_DATE_SZ]; // valid before date
+ byte beforeDateType_; // beforeDate time type
char afterDate_[MAX_DATE_SZ]; // valid after date
+ byte afterDateType_; // afterDate time type
bool verify_; // Default to yes, but could be off
void ReadHeader();
@@ -369,6 +373,9 @@ int GetCert(Source&);
// Get Cert in PEM format from pkcs12 file
int GetPKCS_Cert(const char* password, Source&);
+void ASN1_TIME_extract(const unsigned char* date, unsigned char format,
+ tm *parsed_time);
+
} // namespace
diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp
index a502666d15b..0271891fa53 100644
--- a/extra/yassl/taocrypt/src/asn.cpp
+++ b/extra/yassl/taocrypt/src/asn.cpp
@@ -33,10 +33,55 @@
#include "coding.hpp"
#include <time.h> // gmtime();
#include "memory.hpp" // some auto_ptr don't have reset, also need auto_array
-
+#include <assert.h>
namespace TaoCrypt {
+// like atoi but only use first byte
+word32 btoi(byte b)
+{
+ return b - 0x30;
+}
+
+
+// two byte date/time, add to value
+void GetTime(int *value, const byte* date, int& i)
+{
+ *value += btoi(date[i++]) * 10;
+ *value += btoi(date[i++]);
+}
+
+
+void ASN1_TIME_extract(const unsigned char* date, unsigned char format,
+ tm *t)
+{
+ int i = 0;
+ memset(t, 0, sizeof (tm));
+
+ assert(format == UTC_TIME || format == GENERALIZED_TIME);
+
+ if (format == UTC_TIME) {
+ if (btoi(date[0]) >= 5)
+ t->tm_year = 1900;
+ else
+ t->tm_year = 2000;
+ }
+ else { // format == GENERALIZED_TIME
+ t->tm_year += btoi(date[i++]) * 1000;
+ t->tm_year += btoi(date[i++]) * 100;
+ }
+
+ GetTime(&t->tm_year, date, i); t->tm_year -= 1900; // adjust
+ GetTime(&t->tm_mon, date, i); t->tm_mon -= 1; // adjust
+ GetTime(&t->tm_mday, date, i);
+ GetTime(&t->tm_hour, date, i);
+ GetTime(&t->tm_min, date, i);
+ GetTime(&t->tm_sec, date, i);
+
+ assert(date[i] == 'Z'); // only Zulu supported for this profile
+}
+
+
namespace { // locals
@@ -71,52 +116,15 @@ bool operator<(tm& a, tm&b)
}
-// like atoi but only use first byte
-word32 btoi(byte b)
-{
- return b - 0x30;
-}
-
-
-// two byte date/time, add to value
-void GetTime(int& value, const byte* date, int& i)
-{
- value += btoi(date[i++]) * 10;
- value += btoi(date[i++]);
-}
-
-
// Make sure before and after dates are valid
bool ValidateDate(const byte* date, byte format, CertDecoder::DateType dt)
{
tm certTime;
- memset(&certTime, 0, sizeof(certTime));
- int i = 0;
-
- if (format == UTC_TIME) {
- if (btoi(date[0]) >= 5)
- certTime.tm_year = 1900;
- else
- certTime.tm_year = 2000;
- }
- else { // format == GENERALIZED_TIME
- certTime.tm_year += btoi(date[i++]) * 1000;
- certTime.tm_year += btoi(date[i++]) * 100;
- }
-
- GetTime(certTime.tm_year, date, i); certTime.tm_year -= 1900; // adjust
- GetTime(certTime.tm_mon, date, i); certTime.tm_mon -= 1; // adjust
- GetTime(certTime.tm_mday, date, i);
- GetTime(certTime.tm_hour, date, i);
- GetTime(certTime.tm_min, date, i);
- GetTime(certTime.tm_sec, date, i);
-
- if (date[i] != 'Z') // only Zulu supported for this profile
- return false;
-
time_t ltime = time(0);
tm* localTime = gmtime(&ltime);
+ ASN1_TIME_extract(date, format, &certTime);
+
if (dt == CertDecoder::BEFORE) {
if (*localTime < certTime)
return false;
@@ -879,10 +887,12 @@ void CertDecoder::GetDate(DateType dt)
if (dt == BEFORE) {
memcpy(beforeDate_, date, length);
beforeDate_[length] = 0;
+ beforeDateType_= b;
}
else { // after
memcpy(afterDate_, date, length);
afterDate_[length] = 0;
+ afterDateType_= b;
}
}
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index a90238dbd42..8ff613155d3 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -24,6 +24,7 @@ SET(HEADERS_GEN_CONFIGURE
SET(HEADERS
mysql.h
mysql_com.h
+ mysql_com_server.h
mysql_time.h
ma_dyncol.h
my_list.h
diff --git a/include/my_global.h b/include/my_global.h
index 6fcaa258f21..fa9ce649543 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -90,17 +90,6 @@
#define IF_WIN(A,B) B
#endif
-#ifndef EMBEDDED_LIBRARY
-#ifdef WITH_NDB_BINLOG
-#define HAVE_NDB_BINLOG 1
-#endif
-#endif /* !EMBEDDED_LIBRARY */
-
-#ifndef EMBEDDED_LIBRARY
-#define HAVE_REPLICATION
-#define HAVE_EXTERNAL_CLIENT
-#endif
-
#if defined (_WIN32)
/*
off_t is 32 bit long. We do not use C runtime functions
@@ -1018,6 +1007,7 @@ typedef struct st_mysql_lex_string LEX_STRING;
#define SOCKET_ETIMEDOUT WSAETIMEDOUT
#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
#define SOCKET_EADDRINUSE WSAEADDRINUSE
+#define SOCKET_ECONNRESET WSAECONNRESET
#define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE
#else /* Unix */
@@ -1028,6 +1018,7 @@ typedef struct st_mysql_lex_string LEX_STRING;
#define SOCKET_ETIMEDOUT SOCKET_EINTR
#define SOCKET_EWOULDBLOCK EWOULDBLOCK
#define SOCKET_EADDRINUSE EADDRINUSE
+#define SOCKET_ECONNRESET ECONNRESET
#define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE
#endif
@@ -1541,6 +1532,12 @@ static inline double rint(double x)
#undef HAVE_SMEM /* No shared memory */
+#else
+#ifdef WITH_NDB_BINLOG
+#define HAVE_NDB_BINLOG 1
+#endif
+#define HAVE_REPLICATION
+#define HAVE_EXTERNAL_CLIENT
#endif /* EMBEDDED_LIBRARY */
#endif /* my_global_h */
diff --git a/include/my_net.h b/include/my_net.h
index ce2ee6ce8ca..8c62790bf51 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -61,13 +61,15 @@ C_MODE_START
#define SD_BOTH 0x02
*/
#define SHUT_RDWR 0x02
-
+#else
+#include <netdb.h> /* getaddrinfo() & co */
#endif
/*
- On OSes which don't have the in_addr_t, we guess that using uint32 is the best
- possible choice. We guess this from the fact that on HP-UX64bit & FreeBSD64bit
- & Solaris64bit, in_addr_t is equivalent to uint32. And on Linux32bit too.
+ On OSes which don't have the in_addr_t, we guess that using uint32
+ is the best possible choice. We guess this from the fact that on
+ HP-UX64bit & FreeBSD64bit & Solaris64bit, in_addr_t is equivalent to
+ uint32. And on Linux32bit too.
*/
#ifndef HAVE_IN_ADDR_T
#define in_addr_t uint32
diff --git a/include/my_sys.h b/include/my_sys.h
index 94c57a93e73..d6ed4f29e72 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -490,6 +490,11 @@ typedef struct st_io_cache /* Used when cacheing files */
typedef int (*qsort2_cmp)(const void *, const void *, const void *);
+typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...)
+ ATTRIBUTE_FORMAT_FPTR(printf, 2, 3);
+
+extern my_error_reporter my_charset_error_reporter;
+
/* defines for mf_iocache */
/* Test if buffer is inited */
@@ -1000,6 +1005,7 @@ char* my_cgets(char *string, size_t clen, size_t* plen);
#ifdef HAVE_PSI_INTERFACE
extern MYSQL_PLUGIN_IMPORT struct PSI_bootstrap *PSI_hook;
+extern void set_psi_server(PSI *psi);
void my_init_mysys_psi_keys(void);
#endif
diff --git a/include/mysql.h b/include/mysql.h
index d71d049f69d..4144b6c1ca4 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -168,9 +168,13 @@ enum mysql_option
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH,
- MYSQL_PROGRESS_CALLBACK,
+ MYSQL_OPT_BIND,
+ MYSQL_OPT_SSL_KEY, MYSQL_OPT_SSL_CERT,
+ MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER,
+ MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH,
/* MariaDB options */
- MYSQL_OPT_NONBLOCK=6000
+ MYSQL_OPT_NONBLOCK=6000,
+ MYSQL_PROGRESS_CALLBACK
};
/**
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index ce577146581..b177c36f90c 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -262,8 +262,12 @@ enum mysql_option
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH,
- MYSQL_PROGRESS_CALLBACK,
- MYSQL_OPT_NONBLOCK=6000
+ MYSQL_OPT_BIND,
+ MYSQL_OPT_SSL_KEY, MYSQL_OPT_SSL_CERT,
+ MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER,
+ MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH,
+ MYSQL_OPT_NONBLOCK=6000,
+ MYSQL_PROGRESS_CALLBACK
};
struct st_mysql_options_extention;
struct st_mysql_options {
diff --git a/include/mysql_com_server.h b/include/mysql_com_server.h
new file mode 100644
index 00000000000..1ea040207d4
--- /dev/null
+++ b/include/mysql_com_server.h
@@ -0,0 +1,41 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/*
+ Definitions private to the server,
+ used in the networking layer to notify specific events.
+*/
+
+#ifndef _mysql_com_server_h
+#define _mysql_com_server_h
+
+struct st_net_server;
+
+typedef void (*before_header_callback_fn)
+ (struct st_net *net, void *user_data, size_t count);
+
+typedef void (*after_header_callback_fn)
+ (struct st_net *net, void *user_data, size_t count, my_bool rc);
+
+struct st_net_server
+{
+ before_header_callback_fn m_before_header;
+ after_header_callback_fn m_after_header;
+ void *m_user_data;
+};
+
+typedef struct st_net_server NET_SERVER;
+
+#endif
diff --git a/include/sql_common.h b/include/sql_common.h
index cd32a77f86e..99abdb2bf72 100644
--- a/include/sql_common.h
+++ b/include/sql_common.h
@@ -32,6 +32,8 @@ struct mysql_async_context;
struct st_mysql_options_extention {
char *plugin_dir;
char *default_auth;
+ char *ssl_crl; /* PEM CRL file */
+ char *ssl_crlpath; /* PEM directory of CRL-s? */
void (*report_progress)(const MYSQL *mysql,
unsigned int stage,
unsigned int max_stage,
diff --git a/include/sslopt-case.h b/include/sslopt-case.h
index 2da5ff317e1..4a8c65948cb 100644
--- a/include/sslopt-case.h
+++ b/include/sslopt-case.h
@@ -22,11 +22,18 @@
case OPT_SSL_CA:
case OPT_SSL_CAPATH:
case OPT_SSL_CIPHER:
+ case OPT_SSL_CRL:
+ case OPT_SSL_CRLPATH:
/*
Enable use of SSL if we are using any ssl option
One can disable SSL later by using --skip-ssl or --ssl=0
*/
opt_use_ssl= 1;
+ /* crl has no effect in yaSSL */
+#ifdef HAVE_YASSL
+ opt_ssl_crl= NULL;
+ opt_ssl_crlpath= NULL;
+#endif
break;
#endif
#endif /* SSLOPT_CASE_INCLUDED */
diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h
index 81d03e54016..e605d0134e7 100644
--- a/include/sslopt-longopts.h
+++ b/include/sslopt-longopts.h
@@ -39,6 +39,13 @@
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
&opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
+ {"ssl-crl", OPT_SSL_KEY, "Certificate revocation list (implies --ssl).",
+ &opt_ssl_crl, &opt_ssl_crl, 0, GET_STR, REQUIRED_ARG,
+ 0, 0, 0, 0, 0, 0},
+ {"ssl-crlpath", OPT_SSL_KEY,
+ "Certificate revocation list path (implies --ssl).",
+ &opt_ssl_crlpath, &opt_ssl_crlpath, 0, GET_STR, REQUIRED_ARG,
+ 0, 0, 0, 0, 0, 0},
#ifdef MYSQL_CLIENT
{"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
"Verify server's \"Common Name\" in its cert against hostname used "
diff --git a/include/sslopt-vars.h b/include/sslopt-vars.h
index 01093feceaf..8e669760faf 100644
--- a/include/sslopt-vars.h
+++ b/include/sslopt-vars.h
@@ -22,12 +22,14 @@
#else
#define SSL_STATIC static
#endif
-SSL_STATIC my_bool opt_use_ssl = 0;
-SSL_STATIC char *opt_ssl_ca = 0;
-SSL_STATIC char *opt_ssl_capath = 0;
-SSL_STATIC char *opt_ssl_cert = 0;
-SSL_STATIC char *opt_ssl_cipher = 0;
-SSL_STATIC char *opt_ssl_key = 0;
+SSL_STATIC my_bool opt_use_ssl = 0;
+SSL_STATIC char *opt_ssl_ca = 0;
+SSL_STATIC char *opt_ssl_capath = 0;
+SSL_STATIC char *opt_ssl_cert = 0;
+SSL_STATIC char *opt_ssl_cipher = 0;
+SSL_STATIC char *opt_ssl_key = 0;
+SSL_STATIC char *opt_ssl_crl = 0;
+SSL_STATIC char *opt_ssl_crlpath = 0;
#ifdef MYSQL_CLIENT
SSL_STATIC my_bool opt_ssl_verify_server_cert= 0;
#endif
diff --git a/include/violite.h b/include/violite.h
index 18df848d8b8..838fc7ee096 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2012 Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -10,8 +11,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
* Vio Lite.
@@ -21,8 +22,8 @@
#ifndef vio_violite_h_
#define vio_violite_h_
-#include "my_net.h" /* needed because of struct in_addr */
-
+#include "my_net.h" /* needed because of struct in_addr */
+#include <mysql/psi/mysql_socket.h>
/* Simple vio interface in C; The functions are implemented in violite.c */
@@ -40,12 +41,23 @@ enum enum_vio_type
VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY
};
+/**
+ VIO I/O events.
+*/
+enum enum_vio_io_event
+{
+ VIO_IO_EVENT_READ,
+ VIO_IO_EVENT_WRITE,
+ VIO_IO_EVENT_CONNECT
+};
#define VIO_LOCALHOST 1 /* a localhost connection */
#define VIO_BUFFERED_READ 2 /* use buffered read */
#define VIO_READ_BUFFER_SIZE 16384 /* size of read buffer */
+#define VIO_DESCRIPTION_SIZE 30 /* size of description */
-Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
+Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
+Vio* mysql_socket_vio_new(MYSQL_SOCKET mysql_socket, enum enum_vio_type type, uint flags);
#ifdef __WIN__
Vio* vio_new_win32pipe(HANDLE hPipe);
Vio* vio_new_win32shared_memory(HANDLE handle_file_map,
@@ -59,13 +71,10 @@ Vio* vio_new_win32shared_memory(HANDLE handle_file_map,
#define HANDLE void *
#endif /* __WIN__ */
-/* backport from 5.6 where it is part of PSI, not vio_*() */
-int mysql_socket_shutdown(my_socket mysql_socket, int how);
-
void vio_delete(Vio* vio);
int vio_close(Vio* vio);
-void vio_reset(Vio* vio, enum enum_vio_type type,
- my_socket sd, HANDLE hPipe, uint flags);
+my_bool vio_reset(Vio* vio, enum enum_vio_type type,
+ my_socket sd, void *ssl, uint flags);
size_t vio_read(Vio *vio, uchar * buf, size_t size);
size_t vio_read_buff(Vio *vio, uchar * buf, size_t size);
size_t vio_write(Vio *vio, const uchar * buf, size_t size);
@@ -78,6 +87,7 @@ int vio_keepalive(Vio *vio, my_bool onoff);
/* Whenever we should retry the last read/write operation. */
my_bool vio_should_retry(Vio *vio);
/* Check that operation was timed out */
+my_bool vio_was_timeout(Vio *vio);
my_bool vio_was_interrupted(Vio *vio);
/* Short text description of the socket for those, who are curious.. */
const char* vio_description(Vio *vio);
@@ -89,9 +99,17 @@ int vio_errno(Vio*vio);
my_socket vio_fd(Vio*vio);
/* Remote peer's address and name in text form */
my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen);
-my_bool vio_poll_read(Vio *vio, uint timeout);
+/* Wait for an I/O event notification. */
+int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout);
my_bool vio_is_connected(Vio *vio);
+#ifndef DBUG_OFF
ssize_t vio_pending(Vio *vio);
+#endif
+/* Set timeout for a network operation. */
+int vio_timeout(Vio *vio, uint which, int timeout_sec);
+/* Connect to a peer. */
+my_bool vio_socket_connect(Vio *vio, struct sockaddr *addr, socklen_t len,
+ int timeout);
my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length,
char *ip_string, size_t ip_string_size);
@@ -111,6 +129,10 @@ int vio_getnameinfo(const struct sockaddr *sa,
#define DES_set_key_unchecked(k,ks) des_set_key_unchecked((k),*(ks))
#define DES_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e) des_ede3_cbc_encrypt((i),(o),(l),*(k1),*(k2),*(k3),(iv),(e))
#endif
+/* apple deprecated openssl in MacOSX Lion */
+#ifdef __APPLE__
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
#define HEADER_DES_LOCL_H dummy_something
#define YASSL_MYSQL_COMPATIBLE
@@ -142,11 +164,13 @@ int sslconnect(struct st_VioSSLFd*, Vio *, long timeout, unsigned long *errptr);
struct st_VioSSLFd
*new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
const char *ca_file, const char *ca_path,
- const char *cipher, enum enum_ssl_init_error* error);
+ const char *cipher, enum enum_ssl_init_error *error,
+ const char *crl_file, const char *crl_path);
struct st_VioSSLFd
*new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
const char *ca_file,const char *ca_path,
- const char *cipher, enum enum_ssl_init_error* error);
+ const char *cipher, enum enum_ssl_init_error *error,
+ const char *crl_file, const char *crl_path);
void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd);
#endif /* HAVE_OPENSSL */
@@ -167,12 +191,13 @@ void vio_end(void);
#define vio_fastsend(vio) (vio)->fastsend(vio)
#define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive)
#define vio_should_retry(vio) (vio)->should_retry(vio)
+#define vio_was_timeout(vio) (vio)->was_timeout(vio)
#define vio_was_interrupted(vio) (vio)->was_interrupted(vio)
#define vio_close(vio) ((vio)->vioclose)(vio)
#define vio_shutdown(vio,how) ((vio)->shutdown)(vio,how)
#define vio_peer_addr(vio, buf, prt, buflen) (vio)->peer_addr(vio, buf, prt, buflen)
+#define vio_io_wait(vio, event, timeout) (vio)->io_wait(vio, event, timeout)
#define vio_timeout(vio, which, seconds) (vio)->timeout(vio, which, seconds)
-#define vio_poll_read(vio, timeout) (vio)->poll_read(vio, timeout)
#define vio_is_connected(vio) (vio)->is_connected(vio)
#endif /* !defined(DONT_MAP_VIO) */
@@ -202,26 +227,31 @@ enum SSL_type
/* This structure is for every connection on both sides */
struct st_vio
{
- my_socket sd; /* my_socket - real or imaginary */
- HANDLE hPipe;
+ MYSQL_SOCKET mysql_socket; /* Instrumented socket */
my_bool localhost; /* Are we from localhost? */
int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */
- struct sockaddr_storage local; /* Local internet address */
- struct sockaddr_storage remote; /* Remote internet address */
+ struct sockaddr_storage local; /* Local internet address */
+ struct sockaddr_storage remote; /* Remote internet address */
int addrLen; /* Length of remote address */
enum enum_vio_type type; /* Type of connection */
- char desc[30]; /* String description */
+ /*
+ Description string. This member MUST NOT be used directly, but only
+ via function "vio_description"
+ */
+ char desc[VIO_DESCRIPTION_SIZE];
char *read_buffer; /* buffer for vio_read_buff */
char *read_pos; /* start of unfetched data in the
read buffer */
char *read_end; /* end of unfetched data */
struct mysql_async_context *async_context; /* For non-blocking API */
- uint read_timeout, write_timeout;
+ int read_timeout; /* Timeout value (ms) for read ops. */
+ int write_timeout; /* Timeout value (ms) for write ops. */
/* function pointers. They are similar for socket/SSL/whatever */
void (*viodelete)(Vio*);
int (*vioerrno)(Vio*);
size_t (*read)(Vio*, uchar *, size_t);
size_t (*write)(Vio*, const uchar *, size_t);
+ int (*timeout)(Vio*, uint, my_bool);
int (*vioblocking)(Vio*, my_bool, my_bool *);
my_bool (*is_blocking)(Vio*);
int (*viokeepalive)(Vio*, my_bool);
@@ -229,13 +259,19 @@ struct st_vio
my_bool (*peer_addr)(Vio*, char *, uint16*, size_t);
void (*in_addr)(Vio*, struct sockaddr_storage*);
my_bool (*should_retry)(Vio*);
+ my_bool (*was_timeout)(Vio*);
my_bool (*was_interrupted)(Vio*);
int (*vioclose)(Vio*);
- void (*timeout)(Vio*, unsigned int which, unsigned int timeout);
- my_bool (*poll_read)(Vio *vio, uint timeout);
my_bool (*is_connected)(Vio*);
int (*shutdown)(Vio *, int);
my_bool (*has_data) (Vio*);
+ int (*io_wait)(Vio*, enum enum_vio_io_event, int);
+ my_bool (*connect)(Vio*, struct sockaddr *, socklen_t, int);
+#ifdef _WIN32
+ HANDLE hPipe;
+ DWORD thread_id; /* Used on XP only by vio_shutdown() */
+ OVERLAPPED overlapped;
+#endif
#ifdef HAVE_OPENSSL
void *ssl_arg;
#endif
@@ -250,11 +286,5 @@ struct st_vio
size_t shared_memory_remain;
char *shared_memory_pos;
#endif /* HAVE_SMEM */
-#ifdef _WIN32
- DWORD thread_id; /* Used on XP only by vio_shutdown() */
- OVERLAPPED pipe_overlapped;
- DWORD read_timeout_ms;
- DWORD write_timeout_ms;
-#endif
};
#endif /* vio_violite_h_ */
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index 858a89f706c..d120a09eff2 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -60,10 +60,12 @@ if ($tmp)
--echo Last_SQL_Error
--echo Replicate_Ignore_Server_Ids
--echo Master_Server_Id #
+ --echo Master_SSL_Crl
+ --echo Master_SSL_Crlpath
}
if (!$tmp) {
# Note: after WL#5177, fields 13-18 shall not be filtered-out.
- --replace_column 4 # 5 # 6 # 7 # 8 # 9 # 10 # 13 # 14 # 15 # 16 # 17 # 18 # 22 # 23 # 24 # 25 # 26 # 40 #
+ --replace_column 4 # 5 # 6 # 7 # 8 # 9 # 10 # 13 # 14 # 15 # 16 # 17 # 18 # 22 # 23 # 24 # 25 # 26 # 40 # 41 # 42 #
query_vertical
SHOW SLAVE STATUS;
}
diff --git a/mysql-test/include/have_openssl.inc b/mysql-test/include/have_openssl.inc
new file mode 100644
index 00000000000..e240d935cb2
--- /dev/null
+++ b/mysql-test/include/have_openssl.inc
@@ -0,0 +1,4 @@
+-- require r/openssl.require
+disable_query_log;
+show variables like "have_openssl";
+enable_query_log;
diff --git a/mysql-test/r/openssl.require b/mysql-test/r/openssl.require
new file mode 100644
index 00000000000..dae48a472b5
--- /dev/null
+++ b/mysql-test/r/openssl.require
@@ -0,0 +1,2 @@
+Variable_name Value
+have_openssl YES
diff --git a/mysql-test/r/ssl-crl-revoked-crl.result b/mysql-test/r/ssl-crl-revoked-crl.result
new file mode 100644
index 00000000000..8ecc6a509d3
--- /dev/null
+++ b/mysql-test/r/ssl-crl-revoked-crl.result
@@ -0,0 +1 @@
+# try logging in with a certificate in the server's --ssl-crl : should fail
diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result
index 53fbb1988e7..14c37c1575d 100644
--- a/mysql-test/r/ssl.result
+++ b/mysql-test/r/ssl.result
@@ -1,6 +1,12 @@
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
+SHOW STATUS LIKE 'Ssl_server_not_before';
+Variable_name Value
+Ssl_server_not_before Jan 29 11:56:49 2010 GMT
+SHOW STATUS LIKE 'Ssl_server_not_after';
+Variable_name Value
+Ssl_server_not_after Jan 28 11:56:49 2015 GMT
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
diff --git a/mysql-test/r/ssl_crl.result b/mysql-test/r/ssl_crl.result
new file mode 100644
index 00000000000..570dd9cab06
--- /dev/null
+++ b/mysql-test/r/ssl_crl.result
@@ -0,0 +1,23 @@
+# test --crl for the client : should connect
+Variable_name Value
+have_openssl YES
+have_ssl YES
+ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+ssl_capath
+ssl_cert MYSQL_TEST_DIR/std_data/crl-server-cert.pem
+ssl_cipher
+ssl_crl MYSQL_TEST_DIR/std_data/crl-client-revoked.crl
+ssl_crlpath
+ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
+# test --crlpath for the client : should connect
+Variable_name Value
+have_openssl YES
+have_ssl YES
+ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+ssl_capath
+ssl_cert MYSQL_TEST_DIR/std_data/crl-server-cert.pem
+ssl_cipher
+ssl_crl MYSQL_TEST_DIR/std_data/crl-client-revoked.crl
+ssl_crlpath
+ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
+# try logging in with a certificate in the server's --ssl-crl : should fail
diff --git a/mysql-test/r/ssl_crl_clients-valid.result b/mysql-test/r/ssl_crl_clients-valid.result
new file mode 100644
index 00000000000..f3f47d51846
--- /dev/null
+++ b/mysql-test/r/ssl_crl_clients-valid.result
@@ -0,0 +1,24 @@
+# Test clients with and without CRL lists
+############ Test mysql ##############
+# Test mysql connecting to a server with an empty crl
+Variable_name Value
+have_openssl YES
+have_ssl YES
+ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+ssl_capath
+ssl_cert MYSQL_TEST_DIR/std_data/crl-client-cert.pem
+ssl_cipher
+ssl_crl
+ssl_crlpath
+ssl_key MYSQL_TEST_DIR/std_data/crl-client-key.pem
+# Test mysql connecting to a server with a certificate revoked by -crl
+# Test mysql connecting to a server with a certificate revoked by -crlpath
+############ Test mysqladmin ##############
+# Test mysqladmin connecting to a server with an empty crl
+mysqld is alive
+# Test mysqladmin connecting to a server with a certificate revoked by -crl
+mysqladmin: connect to server at 'localhost' failed
+error: 'SSL connection error: Failed to set ciphers to use'
+# Test mysqladmin connecting to a server with a certificate revoked by -crlpath
+mysqladmin: connect to server at 'localhost' failed
+error: 'SSL connection error: error:00000005:lib(0):func(0):DH lib'
diff --git a/mysql-test/r/ssl_crl_clients.result b/mysql-test/r/ssl_crl_clients.result
new file mode 100644
index 00000000000..3bb9b4ee7e2
--- /dev/null
+++ b/mysql-test/r/ssl_crl_clients.result
@@ -0,0 +1,7 @@
+# Test clients with and without CRL lists
+############ Test mysql ##############
+# Test mysql connecting to a server with a certificate revoked by -crl
+# Test mysql connecting to a server with a certificate revoked by -crlpath
+############ Test mysqladmin ##############
+# Test mysqladmin connecting to a server with a certificate revoked by -crl
+# Test mysqladmin connecting to a server with a certificate revoked by -crlpath
diff --git a/mysql-test/r/ssl_crl_clients_valid.result b/mysql-test/r/ssl_crl_clients_valid.result
new file mode 100644
index 00000000000..32ee72d5c39
--- /dev/null
+++ b/mysql-test/r/ssl_crl_clients_valid.result
@@ -0,0 +1,16 @@
+# Test clients with and without CRL lists
+############ Test mysql ##############
+# Test mysql connecting to a server with an empty crl
+Variable_name Value
+have_openssl YES
+have_ssl YES
+ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+ssl_capath
+ssl_cert MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pem
+ssl_cipher
+ssl_crl MYSQL_TEST_DIR/std_data/crl-client-revoked.crl
+ssl_crlpath
+ssl_key MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem
+############ Test mysqladmin ##############
+# Test mysqladmin connecting to a server with an empty crl
+mysqld is alive
diff --git a/mysql-test/r/ssl_crl_clrpath.result b/mysql-test/r/ssl_crl_clrpath.result
new file mode 100644
index 00000000000..b4b4d13eca1
--- /dev/null
+++ b/mysql-test/r/ssl_crl_clrpath.result
@@ -0,0 +1,23 @@
+# test --crl for the client : should connect
+Variable_name Value
+have_openssl YES
+have_ssl YES
+ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+ssl_capath
+ssl_cert MYSQL_TEST_DIR/std_data/crl-server-cert.pem
+ssl_cipher
+ssl_crl
+ssl_crlpath MYSQL_TEST_DIR/std_data/crldir
+ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
+# test --crlpath for the client : should connect
+Variable_name Value
+have_openssl YES
+have_ssl YES
+ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+ssl_capath
+ssl_cert MYSQL_TEST_DIR/std_data/crl-server-cert.pem
+ssl_cipher
+ssl_crl
+ssl_crlpath MYSQL_TEST_DIR/std_data/crldir
+ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
+# try logging in with a certificate in the server's --ssl-crlpath : should fail
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 4b1e525e1df..a193751048c 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -982,6 +982,8 @@ ssl_ca #
ssl_capath #
ssl_cert #
ssl_cipher #
+ssl_crl #
+ssl_crlpath #
ssl_key #
select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
@@ -989,6 +991,8 @@ SSL_CA #
SSL_CAPATH #
SSL_CERT #
SSL_CIPHER #
+SSL_CRL #
+SSL_CRLPATH #
SSL_KEY #
select @@log_queries_not_using_indexes;
@@log_queries_not_using_indexes
diff --git a/mysql-test/std_data/crl-client-revoked.crl b/mysql-test/std_data/crl-client-revoked.crl
new file mode 100644
index 00000000000..80c4b1254d4
--- /dev/null
+++ b/mysql-test/std_data/crl-client-revoked.crl
@@ -0,0 +1,10 @@
+-----BEGIN X509 CRL-----
+MIIBbDCB1gIBATANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJCRzEQMA4GA1UE
+CBMHUGxvdmRpdjEPMA0GA1UEChMGT3JhY2xlMQ4wDAYDVQQLEwVNeVNRTDEmMCQG
+A1UEAxMdTXlTUUwgQ1JMIHRlc3QgQ0EgY2VydGlmaWNhdGUXDTExMDgxOTEwMDQ1
+MFoXDTE3MDIwODEwMDQ1MFowKjAoAgkApYXsYLFoRCQXDTExMDYxNzA3Mzc1OVow
+DDAKBgNVHRUEAwoBBaAOMAwwCgYDVR0UBAMCAQMwDQYJKoZIhvcNAQEFBQADgYEA
+BXAwYBjHUHG6MQ22/+1hvOaRtSYfj/E5bhKbBB8JlKSRFO+xIOF2i2H1AigunWpC
+R10NicSS7qjsr6yDyBaywZmi0TCNGksR7b3m1m97RnhrxkVRlr/i7L+o04ZwWo/b
+z9zoTX6RTj8rHgQtEdIOi/EArCvDv+wqYmkI+XMScGI=
+-----END X509 CRL-----
diff --git a/mysql-test/std_data/crldir/fc725416.r0 b/mysql-test/std_data/crldir/fc725416.r0
new file mode 100644
index 00000000000..80c4b1254d4
--- /dev/null
+++ b/mysql-test/std_data/crldir/fc725416.r0
@@ -0,0 +1,10 @@
+-----BEGIN X509 CRL-----
+MIIBbDCB1gIBATANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJCRzEQMA4GA1UE
+CBMHUGxvdmRpdjEPMA0GA1UEChMGT3JhY2xlMQ4wDAYDVQQLEwVNeVNRTDEmMCQG
+A1UEAxMdTXlTUUwgQ1JMIHRlc3QgQ0EgY2VydGlmaWNhdGUXDTExMDgxOTEwMDQ1
+MFoXDTE3MDIwODEwMDQ1MFowKjAoAgkApYXsYLFoRCQXDTExMDYxNzA3Mzc1OVow
+DDAKBgNVHRUEAwoBBaAOMAwwCgYDVR0UBAMCAQMwDQYJKoZIhvcNAQEFBQADgYEA
+BXAwYBjHUHG6MQ22/+1hvOaRtSYfj/E5bhKbBB8JlKSRFO+xIOF2i2H1AigunWpC
+R10NicSS7qjsr6yDyBaywZmi0TCNGksR7b3m1m97RnhrxkVRlr/i7L+o04ZwWo/b
+z9zoTX6RTj8rHgQtEdIOi/EArCvDv+wqYmkI+XMScGI=
+-----END X509 CRL-----
diff --git a/mysql-test/suite/perfschema/disabled.def b/mysql-test/suite/perfschema/disabled.def
index 8cae44a3607..a5b558e56cc 100644
--- a/mysql-test/suite/perfschema/disabled.def
+++ b/mysql-test/suite/perfschema/disabled.def
@@ -10,3 +10,22 @@
#
##############################################################################
+hostcache_ipv6_addrinfo_again_allow: Need --bind-addr
+hostcache_ipv6_addrinfo_again_deny: Need --bind-addr
+hostcache_ipv6_addrinfo_bad_allow: Need --bind-addr
+hostcache_ipv6_addrinfo_bad_deny: Need --bind-addr
+hostcache_ipv6_addrinfo_good_allow: Need --bind-addr
+hostcache_ipv6_addrinfo_good_deny: Need --bind-addr
+hostcache_ipv6_addrinfo_noname_allow: Need --bind-addr
+hostcache_ipv6_addrinfo_noname_deny: Need --bind-addr
+hostcache_ipv6_auth_plugin: Need --bind-addr
+hostcache_ipv6_blocked: Need --bind-addr
+hostcache_ipv6_max_con: Need --bind-addr
+hostcache_ipv6_nameinfo_again_allow: Need --bind-addr
+hostcache_ipv6_nameinfo_again_deny: Need --bind-addr
+hostcache_ipv6_nameinfo_noname_allow: Need --bind-addr
+hostcache_ipv6_nameinfo_noname_deny: Need --bind-addr
+hostcache_ipv6_passwd: Need --bind-addr
+hostcache_ipv6_ssl: Need --bind-addr
+hostcache_ipv4_auth_plugin: need hostcache
+hostcache_ipv6_auth_plugin: need hostcache
diff --git a/mysql-test/suite/perfschema/include/connection_cleanup.inc b/mysql-test/suite/perfschema/include/connection_cleanup.inc
new file mode 100644
index 00000000000..761540b4fc4
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/connection_cleanup.inc
@@ -0,0 +1,27 @@
+# Tests for the performance schema
+
+# =====================================
+# HELPER include/connection_cleanup.inc
+# =====================================
+
+--disable_query_log
+revoke all privileges, grant option from user1@localhost;
+revoke all privileges, grant option from user2@localhost;
+revoke all privileges, grant option from user3@localhost;
+revoke all privileges, grant option from user4@localhost;
+revoke all privileges, grant option from user5@localhost;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+drop user user5@localhost;
+flush privileges;
+
+drop procedure dump_all;
+
+truncate table performance_schema.accounts;
+truncate table performance_schema.users;
+truncate table performance_schema.hosts;
+
+--enable_query_log
+
diff --git a/mysql-test/suite/perfschema/include/connection_load.inc b/mysql-test/suite/perfschema/include/connection_load.inc
new file mode 100644
index 00000000000..16fc136f842
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/connection_load.inc
@@ -0,0 +1,210 @@
+# Tests for the performance schema
+
+# =======================================
+# HELPER include/connection_load.inc
+# =======================================
+
+call dump_all();
+
+connect (con1a, localhost, user1, , );
+select "user1 in con1a" as status;
+call dump_all();
+
+connect (con1b, localhost, user1, , );
+select "user1 in con1b" as status;
+call dump_all();
+
+connect (con1c, localhost, user1, , );
+select "user1 in con1c" as status;
+call dump_all();
+
+connect (con2a, localhost, user2, , );
+select "user2 in con2a" as status;
+call dump_all();
+
+connect (con2b, localhost, user2, , );
+select "user2 in con2b" as status;
+call dump_all();
+
+connect (con2c, localhost, user2, , );
+select "user2 in con2c" as status;
+call dump_all();
+
+connect (con3a, localhost, user3, , );
+select "user3 in con3a" as status;
+call dump_all();
+
+connect (con3b, localhost, user3, , );
+select "user3 in con3b" as status;
+call dump_all();
+
+connect (con3c, localhost, user3, , );
+select "user3 in con3c" as status;
+call dump_all();
+
+--connection default
+
+--disconnect con1a
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 8 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+select "con1a disconnected" as status;
+call dump_all();
+
+--disconnect con2a
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 7 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+select "con2a disconnected" as status;
+call dump_all();
+
+--disconnect con3a
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 6 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+select "con3a disconnected" as status;
+call dump_all();
+
+truncate table performance_schema.accounts;
+call dump_all();
+truncate table performance_schema.users;
+call dump_all();
+truncate table performance_schema.hosts;
+call dump_all();
+
+connect (con4a, localhost, user4, , );
+select "user4 in con4a" as status;
+call dump_all();
+
+connect (con4b, localhost, user4, , );
+select "user4 in con4b" as status;
+call dump_all();
+
+connect (con4c, localhost, user4, , );
+select "user4 in con4c" as status;
+call dump_all();
+
+--connection default
+
+--disconnect con1b
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 8 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+select "con1b disconnected" as status;
+call dump_all();
+
+--disconnect con2b
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 7 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+select "con2b disconnected" as status;
+call dump_all();
+
+--disconnect con3b
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 6 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+select "con3b disconnected" as status;
+call dump_all();
+
+--disconnect con1c
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 5 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+select "con1c disconnected" as status;
+call dump_all();
+
+--disconnect con2c
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 4 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+select "con2c disconnected" as status;
+call dump_all();
+
+--disconnect con3c
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 3 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+select "con3c disconnected" as status;
+call dump_all();
+
+truncate table performance_schema.accounts;
+call dump_all();
+truncate table performance_schema.users;
+call dump_all();
+truncate table performance_schema.hosts;
+call dump_all();
+
+connect (con5a, localhost, user5, , );
+select "user5 in con5a" as status;
+call dump_all();
+
+connect (con5b, localhost, user5, , );
+select "user5 in con5b" as status;
+call dump_all();
+
+connect (con5c, localhost, user5, , );
+select "user5 in con5c" as status;
+call dump_all();
+
+--connection default
+
+--disconnect con4a
+--disconnect con4b
+--disconnect con4c
+--disconnect con5a
+--disconnect con5b
+--disconnect con5c
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
+call dump_all();
+
+truncate table performance_schema.hosts;
+call dump_all();
+truncate table performance_schema.users;
+call dump_all();
+truncate table performance_schema.accounts;
+call dump_all();
+
diff --git a/mysql-test/suite/perfschema/include/connection_setup.inc b/mysql-test/suite/perfschema/include/connection_setup.inc
new file mode 100644
index 00000000000..da57b6dd388
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/connection_setup.inc
@@ -0,0 +1,109 @@
+# Tests for the performance schema
+
+# =============
+# DOCUMENTATION
+# =============
+
+# Verify how connections are counted into various tables:
+# - accounts
+# - users
+# - hosts
+#
+# The tests are written with the following helpers:
+# - include/connection_setup.inc
+# - include/connection_load.inc
+# - include/connection_cleanup.inc
+#
+# Helpers are intended to be used as follows.
+#
+# A Typical test t/connection_xxx.test will consist of:
+# --source ../include/connection_setup.inc
+# --source ../include/connection_load.inc
+# --source ../include/connection_cleanup.inc
+# and a t/connection_xxx-master.opt file
+#
+# Naming conventions for t/connection_xxx.test are as follows:
+# t/connection_<account><user><host>
+#
+# <account> corresponds to different sizing settings for
+# the variable performance-schema-accounts-size
+# - (blank): accounts-size sufficient to represent all records
+# - 3a: accounts-size set to 3
+# - no_a: accounts-size set to 0
+#
+# <user> corresponds to different sizing settings for
+# the variable performance-schema-users-size
+# - (blank): users-size sufficient to represent all records
+# - 3u: users-size set to 3
+# - no_u: users-size set to 0
+#
+# <host> corresponds to different sizing settings for
+# the variable performance-schema-hosts-size
+# - (blank): hosts-size sufficient to represent all records
+# - no_h: hosts-size set to 0
+
+# ========================================
+# HELPER include/event_aggregate_setup.inc
+# ========================================
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/no_protocol.inc
+--source ../include/wait_for_pfs_thread_count.inc
+
+--disable_query_log
+
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+grant ALL on *.* to user5@localhost;
+
+flush privileges;
+
+# Purge old users, hosts, user/host from previous tests
+truncate table performance_schema.accounts;
+truncate table performance_schema.users;
+truncate table performance_schema.hosts;
+
+# Save the setup
+
+# Start from a known clean state, to avoid noise from previous tests
+flush tables;
+flush status;
+
+--disable_warnings
+drop procedure if exists dump_all;
+--enable_warnings
+
+delimiter $$;
+
+create procedure dump_all()
+begin
+ select processlist_user, processlist_host
+ from performance_schema.threads
+ where (processlist_user is not null) and (processlist_host is not null)
+ order by processlist_user;
+
+ select * from performance_schema.accounts
+ where (user is not null) and (host is not null)
+ order by user, host;
+
+ select * from performance_schema.users
+ where user is not null
+ order by user;
+
+ select * from performance_schema.hosts
+ where host is not null
+ order by host;
+
+ select variable_name, variable_value from information_schema.global_status
+ where variable_name in ('PERFORMANCE_SCHEMA_ACCOUNTS_LOST',
+ 'PERFORMANCE_SCHEMA_USERS_LOST',
+ 'PERFORMANCE_SCHEMA_HOSTS_LOST');
+end
+$$
+
+delimiter ;$$
+
+--enable_query_log
diff --git a/mysql-test/suite/perfschema/include/digest_cleanup.inc b/mysql-test/suite/perfschema/include/digest_cleanup.inc
new file mode 100644
index 00000000000..99dc41e660f
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/digest_cleanup.inc
@@ -0,0 +1,11 @@
+--echo ####################################
+--echo # CLEANUP
+--echo ####################################
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP TABLE IF EXISTS t5;
+DROP DATABASE IF EXISTS statements_digest;
+--enable_warnings
diff --git a/mysql-test/suite/perfschema/include/digest_execution.inc b/mysql-test/suite/perfschema/include/digest_execution.inc
new file mode 100644
index 00000000000..34c49590217
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/digest_execution.inc
@@ -0,0 +1,86 @@
+--echo ####################################
+--echo # EXECUTION
+--echo ####################################
+
+# -----------------------------------
+# SQL Queries to test normalizations.
+# -----------------------------------
+SELECT 1 FROM t1;
+SELECT 1 FROM `t1`;
+SELECT 1,2 FROM t1;
+SELECT 1, 2, 3, 4 FROM t1;
+SELECT 1 FROM t2;
+SELECT 1,2 FROM t2;
+SELECT 1, 2, 3, 4 FROM t2;
+
+# (NUM) => (#)
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+# (NUM,NUM) => (#,#)
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t4 VALUES (1, 2);
+# (NUM,NUM,NUM) => (#,#)
+INSERT INTO t5 VALUES (1, 2, 3);
+
+# (NUM),(NUM) => (#),(#)
+INSERT INTO t1 VALUES (1), (2), (3);
+# (NUM),(NUM),(NUM) => (#),(#)
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+
+# (NUM,NUM),(NUM,NUM) => (#,#),(#,#)
+INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6);
+# (NUM,NUM,NUM),(NUM,NUM,NUM),(NUM,NUM,NUM) => (#,#),(#,#)
+INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
+
+# -----------------------------------------------------------------------
+# Test case for handling spaces in statement.
+# -----------------------------------------------------------------------
+
+SELECT 1 + 1;
+
+# -----------------------------------------------------------------------
+# Test case for handling comments.
+# -----------------------------------------------------------------------
+
+# comment starting with "--"
+# TODO : SELECT 1; -- This comment continues to the end of line
+# comment starting from "#"
+SELECT 1; # This comment continues to the end of line
+
+# Inline comment
+SELECT 1 /* This is an inline comment */ + 1;
+
+# Multiple line comments
+ SELECT 1+
+ /*
+ this is a
+ multiple-line comment
+ */
+ 1;
+
+
+# -----------------------------------------------------------------------
+# Tests to show how the digest behaves with tokens that can have multiple
+# names (such as DATABASE = "DATABASE" or "SCHEMA", SUBSTRING, STD_SYM,
+# VARIANCE_SYM ... )
+# -----------------------------------------------------------------------
+
+--disable_warnings
+CREATE SCHEMA statements_digest_temp;
+DROP SCHEMA statements_digest_temp;
+CREATE DATABASE statements_digest_temp;
+DROP DATABASE statements_digest_temp;
+# TODO : add more
+--enable_warnings
+
+# -----------------------------------------------------------------------
+# Test case to show stats for statements giving ERRORS/WARNINGS, are also
+# captured.
+# -----------------------------------------------------------------------
+--ERROR ER_NO_SUCH_TABLE
+SELECT 1 from t11;
+create table t11 (c char(4));
+--ERROR ER_TABLE_EXISTS_ERROR
+create table t11 (c char(4));
+insert into t11 values("MySQL");
diff --git a/mysql-test/suite/perfschema/include/digest_setup.inc b/mysql-test/suite/perfschema/include/digest_setup.inc
new file mode 100644
index 00000000000..7145bcfa870
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/digest_setup.inc
@@ -0,0 +1,21 @@
+# Making sure not to run when ps-protocol is set.
+--source ../include/no_protocol.inc
+
+--echo ####################################
+--echo # SETUP
+--echo ####################################
+# Database setup
+--disable_warnings
+CREATE DATABASE statements_digest;
+--enable_warnings
+USE statements_digest;
+
+# Table set up for queries
+--disable_warnings
+CREATE TABLE t1(a int);
+CREATE TABLE t2(a int);
+CREATE TABLE t3(a int, b int);
+CREATE TABLE t4(a int, b int);
+CREATE TABLE t5(a int, b int, c int);
+--enable_warnings
+
diff --git a/mysql-test/suite/perfschema/include/event_aggregate_cleanup.inc b/mysql-test/suite/perfschema/include/event_aggregate_cleanup.inc
new file mode 100644
index 00000000000..c50394f748b
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/event_aggregate_cleanup.inc
@@ -0,0 +1,57 @@
+# Tests for the performance schema
+
+# ==========================================
+# HELPER include/event_aggregate_cleanup.inc
+# ==========================================
+
+--disable_query_log
+revoke all privileges, grant option from user1@localhost;
+revoke all privileges, grant option from user2@localhost;
+revoke all privileges, grant option from user3@localhost;
+revoke all privileges, grant option from user4@localhost;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+flush privileges;
+
+drop procedure dump_thread;
+drop procedure dump_one_thread;
+
+drop prepare dump_waits_account;
+drop prepare dump_waits_user;
+drop prepare dump_waits_host;
+drop prepare dump_waits_history;
+drop prepare dump_waits_global;
+
+drop prepare dump_stages_account;
+drop prepare dump_stages_user;
+drop prepare dump_stages_host;
+drop prepare dump_stages_history;
+drop prepare dump_stages_global;
+
+drop prepare dump_statements_account;
+drop prepare dump_statements_user;
+drop prepare dump_statements_host;
+drop prepare dump_statements_history;
+drop prepare dump_statements_global;
+
+drop prepare dump_users;
+drop prepare dump_hosts;
+drop prepare dump_accounts;
+
+truncate table performance_schema.accounts;
+truncate table performance_schema.users;
+truncate table performance_schema.hosts;
+
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+ select * from test.setup_actors;
+drop table test.setup_actors;
+drop table test.t1;
+
+update performance_schema.threads set instrumented='YES';
+update performance_schema.setup_instruments set enabled='YES', timed='YES';
+
+--enable_query_log
+
diff --git a/mysql-test/suite/perfschema/include/event_aggregate_load.inc b/mysql-test/suite/perfschema/include/event_aggregate_load.inc
new file mode 100644
index 00000000000..75069f4b603
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/event_aggregate_load.inc
@@ -0,0 +1,883 @@
+# Tests for the performance schema
+
+# =======================================
+# HELPER include/event_aggregate_load.inc
+# =======================================
+
+echo "================== Step 1 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+# Notes about this test
+#
+# Each connect causes 2 wait/synch/mutex/sql/LOCK_connection_count events:
+# - 1 in mysqld.cc, create_new_thread(), for the main thread
+# - 1 in sql_connect.cc, check_user(), for the connected thread
+# The main thread does not count for BY_ACCOUNT / BY_HOST.
+# The user thread does count for BY_ACCOUNT, BY_HOST
+#
+# Each get_lock() causes 1 wait/synch/mutex/sql/LOCK_user_locks
+#
+# To avoid noise from main, the background threads are disabled.
+
+connect (con1, localhost, user1, , );
+
+echo "================== con1 connected ==================";
+
+--connection default
+
+# Wait for the connect to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1';
+--source include/wait_condition.inc
+
+echo "================== Step 2 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+--connection con1
+
+select get_lock("marker", 10);
+select release_lock("marker");
+insert into test.t1 values ("marker");
+
+echo "================== con1 marker ==================";
+
+--connection default
+
+echo "================== Step 3 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+# Debugging helpers
+# select * from performance_schema.events_waits_history_long;
+# select PROCESSLIST_USER, PROCESSLIST_HOST, INSTRUMENTED from performance_schema.threads;
+
+connect (con2, localhost, user2, , );
+
+echo "================== con2 connected ==================";
+
+--connection default
+
+# Wait for the connect to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user2';
+--source include/wait_condition.inc
+
+echo "================== Step 4 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+--connection con2
+
+select get_lock("marker", 10);
+select release_lock("marker");
+insert into test.t1 values ("marker");
+
+echo "================== con2 marker ==================";
+
+--connection default
+
+echo "================== Step 5 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+connect (con3, localhost, user3, , );
+
+echo "================== con3 connected ==================";
+
+--connection default
+
+# Wait for the connect to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user3';
+--source include/wait_condition.inc
+
+echo "================== Step 6 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+--connection con3
+
+select get_lock("marker", 10);
+select release_lock("marker");
+insert into test.t1 values ("marker");
+
+echo "================== con3 marker ==================";
+
+--connection default
+
+echo "================== Step 7 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+connect (con4, localhost, user4, , );
+
+echo "================== con4 connected ==================";
+
+--connection default
+
+# Wait for the connect to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4';
+--source include/wait_condition.inc
+
+echo "================== Step 8 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+--connection con4
+
+select get_lock("marker", 10);
+select release_lock("marker");
+insert into test.t1 values ("marker");
+
+echo "================== con4 marker ==================";
+
+--connection default
+
+echo "================== Step 9 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+--disconnect con1
+
+--connection default
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1';
+--source include/wait_condition.inc
+
+echo "================== con1 disconnected ==================";
+
+echo "================== Step 10 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+--disconnect con2
+
+--connection default
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user2';
+--source include/wait_condition.inc
+
+echo "================== con2 disconnected ==================";
+
+echo "================== Step 11 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+--disconnect con3
+
+--connection default
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user3';
+--source include/wait_condition.inc
+
+echo "================== con3 disconnected ==================";
+
+echo "================== Step 12 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+--disconnect con4
+
+--connection default
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4';
+--source include/wait_condition.inc
+
+echo "================== con4 disconnected ==================";
+
+echo "================== Step 13 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+--connection default
+
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+
+echo "================== WAITS_BY_THREAD truncated ==================";
+
+echo "================== Step 14 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+
+echo "================== WAITS_BY_ACCOUNT truncated ==================";
+
+echo "================== Step 15 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+
+echo "================== WAITS_BY_USER truncated ==================";
+
+echo "================== Step 16 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+
+echo "================== WAITS_BY_HOST truncated ==================";
+
+echo "================== Step 17 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_waits_summary_global_by_event_name;
+
+echo "================== WAITS_GLOBAL truncated ==================";
+
+echo "================== Step 18 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+
+echo "================== STAGES_BY_THREAD truncated ==================";
+
+echo "================== Step 19 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_stages_summary_by_account_by_event_name;
+
+echo "================== STAGES_BY_ACCOUNT truncated ==================";
+
+echo "================== Step 20 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_stages_summary_by_user_by_event_name;
+
+echo "================== STAGES_BY_USER truncated ==================";
+
+echo "================== Step 21 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_stages_summary_by_host_by_event_name;
+
+echo "================== STAGES_BY_HOST truncated ==================";
+
+echo "================== Step 22 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_stages_summary_global_by_event_name;
+
+echo "================== STAGES_GLOBAL truncated ==================";
+
+echo "================== Step 23 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+
+echo "================== STATEMENTS_BY_THREAD truncated ==================";
+
+echo "================== Step 24 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_statements_summary_by_account_by_event_name;
+
+echo "================== STATEMENTS_BY_ACCOUNT truncated ==================";
+
+echo "================== Step 25 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_statements_summary_by_user_by_event_name;
+
+echo "================== STATEMENTS_BY_USER truncated ==================";
+
+echo "================== Step 26 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_statements_summary_by_host_by_event_name;
+
+echo "================== STATEMENTS_BY_HOST truncated ==================";
+
+echo "================== Step 27 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.events_statements_summary_global_by_event_name;
+
+echo "================== STATEMENTS_GLOBAL truncated ==================";
+
+echo "================== Step 28 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.accounts;
+
+echo "================== ACCOUNTS truncated ==================";
+
+echo "================== Step 29 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.users;
+
+echo "================== USERS truncated ==================";
+
+echo "================== Step 30 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
+truncate performance_schema.hosts;
+
+echo "================== HOSTS truncated ==================";
+
+echo "================== Step 31 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_stages_account;
+execute dump_stages_user;
+execute dump_stages_host;
+execute dump_stages_global;
+execute dump_stages_history;
+execute dump_statements_account;
+execute dump_statements_user;
+execute dump_statements_host;
+execute dump_statements_global;
+execute dump_statements_history;
+execute dump_accounts;
+execute dump_users;
+execute dump_hosts;
+
diff --git a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
new file mode 100644
index 00000000000..47488403c1f
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
@@ -0,0 +1,347 @@
+# Tests for the performance schema
+
+# =============
+# DOCUMENTATION
+# =============
+
+# Verify how events are aggregated into various tables
+#
+# In the thread dimension:
+# - events_waits_summary_by_thread_by_event_name
+# - events_waits_summary_by_account_by_event_name
+# - events_waits_summary_by_user_by_event_name
+# - events_waits_summary_by_host_by_event_name
+# - events_stages_summary_by_thread_by_event_name
+# - events_stages_summary_by_account_by_event_name
+# - events_stages_summary_by_user_by_event_name
+# - events_stages_summary_by_host_by_event_name
+# - events_statements_summary_by_thread_by_event_name
+# - events_statements_summary_by_account_by_event_name
+# - events_statements_summary_by_user_by_event_name
+# - events_statements_summary_by_host_by_event_name
+#
+# Globally:
+# - events_waits_summary_global_by_event_name
+# - events_stages_summary_global_by_event_name
+# - events_statements_summary_global_by_event_name
+#
+# The tests are written with the following helpers:
+# - include/event_aggregate_setup.inc
+# - include/event_aggregate_load.inc
+# - include/event_aggregate_cleanup.inc
+#
+# Helpers are intended to be used as follows.
+#
+# A Typical test t/event_aggregate_xxx.test will consist of:
+# --source ../include/event_aggregate_setup.inc
+# --source ../include/event_aggregate_load.inc
+# --source ../include/event_aggregate_cleanup.inc
+# and a t/event_aggregate_xxx-master.opt file
+#
+# Naming conventions for t/event_aggregate_xxx.test are as follows:
+# t/event_aggregate_<account><user><host>
+#
+# <account> corresponds to different sizing settings for
+# the variable performance-schema-accounts-size
+# - (blank): accounts-size sufficient to represent all records
+# - no_a: accounts-size set to 0
+#
+# <user> corresponds to different sizing settings for
+# the variable performance-schema-users-size
+# - (blank): users-size sufficient to represent all records
+# - no_u: users-size set to 0
+#
+# <host> corresponds to different sizing settings for
+# the variable performance-schema-hosts-size
+# - (blank): hosts-size sufficient to represent all records
+# - no_h: hosts-size set to 0
+
+# ========================================
+# HELPER include/event_aggregate_setup.inc
+# ========================================
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/no_protocol.inc
+--source ../include/wait_for_pfs_thread_count.inc
+
+--disable_query_log
+
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+
+flush privileges;
+
+# Purge old users, hosts, user/host from previous tests
+truncate table performance_schema.accounts;
+truncate table performance_schema.users;
+truncate table performance_schema.hosts;
+
+# Save the setup
+
+--disable_warnings
+drop table if exists test.setup_actors;
+drop table if exists test.t1;
+--enable_warnings
+
+create table test.t1(a varchar(64));
+
+create table test.setup_actors as
+ select * from performance_schema.setup_actors;
+
+# Only instrument the user connections
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user1', role= '%';
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user2', role= '%';
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user3', role= '%';
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user4', role= '%';
+
+update performance_schema.threads set instrumented='NO';
+
+# Only instrument a few events of each kind
+update performance_schema.setup_instruments set enabled='NO', timed='NO';
+
+update performance_schema.setup_instruments set enabled='YES', timed='YES'
+ where name in ('wait/synch/mutex/sql/LOCK_connection_count',
+ 'wait/synch/mutex/sql/LOCK_user_locks',
+ 'wait/synch/rwlock/sql/LOCK_grant',
+ 'wait/io/file/sql/query_log');
+
+update performance_schema.setup_instruments set enabled='YES', timed='YES'
+ where name in ('stage/sql/init',
+ 'stage/sql/checking permissions',
+ 'stage/sql/Opening tables',
+ 'stage/sql/closing tables');
+
+update performance_schema.setup_instruments set enabled='YES', timed='YES'
+ where name in ('statement/sql/select',
+ 'statement/sql/insert',
+ 'statement/com/',
+ 'statement/com/Query',
+ 'statement/com/Quit',
+ 'statement/com/error');
+
+# Start from a known clean state, to avoid noise from previous tests
+flush tables;
+flush status;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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;
+
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+truncate performance_schema.events_stages_summary_by_account_by_event_name;
+truncate performance_schema.events_stages_summary_by_user_by_event_name;
+truncate performance_schema.events_stages_summary_by_host_by_event_name;
+truncate performance_schema.events_stages_summary_global_by_event_name;
+truncate performance_schema.events_stages_history_long;
+
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+truncate performance_schema.events_statements_summary_by_account_by_event_name;
+truncate performance_schema.events_statements_summary_by_user_by_event_name;
+truncate performance_schema.events_statements_summary_by_host_by_event_name;
+truncate performance_schema.events_statements_summary_global_by_event_name;
+truncate performance_schema.events_statements_history_long;
+
+--disable_warnings
+drop procedure if exists dump_thread;
+drop procedure if exists dump_one_thread;
+--enable_warnings
+
+delimiter $$;
+
+create procedure dump_thread()
+begin
+ call dump_one_thread('user1');
+ call dump_one_thread('user2');
+ call dump_one_thread('user3');
+ call dump_one_thread('user4');
+end
+$$
+
+create procedure dump_one_thread(in username varchar(64))
+begin
+ declare my_thread_id int;
+
+ set my_thread_id = (select thread_id from performance_schema.threads
+ where processlist_user=username);
+
+ if (my_thread_id is not null) then
+ select username, event_name, count_star
+ from performance_schema.events_waits_summary_by_thread_by_event_name
+ where event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
+ 'wait/synch/mutex/sql/LOCK_user_locks',
+ 'wait/synch/rwlock/sql/LOCK_grant',
+ 'wait/io/file/sql/query_log')
+ and thread_id = my_thread_id
+ order by event_name;
+ else
+ select username, "not found" as status;
+ end if;
+end
+$$
+
+delimiter ;$$
+
+prepare dump_waits_account from
+ "select user, host, event_name, count_star
+ from performance_schema.events_waits_summary_by_account_by_event_name
+ where user like \'user%\'
+ and event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
+ 'wait/synch/mutex/sql/LOCK_user_locks',
+ 'wait/synch/rwlock/sql/LOCK_grant',
+ 'wait/io/file/sql/query_log')
+ order by user, host, event_name;";
+
+prepare dump_waits_user from
+ "select user, event_name, count_star
+ from performance_schema.events_waits_summary_by_user_by_event_name
+ where user like \'user%\'
+ and event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
+ 'wait/synch/mutex/sql/LOCK_user_locks',
+ 'wait/synch/rwlock/sql/LOCK_grant',
+ 'wait/io/file/sql/query_log')
+ order by user, event_name;";
+
+prepare dump_waits_host from
+ "select host, event_name, count_star
+ from performance_schema.events_waits_summary_by_host_by_event_name
+ where host=\'localhost\'
+ and event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
+ 'wait/synch/mutex/sql/LOCK_user_locks',
+ 'wait/synch/rwlock/sql/LOCK_grant',
+ 'wait/io/file/sql/query_log')
+ order by host, event_name;";
+
+prepare dump_waits_global from
+ "select event_name, count_star
+ from performance_schema.events_waits_summary_global_by_event_name
+ where event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
+ 'wait/synch/mutex/sql/LOCK_user_locks',
+ 'wait/synch/rwlock/sql/LOCK_grant',
+ 'wait/io/file/sql/query_log')
+ order by event_name;";
+
+prepare dump_waits_history from
+ "select event_name, count(event_name)
+ from performance_schema.events_waits_history_long
+ where event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
+ 'wait/synch/mutex/sql/LOCK_user_locks',
+ 'wait/synch/rwlock/sql/LOCK_grant',
+ 'wait/io/file/sql/query_log')
+ group by event_name order by event_name;";
+
+prepare dump_stages_account from
+ "select user, host, event_name, count_star
+ from performance_schema.events_stages_summary_by_account_by_event_name
+ where user like \'user%\'
+ and event_name in ('stage/sql/init',
+ 'stage/sql/checking permissions',
+ 'stage/sql/Opening tables',
+ 'stage/sql/closing tables')
+ order by user, host, event_name;";
+
+prepare dump_stages_user from
+ "select user, event_name, count_star
+ from performance_schema.events_stages_summary_by_user_by_event_name
+ where user like \'user%\'
+ and event_name in ('stage/sql/init',
+ 'stage/sql/checking permissions',
+ 'stage/sql/Opening tables',
+ 'stage/sql/closing tables')
+ order by user, event_name;";
+
+prepare dump_stages_host from
+ "select host, event_name, count_star
+ from performance_schema.events_stages_summary_by_host_by_event_name
+ where host=\'localhost\'
+ and event_name in ('stage/sql/init',
+ 'stage/sql/checking permissions',
+ 'stage/sql/Opening tables',
+ 'stage/sql/closing tables')
+ order by host, event_name;";
+
+prepare dump_stages_global from
+ "select event_name, count_star
+ from performance_schema.events_stages_summary_global_by_event_name
+ where event_name in ('stage/sql/init',
+ 'stage/sql/checking permissions',
+ 'stage/sql/Opening tables',
+ 'stage/sql/closing tables')
+ order by event_name;";
+
+prepare dump_stages_history from
+ "select event_name, count(event_name)
+ from performance_schema.events_stages_history_long
+ where event_name in ('stage/sql/init',
+ 'stage/sql/checking permissions',
+ 'stage/sql/Opening tables',
+ 'stage/sql/closing tables')
+ group by event_name order by event_name;";
+
+prepare dump_statements_account from
+ "select user, host, event_name, count_star
+ from performance_schema.events_statements_summary_by_account_by_event_name
+ where user like \'user%\'
+ and event_name in ('statement/sql/select',
+ 'statement/sql/insert',
+ 'statement/com/Quit',
+ 'statement/com/error')
+ order by user, host, event_name;";
+
+prepare dump_statements_user from
+ "select user, event_name, count_star
+ from performance_schema.events_statements_summary_by_user_by_event_name
+ where user like \'user%\'
+ and event_name in ('statement/sql/select',
+ 'statement/sql/insert',
+ 'statement/com/Quit',
+ 'statement/com/error')
+ order by user, event_name;";
+
+prepare dump_statements_host from
+ "select host, event_name, count_star
+ from performance_schema.events_statements_summary_by_host_by_event_name
+ where host=\'localhost\'
+ and event_name in ('statement/sql/select',
+ 'statement/sql/insert',
+ 'statement/com/Quit',
+ 'statement/com/error')
+ order by host, event_name;";
+
+prepare dump_statements_global from
+ "select event_name, count_star
+ from performance_schema.events_statements_summary_global_by_event_name
+ where event_name in ('statement/sql/select',
+ 'statement/sql/insert',
+ 'statement/com/Quit',
+ 'statement/com/error')
+ order by event_name;";
+
+prepare dump_statements_history from
+ "select event_name, count(event_name)
+ from performance_schema.events_statements_history_long
+ where event_name in ('statement/sql/select',
+ 'statement/sql/insert',
+ 'statement/com/Quit',
+ 'statement/com/error')
+ group by event_name order by event_name;";
+
+prepare dump_users from
+ "select * from performance_schema.users where user is not null order by user;";
+
+prepare dump_hosts from
+ "select * from performance_schema.hosts where host is not null order by host;";
+
+prepare dump_accounts from
+ "select * from performance_schema.accounts where (user is not null) and (host is not null) order by user, host;";
+
+--enable_query_log
diff --git a/mysql-test/suite/perfschema/include/hostcache_dump.inc b/mysql-test/suite/perfschema/include/hostcache_dump.inc
new file mode 100644
index 00000000000..7f456a0c499
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/hostcache_dump.inc
@@ -0,0 +1,39 @@
+# Helper for hostcache_*.test
+
+--echo "Dumping performance_schema.host_cache"
+
+--disable_query_log
+--vertical_results
+select
+ IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+ COUNT_HOST_BLOCKED_ERRORS,
+ COUNT_NAMEINFO_TRANSIENT_ERRORS,
+ COUNT_NAMEINFO_PERMANENT_ERRORS,
+ COUNT_FORMAT_ERRORS,
+ COUNT_ADDRINFO_TRANSIENT_ERRORS,
+ COUNT_ADDRINFO_PERMANENT_ERRORS,
+ COUNT_FCRDNS_ERRORS,
+ COUNT_HOST_ACL_ERRORS,
+ COUNT_NO_AUTH_PLUGIN_ERRORS,
+ COUNT_AUTH_PLUGIN_ERRORS,
+ COUNT_HANDSHAKE_ERRORS,
+ COUNT_PROXY_USER_ERRORS,
+ COUNT_PROXY_USER_ACL_ERRORS,
+ COUNT_AUTHENTICATION_ERRORS,
+ COUNT_SSL_ERRORS,
+ COUNT_MAX_USER_CONNECTIONS_ERRORS,
+ COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS,
+ COUNT_DEFAULT_DATABASE_ERRORS,
+ COUNT_INIT_CONNECT_ERRORS,
+ COUNT_LOCAL_ERRORS,
+ COUNT_UNKNOWN_ERRORS,
+ if (FIRST_ERROR_SEEN is not null,
+ if (FIRST_ERROR_SEEN > date("2012-01-01"), "set", "wrong epoch"),
+ "null") as FIRST_ERROR_SEEN,
+ if (LAST_ERROR_SEEN is not null,
+ if (FIRST_ERROR_SEEN > date("2012-01-01"), "set", "wrong epoch"),
+ "null") as LAST_ERROR_SEEN
+ from performance_schema.host_cache;
+--horizontal_results
+--enable_query_log
+
diff --git a/mysql-test/suite/perfschema/include/no_protocol.inc b/mysql-test/suite/perfschema/include/no_protocol.inc
new file mode 100644
index 00000000000..451c22f62e3
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/no_protocol.inc
@@ -0,0 +1,10 @@
+# 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/pfs_upgrade.inc b/mysql-test/suite/perfschema/include/pfs_upgrade.inc
new file mode 100644
index 00000000000..0d4a864940c
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/pfs_upgrade.inc
@@ -0,0 +1,112 @@
+# Tests for PERFORMANCE_SCHEMA
+# Make sure mysql_upgrade does not destroy data in a 'performance_schema'
+# database.
+#
+
+# Some initial settings + Preemptive cleanup
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err;
+let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out;
+--error 0,1
+--remove_file $out_file
+--error 0,1
+--remove_file $err_file
+
+--disable_warnings
+drop table if exists test.user_table;
+drop procedure if exists test.user_proc;
+drop function if exists test.user_func;
+drop event if exists test.user_event;
+--enable_warnings
+
+
+--echo "Testing mysql_upgrade with TABLE performance_schema.user_table"
+
+create table test.user_table(a int);
+
+--error 0,1
+--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
+--copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm
+
+# Make sure the table is visible
+use performance_schema;
+show tables like "user_table";
+
+--source suite/perfschema/include/upgrade_check.inc
+
+# Make sure the table is still visible
+show tables like "user_table";
+
+use test;
+
+--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
+drop table test.user_table;
+
+
+--echo "Testing mysql_upgrade with VIEW performance_schema.user_view"
+
+create view test.user_view as select "Not supposed to be here";
+
+--error 0,1
+--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
+--copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm
+
+# Make sure the view is visible
+use performance_schema;
+show tables like "user_view";
+
+--source suite/perfschema/include/upgrade_check.inc
+
+# Make sure the view is still visible
+show tables like "user_view";
+
+use test;
+
+--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
+drop view test.user_view;
+
+
+--echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
+
+create procedure test.user_proc()
+ select "Not supposed to be here";
+
+update mysql.proc set db='performance_schema' where name='user_proc';
+
+--source suite/perfschema/include/upgrade_check.inc
+
+select name from mysql.proc where db='performance_schema';
+
+update mysql.proc set db='test' where name='user_proc';
+drop procedure test.user_proc;
+
+
+--echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func"
+
+create function test.user_func() returns integer
+ return 0;
+
+update mysql.proc set db='performance_schema' where name='user_func';
+
+--source suite/perfschema/include/upgrade_check.inc
+
+select name from mysql.proc where db='performance_schema';
+
+update mysql.proc set db='test' where name='user_func';
+drop function test.user_func;
+
+
+--echo "Testing mysql_upgrade with EVENT performance_schema.user_event"
+
+create event test.user_event on schedule every 1 day do
+ select "not supposed to be here";
+
+update mysql.event set db='performance_schema' where name='user_event';
+
+--source suite/perfschema/include/upgrade_check.inc
+
+select name from mysql.event where db='performance_schema';
+
+update mysql.event set db='test' where name='user_event';
+drop event test.user_event;
+
diff --git a/mysql-test/suite/perfschema/include/schema.inc b/mysql-test/suite/perfschema/include/schema.inc
new file mode 100644
index 00000000000..da587eca481
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/schema.inc
@@ -0,0 +1,60 @@
+# Tests for PERFORMANCE_SCHEMA
+# Show existing objects and information about their structure
+
+show databases like 'performance_schema';
+show create database performance_schema;
+
+use performance_schema;
+
+show tables;
+
+show create table accounts;
+show create table cond_instances;
+show create table events_stages_current;
+show create table events_stages_history;
+show create table events_stages_history_long;
+show create table events_stages_summary_by_host_by_event_name;
+show create table events_stages_summary_by_thread_by_event_name;
+show create table events_stages_summary_by_user_by_event_name;
+show create table events_stages_summary_by_account_by_event_name;
+show create table events_stages_summary_global_by_event_name;
+show create table events_statements_current;
+show create table events_statements_history;
+show create table events_statements_history_long;
+show create table events_statements_summary_by_host_by_event_name;
+show create table events_statements_summary_by_thread_by_event_name;
+show create table events_statements_summary_by_user_by_event_name;
+show create table events_statements_summary_by_account_by_event_name;
+show create table events_statements_summary_global_by_event_name;
+show create table events_waits_current;
+show create table events_waits_history;
+show create table events_waits_history_long;
+show create table events_waits_summary_by_host_by_event_name;
+show create table events_waits_summary_by_instance;
+show create table events_waits_summary_by_thread_by_event_name;
+show create table events_waits_summary_by_user_by_event_name;
+show create table events_waits_summary_by_account_by_event_name;
+show create table events_waits_summary_global_by_event_name;
+show create table file_instances;
+show create table file_summary_by_event_name;
+show create table file_summary_by_instance;
+show create table host_cache;
+show create table hosts;
+show create table mutex_instances;
+show create table objects_summary_global_by_type;
+show create table performance_timers;
+show create table rwlock_instances;
+show create table setup_actors;
+show create table setup_consumers;
+show create table setup_instruments;
+show create table setup_objects;
+show create table setup_timers;
+show create table socket_instances;
+show create table socket_summary_by_instance;
+show create table socket_summary_by_event_name;
+show create table table_io_waits_summary_by_index_usage;
+show create table table_io_waits_summary_by_table;
+show create table table_lock_waits_summary_by_table;
+show create table threads;
+show create table users;
+
diff --git a/mysql-test/suite/perfschema/include/socket_check1.inc b/mysql-test/suite/perfschema/include/socket_check1.inc
new file mode 100644
index 00000000000..29b00fc6abb
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/socket_check1.inc
@@ -0,0 +1,129 @@
+# Example how to use this auxiliary script
+#-----------------------------------------
+#
+### The table/tables used in $part must have the right content.
+### $title_prefix is used for the generation of titles
+#
+# let $title_prefix= 4.3;
+### $check_num is used for the generation of titles and gets incremented after
+### every call of the current script.
+# let $check_num= 1;
+### $diff_column_list is used for the generation of error information and valid for
+### every sub test.
+# let $diff_column_list=
+# t2.COUNT_READ - t1.COUNT_READ AS D_COUNT_READ,
+# t2.COUNT_READ AS S2_COUNT_READ,
+# t1.COUNT_READ AS S1_COUNT_READ,
+# t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ AS D_SUM_NUMBER_OF_BYTES_READ,
+# t2.SUM_NUMBER_OF_BYTES_READ AS S2_SUM_NUMBER_OF_BYTES_READ,
+# t1.SUM_NUMBER_OF_BYTES_READ AS S1_SUM_NUMBER_OF_BYTES_READ,
+# t2.COUNT_WRITE - t1.COUNT_WRITE AS D_COUNT_WRITE,
+# t2.COUNT_WRITE AS S2_COUNT_WRITE,
+# t1.COUNT_WRITE AS S1_COUNT_WRITE,
+# t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE AS D_UM_NUMBER_OF_BYTES_WRITE,
+# t2.SUM_NUMBER_OF_BYTES_WRITE AS S2_SUM_NUMBER_OF_BYTES_WRITE,
+# t1.SUM_NUMBER_OF_BYTES_WRITE AS S1_SUM_NUMBER_OF_BYTES_WRITE,
+# t2.COUNT_MISC - t1.COUNT_MISC AS D_COUNT_MISC,
+# t2.COUNT_MISC AS S2_COUNT_MISC,
+# t1.COUNT_MISC AS S1_COUNT_MISC;
+### $part is used for the generation of "check" statements + error information
+### and valid for every sub test.
+# let $part=
+# FROM mysqltest.socket_summary_by_instance_detail t1
+# JOIN mysqltest.socket_summary_by_instance_detail t2
+# USING (EVENT_NAME, OBJECT_INSTANCE_BEGIN, run)
+# WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+# AND EVENT_NAME LIKE ('%client_connection')
+# AND run = 1;
+#
+# --echo # $title_prefix Check the differences caused by SQL statement
+#
+# let stmt1= SELECT col2 FROM does_not_exist;
+# let stmt2= SELECT col2 FROM does_not_exist WHERE col1 = 0;
+### $msg is used to generate some explanation of what we compare.
+# let $msg=
+# # One statement is longer than the other.
+# # Both statements fail with the same error message (table does not exist);
+# let $my_rules=
+# t2.COUNT_READ - t1.COUNT_READ = 0 AND
+# t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+# t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+# t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE = 0 AND
+# t2.COUNT_MISC - t1.COUNT_MISC = 0;
+# --source ../include/socket_check1.inc
+#
+# let stmt1= ....
+# let stmt2= ....
+# let $my_rules= ...
+# --source ../include/socket_check1.inc
+#
+# ...
+#
+
+--echo # $title_prefix.$check_num Compare impact of statements
+--echo # $stmt2
+--echo # $stmt1
+--echo $msg
+
+# Enable this when extending the checks for SQL statements.
+if(0)
+{
+ if (`SELECT CONCAT("$stmt1","$stmt2","$my_rules") LIKE '%_not_set%'`)
+ {
+ --echo # INTERNAL ERROR:
+ --echo # At least one of the variables has no value (is like '%_not_set')
+ --echo # stmt1 : $stmt1
+ --echo # stmt2 : $stmt2
+ --echo # my_rules : $my_rules
+ --echo # Sorry, have to abort
+ exit;
+ }
+}
+
+if(`SELECT NOT ( $my_rules )
+ $part
+ AND t2.statement = '$stmt2' AND t1.statement = '$stmt1'`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The compared statistics looks suspicious
+ --echo # We expect
+ --echo $my_rules
+ --echo
+ --horizontal_results
+ eval
+ SELECT $my_rules AS Expect_1
+ $part
+ AND t2.statement = '$stmt2' AND t1.statement = '$stmt1';
+ --echo
+ --vertical_results
+ eval
+ SELECT $diff_column_list
+ $part
+ AND t1.statement = '$stmt1' AND t2.statement = '$stmt2';
+ --echo
+ --horizontal_results
+
+ eval
+ SELECT
+ LPAD(COUNT_READ, 8, ' ') AS CNT_READ,
+ LPAD(SUM_NUMBER_OF_BYTES_READ, 10,' ') AS BYTES_READ,
+ LPAD(COUNT_WRITE,9, ' ') AS CNT_WRITE,
+ LPAD(SUM_NUMBER_OF_BYTES_WRITE, 11,' ') AS BYTES_WRITE,
+ LPAD(COUNT_MISC, 8, ' ') AS CNT_MISC, statement
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND run = 1
+ AND statement IN('$stmt2','$stmt1');
+ let $print_details= 1;
+}
+# Initialize all variables which depend on the statements to be checked.
+# This prevents that we run with wrong data.
+let $stmt1= stmt1_not_set;
+let $stmt2= stmt2_not_set;
+let $my_rules= my_rules_not_set;
+let $msg= msg_not_set;
+inc $check_num;
+
+
diff --git a/mysql-test/suite/perfschema/include/socket_event.inc b/mysql-test/suite/perfschema/include/socket_event.inc
new file mode 100644
index 00000000000..ba81c37d5df
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/socket_event.inc
@@ -0,0 +1,236 @@
+# include/socket_event.inc
+#
+# Auxiliary routine running
+# - some statement in connection con1
+# or
+# - connect/disconnect
+# $loop_rounds times and checking if the changes to values caused by the action
+# are reasonable.
+#
+# Requirements:
+# 1. Have socket_summary_by_instance_func running
+# 2a. Have a connection con1
+# @con1_object_instance_begin needs to be the OBJECT_INSTANCE_BEGIN
+# value of the "client_connction" entry belonging to con1 within
+# socket_summary_by_instance.
+# $statement needs to contain the statement to be executed by con1.
+# or
+# 2b. Have assigned values to the following variables
+# $connect_host $connect_db $connect_user
+#
+
+let $my_errno= 0;
+
+let $loop_round= 1;
+while($loop_round <= $loop_rounds)
+{
+
+--disable_query_log
+
+# Collect the current state
+#==========================
+eval $truncate;
+eval $insert_before;
+
+# Run the operation
+#==================
+if($is_connect)
+{
+ let $statement= Connect (con*,$connect_host,$connect_user,,$connect_db,,);
+ # Some statements fail with ER_ACCESS_DENIED_ERROR
+ --disable_abort_on_error
+ --connect (con$loop_round,$connect_host,$connect_user,,$connect_db,,)
+ --enable_abort_on_error
+ let $my_errno= $mysql_errno;
+ if(!$my_errno)
+ {
+ # Note(mleich):
+ # We are aware that this additional statement is overhead.
+ # But it ensures that SUM_NUMBER_OF_BYTES_READ and
+ # SUM_NUMBER_OF_BYTES_WRITE are updated.
+ # And this avoids the instabilities found when running
+ # the connect without this additional statement.
+ DO 1;
+ }
+ --connection default
+}
+if(!$is_connect)
+{
+ --connection con1
+ # Print the statement outcome once.
+ if($loop_round == 1)
+ {
+ --enable_query_log
+ --enable_result_log
+ --horizontal_results
+ }
+ # One of the statements to be checked is expected to fail with ER_NO_SUCH_TABLE.
+ --disable_abort_on_error
+ eval $statement;
+ --connection default
+ --enable_abort_on_error
+ --disable_query_log
+ --disable_result_log
+}
+
+# Wait till the operation is really finished. We expect that there will be no
+# changes to the statistics of the additional connection after this point of time.
+#=================================================================================
+--connection default
+# Variants:
+#----------
+# 1. Connect failed ($my_errno <> 0)
+# no entry in performance_schema.threads -> wait_till_sleep.inc cannot be used
+# short life entry in socket_summary_by_instance -> wait till it doesn't exist
+# 2. Connect with success ($my_errno = 0)
+# entry in performance_schema.threads -> wait_till_sleep.inc can be used
+# entry in socket_summary_by_instance -> wait till it does exist
+# 3. SQL command failed ($my_errno <> 0)
+# entry in performance_schema.threads -> wait_till_sleep.inc can be used
+if($is_connect)
+{
+ let $part=
+ FROM performance_schema.socket_summary_by_instance
+ WHERE EVENT_NAME LIKE '%client_connection'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
+
+ if(!$my_errno)
+ {
+ # Wait till the new connection is visible in performance_schema.threads
+ # and processlist_command is 'Sleep'.
+ --source ../include/wait_till_sleep.inc
+
+ # A successful connect causes that a new second row in
+ # performance_schema.socket_summary_by_instance shows up.
+ # Wait till this row is there.
+ let $wait_timeout= 10;
+ let $wait_condition=
+ SELECT COUNT(*) = 1
+ $part;
+ --source include/wait_condition.inc
+ if (!$success)
+ {
+ --echo # Error: We did not reach the expected state where a new
+ --echo # row in socket_summary_by_instance is visible
+ eval
+ SELECT *
+ $part;
+ --echo # abort
+ exit;
+ }
+ }
+ if($my_errno)
+ {
+ # Experiments with high parallel load showed that there is a very
+ # period of time where a "client_connection" entry for a failing
+ # 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_condition=
+ SELECT COUNT(*) = 0
+ $part;
+ --source include/wait_condition.inc
+ if(!$success)
+ {
+ --echo # Error: We did not reach the expected state.
+ --echo # A failing connect causes a "client_connection" entry
+ --echo # within socket_summary_by_instance having an extreme
+ --echo # short lifetime.
+ --echo # This entry must have now disappeared.
+ eval
+ SELECT *
+ $part;
+ --echo # abort
+ exit;
+ }
+ }
+ # --sleep 3
+}
+if(!$is_connect)
+{
+ --source ../include/wait_till_sleep.inc
+}
+
+# Various checks
+#===============
+# 1. Check statistics in general
+#-------------------------------
+# ../include/socket_summary_check.inc also inserts the 'After' state into
+# mysqltest.my_socket_summary_by_instance.
+--source ../include/socket_summary_check.inc
+--disable_query_log
+--disable_result_log
+
+if($is_connect)
+{
+ eval $get_object_instance_begin;
+ eval $insert_pseudo_before;
+}
+
+eval $insert_delta;
+# Correct the values of the columns statement and run
+eval
+UPDATE mysqltest.socket_summary_by_instance_detail
+SET statement = '$statement'
+WHERE statement IS NULL;
+eval
+UPDATE mysqltest.socket_summary_by_instance_detail
+SET run = $loop_round
+WHERE run IS NULL;
+
+if($is_connect)
+{
+ # Only in case the connect was successful ($my_errno = 0) than we have to disconnect.
+ if(!$my_errno)
+ {
+ --disconnect con$loop_round
+ # Wait till the connection using the DB = 'mysqltest' or
+ # 'mysqlsupertest' has disappeared from performance_schema.threads
+ let $part=
+ FROM performance_schema.threads
+ WHERE processlist_db IN ('mysqltest','mysqlsupertest');
+ let $wait_timeout= 10;
+ let $wait_condition=
+ SELECT COUNT(*) = 0
+ $part;
+ --source include/wait_condition.inc
+ if (!$success)
+ {
+ --echo # Error: The disconnect of the connection with processlist_db
+ --echo # IN ('mysqltest','mysqlsupertest') failed
+ SELECT *
+ $part;
+ --echo # abort
+ exit;
+ }
+ # Wait in addition till the corresponding 'client_connection' entry of
+ # the connection using the DB = 'mysqltest' or 'mysqlsupertest' has disappeared.
+ let $part=
+ FROM performance_schema.socket_summary_by_instance
+ WHERE EVENT_NAME LIKE '%client_connection'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
+ let $wait_timeout= 10;
+ let $wait_condition=
+ SELECT COUNT(*) = 0
+ $part;
+ --source include/wait_condition.inc
+ if (!$success)
+ {
+ --echo # Error: The entry of the disconnectd connection with processlist_db
+ --echo # IN ('mysqltest','mysqlsupertest') did not disappear
+ SELECT *
+ $part;
+ --echo # abort
+ exit;
+ }
+ }
+ # --sleep 3
+}
+inc $loop_round;
+
+}
+
+--enable_query_log
+--enable_result_log
+
diff --git a/mysql-test/suite/perfschema/include/socket_event_dbg.inc b/mysql-test/suite/perfschema/include/socket_event_dbg.inc
new file mode 100644
index 00000000000..75c4d4808cb
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/socket_event_dbg.inc
@@ -0,0 +1,130 @@
+# include/socket_event.inc
+#
+# Auxiliary routine
+# - running some statement in connection con1
+# and checking the changes for the client_connction" entry belonging to con1
+# within socket_summary_by_instance and
+# - checking if the changes to values caused by the statement execution are
+# reasonable and stable
+#
+# Requirements:
+# 1. Have socket_summary_by_instance_func running
+# 2. Have a connection con1
+# @con1_object_instance_begin needs to be the OBJECT_INSTANCE_BEGIN
+# value of the "client_connction" entry belonging to con1 within
+# socket_summary_by_instance.
+# 3. $statement needs to contain the statement to be executed by con1.
+#
+
+let $my_errno= 0;
+
+let $loop_round= 1;
+while($loop_round <= $loop_rounds)
+{
+
+if (!$my_socket_debug)
+{
+ --disable_query_log
+}
+
+# Collect the current state
+#==========================
+eval $truncate;
+eval $insert_before;
+
+# Run the operation
+#==================
+if($is_connect)
+{
+ let $statement= Connect (con1,$connect_host,$connect_user,,$connect_db,,);
+ # Some statements fail with ER_ACCESS_DENIED_ERROR
+ --disable_abort_on_error
+ --connect (con1,$connect_host,$connect_user,,$connect_db,,)
+ --enable_abort_on_error
+ let $my_errno= $mysql_errno;
+}
+if(!$is_connect)
+{
+ --connection con1
+ # Print the statement outcome once.
+ if($loop_round == 1)
+ {
+ --enable_query_log
+ --enable_result_log
+ --horizontal_results
+ }
+ # One of the statements to be checked is expected to fail with ER_NO_SUCH_TABLE.
+ --disable_abort_on_error
+ eval $statement;
+ --enable_abort_on_error
+
+ if (!$my_socket_debug)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+}
+
+# Wait till the operation is really finished. We expect that there will be no
+# changes to the statistics of the additional connection after this point of time.
+#=================================================================================
+
+--connection default
+if($my_errno)
+{
+ # Wait a bit and hope that the counter maintenence is finished.
+ --sleep 3
+}
+if(!$my_errno)
+{
+ --source ../include/wait_till_sleep.inc
+}
+
+# Various checks
+#===============
+# 1. Check statistics in general
+#-------------------------------
+# ../include/socket_summary_check.inc also inserts the 'After' state into
+# mysqltest.my_socket_summary_by_instance.
+--source ../include/socket_summary_check_dbg.inc
+
+if (!$my_socket_debug)
+{
+ --disable_query_log
+ --disable_result_log
+}
+
+if($is_connect)
+{
+ eval $get_object_instance_begin;
+ eval $insert_pseudo_before;
+}
+
+eval $insert_delta;
+# Correct the values of the columns statement and run
+eval
+UPDATE mysqltest.socket_summary_by_instance_detail
+SET statement = '$statement'
+WHERE statement IS NULL;
+eval
+UPDATE mysqltest.socket_summary_by_instance_detail
+SET run = $loop_round
+WHERE run IS NULL;
+
+if($is_connect)
+{
+ if(!$my_errno)
+ {
+ --connection con1
+ --disconnect con1
+ --source include/wait_until_disconnected.inc
+ --connection default
+ }
+}
+inc $loop_round;
+
+}
+
+--enable_query_log
+--enable_result_log
+
diff --git a/mysql-test/suite/perfschema/include/socket_ipv6.inc b/mysql-test/suite/perfschema/include/socket_ipv6.inc
new file mode 100644
index 00000000000..dd077a12c7a
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/socket_ipv6.inc
@@ -0,0 +1,113 @@
+#==============================================================================
+# Set IP address defaults with respect to IPV6 support
+#
+# This file determines the level of support for IPV4, IPV4 mapped or IPV6, then
+# sets the appropriate localhost IP format to use for 'connect()' commands.
+#
+# Input: $my_socket_debug - Print results of IP version check (optional)
+# Output: $my_localhost - Default localhost IP
+#==============================================================================
+
+let $check_ipv6_just_check= 1;
+#--source include/check_ipv6.inc
+
+#==============================================================================
+# Determine if IPV6 supported
+#
+# Parameters:
+# $check_ipv6_just_check - Don't skip the test if IPv6 is unsupported,
+# just set the variable $check_ipv6_supported
+#==============================================================================
+--disable_query_log
+--disable_result_log
+--disable_abort_on_error
+
+let $check_ipv6_supported= 1;
+
+connect (checkcon123456789,::1,root,,test);
+
+if($mysql_errno)
+{
+ let $check_ipv6_supported=0;
+ if(!$check_ipv6_just_check)
+ {
+ skip No IPv6 support;
+ }
+}
+
+if(!$mysql_errno)
+{
+ disconnect checkcon123456789;
+ --source include/wait_until_disconnected.inc
+}
+
+connection default;
+
+--enable_abort_on_error
+--enable_result_log
+--enable_query_log
+
+#==============================================================================
+#
+# Determine if IPV4 mapped to IPV6 supported
+#
+let $check_ipv4_mapped_just_check= 1;
+#--source include/check_ipv4_mapped.inc
+#==============================================================================
+# Check if ipv4 mapped to ipv6 is available.
+#
+# Parameters:
+# $check_ipv4_mapped_just_check - Don't skip the test if IPv4 mapped is unsupported,
+# just set the variable $check_ipv4_mapped_supported
+#==============================================================================
+--disable_query_log
+--disable_result_log
+--disable_abort_on_error
+
+let $check_ipv4_mapped_supported= 1;
+
+connect (checkcon123456789a,::FFFF:127.0.0.1,root,,test);
+
+if($mysql_errno)
+{
+ let $check_ipv4_mapped_supported=0;
+ if(!$check_ipv4_mapped_just_check)
+ {
+ skip No mapped IPv4 support;
+ }
+}
+
+if(!$mysql_errno)
+{
+ disconnect checkcon123456789a;
+ --source include/wait_until_disconnected.inc
+}
+
+connection default;
+
+--enable_abort_on_error
+--enable_result_log
+--enable_query_log
+
+#==============================================================================
+# Set the localhost IP default to use when establishing connections
+#
+#==============================================================================
+let $my_localhost=127.0.0.1;
+
+if($check_ipv6_supported)
+{
+ let $my_localhost=::1;
+}
+
+if($check_ipv4_mapped_supported)
+{
+ let $my_localhost=::ffff:127.0.0.1;
+}
+
+if($my_socket_debug)
+{
+ --echo IPV6=$check_ipv6_supported, IPV4_MAPPED=$check_ipv4_mapped_supported, LOCALHOST=$my_localhost
+}
+#==============================================================================
+
diff --git a/mysql-test/suite/perfschema/include/socket_summary_check.inc b/mysql-test/suite/perfschema/include/socket_summary_check.inc
new file mode 100644
index 00000000000..10258cadb1b
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/socket_summary_check.inc
@@ -0,0 +1,227 @@
+# include/socket_summary_check.inc
+#
+# Auxiliary routine to be sourced by socket_summary_by_instance_func.test
+# or other routines sourced within this script.
+#
+# Purpose
+# Various checks for the content of the table socket_summary_by_instance.
+#
+# It is intentional that we do not try to cram as much checks as possible into
+# one single SQL statement.
+# Reasons:
+# - We check performance_schema here and NOT something like optimizer.
+# - This test should work even if some other feature has become buggy.
+# - In case some check gives unexpected results than we print the
+# relevant content of the table and the values which we expect.
+# In case of all checks in one statement such a printout would be too huge.
+#
+# IMPORTANT:
+# The maximum number of rows which the table socket_summary_by_instance
+# can keep is limited via the system variables max_socket_classes and
+# max_socket_instances. We are running with the default values here.
+# They are sufficient high so that these limits cannot harm the current test.
+# FIXME: Check at the beginning of the test that the limits are sufficient
+# for the current test.
+#
+
+--disable_query_log
+# Insert the current state into mysqltest.my_socket_summary_by_instance.
+eval $insert_after;
+--enable_query_log
+--enable_result_log
+
+
+# 1. The content of socket_summary_by_instance must be consistent to the
+# content of socket_instances
+#=======================================================================
+let $part1=
+FROM performance_schema.socket_summary_by_instance
+WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN)
+ NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN
+FROM performance_schema.socket_instances);
+if(`SELECT COUNT(*) $part1`)
+{
+ --echo # There is an inconsistency between the content of the tables
+ --echo # socket_instances and socket_summary_by_instance
+ --echo #
+ eval
+ SELECT 'not in socket_instances' AS state, EVENT_NAME, OBJECT_INSTANCE_BEGIN
+ $part1;
+}
+
+--vertical_results
+
+
+# 2. The computation of statistics must be roughly correct.
+#
+# If we run this check sufficient frequent than AVG_TIMER_* can be removed from other checks.
+#===============================================================================================
+let $my_lo= 0.98;
+let $my_hi= 1.02;
+
+let $my_rules=
+COUNT_STAR * AVG_TIMER_WAIT BETWEEN SUM_TIMER_WAIT * $my_lo AND SUM_TIMER_WAIT * $my_hi AND
+COUNT_READ * AVG_TIMER_READ BETWEEN SUM_TIMER_READ * $my_lo AND SUM_TIMER_READ * $my_hi AND
+COUNT_WRITE * AVG_TIMER_WRITE BETWEEN SUM_TIMER_WRITE * $my_lo AND SUM_TIMER_WRITE * $my_hi AND
+COUNT_MISC * AVG_TIMER_MISC BETWEEN SUM_TIMER_MISC * $my_lo AND SUM_TIMER_MISC * $my_hi;
+
+let $part=
+SUM_TIMER_WAIT * $my_lo, COUNT_STAR * AVG_TIMER_WAIT, SUM_TIMER_WAIT * $my_hi,
+ COUNT_STAR, SUM_TIMER_WAIT, AVG_TIMER_WAIT,
+SUM_TIMER_READ * $my_lo, COUNT_READ * AVG_TIMER_READ, SUM_TIMER_READ * $my_hi,
+ COUNT_READ, SUM_TIMER_READ, AVG_TIMER_READ,
+SUM_TIMER_WRITE * $my_lo, COUNT_WRITE * AVG_TIMER_WRITE, SUM_TIMER_WRITE * $my_hi,
+ COUNT_WRITE, SUM_TIMER_WRITE, AVG_TIMER_WRITE,
+SUM_TIMER_MISC * $my_lo, COUNT_MISC * AVG_TIMER_MISC, SUM_TIMER_MISC * $my_hi,
+ COUNT_MISC, SUM_TIMER_MISC, AVG_TIMER_MISC;
+
+if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'`)
+{
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After' AND NOT ($my_rules)
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+ let $print_details= 1;
+}
+
+
+# 3. Check the relation between AVG_*, MIN_TIMER_* and MAX_TIMER_*
+#
+# If we run this check sufficient frequent than only the following
+# additional checks are required:
+# a) If (SUM_TIMER_*(new) - SUM_TIMER_*(old) < MIN_TIMER_*(old))
+# than MIN_TIMER_*(new) = SUM_TIMER_*(new) - SUM_TIMER_*(old).
+# b) If (SUM_TIMER_*(new) - SUM_TIMER_*(old) > MAX_TIMER_*(old))
+# than MAX_TIMER_*(new) = SUM_TIMER_*(new) - SUM_TIMER_*(old).
+# in order to remove MIN_TIMER_* and MAX_TIMER_* from other checks
+# Between the states "new" and "old" must be exact one statement.
+#-----------------------------------------------------------------------------------------------
+let $my_rules=
+AVG_TIMER_WAIT >= MIN_TIMER_WAIT AND MAX_TIMER_WAIT >= AVG_TIMER_WAIT AND
+AVG_TIMER_READ >= MIN_TIMER_READ AND MAX_TIMER_READ >= AVG_TIMER_READ AND
+AVG_TIMER_WRITE >= MIN_TIMER_WRITE AND MAX_TIMER_WRITE >= AVG_TIMER_WRITE AND
+AVG_TIMER_MISC >= MIN_TIMER_MISC AND MAX_TIMER_MISC >= AVG_TIMER_MISC;
+
+let $part=
+MIN_TIMER_WAIT, AVG_TIMER_WAIT, MAX_TIMER_WAIT,
+MIN_TIMER_READ, AVG_TIMER_READ, MAX_TIMER_READ,
+MIN_TIMER_WRITE, AVG_TIMER_WRITE, MAX_TIMER_WRITE,
+MIN_TIMER_MISC, AVG_TIMER_MISC, MAX_TIMER_MISC;
+
+if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'`)
+{
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After' AND NOT ($my_rules)
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+ let $print_details= 1;
+}
+
+
+# 4. Check the aggregate columns COUNT_STAR and SUM_TIMER_WAIT
+#
+# The specification says:
+# The columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT aggregates all operations.
+#
+# If we run this check sufficient frequent than COUNT_STAR and SUM_TIMER_WAIT
+# can be removed from other checks.
+#---------------------------------------------------------------------------------
+let $my_rules=
+COUNT_STAR = COUNT_READ + COUNT_WRITE + COUNT_MISC AND
+SUM_TIMER_WAIT = SUM_TIMER_READ + SUM_TIMER_WRITE + SUM_TIMER_MISC;
+
+let $part=
+COUNT_STAR, COUNT_READ + COUNT_WRITE + COUNT_MISC, COUNT_READ, COUNT_WRITE, COUNT_MISC,
+SUM_TIMER_WAIT, SUM_TIMER_READ + SUM_TIMER_WRITE + SUM_TIMER_MISC, SUM_TIMER_READ,
+SUM_TIMER_WRITE, SUM_TIMER_MISC;
+
+if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'`)
+{
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+ let $print_details= 1;
+}
+
+
+# 5. Check the aggregate column MIN_TIMER_WAIT
+#
+# If we run this check sufficient frequent than MIN_TIMER_WAIT
+# can be removed from other checks.
+#---------------------------------------------------------------------------------
+let $my_rules=
+MIN_TIMER_WAIT >= mysqltest.min_of_triple(MIN_TIMER_READ,MIN_TIMER_WRITE,MIN_TIMER_MISC);
+
+let $part=
+MIN_TIMER_WAIT,
+mysqltest.min_of_triple(MIN_TIMER_READ, MIN_TIMER_WRITE, MIN_TIMER_MISC) AS "Min_of_Triple",
+MIN_TIMER_READ, MIN_TIMER_WRITE, MIN_TIMER_MISC;
+
+if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'`)
+{
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+ let $print_details= 1;
+}
+
+
+# 6. Check the aggregate column MAX_TIMER_WAIT
+#
+# If we run this check sufficient frequent than MAX_TIMER_WAIT
+# can be removed from other checks.
+#---------------------------------------------------------------------------------
+let $my_rules=
+MAX_TIMER_WAIT >= mysqltest.max_of_triple(MAX_TIMER_READ,MAX_TIMER_WRITE,MAX_TIMER_MISC);
+
+let $part=
+MAX_TIMER_WAIT,
+mysqltest.max_of_triple(MAX_TIMER_READ, MAX_TIMER_WRITE, MAX_TIMER_MISC) AS "Max_of_Triple",
+MAX_TIMER_READ, MAX_TIMER_WRITE, MAX_TIMER_MISC;
+
+if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'`)
+{
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+ let $print_details= 1;
+}
+
+--horizontal_results
+
diff --git a/mysql-test/suite/perfschema/include/socket_summary_check_dbg.inc b/mysql-test/suite/perfschema/include/socket_summary_check_dbg.inc
new file mode 100644
index 00000000000..64ee19c3d9b
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/socket_summary_check_dbg.inc
@@ -0,0 +1,236 @@
+# include/socket_summary_check.inc
+#
+# Auxiliary routine to be sourced by socket_summary_by_instance_func.test
+# or other routines sourced within this script.
+#
+# Purpose
+# Various checks for the content of the table socket_summary_by_instance.
+#
+# It is intentional that we do not try to cram as much checks as possible into
+# one single SQL statement.
+# Reasons:
+# - We check performance_schema here and NOT something like optimizer.
+# - This test should work even if some other feature has become buggy.
+# - In case some check gives unexpected results than we print the
+# relevant content of the table and the values which we expect.
+# In case of all checks in one statement such a printout would be too huge.
+#
+# IMPORTANT:
+# The maximum number of rows which the table socket_summary_by_instance
+# can keep is limited via the system variables max_socket_classes and
+# max_socket_instances. We are running with the default values here.
+# They are sufficient high so that these limits cannot harm the current test.
+# FIXME: Check at the beginning of the test that the limits are sufficient
+# for the current test.
+#
+
+--disable_query_log
+# Insert the current state into mysqltest.my_socket_summary_by_instance.
+eval $insert_after;
+--enable_query_log
+
+
+# 1. The content of socket_summary_by_instance must be consistent to the
+# content of socket_instances
+#-----------------------------------------------------------------------
+let $part1=
+FROM performance_schema.socket_summary_by_instance
+WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN)
+ NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN
+FROM performance_schema.socket_instances);
+if(`SELECT COUNT(*) $part1`)
+{
+ --echo # There is an inconsistency between the content of the tables
+ --echo # socket_instances and socket_summary_by_instance
+ --echo #
+ eval
+ SELECT 'not in socket_instances' AS state, EVENT_NAME, OBJECT_INSTANCE_BEGIN
+ $part1;
+ --echo # abort 1
+ # exit;
+}
+
+--vertical_results
+
+
+# 2. The computation of statistics must be roughly correct.
+#
+# If we run this check sufficient frequent than AVG_TIMER_* can be removed from other checks.
+#-----------------------------------------------------------------------------------------------
+let $my_lo= 0.99;
+let $my_hi= 1.01;
+
+let $my_rules=
+COUNT_STAR * AVG_TIMER_WAIT BETWEEN SUM_TIMER_WAIT * $my_lo AND SUM_TIMER_WAIT * $my_hi AND
+COUNT_READ * AVG_TIMER_READ BETWEEN SUM_TIMER_READ * $my_lo AND SUM_TIMER_READ * $my_hi AND
+COUNT_WRITE * AVG_TIMER_WRITE BETWEEN SUM_TIMER_WRITE * $my_lo AND SUM_TIMER_WRITE * $my_hi AND
+COUNT_MISC * AVG_TIMER_MISC BETWEEN SUM_TIMER_MISC * $my_lo AND SUM_TIMER_MISC * $my_hi;
+
+let $part=
+SUM_TIMER_WAIT * $my_lo, COUNT_STAR * AVG_TIMER_WAIT, SUM_TIMER_WAIT * $my_hi, COUNT_STAR, SUM_TIMER_WAIT, AVG_TIMER_WAIT,
+SUM_TIMER_READ * $my_lo, COUNT_READ * AVG_TIMER_READ, SUM_TIMER_READ * $my_hi, COUNT_READ, SUM_TIMER_READ, AVG_TIMER_READ,
+SUM_TIMER_WRITE * $my_lo, COUNT_WRITE * AVG_TIMER_WRITE, SUM_TIMER_WRITE * $my_hi, COUNT_WRITE, SUM_TIMER_WRITE, AVG_TIMER_WRITE,
+SUM_TIMER_MISC * $my_lo, COUNT_MISC * AVG_TIMER_MISC, SUM_TIMER_MISC * $my_hi, COUNT_MISC, SUM_TIMER_MISC, AVG_TIMER_MISC;
+
+if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'`)
+{
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+
+ -- echo # Debug 2a: Dump socket_summary_by_instance
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM performance_schema.socket_summary_by_instance
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+ --echo # abort 2
+# exit;
+}
+
+
+# 3. Check the relation between AVG_*, MIN_TIMER_* and MAX_TIMER_*
+#
+# If we run this check sufficient frequent than only the following
+# additional checks are required:
+# a) If (SUM_TIMER_*(new) - SUM_TIMER_*(old) < MIN_TIMER_*(old))
+# than MIN_TIMER_*(new) = SUM_TIMER_*(new) - SUM_TIMER_*(old).
+# b) If (SUM_TIMER_*(new) - SUM_TIMER_*(old) > MAX_TIMER_*(old))
+# than MAX_TIMER_*(new) = SUM_TIMER_*(new) - SUM_TIMER_*(old).
+# in order to remove MIN_TIMER_* and MAX_TIMER_* from other checks
+# Between the states "new" and "old" must be exact one statement.
+#-----------------------------------------------------------------------------------------------
+let $my_rules=
+AVG_TIMER_WAIT >= MIN_TIMER_WAIT AND MAX_TIMER_WAIT >= AVG_TIMER_WAIT AND
+AVG_TIMER_READ >= MIN_TIMER_READ AND MAX_TIMER_READ >= AVG_TIMER_READ AND
+AVG_TIMER_WRITE >= MIN_TIMER_WRITE AND MAX_TIMER_WRITE >= AVG_TIMER_WRITE AND
+AVG_TIMER_MISC >= MIN_TIMER_MISC AND MAX_TIMER_MISC >= AVG_TIMER_MISC;
+
+let $part=
+MIN_TIMER_WAIT, AVG_TIMER_WAIT, MAX_TIMER_WAIT,
+MIN_TIMER_READ, AVG_TIMER_READ, MAX_TIMER_READ,
+MIN_TIMER_WRITE, AVG_TIMER_WRITE, MAX_TIMER_WRITE,
+MIN_TIMER_MISC, AVG_TIMER_MISC, MAX_TIMER_MISC;
+
+if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'`)
+{
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+ --echo # abort 3
+# exit;
+}
+
+
+# 4. Check the aggregate columns COUNT_STAR and SUM_TIMER_WAIT
+#
+# The specification says:
+# The columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT aggregates all operations.
+#
+# If we run this check sufficient frequent than COUNT_STAR and SUM_TIMER_WAIT
+# can be removed from other checks.
+#---------------------------------------------------------------------------------
+let $my_rules=
+COUNT_STAR = COUNT_READ + COUNT_WRITE + COUNT_MISC AND
+SUM_TIMER_WAIT = SUM_TIMER_READ + SUM_TIMER_WRITE + SUM_TIMER_MISC;
+
+let $part=
+COUNT_STAR, COUNT_READ + COUNT_WRITE + COUNT_MISC, COUNT_READ, COUNT_WRITE, COUNT_MISC,
+SUM_TIMER_WAIT, SUM_TIMER_READ + SUM_TIMER_WRITE + SUM_TIMER_MISC, SUM_TIMER_READ,
+SUM_TIMER_WRITE, SUM_TIMER_MISC;
+
+if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'`)
+{
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+ --echo # abort 4
+# exit;
+}
+
+
+# 5. Check the aggregate column MIN_TIMER_WAIT
+#
+# If we run this check sufficient frequent than MIN_TIMER_WAIT
+# can be removed from other checks.
+#---------------------------------------------------------------------------------
+let $my_rules=
+MIN_TIMER_WAIT >= mysqltest.min_of_triple(MIN_TIMER_READ,MIN_TIMER_WRITE,MIN_TIMER_MISC);
+
+let $part=
+MIN_TIMER_WAIT,
+mysqltest.min_of_triple(MIN_TIMER_READ, MIN_TIMER_WRITE, MIN_TIMER_MISC) AS "Min_of_Triple",
+MIN_TIMER_READ, MIN_TIMER_WRITE, MIN_TIMER_MISC;
+
+if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'`)
+{
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+ --echo # abort 5
+# exit;
+}
+
+
+# 6. Check the aggregate column MAX_TIMER_WAIT
+#
+# If we run this check sufficient frequent than MAX_TIMER_WAIT
+# can be removed from other checks.
+#---------------------------------------------------------------------------------
+let $my_rules=
+MAX_TIMER_WAIT >= mysqltest.max_of_triple(MAX_TIMER_READ,MAX_TIMER_WRITE,MAX_TIMER_MISC);
+
+let $part=
+MAX_TIMER_WAIT,
+mysqltest.max_of_triple(MAX_TIMER_READ, MAX_TIMER_WRITE, MAX_TIMER_MISC) AS "Max_of_Triple",
+MAX_TIMER_READ, MAX_TIMER_WRITE, MAX_TIMER_MISC;
+
+if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'`)
+{
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ $part
+ FROM mysqltest.my_socket_summary_by_instance
+ WHERE pk = 'After'
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+ --echo # abort 6
+# exit;
+}
+
+--horizontal_results
+
diff --git a/mysql-test/suite/perfschema/include/stage_cleanup.inc b/mysql-test/suite/perfschema/include/stage_cleanup.inc
new file mode 100644
index 00000000000..c3c9d911dbd
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/stage_cleanup.inc
@@ -0,0 +1,31 @@
+# Tests for the performance schema
+
+# ================================
+# HELPER include/stage_cleanup.inc
+# ================================
+
+--disable_query_log
+revoke all privileges, grant option from user1@localhost;
+revoke all privileges, grant option from user2@localhost;
+revoke all privileges, grant option from user3@localhost;
+revoke all privileges, grant option from user4@localhost;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+flush privileges;
+
+drop procedure dump_thread;
+drop procedure dump_one_thread;
+
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+ select * from test.setup_actors;
+drop table test.setup_actors;
+drop table test.t1;
+
+update performance_schema.threads set instrumented='YES';
+update performance_schema.setup_instruments set enabled='YES', timed='YES';
+
+--enable_query_log
+
diff --git a/mysql-test/suite/perfschema/include/stage_setup.inc b/mysql-test/suite/perfschema/include/stage_setup.inc
new file mode 100644
index 00000000000..3558e43652e
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/stage_setup.inc
@@ -0,0 +1,134 @@
+# Tests for the performance schema
+
+# =============
+# DOCUMENTATION
+# =============
+
+# Verify critical stages of a statement
+#
+# The tests are written with the following helpers:
+# - include/stage_setup.inc
+# - include/stage_cleanup.inc
+#
+# Helpers are intended to be used as follows.
+#
+# A Typical test t/stage_xxx.test will consist of:
+# --source ../include/stage_setup.inc
+# ... test specific payload ...
+# --source ../include/stage_cleanup.inc
+# and a t/stage_xxx-master.opt file
+#
+# ==============================
+# HELPER include/stage_setup.inc
+# ==============================
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/no_protocol.inc
+
+--disable_query_log
+
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+
+flush privileges;
+
+# Save the setup
+
+--disable_warnings
+drop table if exists test.setup_actors;
+drop table if exists test.t1;
+--enable_warnings
+
+create table test.t1(a varchar(64));
+
+create table test.setup_actors as
+ select * from performance_schema.setup_actors;
+
+# Only instrument the user connections
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user1', role= '%';
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user2', role= '%';
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user3', role= '%';
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user4', role= '%';
+
+update performance_schema.threads set instrumented='NO';
+
+# Only instrument a few events of each kind
+update performance_schema.setup_instruments set enabled='YES', timed='YES';
+
+# Start from a known clean state, to avoid noise from previous tests
+flush tables;
+flush status;
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+truncate performance_schema.events_stages_summary_global_by_event_name;
+truncate performance_schema.events_stages_history;
+truncate performance_schema.events_stages_history_long;
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+truncate performance_schema.events_statements_summary_global_by_event_name;
+truncate performance_schema.events_statements_history;
+truncate performance_schema.events_statements_history_long;
+
+--disable_warnings
+drop procedure if exists dump_thread;
+drop procedure if exists dump_one_thread;
+--enable_warnings
+
+delimiter $$;
+
+create procedure dump_thread()
+begin
+ call dump_one_thread('user1');
+ call dump_one_thread('user2');
+ call dump_one_thread('user3');
+ call dump_one_thread('user4');
+end
+$$
+
+create procedure dump_one_thread(in username varchar(64))
+begin
+ declare my_thread_id int;
+ declare my_statement_id int;
+
+ set my_thread_id = (select thread_id from performance_schema.threads
+ where processlist_user=username);
+
+ if (my_thread_id is not null) then
+ begin
+ # Dump the current statement for this thread
+ select username, event_name, sql_text
+ from performance_schema.events_statements_current
+ where thread_id = my_thread_id;
+
+ # Get the current statement
+ set my_statement_id = (select event_id from
+ performance_schema.events_statements_current
+ where thread_id = my_thread_id);
+
+ # Dump the stages for this statement
+ select username, event_name, nesting_event_type
+ from performance_schema.events_stages_current
+ where thread_id = my_thread_id
+ and nesting_event_id = my_statement_id
+ order by event_id asc;
+ select username, event_name, nesting_event_type
+ from performance_schema.events_stages_history
+ where thread_id = my_thread_id
+ and nesting_event_id = my_statement_id
+ order by event_id asc;
+ end;
+ else
+ select username, "not found" as status;
+ end if;
+end
+$$
+
+delimiter ;$$
+
+--enable_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 88f98f0c063..69a9c47063b 100644
--- a/mysql-test/suite/perfschema/include/start_server_common.inc
+++ b/mysql-test/suite/perfschema/include/start_server_common.inc
@@ -4,29 +4,64 @@ show databases;
select count(*) from performance_schema.performance_timers;
select count(*) from performance_schema.setup_consumers;
-select count(*) > 0 from performance_schema.setup_instruments;
+# wait/io/table/sql/handler is a native instrument
+# wait/lock/table/sql/handler is a native instrument
+# idle/io/socket is a native instrument
+select count(*) > 3 from performance_schema.setup_instruments;
select count(*) from performance_schema.setup_timers;
# Make sure we don't crash, no matter what the starting parameters are
--disable_result_log
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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;
--enable_result_log
# This has a stable output, printing the result:
diff --git a/mysql-test/suite/perfschema/include/table_aggregate_cleanup.inc b/mysql-test/suite/perfschema/include/table_aggregate_cleanup.inc
new file mode 100644
index 00000000000..11b354d8b3e
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/table_aggregate_cleanup.inc
@@ -0,0 +1,53 @@
+# Tests for the performance schema
+#
+
+# See comments in include/table_aggregate_setup.inc
+
+--disable_query_log
+
+revoke all privileges, grant option from user1@localhost;
+revoke all privileges, grant option from user2@localhost;
+revoke all privileges, grant option from user3@localhost;
+revoke all privileges, grant option from user4@localhost;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+flush privileges;
+
+drop procedure dump_thread;
+drop procedure dump_one_thread;
+drop prepare dump_waits_account;
+drop prepare dump_waits_user;
+drop prepare dump_waits_host;
+drop prepare dump_waits_global;
+drop prepare dump_waits_history;
+drop prepare dump_waits_index_io;
+drop prepare dump_waits_table_io;
+drop prepare dump_waits_table_lock;
+drop prepare dump_objects_summary;
+
+truncate table performance_schema.accounts;
+truncate table performance_schema.users;
+truncate table performance_schema.hosts;
+
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+ select * from test.setup_actors;
+drop table test.setup_actors;
+
+truncate table performance_schema.setup_objects;
+insert into performance_schema.setup_objects
+ select * from test.setup_objects;
+drop table test.setup_objects;
+
+drop table test.t1;
+drop table test.t2;
+drop table test.t3;
+
+update performance_schema.threads set instrumented='YES';
+update performance_schema.setup_instruments set enabled='YES', timed='YES';
+update performance_schema.setup_consumers set enabled='YES';
+
+--enable_query_log
+
diff --git a/mysql-test/suite/perfschema/include/table_aggregate_load.inc b/mysql-test/suite/perfschema/include/table_aggregate_load.inc
new file mode 100644
index 00000000000..b72220c58bd
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/table_aggregate_load.inc
@@ -0,0 +1,540 @@
+# Tests for the performance schema
+#
+
+# See comments in include/table_aggregate_setup.inc
+
+# Display the current setup used
+
+select * from performance_schema.setup_actors
+ order by USER, HOST, ROLE;
+
+select * from performance_schema.setup_objects
+ order by object_type, object_schema, object_name;
+
+select * from performance_schema.setup_consumers;
+
+# General cleanup
+
+flush tables;
+
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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;
+
+# Check the configuration is ok
+show variables like "performance_schema%";
+show status like "performance_schema%";
+
+echo "================== Step 1 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+# Notes about this test
+#
+
+connect (con1, localhost, user1, , );
+
+echo "================== con1 connected ==================";
+
+--connection default
+
+# Wait for the connect to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1';
+--source include/wait_condition.inc
+
+echo "================== Step 2 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--connection con1
+
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+select * from test.t2;
+select * from test.t3;
+# Full table scan
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+# Update with PK
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+# select with index
+select * from test.t1 where b=5;
+select * from test.t2 where b=5;
+select * from test.t3 where b=5;
+
+echo "================== con1 marker ==================";
+
+--connection default
+
+echo "================== Step 3 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+# Debugging helpers
+# select * from performance_schema.events_waits_history_long;
+# select PROCESSLIST_USER, PROCESSLIST_HOST, INSTRUMENTED from performance_schema.threads;
+
+connect (con2, localhost, user2, , );
+
+echo "================== con2 connected ==================";
+
+--connection default
+
+# Wait for the connect to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user2';
+--source include/wait_condition.inc
+
+echo "================== Step 4 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--connection con2
+
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+select * from test.t2;
+select * from test.t3;
+# Full table scan
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+# Update with PK
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+# select with index
+select * from test.t1 where b=5;
+select * from test.t2 where b=5;
+select * from test.t3 where b=5;
+
+echo "================== con2 marker ==================";
+
+--connection default
+
+echo "================== Step 5 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+connect (con3, localhost, user3, , );
+
+echo "================== con3 connected ==================";
+
+--connection default
+
+# Wait for the connect to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user3';
+--source include/wait_condition.inc
+
+echo "================== Step 6 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--connection con3
+
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+select * from test.t2;
+select * from test.t3;
+# Full table scan
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+# Update with PK
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+# select with index
+select * from test.t1 where b=5;
+select * from test.t2 where b=5;
+select * from test.t3 where b=5;
+
+echo "================== con3 marker ==================";
+
+--connection default
+
+echo "================== Step 7 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+connect (con4, localhost, user4, , );
+
+echo "================== con4 connected ==================";
+
+--connection default
+
+# Wait for the connect to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4';
+--source include/wait_condition.inc
+
+echo "================== Step 8 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--connection con4
+
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+select * from test.t2;
+select * from test.t3;
+# Full table scan
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+# Update with PK
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+# select with index
+select * from test.t1 where b=5;
+select * from test.t2 where b=5;
+select * from test.t3 where b=5;
+
+echo "================== con4 marker ==================";
+
+--connection default
+
+echo "================== Step 9 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--connection con1
+
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+
+echo "================== con1 marker ==================";
+
+--connection default
+
+echo "================== Step 10 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--connection default
+
+flush tables;
+
+echo "================== flush marker ==================";
+
+echo "================== Step 11 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+set global read_only=1;
+set global read_only=0;
+
+echo "================== global read_only marker ==================";
+
+echo "================== Step 12 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--disconnect con1
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1';
+--source include/wait_condition.inc
+
+echo "================== con1 disconnected ==================";
+
+echo "================== Step 13 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--disconnect con2
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user2';
+--source include/wait_condition.inc
+
+echo "================== con2 disconnected ==================";
+
+echo "================== Step 14 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--disconnect con3
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user3';
+--source include/wait_condition.inc
+
+echo "================== con3 disconnected ==================";
+
+echo "================== Step 15 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--disconnect con4
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4';
+--source include/wait_condition.inc
+
+echo "================== con4 disconnected ==================";
+
+echo "================== Step 16 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+--connection default
+
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+
+echo "================== BY_THREAD truncated ==================";
+
+echo "================== Step 17 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+
+echo "================== BY_ACCOUNT truncated ==================";
+
+echo "================== Step 18 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+
+echo "================== BY_USER truncated ==================";
+
+echo "================== Step 19 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+
+echo "================== BY_HOST truncated ==================";
+
+echo "================== Step 21 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+truncate performance_schema.events_waits_summary_global_by_event_name;
+
+echo "================== GLOBAL truncated ==================";
+
+echo "================== Step 21 ==================";
+call dump_thread();
+execute dump_waits_account;
+execute dump_waits_user;
+execute dump_waits_host;
+execute dump_waits_global;
+execute dump_waits_history;
+execute dump_waits_index_io;
+execute dump_waits_table_io;
+execute dump_waits_table_lock;
+execute dump_objects_summary;
+
+# On test failures, may help to track the root cause
+show status like "performance_schema%";
+
diff --git a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc
new file mode 100644
index 00000000000..8efdc8d2f24
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc
@@ -0,0 +1,267 @@
+# Tests for the performance schema
+
+# =============
+# DOCUMENTATION
+# =============
+
+# Verify how table io is aggregated into various tables
+#
+# In the instance dimension:
+# - table_io_waits_summary_by_index_usage
+# - table_io_waits_summary_by_table
+# - table_lock_waits_summary_by_table
+# - objects_summary_global_by_type
+#
+# In the thread dimension:
+# - events_waits_summary_by_thread_by_event_name
+# - events_waits_summary_by_account_by_event_name
+# - events_waits_summary_by_user_by_event_name
+# - events_waits_summary_by_host_by_event_name
+#
+# Globally:
+# - events_waits_summary_global_by_event_name
+#
+# The tests are written with the following helpers:
+# - include/table_aggregate_setup.inc
+# - include/table_aggregate_load.inc
+# - include/table_aggregate_cleanup.inc
+#
+# Helpers are intended to be used as follows.
+#
+# A Typical test t/table_aggregate_xxx.test will consist of:
+# --source ../include/table_aggregate_setup.inc
+#
+# ... statements to modify the default configuration ...
+#
+# --source ../include/table_aggregate_load.inc
+# --source ../include/table_aggregate_cleanup.inc
+#
+# Naming conventions for t/table_aggregate_xxx.test are as follows:
+# t/<instrument>aggregate_<mode><actors><objects>
+#
+# <instrument> corresponds to different instruments settings
+# - table: both table io and table lock are instrumented
+# - table_io: only table io is instrumented
+# - table_lock: only table lock is instrumented
+#
+# <mode> corresponds to different consumers settings
+# - off: global_instrumentation OFF
+# - global: global_instrumentation ON, thread_instrumentation OFF
+# - thread: global_instrumentation ON, thread_instrumentation ON,
+# events_* consumers OFF
+# - history: global_instrumentation ON, thread_instrumentation ON,
+# events_* consumers ON
+#
+# <actors> corresponds to different setup_actors settings
+# - 4u: every test user (user1, user2, user3, user4) is ON
+# - 2u: (user1, user3) are ON, (user2, user4) are OFF
+#
+# <objects> corresponds to different setup_objects settings
+# - 3t: tables t1, t2 and t3 are ON
+# - 2t: tables t1 and t3 are ON, table t2 is OFF
+#
+
+# ========================================
+# HELPER include/table_aggregate_setup.inc
+# ========================================
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/no_protocol.inc
+--source ../include/wait_for_pfs_thread_count.inc
+
+--disable_query_log
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+
+flush privileges;
+
+# Purge old users, hosts, user/host from previous tests
+truncate table performance_schema.accounts;
+truncate table performance_schema.users;
+truncate table performance_schema.hosts;
+
+# Save the setup
+
+--disable_warnings
+drop table if exists test.setup_actors;
+drop table if exists test.setup_objects;
+--enable_warnings
+
+create table test.setup_actors as
+ select * from performance_schema.setup_actors;
+
+create table test.setup_objects as
+ select * from performance_schema.setup_objects;
+
+# Only instrument the user connections (by default)
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user1', role= '%';
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user2', role= '%';
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user3', role= '%';
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user4', role= '%';
+
+# Only instrument test.t% tables (by default)
+truncate table performance_schema.setup_objects;
+insert into performance_schema.setup_objects
+ set object_type='TABLE', object_schema='test', object_name='t1', timed='YES';
+insert into performance_schema.setup_objects
+ set object_type='TABLE', object_schema='test', object_name='t2', timed='NO';
+insert into performance_schema.setup_objects
+ set object_type='TABLE', object_schema='test', object_name='t3', timed='NO';
+
+update performance_schema.threads set instrumented='NO';
+
+# Only instrument table io and lock (by default)
+update performance_schema.setup_instruments set enabled='NO', timed='NO';
+update performance_schema.setup_instruments set enabled='YES', timed='YES'
+ where name in ('wait/io/table/sql/handler',
+ 'wait/lock/table/sql/handler');
+
+# Enable all consumers (by default)
+update performance_schema.setup_consumers set enabled='YES';
+
+# Start from a known clean state, to avoid noise from previous tests
+flush tables;
+flush status;
+
+create table test.t1(a int, b int, c int, d int default 0,
+ primary key(a),
+ index index_b(b),
+ index index_cb(c, b));
+create table test.t2 like test.t1;
+create table test.t3 like test.t1;
+
+#
+# Note:
+# For test robustness and to avoid picking up noise from other tests scripts,
+# it is better to use:
+# in ('t1', 't2', 't3)
+# explicitly instead of:
+# like 't%'
+
+--disable_warnings
+drop procedure if exists dump_thread;
+drop procedure if exists dump_one_thread;
+--enable_warnings
+
+delimiter $$;
+
+create procedure dump_thread()
+begin
+ call dump_one_thread('user1');
+ call dump_one_thread('user2');
+ call dump_one_thread('user3');
+ call dump_one_thread('user4');
+end
+$$
+
+create procedure dump_one_thread(in username varchar(64))
+begin
+ declare my_thread_id int;
+
+ set my_thread_id = (select thread_id from performance_schema.threads
+ where processlist_user=username);
+
+ if (my_thread_id is not null) then
+ select username, event_name, count_star
+ from performance_schema.events_waits_summary_by_thread_by_event_name
+ where event_name in
+ ('wait/io/table/sql/handler',
+ 'wait/lock/table/sql/handler')
+ and thread_id = my_thread_id
+ order by event_name;
+ else
+ select username, "not found" as status;
+ end if;
+end
+$$
+
+delimiter ;$$
+
+prepare dump_waits_user from
+ "select user, event_name, count_star
+ from performance_schema.events_waits_summary_by_user_by_event_name
+ where user like \'user%\' and event_name in
+ (\'wait/io/table/sql/handler\',
+ \'wait/lock/table/sql/handler\')
+ order by user, event_name;";
+
+prepare dump_waits_account from
+ "select user, host, event_name, count_star
+ from performance_schema.events_waits_summary_by_account_by_event_name
+ where user like \'user%\' and event_name in
+ (\'wait/io/table/sql/handler\',
+ \'wait/lock/table/sql/handler\')
+ order by user, host, event_name;";
+
+prepare dump_waits_host from
+ "select host, event_name, count_star
+ from performance_schema.events_waits_summary_by_host_by_event_name
+ where host=\'localhost\' and event_name in
+ (\'wait/io/table/sql/handler\',
+ \'wait/lock/table/sql/handler\')
+ order by host, event_name;";
+
+prepare dump_waits_global from
+ "select event_name, count_star
+ from performance_schema.events_waits_summary_global_by_event_name
+ where event_name in
+ (\'wait/io/table/sql/handler\',
+ \'wait/lock/table/sql/handler\')
+ order by event_name;";
+
+prepare dump_waits_history from
+ "select event_name, count(event_name), object_type, object_schema, object_name
+ from performance_schema.events_waits_history_long
+ where event_name in
+ (\'wait/io/table/sql/handler\',
+ \'wait/lock/table/sql/handler\')
+ group by object_type, object_schema, object_name, event_name
+ order by object_type, object_schema, object_name, event_name;";
+
+prepare dump_waits_index_io from
+ "select object_type, object_schema, object_name, index_name,
+ count_star, count_read, count_write,
+ count_fetch, count_insert, count_update, count_delete
+ from performance_schema.table_io_waits_summary_by_index_usage
+ where object_type='TABLE' and object_schema='test'
+ and object_name in ('t1', 't2', 't3')
+ order by object_type, object_schema, object_name, index_name;";
+
+prepare dump_waits_table_io from
+ "select object_type, object_schema, object_name,
+ count_star, count_read, count_write,
+ count_fetch, count_insert, count_update, count_delete
+ from performance_schema.table_io_waits_summary_by_table
+ where object_type='TABLE' and object_schema='test'
+ and object_name in ('t1', 't2', 't3')
+ order by object_type, object_schema, object_name";
+
+prepare dump_waits_table_lock from
+ "select object_type, object_schema, object_name,
+ count_star, count_read, count_write,
+ count_read_normal, count_read_with_shared_locks,
+ count_read_high_priority, count_read_no_insert,
+ count_read_external,
+ count_write_delayed, count_write_low_priority,
+ count_write_external
+ from performance_schema.table_lock_waits_summary_by_table
+ where object_type='TABLE' and object_schema='test'
+ and object_name in ('t1', 't2', 't3')
+ order by object_type, object_schema, object_name";
+
+prepare dump_objects_summary from
+ "select object_type, object_schema, object_name, count_star
+ from performance_schema.objects_summary_global_by_type
+ where object_type='TABLE' and object_schema='test'
+ and object_name in ('t1', 't2', 't3')
+ order by object_type, object_schema, object_name";
+
+--enable_query_log
diff --git a/mysql-test/suite/perfschema/include/table_io_basic_dml.inc b/mysql-test/suite/perfschema/include/table_io_basic_dml.inc
new file mode 100644
index 00000000000..4fe2fd9dfb3
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/table_io_basic_dml.inc
@@ -0,0 +1,36 @@
+# Tests for PERFORMANCE_SCHEMA table io
+#
+# Payload fragment to test table io for basic DML.
+#
+# $table_item = <schema>.<tablename> must be set before sourcing this script.
+#
+
+insert into marker set a = 1;
+eval insert into $table_item set a = 'foo', b = 1;
+insert into marker set a = 1;
+eval insert into $table_item set a = 'foo', b = 2;
+insert into marker set a = 1;
+eval insert into $table_item set a = 'foo', b = 3;
+insert into marker set a = 1;
+eval select * from $table_item;
+insert into marker set a = 1;
+eval update $table_item set a = 'bar';
+insert into marker set a = 1;
+eval select * from $table_item limit 2;
+insert into marker set a = 1;
+eval delete from $table_item where b = 3;
+insert into marker set a = 1;
+# This may record a fetch for "deleted" records
+eval select * from $table_item;
+insert into marker set a = 1;
+eval optimize table $table_item;
+insert into marker set a = 1;
+# Same data after optimize
+eval select * from $table_item;
+insert into marker set a = 1;
+# truncate will fail for views
+--disable_abort_on_error
+eval truncate table $table_item;
+--enable_abort_on_error
+insert into marker set a = 1;
+
diff --git a/mysql-test/suite/perfschema/include/table_io_cleanup_helper.inc b/mysql-test/suite/perfschema/include/table_io_cleanup_helper.inc
new file mode 100644
index 00000000000..02957903762
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/table_io_cleanup_helper.inc
@@ -0,0 +1,10 @@
+# See related script table_io_setup_helper.inc
+
+# Cleanup
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
+
diff --git a/mysql-test/suite/perfschema/include/table_io_result_helper.inc b/mysql-test/suite/perfschema/include/table_io_result_helper.inc
new file mode 100644
index 00000000000..789f7135a1a
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/table_io_result_helper.inc
@@ -0,0 +1,22 @@
+# See related script table_io_setup_helper.inc
+
+# Stop table io recording
+update performance_schema.setup_consumers set enabled='NO';
+eval select event_name,
+ left(source, locate(":", source)) as short_source,
+ object_type, object_schema,
+ if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+ as pretty_name,
+ operation, number_of_bytes
+ from performance_schema.events_waits_history_long
+ where event_name like 'wait/io/table/%'
+ and object_schema in ($schema_to_dump)
+ order by thread_id, event_id;
+
+# In case of failures, this will tell if table io are lost.
+show status like 'performance_schema_%';
+
+# Cleanup
+truncate performance_schema.events_waits_history_long;
+flush status;
+
diff --git a/mysql-test/suite/perfschema/include/table_io_setup_helper.inc b/mysql-test/suite/perfschema/include/table_io_setup_helper.inc
new file mode 100644
index 00000000000..b4c4b5fab69
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/table_io_setup_helper.inc
@@ -0,0 +1,58 @@
+# Performance schema test template
+
+# How to use this script in a test case
+# =====================================
+#
+# The general table io test template is as follows
+#
+# --source include/not_embedded.inc
+# --source include/have_perfschema.inc
+# --source ../include/table_io_setup_helper.inc
+# ... more setup scripts as needed ...
+# update performance_schema.setup_consumers set enabled='YES';
+# ... test payload here ...
+# ... optionally, add this insert between statements
+# ... to make the final output more readable
+# insert into test.marker set a=1;
+# ... more test payload here ...
+# ... optionaly, add the following line (by default, only "test" is dumped) ...
+# let $schema_to_dump="db1", "db2", "db3";
+# --source ../include/table_io_result_helper.inc
+# Optional: Repeat several times
+# update performance_schema.setup_consumers set enabled='YES';
+# ... test payload here ...
+# --source ../include/table_io_result_helper.inc
+# ... cleanup
+# --source ../include/table_io_cleanup_helper.inc
+#
+# (end of template)
+
+# Setup
+
+--disable_warnings
+drop table if exists test.marker;
+--enable_warnings
+
+# To be used in the test payload,
+# insert into marker makes the test output easier to read,
+# to separate table io events between statements.
+create table test.marker(a int);
+
+update performance_schema.setup_consumers set enabled='NO';
+
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+
+truncate table performance_schema.events_waits_history_long;
+
+# Reset lost counters to a known state
+flush status;
+
+# Make sure there is room to instrument tables from this test.
+flush tables;
+
+# By default, dump table io only for test.
+# A test can overide this
+let $schema_to_dump="test";
+
diff --git a/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc b/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc
new file mode 100644
index 00000000000..a2ed41d9d1b
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc
@@ -0,0 +1,20 @@
+# Tests for the performance schema
+# This helper can be used to enforce that no threads from previous
+# tests are still running, which can impact some test scripts.
+
+# Wait until there is only one session left, this one.
+
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist;
+--source include/wait_condition.inc
+
+# Threads are removed from information_schema.processlist
+# very soon, but continue to execute in the server,
+# before finally be removed from performance_schema.threads.
+# Because instrumentation is optional, we use "<=" here.
+
+let $wait_condition=
+ select count(*) <= 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND';
+--source include/wait_condition.inc
+
diff --git a/mysql-test/suite/perfschema/include/wait_till_sleep.inc b/mysql-test/suite/perfschema/include/wait_till_sleep.inc
new file mode 100644
index 00000000000..5f0f85948c7
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/wait_till_sleep.inc
@@ -0,0 +1,19 @@
+# Wait till the action of the connection using the DB = 'mysqltest' or
+# 'mysqlsupertest' is finished ( Command = 'Sleep').
+
+let $wait_timeout= 10;
+let $wait_condition=
+SELECT COUNT(*) = 1
+FROM performance_schema.threads
+WHERE processlist_db IN ('mysqltest','mysqlsupertest')
+ AND processlist_command = 'Sleep';
+--source include/wait_condition.inc
+if (!$success)
+{
+ --echo # Error: We did not reach the expected state where processlist_command = 'Sleep'
+ SELECT * FROM performance_schema.threads
+ WHERE processlist_db IN ('mysqltest','mysqlsupertest');
+ --echo # abort
+ exit;
+}
+
diff --git a/mysql-test/suite/perfschema/r/aggregate.result b/mysql-test/suite/perfschema/r/aggregate.result
index edc7ce0bcca..ab927f544cf 100644
--- a/mysql-test/suite/perfschema/r/aggregate.result
+++ b/mysql-test/suite/perfschema/r/aggregate.result
@@ -4,6 +4,8 @@ update performance_schema.setup_instruments set enabled = 'NO';
update performance_schema.setup_consumers set enabled = 'NO';
truncate table performance_schema.file_summary_by_event_name;
truncate table performance_schema.file_summary_by_instance;
+truncate table performance_schema.socket_summary_by_event_name;
+truncate table performance_schema.socket_summary_by_instance;
truncate table performance_schema.events_waits_summary_global_by_event_name;
truncate table performance_schema.events_waits_summary_by_instance;
truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
@@ -33,6 +35,20 @@ GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE)
+SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
+FROM performance_schema.socket_summary_by_event_name AS e
+JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
+GROUP BY EVENT_NAME
+HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
+OR @dump_all;
+EVENT_NAME COUNT_READ SUM(i.COUNT_READ)
+SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
+FROM performance_schema.socket_summary_by_event_name AS e
+JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
+GROUP BY EVENT_NAME
+HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
+OR @dump_all;
+EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE)
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
diff --git a/mysql-test/suite/perfschema/r/all_instances.result b/mysql-test/suite/perfschema/r/all_instances.result
deleted file mode 100644
index caf4f49034f..00000000000
--- a/mysql-test/suite/perfschema/r/all_instances.result
+++ /dev/null
@@ -1,161 +0,0 @@
-use performance_schema;
-select name from mutex_instances
-where name not rlike '/(DEBUG_SYNC::mutex)$'
- and name != 'wait/synch/mutex/mysys/BITMAP::mutex'
- group by name;
-name
-wait/synch/mutex/archive/archive_mutex
-wait/synch/mutex/aria/LOCK_trn_list
-wait/synch/mutex/aria/PAGECACHE::cache_lock
-wait/synch/mutex/aria/SERVICE_THREAD_CONTROL::LOCK_control
-wait/synch/mutex/aria/THR_LOCK_maria
-wait/synch/mutex/aria/TRANSLOG_BUFFER::mutex
-wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::dirty_buffer_mask_lock
-wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::file_header_lock
-wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::log_flush_lock
-wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::purger_lock
-wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::unfinished_files_lock
-wait/synch/mutex/blackhole/blackhole
-wait/synch/mutex/csv/tina
-wait/synch/mutex/memory/HP_SHARE::intern_lock
-wait/synch/mutex/myisam/MYISAM_SHARE::intern_lock
-wait/synch/mutex/mysys/KEY_CACHE::cache_lock
-wait/synch/mutex/mysys/LOCK_alarm
-wait/synch/mutex/mysys/LOCK_uuid_generator
-wait/synch/mutex/mysys/my_thread_var::mutex
-wait/synch/mutex/mysys/THR_LOCK::mutex
-wait/synch/mutex/mysys/THR_LOCK_charset
-wait/synch/mutex/mysys/THR_LOCK_heap
-wait/synch/mutex/mysys/THR_LOCK_isam
-wait/synch/mutex/mysys/THR_LOCK_lock
-wait/synch/mutex/mysys/THR_LOCK_malloc
-wait/synch/mutex/mysys/THR_LOCK_myisam
-wait/synch/mutex/mysys/THR_LOCK_myisam_mmap
-wait/synch/mutex/mysys/THR_LOCK_net
-wait/synch/mutex/mysys/THR_LOCK_open
-wait/synch/mutex/mysys/THR_LOCK_threads
-wait/synch/mutex/mysys/TMPDIR_mutex
-wait/synch/mutex/sql/Cversion_lock
-wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state
-wait/synch/mutex/sql/hash_filo::lock
-wait/synch/mutex/sql/LOCK_active_mi
-wait/synch/mutex/sql/LOCK_audit_mask
-wait/synch/mutex/sql/LOCK_commit_ordered
-wait/synch/mutex/sql/LOCK_connection_count
-wait/synch/mutex/sql/LOCK_crypt
-wait/synch/mutex/sql/LOCK_delayed_create
-wait/synch/mutex/sql/LOCK_delayed_insert
-wait/synch/mutex/sql/LOCK_delayed_status
-wait/synch/mutex/sql/LOCK_des_key_file
-wait/synch/mutex/sql/LOCK_error_log
-wait/synch/mutex/sql/LOCK_error_messages
-wait/synch/mutex/sql/LOCK_event_queue
-wait/synch/mutex/sql/LOCK_gdl
-wait/synch/mutex/sql/LOCK_global_index_stats
-wait/synch/mutex/sql/LOCK_global_system_variables
-wait/synch/mutex/sql/LOCK_global_table_stats
-wait/synch/mutex/sql/LOCK_global_user_client_stats
-wait/synch/mutex/sql/LOCK_open
-wait/synch/mutex/sql/LOCK_plugin
-wait/synch/mutex/sql/LOCK_prepared_stmt_count
-wait/synch/mutex/sql/LOCK_prepare_ordered
-wait/synch/mutex/sql/LOCK_rpl_status
-wait/synch/mutex/sql/LOCK_server_started
-wait/synch/mutex/sql/LOCK_slave_list
-wait/synch/mutex/sql/LOCK_stats
-wait/synch/mutex/sql/LOCK_status
-wait/synch/mutex/sql/LOCK_thread_count
-wait/synch/mutex/sql/LOCK_user_conn
-wait/synch/mutex/sql/LOCK_user_locks
-wait/synch/mutex/sql/LOCK_uuid_short_generator
-wait/synch/mutex/sql/LOCK_xid_cache
-wait/synch/mutex/sql/LOG::LOCK_log
-wait/synch/mutex/sql/LOG_INFO::lock
-wait/synch/mutex/sql/Master_info::data_lock
-wait/synch/mutex/sql/Master_info::run_lock
-wait/synch/mutex/sql/Master_info::sleep_lock
-wait/synch/mutex/sql/MDL_map::mutex
-wait/synch/mutex/sql/MDL_wait::LOCK_wait_status
-wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index
-wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index
-wait/synch/mutex/sql/Query_cache::structure_guard_mutex
-wait/synch/mutex/sql/Relay_log_info::data_lock
-wait/synch/mutex/sql/Relay_log_info::log_space_lock
-wait/synch/mutex/sql/Relay_log_info::run_lock
-wait/synch/mutex/sql/Relay_log_info::sleep_lock
-wait/synch/mutex/sql/Slave_reporting_capability::err_lock
-wait/synch/mutex/sql/TABLE_SHARE::LOCK_ha_data
-wait/synch/mutex/sql/THD::LOCK_thd_data
-wait/synch/mutex/sql/THD::LOCK_wakeup_ready
-wait/synch/mutex/sql/tz_LOCK
-select name from rwlock_instances
-where name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock")
-group by name;
-name
-wait/synch/rwlock/aria/TRANSLOG_DESCRIPTOR::open_files_lock
-wait/synch/rwlock/myisam/MYISAM_SHARE::key_root_lock
-wait/synch/rwlock/myisam/MYISAM_SHARE::mmap_lock
-wait/synch/rwlock/mysys/SAFE_HASH::mutex
-wait/synch/rwlock/sql/LOCK_dboptions
-wait/synch/rwlock/sql/LOCK_grant
-wait/synch/rwlock/sql/LOCK_system_variables_hash
-wait/synch/rwlock/sql/LOCK_sys_init_connect
-wait/synch/rwlock/sql/LOCK_sys_init_slave
-wait/synch/rwlock/sql/LOGGER::LOCK_logger
-wait/synch/rwlock/sql/MDL_context::LOCK_waiting_for
-wait/synch/rwlock/sql/MDL_lock::rwlock
-wait/synch/rwlock/sql/THR_LOCK_servers
-wait/synch/rwlock/sql/THR_LOCK_udf
-select name from cond_instances where name not rlike '/(DEBUG_SYNC::cond)$' group by name;
-name
-wait/synch/cond/aria/SERVICE_THREAD_CONTROL::COND_control
-wait/synch/cond/aria/TRANSLOG_BUFFER::prev_sent_to_disk_cond
-wait/synch/cond/aria/TRANSLOG_BUFFER::waiting_filling_buffer
-wait/synch/cond/aria/TRANSLOG_DESCRIPTOR::log_flush_cond
-wait/synch/cond/aria/TRANSLOG_DESCRIPTOR::new_goal_cond
-wait/synch/cond/mysys/COND_alarm
-wait/synch/cond/mysys/my_thread_var::suspend
-wait/synch/cond/mysys/THR_COND_threads
-wait/synch/cond/sql/COND_flush_thread_cache
-wait/synch/cond/sql/COND_queue_state
-wait/synch/cond/sql/COND_rpl_status
-wait/synch/cond/sql/COND_server_started
-wait/synch/cond/sql/COND_thread_cache
-wait/synch/cond/sql/COND_thread_count
-wait/synch/cond/sql/Event_scheduler::COND_state
-wait/synch/cond/sql/Master_info::data_cond
-wait/synch/cond/sql/Master_info::sleep_cond
-wait/synch/cond/sql/Master_info::start_cond
-wait/synch/cond/sql/Master_info::stop_cond
-wait/synch/cond/sql/MDL_context::COND_wait_status
-wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy
-wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond
-wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy
-wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond
-wait/synch/cond/sql/Query_cache::COND_cache_status_changed
-wait/synch/cond/sql/Relay_log_info::data_cond
-wait/synch/cond/sql/Relay_log_info::log_space_cond
-wait/synch/cond/sql/Relay_log_info::sleep_cond
-wait/synch/cond/sql/Relay_log_info::start_cond
-wait/synch/cond/sql/Relay_log_info::stop_cond
-wait/synch/cond/sql/THD::COND_wakeup_ready
-select event_name from file_instances group by event_name;
-event_name
-wait/io/file/aria/control
-wait/io/file/aria/translog
-wait/io/file/myisam/dfile
-wait/io/file/myisam/kfile
-wait/io/file/mysys/charset
-wait/io/file/sql/casetest
-wait/io/file/sql/dbopt
-wait/io/file/sql/ERRMSG
-wait/io/file/sql/FRM
-wait/io/file/sql/pid
-wait/io/file/sql/query_log
-wait/io/file/sql/slow_log
-select name from threads group by name;
-name
-thread/aria/checkpoint_background
-thread/sql/main
-thread/sql/one_connection
-thread/sql/signal_handler
diff --git a/mysql-test/suite/perfschema/r/all_tests.result b/mysql-test/suite/perfschema/r/all_tests.result
new file mode 100644
index 00000000000..3f413ca9a1e
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/all_tests.result
@@ -0,0 +1,21 @@
+drop table if exists t1;
+drop table if exists t2;
+create table t1 (test_name text);
+create table t2 (test_name text);
+load data infile "<MYSQLTEST_VARDIR>/tmp/perfschema-all_tests.txt" into table t1;
+insert into t2 select concat('ddl_', table_name, '.test') from information_schema.tables
+where table_schema='performance_schema';
+insert into t2 select concat('dml_', table_name, '.test') from information_schema.tables
+where table_schema='performance_schema';
+update t2 set test_name= replace(test_name, "events_waits_summary_", "ews_");
+update t2 set test_name= replace(test_name, "events_stages_summary_", "esgs_");
+update t2 set test_name= replace(test_name, "events_statements_summary_", "esms_");
+update t2 set test_name= replace(test_name, "file_summary_", "fs_");
+update t2 set test_name= replace(test_name, "objects_summary_", "os_");
+update t2 set test_name= replace(test_name, "table_io_waits_summary_", "tiws_");
+update t2 set test_name= replace(test_name, "table_lock_waits_summary_", "tlws_");
+delete from t2 where t2.test_name in (select t1.test_name from t1);
+select test_name as `MISSING DDL/DML TESTS` from t2;
+MISSING DDL/DML TESTS
+drop table t1;
+drop table t2;
diff --git a/mysql-test/suite/perfschema/r/binlog_mix.result b/mysql-test/suite/perfschema/r/binlog_mix.result
index 97f76619619..1c639340b3b 100644
--- a/mysql-test/suite/perfschema/r/binlog_mix.result
+++ b/mysql-test/suite/perfschema/r/binlog_mix.result
@@ -24,8 +24,12 @@ drop table test.t2;
update performance_schema.setup_instruments set enabled='YES'
where name like "wait/synch/rwlock/sql/%"
and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
-show binlog events from <binlog_start>;
+include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */
master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer)
@@ -40,3 +44,7 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
diff --git a/mysql-test/suite/perfschema/r/binlog_row.result b/mysql-test/suite/perfschema/r/binlog_row.result
index 1bcdb4a6c58..6ef080663c7 100644
--- a/mysql-test/suite/perfschema/r/binlog_row.result
+++ b/mysql-test/suite/perfschema/r/binlog_row.result
@@ -24,8 +24,12 @@ drop table test.t2;
update performance_schema.setup_instruments set enabled='YES'
where name like "wait/synch/rwlock/sql/%"
and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
-show binlog events from <binlog_start>;
+include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */
master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer)
@@ -40,3 +44,7 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
diff --git a/mysql-test/suite/perfschema/r/binlog_stmt.result b/mysql-test/suite/perfschema/r/binlog_stmt.result
index 1d18bd984b8..80c646abe46 100644
--- a/mysql-test/suite/perfschema/r/binlog_stmt.result
+++ b/mysql-test/suite/perfschema/r/binlog_stmt.result
@@ -20,14 +20,12 @@ insert into test.t1
select thread_id from performance_schema.events_waits_current;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Mixing self-logging and non-self-logging engines in a statement is unsafe.
insert into test.t2
select name from performance_schema.setup_instruments
where name like "wait/synch/rwlock/sql/%"
and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Mixing self-logging and non-self-logging engines in a statement is unsafe.
drop table test.t1;
drop table test.t2;
update performance_schema.setup_instruments set enabled='YES'
@@ -35,7 +33,7 @@ update performance_schema.setup_instruments set enabled='YES'
and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
-show binlog events from <binlog_start>;
+include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; update performance_schema.setup_instruments set enabled='NO'
diff --git a/mysql-test/suite/perfschema/r/checksum.result b/mysql-test/suite/perfschema/r/checksum.result
index 587dead845a..f2a0f5a7713 100644
--- a/mysql-test/suite/perfschema/r/checksum.result
+++ b/mysql-test/suite/perfschema/r/checksum.result
@@ -1,34 +1,90 @@
+checksum table performance_schema.accounts;
checksum table performance_schema.cond_instances;
+checksum table performance_schema.events_stages_current;
+checksum table performance_schema.events_stages_history;
+checksum table performance_schema.events_stages_history_long;
+checksum table performance_schema.events_stages_summary_by_account_by_event_name;
+checksum table performance_schema.events_stages_summary_by_host_by_event_name;
+checksum table performance_schema.events_stages_summary_by_thread_by_event_name;
+checksum table performance_schema.events_stages_summary_by_user_by_event_name;
+checksum table performance_schema.events_stages_summary_global_by_event_name;
+checksum table performance_schema.events_statements_current;
+checksum table performance_schema.events_statements_history;
+checksum table performance_schema.events_statements_history_long;
+checksum table performance_schema.events_statements_summary_by_account_by_event_name;
+checksum table performance_schema.events_statements_summary_by_host_by_event_name;
+checksum table performance_schema.events_statements_summary_by_thread_by_event_name;
+checksum table performance_schema.events_statements_summary_by_user_by_event_name;
+checksum table performance_schema.events_statements_summary_global_by_event_name;
checksum table performance_schema.events_waits_current;
checksum table performance_schema.events_waits_history;
checksum table performance_schema.events_waits_history_long;
+checksum table performance_schema.events_waits_summary_by_account_by_event_name;
+checksum table performance_schema.events_waits_summary_by_host_by_event_name;
checksum table performance_schema.events_waits_summary_by_instance;
checksum table performance_schema.events_waits_summary_by_thread_by_event_name;
+checksum table performance_schema.events_waits_summary_by_user_by_event_name;
checksum table performance_schema.events_waits_summary_global_by_event_name;
checksum table performance_schema.file_instances;
checksum table performance_schema.file_summary_by_event_name;
checksum table performance_schema.file_summary_by_instance;
+checksum table performance_schema.hosts;
checksum table performance_schema.mutex_instances;
+checksum table performance_schema.objects_summary_global_by_type;
checksum table performance_schema.performance_timers;
checksum table performance_schema.rwlock_instances;
+checksum table performance_schema.setup_actors;
checksum table performance_schema.setup_consumers;
checksum table performance_schema.setup_instruments;
+checksum table performance_schema.setup_objects;
checksum table performance_schema.setup_timers;
+checksum table performance_schema.table_io_waits_summary_by_index_usage;
+checksum table performance_schema.table_io_waits_summary_by_table;
+checksum table performance_schema.table_lock_waits_summary_by_table;
checksum table performance_schema.threads;
+checksum table performance_schema.users;
+checksum table performance_schema.accounts extended;
checksum table performance_schema.cond_instances extended;
+checksum table performance_schema.events_stages_current extended;
+checksum table performance_schema.events_stages_history extended;
+checksum table performance_schema.events_stages_history_long extended;
+checksum table performance_schema.events_stages_summary_by_account_by_event_name extended;
+checksum table performance_schema.events_stages_summary_by_host_by_event_name extended;
+checksum table performance_schema.events_stages_summary_by_thread_by_event_name extended;
+checksum table performance_schema.events_stages_summary_by_user_by_event_name extended;
+checksum table performance_schema.events_stages_summary_global_by_event_name extended;
+checksum table performance_schema.events_statements_current extended;
+checksum table performance_schema.events_statements_history extended;
+checksum table performance_schema.events_statements_history_long extended;
+checksum table performance_schema.events_statements_summary_by_account_by_event_name extended;
+checksum table performance_schema.events_statements_summary_by_host_by_event_name extended;
+checksum table performance_schema.events_statements_summary_by_thread_by_event_name extended;
+checksum table performance_schema.events_statements_summary_by_user_by_event_name extended;
+checksum table performance_schema.events_statements_summary_global_by_event_name extended;
checksum table performance_schema.events_waits_current extended;
checksum table performance_schema.events_waits_history extended;
checksum table performance_schema.events_waits_history_long extended;
+checksum table performance_schema.events_waits_summary_by_account_by_event_name extended;
+checksum table performance_schema.events_waits_summary_by_host_by_event_name extended;
checksum table performance_schema.events_waits_summary_by_instance extended;
checksum table performance_schema.events_waits_summary_by_thread_by_event_name extended;
+checksum table performance_schema.events_waits_summary_by_user_by_event_name extended;
checksum table performance_schema.events_waits_summary_global_by_event_name extended;
checksum table performance_schema.file_instances extended;
checksum table performance_schema.file_summary_by_event_name extended;
checksum table performance_schema.file_summary_by_instance extended;
+checksum table performance_schema.hosts extended;
checksum table performance_schema.mutex_instances extended;
+checksum table performance_schema.objects_summary_global_by_type extended;
checksum table performance_schema.performance_timers extended;
checksum table performance_schema.rwlock_instances extended;
+checksum table performance_schema.setup_actors extended;
checksum table performance_schema.setup_consumers extended;
checksum table performance_schema.setup_instruments extended;
+checksum table performance_schema.setup_objects extended;
checksum table performance_schema.setup_timers extended;
+checksum table performance_schema.table_io_waits_summary_by_index_usage extended;
+checksum table performance_schema.table_io_waits_summary_by_table extended;
+checksum table performance_schema.table_lock_waits_summary_by_table extended;
checksum table performance_schema.threads extended;
+checksum table performance_schema.users extended;
diff --git a/mysql-test/suite/perfschema/r/column_privilege.result b/mysql-test/suite/perfschema/r/column_privilege.result
index aff5f3e6eee..b013ea3fcad 100644
--- a/mysql-test/suite/perfschema/r/column_privilege.result
+++ b/mysql-test/suite/perfschema/r/column_privilege.result
@@ -24,5 +24,3 @@ REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'pfs_user_5'@localhost;
DROP USER 'pfs_user_5'@localhost;
flush privileges;
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
-UPDATE performance_schema.setup_consumers SET enabled = 'YES';
-UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE';
diff --git a/mysql-test/suite/perfschema/r/connection.result b/mysql-test/suite/perfschema/r/connection.result
new file mode 100644
index 00000000000..fe312f6fa04
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/connection.result
@@ -0,0 +1,875 @@
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1a" as status;
+status
+user1 in con1a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1b" as status;
+status
+user1 in con1b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1c" as status;
+status
+user1 in con1c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user2 in con2a" as status;
+status
+user2 in con2a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user2 in con2b" as status;
+status
+user2 in con2b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 6
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user2 in con2c" as status;
+status
+user2 in con2c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user3 in con3a" as status;
+status
+user3 in con3a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 3 3
+user3 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 3 3
+user3 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 8
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user3 in con3b" as status;
+status
+user3 in con3b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 3 3
+user3 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 3 3
+user3 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 9
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user3 in con3c" as status;
+status
+user3 in con3c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 3 3
+user3 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 3 3
+user3 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 10 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con1a disconnected" as status;
+status
+con1a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+user2 localhost 3 3
+user3 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+user2 3 3
+user3 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con2a disconnected" as status;
+status
+con2a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+user2 localhost 2 3
+user3 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+user2 2 3
+user3 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con3a disconnected" as status;
+status
+con3a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+user2 localhost 2 3
+user3 localhost 2 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+user2 2 3
+user3 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+user2 2 3
+user3 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+user2 2 2
+user3 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+user2 2 2
+user3 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user4 in con4a" as status;
+status
+user4 in con4a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+user4 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+user2 2 2
+user3 2 2
+user4 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 8
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user4 in con4b" as status;
+status
+user4 in con4b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+user4 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+user2 2 2
+user3 2 2
+user4 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 9
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user4 in con4c" as status;
+status
+user4 in con4c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+user2 2 2
+user3 2 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 10 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con1b disconnected" as status;
+status
+con1b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+user2 localhost 2 2
+user3 localhost 2 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+user2 2 2
+user3 2 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con2b disconnected" as status;
+status
+con2b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+user2 localhost 1 2
+user3 localhost 2 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+user2 1 2
+user3 2 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con3b disconnected" as status;
+status
+con3b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+user2 localhost 1 2
+user3 localhost 1 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+user2 1 2
+user3 1 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con1c disconnected" as status;
+status
+con1c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user2 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+user2 localhost 1 2
+user3 localhost 1 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+user2 1 2
+user3 1 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con2c disconnected" as status;
+status
+con2c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+user2 localhost 0 2
+user3 localhost 1 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+user2 0 2
+user3 1 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con3c disconnected" as status;
+status
+con3c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+user2 localhost 0 2
+user3 localhost 0 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+user2 0 2
+user3 0 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+user2 0 2
+user3 0 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user5 in con5a" as status;
+status
+user5 in con5a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+user5 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 3 3
+user5 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user5 in con5b" as status;
+status
+user5 in con5b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+user5 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 3 3
+user5 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 6
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user5 in con5c" as status;
+status
+user5 in con5c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+user5 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+user5 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 3 3
+user5 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
+status
+con 5a, 5b, 5c, 6a, 6b, 6c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 0 3
+user5 localhost 0 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 0 3
+user5 0 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 0 3
+user5 0 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
diff --git a/mysql-test/suite/perfschema/r/connection_3a.result b/mysql-test/suite/perfschema/r/connection_3a.result
new file mode 100644
index 00000000000..1f92d67137d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/connection_3a.result
@@ -0,0 +1,820 @@
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1a" as status;
+status
+user1 in con1a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1b" as status;
+status
+user1 in con1b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1c" as status;
+status
+user1 in con1c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user2 in con2a" as status;
+status
+user2 in con2a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 1
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user2 in con2b" as status;
+status
+user2 in con2b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 6
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 2
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user2 in con2c" as status;
+status
+user2 in con2c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 3
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user3 in con3a" as status;
+status
+user3 in con3a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 3 3
+user3 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 8
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 4
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user3 in con3b" as status;
+status
+user3 in con3b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 3 3
+user3 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 9
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 5
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user3 in con3c" as status;
+status
+user3 in con3c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+user2 3 3
+user3 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 10 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con1a disconnected" as status;
+status
+con1a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+user2 3 3
+user3 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con2a disconnected" as status;
+status
+con2a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+user2 2 3
+user3 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con3a disconnected" as status;
+status
+con3a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+user2 2 3
+user3 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+user2 2 3
+user3 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+user2 2 2
+user3 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+user2 2 2
+user3 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user4 in con4a" as status;
+status
+user4 in con4a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+user2 2 2
+user3 2 2
+user4 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 8
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 7
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user4 in con4b" as status;
+status
+user4 in con4b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+user2 2 2
+user3 2 2
+user4 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 9
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 8
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user4 in con4c" as status;
+status
+user4 in con4c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+user2 2 2
+user3 2 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 10 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con1b disconnected" as status;
+status
+con1b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+user2 2 2
+user3 2 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con2b disconnected" as status;
+status
+con2b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+user2 1 2
+user3 2 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con3b disconnected" as status;
+status
+con3b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+user2 1 2
+user3 1 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con1c disconnected" as status;
+status
+con1c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user2 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+user2 1 2
+user3 1 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con2c disconnected" as status;
+status
+con2c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+user2 0 2
+user3 1 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con3c disconnected" as status;
+status
+con3c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+user2 0 2
+user3 0 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+user2 0 2
+user3 0 2
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user5 in con5a" as status;
+status
+user5 in con5a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user5 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 3 3
+user5 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user5 in con5b" as status;
+status
+user5 in con5b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user5 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 3 3
+user5 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 6
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user5 in con5c" as status;
+status
+user5 in con5c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+user5 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user5 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 3 3
+user5 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
+status
+con 5a, 5b, 5c, 6a, 6b, 6c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user5 localhost 0 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 0 3
+user5 0 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user4 0 3
+user5 0 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
diff --git a/mysql-test/suite/perfschema/r/connection_3a_3u.result b/mysql-test/suite/perfschema/r/connection_3a_3u.result
new file mode 100644
index 00000000000..0a6229d9f93
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/connection_3a_3u.result
@@ -0,0 +1,762 @@
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1a" as status;
+status
+user1 in con1a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1b" as status;
+status
+user1 in con1b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1c" as status;
+status
+user1 in con1c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user2 in con2a" as status;
+status
+user2 in con2a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 1
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 1
+select "user2 in con2b" as status;
+status
+user2 in con2b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 6
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 2
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 2
+select "user2 in con2c" as status;
+status
+user2 in con2c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 3
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "user3 in con3a" as status;
+status
+user3 in con3a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 8
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 4
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 4
+select "user3 in con3b" as status;
+status
+user3 in con3b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 9
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 5
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 5
+select "user3 in con3c" as status;
+status
+user3 in con3c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 10 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 6
+select "con1a disconnected" as status;
+status
+con1a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 6
+select "con2a disconnected" as status;
+status
+con2a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 6
+select "con3a disconnected" as status;
+status
+con3a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 6
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 6
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 6
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 6
+select "user4 in con4a" as status;
+status
+user4 in con4a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 8
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 7
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 7
+select "user4 in con4b" as status;
+status
+user4 in con4b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 9
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 8
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 8
+select "user4 in con4c" as status;
+status
+user4 in con4c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 10 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+select "con1b disconnected" as status;
+status
+con1b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+select "con2b disconnected" as status;
+status
+con2b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+select "con3b disconnected" as status;
+status
+con3b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+select "con1c disconnected" as status;
+status
+con1c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user2 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+select "con2c disconnected" as status;
+status
+con2c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+select "con3c disconnected" as status;
+status
+con3c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+select "user5 in con5a" as status;
+status
+user5 in con5a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user5 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user5 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+select "user5 in con5b" as status;
+status
+user5 in con5b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user5 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user5 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 6
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+select "user5 in con5c" as status;
+status
+user5 in con5c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+user5 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user5 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user5 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
+status
+con 5a, 5b, 5c, 6a, 6b, 6c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user5 localhost 0 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user5 0 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user5 0 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 9
diff --git a/mysql-test/suite/perfschema/r/connection_3u.result b/mysql-test/suite/perfschema/r/connection_3u.result
new file mode 100644
index 00000000000..f0606301532
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/connection_3u.result
@@ -0,0 +1,817 @@
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1a" as status;
+status
+user1 in con1a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1b" as status;
+status
+user1 in con1b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user1 in con1c" as status;
+status
+user1 in con1c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 0
+select "user2 in con2a" as status;
+status
+user2 in con2a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 1
+select "user2 in con2b" as status;
+status
+user2 in con2b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 6
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 1
+select "user2 in con2c" as status;
+status
+user2 in con2c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 1
+select "user3 in con3a" as status;
+status
+user3 in con3a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 3 3
+user3 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 8
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 2
+select "user3 in con3b" as status;
+status
+user3 in con3b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 3 3
+user3 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 9
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 2
+select "user3 in con3c" as status;
+status
+user3 in con3c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 3 3
+user2 localhost 3 3
+user3 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 10 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 2
+select "con1a disconnected" as status;
+status
+con1a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+user2 localhost 3 3
+user3 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 2
+select "con2a disconnected" as status;
+status
+con2a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+user2 localhost 2 3
+user3 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 2
+select "con3a disconnected" as status;
+status
+con3a disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 3
+user2 localhost 2 3
+user3 localhost 2 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 2
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 2
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 2
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 2
+select "user4 in con4a" as status;
+status
+user4 in con4a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+user4 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 8
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "user4 in con4b" as status;
+status
+user4 in con4b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+user4 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 9
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "user4 in con4c" as status;
+status
+user4 in con4c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 2 2
+user2 localhost 2 2
+user3 localhost 2 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 10 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "con1b disconnected" as status;
+status
+con1b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+user2 localhost 2 2
+user3 localhost 2 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 9 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "con2b disconnected" as status;
+status
+con2b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user3 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+user2 localhost 1 2
+user3 localhost 2 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 8 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "con3b disconnected" as status;
+status
+con3b disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user1 localhost
+user2 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 2
+user2 localhost 1 2
+user3 localhost 1 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "con1c disconnected" as status;
+status
+con1c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user2 localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+user2 localhost 1 2
+user3 localhost 1 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "con2c disconnected" as status;
+status
+con2c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user3 localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+user2 localhost 0 2
+user3 localhost 1 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "con3c disconnected" as status;
+status
+con3c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 2
+user2 localhost 0 2
+user3 localhost 0 2
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 10
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "user5 in con5a" as status;
+status
+user5 in con5a
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+user5 localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user5 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "user5 in con5b" as status;
+status
+user5 in con5b
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+user5 localhost 2 2
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user5 2 2
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 6 6
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "user5 in con5c" as status;
+status
+user5 in con5c
+call dump_all();
+processlist_user processlist_host
+root localhost
+user4 localhost
+user4 localhost
+user4 localhost
+user5 localhost
+user5 localhost
+user5 localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 3 3
+user5 localhost 3 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user5 3 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 7 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
+status
+con 5a, 5b, 5c, 6a, 6b, 6c disconnected
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user4 localhost 0 3
+user5 localhost 0 3
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user5 0 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 7
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+truncate table performance_schema.hosts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user5 0 3
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+truncate table performance_schema.users;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
+truncate table performance_schema.accounts;
+call dump_all();
+processlist_user processlist_host
+root localhost
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+variable_name variable_value
+PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
+PERFORMANCE_SCHEMA_HOSTS_LOST 0
+PERFORMANCE_SCHEMA_USERS_LOST 3
diff --git a/mysql-test/suite/perfschema/r/csv_table_io.result b/mysql-test/suite/perfschema/r/csv_table_io.result
new file mode 100644
index 00000000000..d5b39a2d90c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/csv_table_io.result
@@ -0,0 +1,145 @@
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+drop table if exists test.no_index_tab;
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+create table test.no_index_tab
+( a varchar(255) not null, b int not null) engine = CSV;
+insert into marker set a = 1;
+show create table test.no_index_tab;
+Table Create Table
+no_index_tab CREATE TABLE `no_index_tab` (
+ `a` varchar(255) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=CSV DEFAULT CHARSET=latin1
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 1;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 2;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+foo 1
+foo 2
+foo 3
+insert into marker set a = 1;
+update test.no_index_tab set a = 'bar';
+insert into marker set a = 1;
+select * from test.no_index_tab limit 2;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+delete from test.no_index_tab where b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+optimize table test.no_index_tab;
+Table Op Msg_type Msg_text
+test.no_index_tab optimize note The storage engine for the table doesn't support optimize
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+truncate table test.no_index_tab;
+insert into marker set a = 1;
+drop table test.no_index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ("test")
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/ddl_accounts.result b/mysql-test/suite/perfschema/r/ddl_accounts.result
new file mode 100644
index 00000000000..4884f053df1
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_accounts.result
@@ -0,0 +1,8 @@
+alter table performance_schema.accounts
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.accounts;
+ALTER TABLE performance_schema.accounts ADD INDEX test_index(CURRENT_CONNECTIONS);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.accounts(CURRENT_CONNECTIONS);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esgs_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_esgs_by_account_by_event_name.result
new file mode 100644
index 00000000000..449a19e5310
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esgs_by_account_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_stages_summary_by_account_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_stages_summary_by_account_by_event_name;
+ALTER TABLE performance_schema.events_stages_summary_by_account_by_event_name
+ADD INDEX test_index(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_stages_summary_by_account_by_event_name(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esgs_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_esgs_by_host_by_event_name.result
new file mode 100644
index 00000000000..4760dbda8d3
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esgs_by_host_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_stages_summary_by_host_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_stages_summary_by_host_by_event_name;
+ALTER TABLE performance_schema.events_stages_summary_by_host_by_event_name
+ADD INDEX test_index(HOSTNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_stages_summary_by_host_by_event_name(HOSTNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esgs_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_esgs_by_thread_by_event_name.result
new file mode 100644
index 00000000000..0e070125daa
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esgs_by_thread_by_event_name.result
@@ -0,0 +1,9 @@
+alter table performance_schema.events_stages_summary_by_thread_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_stages_summary_by_thread_by_event_name;
+ALTER TABLE performance_schema.events_stages_summary_by_thread_by_event_name ADD INDEX test_index(THREAD_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_stages_summary_by_thread_by_event_name(THREAD_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esgs_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_esgs_by_user_by_event_name.result
new file mode 100644
index 00000000000..1d797234bcb
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esgs_by_user_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_stages_summary_by_user_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_stages_summary_by_user_by_event_name;
+ALTER TABLE performance_schema.events_stages_summary_by_user_by_event_name
+ADD INDEX test_index(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_stages_summary_by_user_by_event_name(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esgs_global_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_esgs_global_by_event_name.result
new file mode 100644
index 00000000000..0959af39d77
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esgs_global_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_stages_summary_global_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_stages_summary_global_by_event_name;
+ALTER TABLE performance_schema.events_stages_summary_global_by_event_name
+ADD INDEX test_index(EVENT_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_stages_summary_global_by_event_name(EVENT_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esms_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_esms_by_account_by_event_name.result
new file mode 100644
index 00000000000..732f52d3fb7
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esms_by_account_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_statements_summary_by_account_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_statements_summary_by_account_by_event_name;
+ALTER TABLE performance_schema.events_statements_summary_by_account_by_event_name
+ADD INDEX test_index(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_statements_summary_by_account_by_event_name(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esms_by_digest.result b/mysql-test/suite/perfschema/r/ddl_esms_by_digest.result
new file mode 100644
index 00000000000..2a2d0b12285
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esms_by_digest.result
@@ -0,0 +1,9 @@
+alter table performance_schema.events_statements_summary_by_digest
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_statements_summary_by_digest;
+ALTER TABLE performance_schema.events_statements_summary_by_digest ADD INDEX test_index(DIGEST);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_statements_summary_by_digest(DIGEST);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esms_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_esms_by_host_by_event_name.result
new file mode 100644
index 00000000000..efedfe2e1e0
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esms_by_host_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_statements_summary_by_host_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_statements_summary_by_host_by_event_name;
+ALTER TABLE performance_schema.events_statements_summary_by_host_by_event_name
+ADD INDEX test_index(HOSTNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_statements_summary_by_host_by_event_name(HOSTNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esms_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_esms_by_thread_by_event_name.result
new file mode 100644
index 00000000000..edd03d38c67
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esms_by_thread_by_event_name.result
@@ -0,0 +1,9 @@
+alter table performance_schema.events_statements_summary_by_thread_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_statements_summary_by_thread_by_event_name;
+ALTER TABLE performance_schema.events_statements_summary_by_thread_by_event_name ADD INDEX test_index(THREAD_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_statements_summary_by_thread_by_event_name(THREAD_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esms_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_esms_by_user_by_event_name.result
new file mode 100644
index 00000000000..0334e578019
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esms_by_user_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_statements_summary_by_user_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_statements_summary_by_user_by_event_name;
+ALTER TABLE performance_schema.events_statements_summary_by_user_by_event_name
+ADD INDEX test_index(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_statements_summary_by_user_by_event_name(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_esms_global_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_esms_global_by_event_name.result
new file mode 100644
index 00000000000..d2491c67783
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_esms_global_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_statements_summary_global_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_statements_summary_global_by_event_name;
+ALTER TABLE performance_schema.events_statements_summary_global_by_event_name
+ADD INDEX test_index(EVENT_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_statements_summary_global_by_event_name(EVENT_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_events_stages_current.result b/mysql-test/suite/perfschema/r/ddl_events_stages_current.result
new file mode 100644
index 00000000000..d9094ffb366
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_events_stages_current.result
@@ -0,0 +1,7 @@
+alter table performance_schema.events_stages_current add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_stages_current;
+ALTER TABLE performance_schema.events_stages_current ADD INDEX test_index(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_current(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_events_stages_history.result b/mysql-test/suite/perfschema/r/ddl_events_stages_history.result
new file mode 100644
index 00000000000..0b6d6df06d2
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_events_stages_history.result
@@ -0,0 +1,7 @@
+alter table performance_schema.events_stages_history add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_stages_history;
+ALTER TABLE performance_schema.events_stages_history ADD INDEX test_index(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_history(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result b/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result
new file mode 100644
index 00000000000..7843f61aa0d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result
@@ -0,0 +1,7 @@
+alter table performance_schema.events_stages_history_long add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_stages_history_long;
+ALTER TABLE performance_schema.events_stages_history_long ADD INDEX test_index(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_history_long(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_events_statements_current.result b/mysql-test/suite/perfschema/r/ddl_events_statements_current.result
new file mode 100644
index 00000000000..bf458ab5fca
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_events_statements_current.result
@@ -0,0 +1,7 @@
+alter table performance_schema.events_statements_current add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_statements_current;
+ALTER TABLE performance_schema.events_statements_current ADD INDEX test_index(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.events_statements_current(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_events_statements_history.result b/mysql-test/suite/perfschema/r/ddl_events_statements_history.result
new file mode 100644
index 00000000000..1ef7f6c8463
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_events_statements_history.result
@@ -0,0 +1,7 @@
+alter table performance_schema.events_statements_history add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_statements_history;
+ALTER TABLE performance_schema.events_statements_history ADD INDEX test_index(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.events_statements_history(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_events_statements_history_long.result b/mysql-test/suite/perfschema/r/ddl_events_statements_history_long.result
new file mode 100644
index 00000000000..e3f75681c62
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_events_statements_history_long.result
@@ -0,0 +1,7 @@
+alter table performance_schema.events_statements_history_long add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_statements_history_long;
+ALTER TABLE performance_schema.events_statements_history_long ADD INDEX test_index(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.events_statements_history_long(EVENT_ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_ews_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ews_by_account_by_event_name.result
new file mode 100644
index 00000000000..2b50cd10868
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_ews_by_account_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_waits_summary_by_account_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_waits_summary_by_account_by_event_name;
+ALTER TABLE performance_schema.events_waits_summary_by_account_by_event_name
+ADD INDEX test_index(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_waits_summary_by_account_by_event_name(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_ews_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ews_by_host_by_event_name.result
new file mode 100644
index 00000000000..5f1886b5bb8
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_ews_by_host_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_waits_summary_by_host_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_waits_summary_by_host_by_event_name;
+ALTER TABLE performance_schema.events_waits_summary_by_host_by_event_name
+ADD INDEX test_index(HOSTNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_waits_summary_by_host_by_event_name(HOSTNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_ews_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ews_by_user_by_event_name.result
new file mode 100644
index 00000000000..1ed4a8ef36d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_ews_by_user_by_event_name.result
@@ -0,0 +1,10 @@
+alter table performance_schema.events_waits_summary_by_user_by_event_name
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.events_waits_summary_by_user_by_event_name;
+ALTER TABLE performance_schema.events_waits_summary_by_user_by_event_name
+ADD INDEX test_index(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.events_waits_summary_by_user_by_event_name(USERNAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_host_cache.result b/mysql-test/suite/perfschema/r/ddl_host_cache.result
new file mode 100644
index 00000000000..0f938b5fc88
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_host_cache.result
@@ -0,0 +1,7 @@
+alter table performance_schema.host_cache add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.host_cache;
+ALTER TABLE performance_schema.host_cache ADD INDEX test_index(IP);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.host_cache(IP);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_hosts.result b/mysql-test/suite/perfschema/r/ddl_hosts.result
new file mode 100644
index 00000000000..3a84c9d0fd2
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_hosts.result
@@ -0,0 +1,8 @@
+alter table performance_schema.hosts
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.hosts;
+ALTER TABLE performance_schema.hosts ADD INDEX test_index(CURRENT_CONNECTIONS);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.hosts(CURRENT_CONNECTIONS);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_os_global_by_type.result b/mysql-test/suite/perfschema/r/ddl_os_global_by_type.result
new file mode 100644
index 00000000000..66e3379191d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_os_global_by_type.result
@@ -0,0 +1,10 @@
+alter table performance_schema.objects_summary_global_by_type
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.objects_summary_global_by_type;
+ALTER TABLE performance_schema.objects_summary_global_by_type
+ADD INDEX test_index(OBJECT_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.objects_summary_global_by_type(OBJECT_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_setup_actors.result b/mysql-test/suite/perfschema/r/ddl_setup_actors.result
new file mode 100644
index 00000000000..753632eb62d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_setup_actors.result
@@ -0,0 +1,16 @@
+alter table performance_schema.setup_actors add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+drop table if exists test.setup_actors;
+create table test.setup_actors as
+select * from performance_schema.setup_actors;
+truncate table performance_schema.setup_actors;
+select count(*) from performance_schema.setup_actors;
+count(*)
+0
+insert into performance_schema.setup_actors
+select * from test.setup_actors;
+drop table test.setup_actors;
+ALTER TABLE performance_schema.setup_actors ADD INDEX test_index(HOST);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.setup_actors(HOST);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_setup_objects.result b/mysql-test/suite/perfschema/r/ddl_setup_objects.result
new file mode 100644
index 00000000000..60eeecdeccf
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_setup_objects.result
@@ -0,0 +1,16 @@
+alter table performance_schema.setup_objects add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+drop table if exists test.setup_objects;
+create table test.setup_objects as
+select * from performance_schema.setup_objects;
+truncate table performance_schema.setup_objects;
+select count(*) from performance_schema.setup_objects;
+count(*)
+0
+insert into performance_schema.setup_objects
+select * from test.setup_objects;
+drop table test.setup_objects;
+ALTER TABLE performance_schema.setup_objects ADD INDEX test_index(OBJECT_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.setup_objects(OBJECT_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_socket_instances.result b/mysql-test/suite/perfschema/r/ddl_socket_instances.result
new file mode 100644
index 00000000000..b9dfd63bad1
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_socket_instances.result
@@ -0,0 +1,8 @@
+alter table performance_schema.socket_instances add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.socket_instances;
+ERROR HY000: Invalid performance_schema usage.
+ALTER TABLE performance_schema.socket_instances ADD INDEX test_index(FILE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.socket_instances(FILE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_socket_summary_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_socket_summary_by_event_name.result
new file mode 100644
index 00000000000..64e1f280675
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_socket_summary_by_event_name.result
@@ -0,0 +1,7 @@
+alter table performance_schema.socket_summary_by_instance add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.socket_summary_by_instance;
+ALTER TABLE performance_schema.socket_summary_by_instance ADD INDEX test_index(FILE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.socket_summary_by_instance(FILE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_socket_summary_by_instance.result b/mysql-test/suite/perfschema/r/ddl_socket_summary_by_instance.result
new file mode 100644
index 00000000000..64e1f280675
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_socket_summary_by_instance.result
@@ -0,0 +1,7 @@
+alter table performance_schema.socket_summary_by_instance add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.socket_summary_by_instance;
+ALTER TABLE performance_schema.socket_summary_by_instance ADD INDEX test_index(FILE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.socket_summary_by_instance(FILE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_threads.result b/mysql-test/suite/perfschema/r/ddl_threads.result
index 9d949e0920f..0856dedbaee 100644
--- a/mysql-test/suite/perfschema/r/ddl_threads.result
+++ b/mysql-test/suite/perfschema/r/ddl_threads.result
@@ -2,7 +2,7 @@ alter table performance_schema.threads add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.threads;
ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.threads ADD INDEX test_index(ID);
+ALTER TABLE performance_schema.threads ADD INDEX test_index(PROCESSLIST_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.threads(ID);
+CREATE UNIQUE INDEX test_index ON performance_schema.threads(PROCESSLIST_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_tiws_by_index_usage.result b/mysql-test/suite/perfschema/r/ddl_tiws_by_index_usage.result
new file mode 100644
index 00000000000..bc002515f42
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_tiws_by_index_usage.result
@@ -0,0 +1,8 @@
+alter table performance_schema.table_io_waits_summary_by_index_usage
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.table_io_waits_summary_by_index_usage;
+ALTER TABLE performance_schema.table_io_waits_summary_by_index_usage ADD INDEX test_index(TABLE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.table_io_waits_summary_by_index_usage(TABLE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_tiws_by_table.result b/mysql-test/suite/perfschema/r/ddl_tiws_by_table.result
new file mode 100644
index 00000000000..6f2d3329a96
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_tiws_by_table.result
@@ -0,0 +1,8 @@
+alter table performance_schema.table_io_waits_summary_by_table
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.table_io_waits_summary_by_table;
+ALTER TABLE performance_schema.table_io_waits_summary_by_table ADD INDEX test_index(TABLE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.table_io_waits_summary_by_table(TABLE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_tlws_by_table.result b/mysql-test/suite/perfschema/r/ddl_tlws_by_table.result
new file mode 100644
index 00000000000..b7312191c86
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_tlws_by_table.result
@@ -0,0 +1,8 @@
+alter table performance_schema.table_lock_waits_summary_by_table
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.table_lock_waits_summary_by_table;
+ALTER TABLE performance_schema.table_lock_waits_summary_by_table ADD INDEX test_index(TABLE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.table_lock_waits_summary_by_table(TABLE_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_users.result b/mysql-test/suite/perfschema/r/ddl_users.result
new file mode 100644
index 00000000000..907710bb3b2
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_users.result
@@ -0,0 +1,8 @@
+alter table performance_schema.users
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.users;
+ALTER TABLE performance_schema.users ADD INDEX test_index(CURRENT_CONNECTIONS);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.users(CURRENT_CONNECTIONS);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/digest_table_full.result b/mysql-test/suite/perfschema/r/digest_table_full.result
new file mode 100644
index 00000000000..2ae455f3d3a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/digest_table_full.result
@@ -0,0 +1,94 @@
+####################################
+# SETUP
+####################################
+CREATE DATABASE statements_digest;
+USE statements_digest;
+CREATE TABLE t1(a int);
+CREATE TABLE t2(a int);
+CREATE TABLE t3(a int, b int);
+CREATE TABLE t4(a int, b int);
+CREATE TABLE t5(a int, b int, c int);
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+####################################
+# EXECUTION
+####################################
+SELECT 1 FROM t1;
+1
+SELECT 1 FROM `t1`;
+1
+SELECT 1,2 FROM t1;
+1 2
+SELECT 1, 2, 3, 4 FROM t1;
+1 2 3 4
+SELECT 1 FROM t2;
+1
+SELECT 1,2 FROM t2;
+1 2
+SELECT 1, 2, 3, 4 FROM t2;
+1 2 3 4
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t4 VALUES (1, 2);
+INSERT INTO t5 VALUES (1, 2, 3);
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6);
+INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
+SELECT 1 + 1;
+1 + 1
+2
+SELECT 1;
+1
+1
+SELECT 1 /* This is an inline comment */ + 1;
+1 /* This is an inline comment */ + 1
+2
+SELECT 1+
+/*
+this is a
+multiple-line comment
+*/
+1;
+1+
+/*
+this is a
+multiple-line comment
+*/
+1
+2
+CREATE SCHEMA statements_digest_temp;
+DROP SCHEMA statements_digest_temp;
+CREATE DATABASE statements_digest_temp;
+DROP DATABASE statements_digest_temp;
+SELECT 1 from t11;
+ERROR 42S02: Table 'statements_digest.t11' doesn't exist
+create table t11 (c char(4));
+create table t11 (c char(4));
+ERROR 42S01: Table 't11' already exists
+insert into t11 values("MySQL");
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+####################################
+# QUERYING PS STATEMENT DIGEST
+####################################
+SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
+DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
+NULL NULL 29 21 1 2
+dee8f4f04e57a5e456c31892855e6835 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
+SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest;
+COUNT(*)
+2
+####################################
+# CLEANUP
+####################################
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP TABLE IF EXISTS t5;
+DROP DATABASE IF EXISTS statements_digest;
diff --git a/mysql-test/suite/perfschema/r/dml_accounts.result b/mysql-test/suite/perfschema/r/dml_accounts.result
new file mode 100644
index 00000000000..cbf9491f806
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_accounts.result
@@ -0,0 +1,25 @@
+select * from performance_schema.accounts
+limit 1;
+select * from performance_schema.accounts
+where user='FOO' or host='BAR';
+insert into performance_schema.accounts
+set user='FOO', host='BAR',
+current_connections=1, total_connections=2;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'accounts'
+update performance_schema.accounts
+set current_connections=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'accounts'
+update performance_schema.accounts
+set current_connections=12 where host like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'accounts'
+delete from performance_schema.accounts
+where total_connections=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'accounts'
+delete from performance_schema.accounts;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'accounts'
+LOCK TABLES performance_schema.accounts READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.accounts WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_cond_instances.result b/mysql-test/suite/perfschema/r/dml_cond_instances.result
index 5cd04127700..0b7d4e7188e 100644
--- a/mysql-test/suite/perfschema/r/dml_cond_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_cond_instances.result
@@ -13,8 +13,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'cond_in
delete from performance_schema.cond_instances;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'cond_instances'
LOCK TABLES performance_schema.cond_instances READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'cond_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'cond_instances'
UNLOCK TABLES;
LOCK TABLES performance_schema.cond_instances WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'cond_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'cond_instances'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esgs_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esgs_by_account_by_event_name.result
new file mode 100644
index 00000000000..7157e18bdfd
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esgs_by_account_by_event_name.result
@@ -0,0 +1,26 @@
+select * from performance_schema.events_stages_summary_by_account_by_event_name
+where event_name like 'stage/%' limit 1;
+select * from performance_schema.events_stages_summary_by_account_by_event_name
+where event_name='FOO';
+insert into performance_schema.events_stages_summary_by_account_by_event_name
+set event_name='FOO', user='BAR', host='BAZ',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_stages_summary_by_account_by_event_name'
+update performance_schema.events_stages_summary_by_account_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_account_by_event_name'
+update performance_schema.events_stages_summary_by_account_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_account_by_event_name'
+delete from performance_schema.events_stages_summary_by_account_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_account_by_event_name'
+delete from performance_schema.events_stages_summary_by_account_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_account_by_event_name'
+LOCK TABLES performance_schema.events_stages_summary_by_account_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_account_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_stages_summary_by_account_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_account_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esgs_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esgs_by_host_by_event_name.result
new file mode 100644
index 00000000000..7a157ead3c9
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esgs_by_host_by_event_name.result
@@ -0,0 +1,26 @@
+select * from performance_schema.events_stages_summary_by_host_by_event_name
+where event_name like 'stage/%' limit 1;
+select * from performance_schema.events_stages_summary_by_host_by_event_name
+where event_name='FOO';
+insert into performance_schema.events_stages_summary_by_host_by_event_name
+set event_name='FOO', thread_id=1,
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_stages_summary_by_host_by_event_name'
+update performance_schema.events_stages_summary_by_host_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_host_by_event_name'
+update performance_schema.events_stages_summary_by_host_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_host_by_event_name'
+delete from performance_schema.events_stages_summary_by_host_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_host_by_event_name'
+delete from performance_schema.events_stages_summary_by_host_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_host_by_event_name'
+LOCK TABLES performance_schema.events_stages_summary_by_host_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_host_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_stages_summary_by_host_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_host_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esgs_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esgs_by_thread_by_event_name.result
new file mode 100644
index 00000000000..18b6214213a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esgs_by_thread_by_event_name.result
@@ -0,0 +1,26 @@
+select * from performance_schema.events_stages_summary_by_thread_by_event_name
+where event_name like 'stage/%' limit 1;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name
+where event_name='FOO';
+insert into performance_schema.events_stages_summary_by_thread_by_event_name
+set event_name='FOO', thread_id=1,
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_stages_summary_by_thread_by_event_name'
+update performance_schema.events_stages_summary_by_thread_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_thread_by_event_name'
+update performance_schema.events_stages_summary_by_thread_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_thread_by_event_name'
+delete from performance_schema.events_stages_summary_by_thread_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_thread_by_event_name'
+delete from performance_schema.events_stages_summary_by_thread_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_thread_by_event_name'
+LOCK TABLES performance_schema.events_stages_summary_by_thread_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_thread_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_stages_summary_by_thread_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_thread_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esgs_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esgs_by_user_by_event_name.result
new file mode 100644
index 00000000000..0ff678ca5a4
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esgs_by_user_by_event_name.result
@@ -0,0 +1,26 @@
+select * from performance_schema.events_stages_summary_by_user_by_event_name
+where event_name like 'stage/%' limit 1;
+select * from performance_schema.events_stages_summary_by_user_by_event_name
+where event_name='FOO';
+insert into performance_schema.events_stages_summary_by_user_by_event_name
+set event_name='FOO', user='BAR',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_stages_summary_by_user_by_event_name'
+update performance_schema.events_stages_summary_by_user_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_user_by_event_name'
+update performance_schema.events_stages_summary_by_user_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_user_by_event_name'
+delete from performance_schema.events_stages_summary_by_user_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_user_by_event_name'
+delete from performance_schema.events_stages_summary_by_user_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_summary_by_user_by_event_name'
+LOCK TABLES performance_schema.events_stages_summary_by_user_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_user_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_stages_summary_by_user_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_user_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esgs_global_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esgs_global_by_event_name.result
new file mode 100644
index 00000000000..07e127679b9
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esgs_global_by_event_name.result
@@ -0,0 +1,25 @@
+select * from performance_schema.events_stages_summary_global_by_event_name
+where event_name like 'stage/%' limit 1;
+select * from performance_schema.events_stages_summary_global_by_event_name
+where event_name='FOO';
+insert into performance_schema.events_stages_summary_global_by_event_name
+set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_stages_summary_global_by_event_name'
+update performance_schema.events_stages_summary_global_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_summary_global_by_event_name'
+update performance_schema.events_stages_summary_global_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_summary_global_by_event_name'
+delete from performance_schema.events_stages_summary_global_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_summary_global_by_event_name'
+delete from performance_schema.events_stages_summary_global_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_summary_global_by_event_name'
+LOCK TABLES performance_schema.events_stages_summary_global_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_global_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_stages_summary_global_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_global_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esms_by_account_by_event_name.result
new file mode 100644
index 00000000000..57a9cd695dd
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_account_by_event_name.result
@@ -0,0 +1,26 @@
+select * from performance_schema.events_statements_summary_by_account_by_event_name
+where event_name like 'statement/%' limit 1;
+select * from performance_schema.events_statements_summary_by_account_by_event_name
+where event_name='FOO';
+insert into performance_schema.events_statements_summary_by_account_by_event_name
+set event_name='FOO', user='BAR', host='BAZ',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_statements_summary_by_account_by_event_name'
+update performance_schema.events_statements_summary_by_account_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_account_by_event_name'
+update performance_schema.events_statements_summary_by_account_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_account_by_event_name'
+delete from performance_schema.events_statements_summary_by_account_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_account_by_event_name'
+delete from performance_schema.events_statements_summary_by_account_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_account_by_event_name'
+LOCK TABLES performance_schema.events_statements_summary_by_account_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_account_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_statements_summary_by_account_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_account_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_digest.result b/mysql-test/suite/perfschema/r/dml_esms_by_digest.result
new file mode 100644
index 00000000000..032c19112e1
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_digest.result
@@ -0,0 +1,27 @@
+select * from performance_schema.events_statements_summary_by_digest
+where digest like 'XXYYZZ%' limit 1;
+DIGEST DIGEST_TEXT COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED FIRST_SEEN LAST_SEEN
+select * from performance_schema.events_statements_summary_by_digest
+where digest='XXYYZZ';
+DIGEST DIGEST_TEXT COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED FIRST_SEEN LAST_SEEN
+insert into performance_schema.events_statements_summary_by_digest
+set digest='XXYYZZ', count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_statements_summary_by_digest'
+update performance_schema.events_statements_summary_by_digest
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_digest'
+update performance_schema.events_statements_summary_by_digest
+set count_star=12 where digest like "XXYYZZ";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_digest'
+delete from performance_schema.events_statements_summary_by_digest
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_digest'
+delete from performance_schema.events_statements_summary_by_digest;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_digest'
+LOCK TABLES performance_schema.events_statements_summary_by_digest READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_digest'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_statements_summary_by_digest WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_digest'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esms_by_host_by_event_name.result
new file mode 100644
index 00000000000..d98f6a7e0d6
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_host_by_event_name.result
@@ -0,0 +1,26 @@
+select * from performance_schema.events_statements_summary_by_host_by_event_name
+where event_name like 'statement/%' limit 1;
+select * from performance_schema.events_statements_summary_by_host_by_event_name
+where event_name='FOO';
+insert into performance_schema.events_statements_summary_by_host_by_event_name
+set event_name='FOO', thread_id=1,
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_statements_summary_by_host_by_event_name'
+update performance_schema.events_statements_summary_by_host_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_host_by_event_name'
+update performance_schema.events_statements_summary_by_host_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_host_by_event_name'
+delete from performance_schema.events_statements_summary_by_host_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_host_by_event_name'
+delete from performance_schema.events_statements_summary_by_host_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_host_by_event_name'
+LOCK TABLES performance_schema.events_statements_summary_by_host_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_host_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_statements_summary_by_host_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_host_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esms_by_thread_by_event_name.result
new file mode 100644
index 00000000000..9573798349c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_thread_by_event_name.result
@@ -0,0 +1,26 @@
+select * from performance_schema.events_statements_summary_by_thread_by_event_name
+where event_name like 'statement/%' limit 1;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name
+where event_name='FOO';
+insert into performance_schema.events_statements_summary_by_thread_by_event_name
+set event_name='FOO', thread_id=1,
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_statements_summary_by_thread_by_event_name'
+update performance_schema.events_statements_summary_by_thread_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_thread_by_event_name'
+update performance_schema.events_statements_summary_by_thread_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_thread_by_event_name'
+delete from performance_schema.events_statements_summary_by_thread_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_thread_by_event_name'
+delete from performance_schema.events_statements_summary_by_thread_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_thread_by_event_name'
+LOCK TABLES performance_schema.events_statements_summary_by_thread_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_thread_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_statements_summary_by_thread_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_thread_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esms_by_user_by_event_name.result
new file mode 100644
index 00000000000..950af5ca8b7
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_user_by_event_name.result
@@ -0,0 +1,26 @@
+select * from performance_schema.events_statements_summary_by_user_by_event_name
+where event_name like 'statement/%' limit 1;
+select * from performance_schema.events_statements_summary_by_user_by_event_name
+where event_name='FOO';
+insert into performance_schema.events_statements_summary_by_user_by_event_name
+set event_name='FOO', user='BAR',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_statements_summary_by_user_by_event_name'
+update performance_schema.events_statements_summary_by_user_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_user_by_event_name'
+update performance_schema.events_statements_summary_by_user_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_user_by_event_name'
+delete from performance_schema.events_statements_summary_by_user_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_user_by_event_name'
+delete from performance_schema.events_statements_summary_by_user_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_user_by_event_name'
+LOCK TABLES performance_schema.events_statements_summary_by_user_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_user_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_statements_summary_by_user_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_user_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_esms_global_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esms_global_by_event_name.result
new file mode 100644
index 00000000000..e5623ed131d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_esms_global_by_event_name.result
@@ -0,0 +1,25 @@
+select * from performance_schema.events_statements_summary_global_by_event_name
+where event_name like 'statement/%' limit 1;
+select * from performance_schema.events_statements_summary_global_by_event_name
+where event_name='FOO';
+insert into performance_schema.events_statements_summary_global_by_event_name
+set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_statements_summary_global_by_event_name'
+update performance_schema.events_statements_summary_global_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_global_by_event_name'
+update performance_schema.events_statements_summary_global_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_global_by_event_name'
+delete from performance_schema.events_statements_summary_global_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_global_by_event_name'
+delete from performance_schema.events_statements_summary_global_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_global_by_event_name'
+LOCK TABLES performance_schema.events_statements_summary_global_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_global_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_statements_summary_global_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_global_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_stages_current.result b/mysql-test/suite/perfschema/r/dml_events_stages_current.result
new file mode 100644
index 00000000000..7d0c3bed19c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_events_stages_current.result
@@ -0,0 +1,25 @@
+select * from performance_schema.events_stages_current
+where event_name like 'stage/%' limit 1;
+select * from performance_schema.events_stages_current
+where event_name='FOO';
+insert into performance_schema.events_stages_current
+set thread_id='1', event_id=1,
+event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_stages_current'
+update performance_schema.events_stages_current
+set timer_start=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_current'
+update performance_schema.events_stages_current
+set timer_start=12 where thread_id=0;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_current'
+delete from performance_schema.events_stages_current
+where thread_id=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_current'
+delete from performance_schema.events_stages_current;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_current'
+LOCK TABLES performance_schema.events_stages_current READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_current'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_stages_current WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_current'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_stages_history.result b/mysql-test/suite/perfschema/r/dml_events_stages_history.result
new file mode 100644
index 00000000000..66047e9615b
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_events_stages_history.result
@@ -0,0 +1,29 @@
+select * from performance_schema.events_stages_history
+where event_name like 'stage/%' limit 1;
+select * from performance_schema.events_stages_history
+where event_name='FOO';
+select * from performance_schema.events_stages_history
+where event_name like 'stage/%' order by timer_wait limit 1;
+select * from performance_schema.events_stages_history
+where event_name like 'stage/%' order by timer_wait desc limit 1;
+insert into performance_schema.events_stages_history
+set thread_id='1', event_id=1,
+event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_stages_history'
+update performance_schema.events_stages_history
+set timer_start=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_history'
+update performance_schema.events_stages_history
+set timer_start=12 where thread_id=0;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_history'
+delete from performance_schema.events_stages_history
+where thread_id=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_history'
+delete from performance_schema.events_stages_history;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_history'
+LOCK TABLES performance_schema.events_stages_history READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_history'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_stages_history WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_history'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_stages_history_long.result b/mysql-test/suite/perfschema/r/dml_events_stages_history_long.result
new file mode 100644
index 00000000000..da1fae71aa5
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_events_stages_history_long.result
@@ -0,0 +1,29 @@
+select * from performance_schema.events_stages_history_long
+where event_name like 'stage/%' limit 1;
+select * from performance_schema.events_stages_history_long
+where event_name='FOO';
+select * from performance_schema.events_stages_history_long
+where event_name like 'stage/%' order by timer_wait limit 1;
+select * from performance_schema.events_stages_history_long
+where event_name like 'stage/%' order by timer_wait desc limit 1;
+insert into performance_schema.events_stages_history_long
+set thread_id='1', event_id=1,
+event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_stages_history_long'
+update performance_schema.events_stages_history_long
+set timer_start=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_history_long'
+update performance_schema.events_stages_history_long
+set timer_start=12 where thread_id=0;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_stages_history_long'
+delete from performance_schema.events_stages_history_long
+where thread_id=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_history_long'
+delete from performance_schema.events_stages_history_long;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_stages_history_long'
+LOCK TABLES performance_schema.events_stages_history_long READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_history_long'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_stages_history_long WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_history_long'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_statements_current.result b/mysql-test/suite/perfschema/r/dml_events_statements_current.result
new file mode 100644
index 00000000000..af18f0bba79
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_events_statements_current.result
@@ -0,0 +1,25 @@
+select * from performance_schema.events_statements_current
+where event_name like 'statement/%' limit 1;
+select * from performance_schema.events_statements_current
+where event_name='FOO';
+insert into performance_schema.events_statements_current
+set thread_id='1', event_id=1,
+event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_statements_current'
+update performance_schema.events_statements_current
+set timer_start=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_current'
+update performance_schema.events_statements_current
+set timer_start=12 where thread_id=0;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_current'
+delete from performance_schema.events_statements_current
+where thread_id=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_current'
+delete from performance_schema.events_statements_current;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_current'
+LOCK TABLES performance_schema.events_statements_current READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_current'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_statements_current WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_current'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_statements_history.result b/mysql-test/suite/perfschema/r/dml_events_statements_history.result
new file mode 100644
index 00000000000..3f24f94196e
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_events_statements_history.result
@@ -0,0 +1,29 @@
+select * from performance_schema.events_statements_history
+where event_name like 'statement/%' limit 1;
+select * from performance_schema.events_statements_history
+where event_name='FOO';
+select * from performance_schema.events_statements_history
+where event_name like 'statement/%' order by timer_wait limit 1;
+select * from performance_schema.events_statements_history
+where event_name like 'statement/%' order by timer_wait desc limit 1;
+insert into performance_schema.events_statements_history
+set thread_id='1', event_id=1,
+event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_statements_history'
+update performance_schema.events_statements_history
+set timer_start=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_history'
+update performance_schema.events_statements_history
+set timer_start=12 where thread_id=0;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_history'
+delete from performance_schema.events_statements_history
+where thread_id=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_history'
+delete from performance_schema.events_statements_history;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_history'
+LOCK TABLES performance_schema.events_statements_history READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_history'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_statements_history WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_history'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_statements_history_long.result b/mysql-test/suite/perfschema/r/dml_events_statements_history_long.result
new file mode 100644
index 00000000000..88634e93bb5
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_events_statements_history_long.result
@@ -0,0 +1,29 @@
+select * from performance_schema.events_statements_history_long
+where event_name like 'statement/%' limit 1;
+select * from performance_schema.events_statements_history_long
+where event_name='FOO';
+select * from performance_schema.events_statements_history_long
+where event_name like 'statement/%' order by timer_wait limit 1;
+select * from performance_schema.events_statements_history_long
+where event_name like 'statement/%' order by timer_wait desc limit 1;
+insert into performance_schema.events_statements_history_long
+set thread_id='1', event_id=1,
+event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_statements_history_long'
+update performance_schema.events_statements_history_long
+set timer_start=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_history_long'
+update performance_schema.events_statements_history_long
+set timer_start=12 where thread_id=0;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_history_long'
+delete from performance_schema.events_statements_history_long
+where thread_id=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_history_long'
+delete from performance_schema.events_statements_history_long;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_history_long'
+LOCK TABLES performance_schema.events_statements_history_long READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_history_long'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_statements_history_long WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_history_long'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_current.result b/mysql-test/suite/perfschema/r/dml_events_waits_current.result
index 66ff929e79b..53e2bc02bbb 100644
--- a/mysql-test/suite/perfschema/r/dml_events_waits_current.result
+++ b/mysql-test/suite/perfschema/r/dml_events_waits_current.result
@@ -18,8 +18,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_
delete from performance_schema.events_waits_current;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_current'
LOCK TABLES performance_schema.events_waits_current READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_current'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_current'
UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_current WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_current'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_current'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_history.result b/mysql-test/suite/perfschema/r/dml_events_waits_history.result
index ba883c9552a..4beb51aeaf5 100644
--- a/mysql-test/suite/perfschema/r/dml_events_waits_history.result
+++ b/mysql-test/suite/perfschema/r/dml_events_waits_history.result
@@ -22,8 +22,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_
delete from performance_schema.events_waits_history;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_history'
LOCK TABLES performance_schema.events_waits_history READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_history'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_history'
UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_history WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_history'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_history'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result b/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
index 408368ca77c..13571fbf513 100644
--- a/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
@@ -22,8 +22,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_
delete from performance_schema.events_waits_history_long;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_history_long'
LOCK TABLES performance_schema.events_waits_history_long READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_history_long'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_history_long'
UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_history_long WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_history_long'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_history_long'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_account_by_event_name.result
new file mode 100644
index 00000000000..a4808251228
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_account_by_event_name.result
@@ -0,0 +1,29 @@
+select * from performance_schema.events_waits_summary_by_account_by_event_name
+where event_name like 'Wait/Synch/%' limit 1;
+USER HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+# # # # # # # #
+select * from performance_schema.events_waits_summary_by_account_by_event_name
+where event_name='FOO';
+USER HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+insert into performance_schema.events_waits_summary_by_account_by_event_name
+set event_name='FOO', user='BAR', host='BAZ',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_waits_summary_by_account_by_event_name'
+update performance_schema.events_waits_summary_by_account_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_account_by_event_name'
+update performance_schema.events_waits_summary_by_account_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_account_by_event_name'
+delete from performance_schema.events_waits_summary_by_account_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_account_by_event_name'
+delete from performance_schema.events_waits_summary_by_account_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_account_by_event_name'
+LOCK TABLES performance_schema.events_waits_summary_by_account_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_account_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_waits_summary_by_account_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_account_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_host_by_event_name.result
new file mode 100644
index 00000000000..2a250eee5a5
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_host_by_event_name.result
@@ -0,0 +1,29 @@
+select * from performance_schema.events_waits_summary_by_host_by_event_name
+where event_name like 'Wait/Synch/%' limit 1;
+HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+# # # # # # #
+select * from performance_schema.events_waits_summary_by_host_by_event_name
+where event_name='FOO';
+HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+insert into performance_schema.events_waits_summary_by_host_by_event_name
+set event_name='FOO', thread_id=1,
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_waits_summary_by_host_by_event_name'
+update performance_schema.events_waits_summary_by_host_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_host_by_event_name'
+update performance_schema.events_waits_summary_by_host_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_host_by_event_name'
+delete from performance_schema.events_waits_summary_by_host_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_host_by_event_name'
+delete from performance_schema.events_waits_summary_by_host_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_host_by_event_name'
+LOCK TABLES performance_schema.events_waits_summary_by_host_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_host_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_waits_summary_by_host_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_host_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_instance.result b/mysql-test/suite/perfschema/r/dml_ews_by_instance.result
index 0c95c61fd08..17619918b01 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_by_instance.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_instance.result
@@ -27,8 +27,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_
delete from performance_schema.events_waits_summary_by_instance;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
LOCK TABLES performance_schema.events_waits_summary_by_instance READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_instance WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result
index 27f8b5644fd..879abf90f4b 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result
@@ -19,8 +19,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_
delete from performance_schema.events_waits_summary_by_thread_by_event_name;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
LOCK TABLES performance_schema.events_waits_summary_by_thread_by_event_name READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_thread_by_event_name WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_user_by_event_name.result
new file mode 100644
index 00000000000..3fa3deedaef
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_user_by_event_name.result
@@ -0,0 +1,29 @@
+select * from performance_schema.events_waits_summary_by_user_by_event_name
+where event_name like 'Wait/Synch/%' limit 1;
+USER EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+# # # # # # #
+select * from performance_schema.events_waits_summary_by_user_by_event_name
+where event_name='FOO';
+USER EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+insert into performance_schema.events_waits_summary_by_user_by_event_name
+set event_name='FOO', user='BAR',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_waits_summary_by_user_by_event_name'
+update performance_schema.events_waits_summary_by_user_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_user_by_event_name'
+update performance_schema.events_waits_summary_by_user_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_user_by_event_name'
+delete from performance_schema.events_waits_summary_by_user_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_user_by_event_name'
+delete from performance_schema.events_waits_summary_by_user_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_user_by_event_name'
+LOCK TABLES performance_schema.events_waits_summary_by_user_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_user_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_waits_summary_by_user_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_user_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
index 6ddf1841a4e..ccf88c282b8 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
@@ -18,8 +18,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_
delete from performance_schema.events_waits_summary_global_by_event_name;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
LOCK TABLES performance_schema.events_waits_summary_global_by_event_name READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_global_by_event_name WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_file_instances.result b/mysql-test/suite/perfschema/r/dml_file_instances.result
index 52204160a4b..d2564cb58dd 100644
--- a/mysql-test/suite/perfschema/r/dml_file_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_file_instances.result
@@ -13,8 +13,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_in
delete from performance_schema.file_instances;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_instances'
LOCK TABLES performance_schema.file_instances READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'file_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_instances'
UNLOCK TABLES;
LOCK TABLES performance_schema.file_instances WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'file_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_instances'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result b/mysql-test/suite/perfschema/r/dml_fs_by_event_name.result
index be1b744f786..ffd63232631 100644
--- a/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_fs_by_event_name.result
@@ -18,8 +18,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_su
delete from performance_schema.file_summary_by_event_name;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
LOCK TABLES performance_schema.file_summary_by_event_name READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
UNLOCK TABLES;
LOCK TABLES performance_schema.file_summary_by_event_name WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result b/mysql-test/suite/perfschema/r/dml_fs_by_instance.result
index eabd9170cbc..cde57dd19ce 100644
--- a/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result
+++ b/mysql-test/suite/perfschema/r/dml_fs_by_instance.result
@@ -18,8 +18,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_su
delete from performance_schema.file_summary_by_instance;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
LOCK TABLES performance_schema.file_summary_by_instance READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
UNLOCK TABLES;
LOCK TABLES performance_schema.file_summary_by_instance WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_handler.result b/mysql-test/suite/perfschema/r/dml_handler.result
new file mode 100644
index 00000000000..de3071c7535
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_handler.result
@@ -0,0 +1,162 @@
+
+# Create a temporary table of performance schema table names
+
+CREATE TEMPORARY TABLE table_list (id INT AUTO_INCREMENT, PRIMARY KEY (id)) AS
+SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_SCHEMA='performance_schema';
+SELECT COUNT(*) FROM table_list INTO @table_count;
+
+# For each table in the performance schema, attempt HANDLER...OPEN,
+# which should fail with an error 1031, ER_ILLEGAL_HA.
+
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=50;
+HANDLER performance_schema.users OPEN;
+ERROR HY000: Table storage engine for 'users' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=49;
+HANDLER performance_schema.threads OPEN;
+ERROR HY000: Table storage engine for 'threads' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=48;
+HANDLER performance_schema.table_lock_waits_summary_by_table OPEN;
+ERROR HY000: Table storage engine for 'table_lock_waits_summary_by_table' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=47;
+HANDLER performance_schema.table_io_waits_summary_by_table OPEN;
+ERROR HY000: Table storage engine for 'table_io_waits_summary_by_table' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=46;
+HANDLER performance_schema.table_io_waits_summary_by_index_usage OPEN;
+ERROR HY000: Table storage engine for 'table_io_waits_summary_by_index_usage' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=45;
+HANDLER performance_schema.socket_summary_by_instance OPEN;
+ERROR HY000: Table storage engine for 'socket_summary_by_instance' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=44;
+HANDLER performance_schema.socket_summary_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'socket_summary_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=43;
+HANDLER performance_schema.socket_instances OPEN;
+ERROR HY000: Table storage engine for 'socket_instances' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=42;
+HANDLER performance_schema.setup_timers OPEN;
+ERROR HY000: Table storage engine for 'setup_timers' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=41;
+HANDLER performance_schema.setup_objects OPEN;
+ERROR HY000: Table storage engine for 'setup_objects' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=40;
+HANDLER performance_schema.setup_instruments OPEN;
+ERROR HY000: Table storage engine for 'setup_instruments' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=39;
+HANDLER performance_schema.setup_consumers OPEN;
+ERROR HY000: Table storage engine for 'setup_consumers' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=38;
+HANDLER performance_schema.setup_actors OPEN;
+ERROR HY000: Table storage engine for 'setup_actors' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=37;
+HANDLER performance_schema.rwlock_instances OPEN;
+ERROR HY000: Table storage engine for 'rwlock_instances' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=36;
+HANDLER performance_schema.performance_timers OPEN;
+ERROR HY000: Table storage engine for 'performance_timers' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=35;
+HANDLER performance_schema.objects_summary_global_by_type OPEN;
+ERROR HY000: Table storage engine for 'objects_summary_global_by_type' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=34;
+HANDLER performance_schema.mutex_instances OPEN;
+ERROR HY000: Table storage engine for 'mutex_instances' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=33;
+HANDLER performance_schema.hosts OPEN;
+ERROR HY000: Table storage engine for 'hosts' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=32;
+HANDLER performance_schema.host_cache OPEN;
+ERROR HY000: Table storage engine for 'host_cache' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=31;
+HANDLER performance_schema.file_summary_by_instance OPEN;
+ERROR HY000: Table storage engine for 'file_summary_by_instance' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=30;
+HANDLER performance_schema.file_summary_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'file_summary_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=29;
+HANDLER performance_schema.file_instances OPEN;
+ERROR HY000: Table storage engine for 'file_instances' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=28;
+HANDLER performance_schema.events_waits_summary_global_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_waits_summary_global_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=27;
+HANDLER performance_schema.events_waits_summary_by_user_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_waits_summary_by_user_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=26;
+HANDLER performance_schema.events_waits_summary_by_thread_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_waits_summary_by_thread_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=25;
+HANDLER performance_schema.events_waits_summary_by_instance OPEN;
+ERROR HY000: Table storage engine for 'events_waits_summary_by_instance' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=24;
+HANDLER performance_schema.events_waits_summary_by_host_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_waits_summary_by_host_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=23;
+HANDLER performance_schema.events_waits_summary_by_account_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_waits_summary_by_account_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=22;
+HANDLER performance_schema.events_waits_history_long OPEN;
+ERROR HY000: Table storage engine for 'events_waits_history_long' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=21;
+HANDLER performance_schema.events_waits_history OPEN;
+ERROR HY000: Table storage engine for 'events_waits_history' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=20;
+HANDLER performance_schema.events_waits_current OPEN;
+ERROR HY000: Table storage engine for 'events_waits_current' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=19;
+HANDLER performance_schema.events_statements_summary_global_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_statements_summary_global_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=18;
+HANDLER performance_schema.events_statements_summary_by_user_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_statements_summary_by_user_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=17;
+HANDLER performance_schema.events_statements_summary_by_thread_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_statements_summary_by_thread_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=16;
+HANDLER performance_schema.events_statements_summary_by_host_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_statements_summary_by_host_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=15;
+HANDLER performance_schema.events_statements_summary_by_digest OPEN;
+ERROR HY000: Table storage engine for 'events_statements_summary_by_digest' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=14;
+HANDLER performance_schema.events_statements_summary_by_account_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_statements_summary_by_account_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=13;
+HANDLER performance_schema.events_statements_history_long OPEN;
+ERROR HY000: Table storage engine for 'events_statements_history_long' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=12;
+HANDLER performance_schema.events_statements_history OPEN;
+ERROR HY000: Table storage engine for 'events_statements_history' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=11;
+HANDLER performance_schema.events_statements_current OPEN;
+ERROR HY000: Table storage engine for 'events_statements_current' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=10;
+HANDLER performance_schema.events_stages_summary_global_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_stages_summary_global_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=9;
+HANDLER performance_schema.events_stages_summary_by_user_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_stages_summary_by_user_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=8;
+HANDLER performance_schema.events_stages_summary_by_thread_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_stages_summary_by_thread_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=7;
+HANDLER performance_schema.events_stages_summary_by_host_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_stages_summary_by_host_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=6;
+HANDLER performance_schema.events_stages_summary_by_account_by_event_name OPEN;
+ERROR HY000: Table storage engine for 'events_stages_summary_by_account_by_event_name' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=5;
+HANDLER performance_schema.events_stages_history_long OPEN;
+ERROR HY000: Table storage engine for 'events_stages_history_long' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=4;
+HANDLER performance_schema.events_stages_history OPEN;
+ERROR HY000: Table storage engine for 'events_stages_history' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=3;
+HANDLER performance_schema.events_stages_current OPEN;
+ERROR HY000: Table storage engine for 'events_stages_current' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=2;
+HANDLER performance_schema.cond_instances OPEN;
+ERROR HY000: Table storage engine for 'cond_instances' doesn't have this option
+SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=1;
+HANDLER performance_schema.accounts OPEN;
+ERROR HY000: Table storage engine for 'accounts' doesn't have this option
+DROP TEMPORARY TABLE table_list;
diff --git a/mysql-test/suite/perfschema/r/dml_host_cache.result b/mysql-test/suite/perfschema/r/dml_host_cache.result
new file mode 100644
index 00000000000..a0ed1a3f3b1
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_host_cache.result
@@ -0,0 +1,27 @@
+select * from performance_schema.host_cache
+where IP like '%' limit 1;
+select * from performance_schema.host_cache
+where IP='localhost';
+insert into performance_schema.host_cache
+set IP='FOO', SUM_BLOCKING_ERRORS=1, COUNT_FCRDNS_ERRORS=2;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'host_cache'
+update performance_schema.host_cache
+set COUNT_UNKNOWN_ERRORS=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'host_cache'
+update performance_schema.host_cache
+set SUM_BLOCKING_ERRORS=12 where IP='127.0.0.1';
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'host_cache'
+select HOST from performance_schema.host_cache
+where IP='::1';
+HOST
+delete from performance_schema.host_cache
+where IP='::1';
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'host_cache'
+delete from performance_schema.host_cache;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'host_cache'
+LOCK TABLES performance_schema.host_cache READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'host_cache'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.host_cache WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'host_cache'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_hosts.result b/mysql-test/suite/perfschema/r/dml_hosts.result
new file mode 100644
index 00000000000..8ae4e3b0984
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_hosts.result
@@ -0,0 +1,25 @@
+select * from performance_schema.hosts
+limit 1;
+select * from performance_schema.hosts
+where host='FOO';
+insert into performance_schema.hosts
+set host='FOO',
+current_connections=1, total_connections=2;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'hosts'
+update performance_schema.hosts
+set current_connections=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'hosts'
+update performance_schema.hosts
+set current_connections=12 where host like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'hosts'
+delete from performance_schema.hosts
+where total_connections=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'hosts'
+delete from performance_schema.hosts;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'hosts'
+LOCK TABLES performance_schema.hosts READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'hosts'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.hosts WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'hosts'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_mutex_instances.result b/mysql-test/suite/perfschema/r/dml_mutex_instances.result
index 0089e20b3b6..03d2cfb1260 100644
--- a/mysql-test/suite/perfschema/r/dml_mutex_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_mutex_instances.result
@@ -13,8 +13,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'mutex_i
delete from performance_schema.mutex_instances;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'mutex_instances'
LOCK TABLES performance_schema.mutex_instances READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'mutex_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'mutex_instances'
UNLOCK TABLES;
LOCK TABLES performance_schema.mutex_instances WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'mutex_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'mutex_instances'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_os_global_by_type.result b/mysql-test/suite/perfschema/r/dml_os_global_by_type.result
new file mode 100644
index 00000000000..681ec364973
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_os_global_by_type.result
@@ -0,0 +1,45 @@
+select * from performance_schema.objects_summary_global_by_type
+where object_schema = 'performance_schema' limit 1;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+# # # # # # # #
+select * from performance_schema.objects_summary_global_by_type
+where object_schema='FOO';
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.objects_summary_global_by_type
+order by count_star limit 1;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+# # # # # # # #
+select * from performance_schema.objects_summary_global_by_type
+order by count_star desc limit 1;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+# # # # # # # #
+select * from performance_schema.objects_summary_global_by_type
+where object_type = 'TABLE' order by object_schema, object_name limit 1;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+# # # # # # # #
+select * from performance_schema.objects_summary_global_by_type
+where object_type = 'TABLE' order by object_schema desc, object_name desc limit 1;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+# # # # # # # #
+insert into performance_schema.objects_summary_global_by_type
+set object_type='TABLE', schema_name='FOO', object_name='BAR',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'objects_summary_global_by_type'
+update performance_schema.objects_summary_global_by_type
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'objects_summary_global_by_type'
+update performance_schema.objects_summary_global_by_type
+set count_star=12 where object_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'objects_summary_global_by_type'
+delete from performance_schema.objects_summary_global_by_type
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'objects_summary_global_by_type'
+delete from performance_schema.objects_summary_global_by_type;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'objects_summary_global_by_type'
+LOCK TABLES performance_schema.objects_summary_global_by_type READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'objects_summary_global_by_type'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.objects_summary_global_by_type WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'objects_summary_global_by_type'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_performance_timers.result b/mysql-test/suite/perfschema/r/dml_performance_timers.result
index 99d0b9fdf60..7e1d3005fb0 100644
--- a/mysql-test/suite/perfschema/r/dml_performance_timers.result
+++ b/mysql-test/suite/perfschema/r/dml_performance_timers.result
@@ -22,8 +22,8 @@ delete from performance_schema.performance_timers
where timer_name='CYCLE';
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'performance_timers'
LOCK TABLES performance_schema.performance_timers READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'performance_timers'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'performance_timers'
UNLOCK TABLES;
LOCK TABLES performance_schema.performance_timers WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'performance_timers'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'performance_timers'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result
index 117c4e47508..e127ace2dfe 100644
--- a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result
@@ -13,8 +13,8 @@ ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'rwlock_
delete from performance_schema.rwlock_instances;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'rwlock_instances'
LOCK TABLES performance_schema.rwlock_instances READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'rwlock_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'rwlock_instances'
UNLOCK TABLES;
LOCK TABLES performance_schema.rwlock_instances WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'rwlock_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'rwlock_instances'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_setup_actors.result b/mysql-test/suite/perfschema/r/dml_setup_actors.result
new file mode 100644
index 00000000000..9ff49d8b7e2
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_setup_actors.result
@@ -0,0 +1,60 @@
+drop table if exists test.setup_actors;
+create table test.setup_actors as
+select * from performance_schema.setup_actors;
+truncate table performance_schema.setup_actors;
+select * from performance_schema.setup_actors;
+HOST USER ROLE
+select * from performance_schema.setup_actors
+where user = '%';
+HOST USER ROLE
+insert into performance_schema.setup_actors
+set user='Joe', host='localhost';
+insert into performance_schema.setup_actors
+set user='Joe', host='%';
+insert into performance_schema.setup_actors
+set user='%', host='server1';
+insert into performance_schema.setup_actors
+set user='%', host='%';
+select * from performance_schema.setup_actors
+order by USER, HOST;
+HOST USER ROLE
+% % %
+server1 % %
+% Joe %
+localhost Joe %
+update performance_schema.setup_actors
+set user='ILLEGAL';
+ERROR HY000: Invalid performance_schema usage.
+update performance_schema.setup_actors
+set host='ILLEGAL';
+ERROR HY000: Invalid performance_schema usage.
+update performance_schema.setup_actors
+set role='ILLEGAL';
+ERROR HY000: Invalid performance_schema usage.
+select * from performance_schema.setup_actors
+order by USER, HOST;
+HOST USER ROLE
+% % %
+server1 % %
+% Joe %
+localhost Joe %
+delete from performance_schema.setup_actors
+where user = 'Joe' and host = 'localhost';
+select * from performance_schema.setup_actors
+order by USER, HOST;
+HOST USER ROLE
+% % %
+server1 % %
+% Joe %
+delete from performance_schema.setup_actors;
+select * from performance_schema.setup_actors
+order by USER, HOST;
+HOST USER ROLE
+LOCK TABLES performance_schema.setup_actors READ;
+UNLOCK TABLES;
+LOCK TABLES performance_schema.setup_actors WRITE;
+UNLOCK TABLES;
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+select * from test.setup_actors;
+drop table test.setup_actors;
diff --git a/mysql-test/suite/perfschema/r/dml_setup_consumers.result b/mysql-test/suite/perfschema/r/dml_setup_consumers.result
index db0a6820de9..81fa27a3fdf 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_consumers.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_consumers.result
@@ -1,13 +1,17 @@
select * from performance_schema.setup_consumers;
NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
events_waits_current YES
events_waits_history YES
events_waits_history_long YES
-events_waits_summary_by_thread_by_event_name YES
-events_waits_summary_by_event_name YES
-events_waits_summary_by_instance YES
-file_summary_by_event_name YES
-file_summary_by_instance YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
select * from performance_schema.setup_consumers
where name='events_waits_current';
NAME ENABLED
@@ -15,14 +19,18 @@ events_waits_current YES
select * from performance_schema.setup_consumers
where enabled='YES';
NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
events_waits_current YES
events_waits_history YES
events_waits_history_long YES
-events_waits_summary_by_thread_by_event_name YES
-events_waits_summary_by_event_name YES
-events_waits_summary_by_instance YES
-file_summary_by_event_name YES
-file_summary_by_instance YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
select * from performance_schema.setup_consumers
where enabled='NO';
NAME ENABLED
diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
index 9f48a085eca..30c7ff5125b 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
@@ -11,9 +11,9 @@ wait/synch/mutex/sql/hash_filo::lock YES YES
wait/synch/mutex/sql/HA_DATA_PARTITION::LOCK_auto_inc YES YES
wait/synch/mutex/sql/LOCK_active_mi YES YES
wait/synch/mutex/sql/LOCK_audit_mask YES YES
-wait/synch/mutex/sql/LOCK_commit_ordered YES YES
wait/synch/mutex/sql/LOCK_connection_count YES YES
wait/synch/mutex/sql/LOCK_crypt YES YES
+wait/synch/mutex/sql/LOCK_delayed_create YES YES
select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Rwlock/sql/%'
and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock')
@@ -39,13 +39,13 @@ NAME ENABLED TIMED
wait/synch/cond/sql/COND_flush_thread_cache YES YES
wait/synch/cond/sql/COND_manager YES YES
wait/synch/cond/sql/COND_queue_state YES YES
-wait/synch/cond/sql/COND_rpl_status YES YES
wait/synch/cond/sql/COND_server_started YES YES
wait/synch/cond/sql/COND_thread_cache YES YES
wait/synch/cond/sql/COND_thread_count YES YES
wait/synch/cond/sql/Delayed_insert::cond YES YES
wait/synch/cond/sql/Delayed_insert::cond_client YES YES
wait/synch/cond/sql/Event_scheduler::COND_state YES YES
+wait/synch/cond/sql/Item_func_sleep::cond YES YES
select * from performance_schema.setup_instruments
where name='Wait';
select * from performance_schema.setup_instruments
diff --git a/mysql-test/suite/perfschema/r/dml_setup_objects.result b/mysql-test/suite/perfschema/r/dml_setup_objects.result
new file mode 100644
index 00000000000..075114a9b5a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_setup_objects.result
@@ -0,0 +1,67 @@
+drop table if exists test.setup_objects;
+create table test.setup_objects as
+select * from performance_schema.setup_objects;
+truncate table performance_schema.setup_objects;
+select * from performance_schema.setup_objects;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+select * from performance_schema.setup_objects
+where object_type = 'TABLE'
+ order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+insert into performance_schema.setup_objects
+set object_type='ILLEGAL', object_schema='FOO', object_name='BAR',
+enabled='YES', timed='YES';
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+insert into performance_schema.setup_objects
+set object_type='TABLE', object_schema='FOO', object_name='BAR',
+enabled='YES', timed='YES';
+insert into performance_schema.setup_objects
+set object_type='TABLE', object_schema='FOO', object_name='BAR',
+enabled='YES', timed='NO';
+ERROR 23000: Can't write; duplicate key in table 'setup_objects'
+delete from performance_schema.setup_objects
+where object_type='TABLE' and object_schema='FOO';
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+insert into performance_schema.setup_objects
+set object_type='TABLE', object_schema='FOO', object_name='BAR',
+enabled='NO', timed='YES';
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE FOO BAR NO YES
+update performance_schema.setup_objects
+set object_type='ILLEGAL';
+ERROR HY000: Invalid performance_schema usage.
+update performance_schema.setup_objects
+set object_schema='ILLEGAL';
+ERROR HY000: Invalid performance_schema usage.
+update performance_schema.setup_objects
+set object_name='ILLEGAL';
+ERROR HY000: Invalid performance_schema usage.
+update performance_schema.setup_objects
+set enabled='NO', timed='NO';
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE FOO BAR NO NO
+update performance_schema.setup_objects
+set enabled='YES', timed='YES';
+delete from performance_schema.setup_objects
+where object_type = 'TABLE';
+delete from performance_schema.setup_objects;
+LOCK TABLES performance_schema.setup_objects READ;
+UNLOCK TABLES;
+LOCK TABLES performance_schema.setup_objects WRITE;
+UNLOCK TABLES;
+truncate table performance_schema.setup_objects;
+insert into performance_schema.setup_objects
+select * from test.setup_objects;
+drop table test.setup_objects;
diff --git a/mysql-test/suite/perfschema/r/dml_setup_timers.result b/mysql-test/suite/perfschema/r/dml_setup_timers.result
index ad1f6df3e81..1667e58f7ed 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_timers.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_timers.result
@@ -1,6 +1,17 @@
+update performance_schema.setup_timers
+set timer_name='CYCLE' where name="wait";
+update performance_schema.setup_timers
+set timer_name='NANOSECOND' where name="stage";
+update performance_schema.setup_timers
+set timer_name='NANOSECOND' where name="statement";
+update performance_schema.setup_timers
+set timer_name='MICROSECOND' where name="idle";
select * from performance_schema.setup_timers;
NAME TIMER_NAME
+idle MICROSECOND
wait CYCLE
+stage NANOSECOND
+statement NANOSECOND
select * from performance_schema.setup_timers
where name='Wait';
NAME TIMER_NAME
@@ -19,7 +30,10 @@ update performance_schema.setup_timers
set timer_name='MILLISECOND';
select * from performance_schema.setup_timers;
NAME TIMER_NAME
+idle MILLISECOND
wait MILLISECOND
+stage MILLISECOND
+statement MILLISECOND
update performance_schema.setup_timers
set timer_name='CYCLE';
delete from performance_schema.setup_timers;
@@ -31,3 +45,17 @@ LOCK TABLES performance_schema.setup_timers READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.setup_timers WRITE;
UNLOCK TABLES;
+update performance_schema.setup_timers
+set timer_name='CYCLE' where name="wait";
+update performance_schema.setup_timers
+set timer_name='NANOSECOND' where name="stage";
+update performance_schema.setup_timers
+set timer_name='NANOSECOND' where name="statement";
+update performance_schema.setup_timers
+set timer_name='MICROSECOND' where name="idle";
+select * from performance_schema.setup_timers;
+NAME TIMER_NAME
+idle MICROSECOND
+wait CYCLE
+stage NANOSECOND
+statement NANOSECOND
diff --git a/mysql-test/suite/perfschema/r/dml_socket_instances.result b/mysql-test/suite/perfschema/r/dml_socket_instances.result
new file mode 100644
index 00000000000..957f9bf9080
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_socket_instances.result
@@ -0,0 +1,20 @@
+select * from performance_schema.socket_instances limit 1;
+select * from performance_schema.socket_instances
+where ip='FOO';
+insert into performance_schema.socket_instances
+set ip='FOO', event_name='BAR', port=12;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'socket_instances'
+update performance_schema.socket_instances
+set ip='FOO';
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'socket_instances'
+delete from performance_schema.socket_instances
+where event_name like "wait/%";
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'socket_instances'
+delete from performance_schema.socket_instances;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'socket_instances'
+LOCK TABLES performance_schema.socket_instances READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'socket_instances'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.socket_instances WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'socket_instances'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_socket_summary_by_event_name.result b/mysql-test/suite/perfschema/r/dml_socket_summary_by_event_name.result
new file mode 100644
index 00000000000..39d14f413db
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_socket_summary_by_event_name.result
@@ -0,0 +1,26 @@
+select * from performance_schema.socket_summary_by_event_name
+limit 1;
+select * from performance_schema.socket_summary_by_event_name
+where event_name='FOO';
+insert into performance_schema.socket_summary_by_event_name
+set event_name='FOO',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'socket_summary_by_event_name'
+update performance_schema.socket_summary_by_event_name
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'socket_summary_by_event_name'
+update performance_schema.socket_summary_by_event_name
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'socket_summary_by_event_name'
+delete from performance_schema.socket_summary_by_event_name
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'socket_summary_by_event_name'
+delete from performance_schema.socket_summary_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'socket_summary_by_event_name'
+LOCK TABLES performance_schema.socket_summary_by_event_name READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'socket_summary_by_event_name'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.socket_summary_by_event_name WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'socket_summary_by_event_name'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_socket_summary_by_instance.result b/mysql-test/suite/perfschema/r/dml_socket_summary_by_instance.result
new file mode 100644
index 00000000000..35ad763d9a7
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_socket_summary_by_instance.result
@@ -0,0 +1,26 @@
+select * from performance_schema.socket_summary_by_instance
+limit 1;
+select * from performance_schema.socket_summary_by_instance
+where object_instance_begin='FOO';
+insert into performance_schema.socket_summary_by_instance
+set object_instance_begin=1,
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'socket_summary_by_instance'
+update performance_schema.socket_summary_by_instance
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'socket_summary_by_instance'
+update performance_schema.socket_summary_by_instance
+set count_star=12 where object_instance_begin like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'socket_summary_by_instance'
+delete from performance_schema.socket_summary_by_instance
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'socket_summary_by_instance'
+delete from performance_schema.socket_summary_by_instance;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'socket_summary_by_instance'
+LOCK TABLES performance_schema.socket_summary_by_instance READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'socket_summary_by_instance'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.socket_summary_by_instance WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'socket_summary_by_instance'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_threads.result b/mysql-test/suite/perfschema/r/dml_threads.result
index c5a753e7f14..96fb1541df0 100644
--- a/mysql-test/suite/perfschema/r/dml_threads.result
+++ b/mysql-test/suite/perfschema/r/dml_threads.result
@@ -7,18 +7,28 @@ set name='FOO', thread_id=1, processlist_id=2;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'threads'
update performance_schema.threads
set thread_id=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'threads'
+ERROR HY000: Invalid performance_schema usage.
update performance_schema.threads
-set thread_id=12 where name like "FOO";
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'threads'
+set thread_id=12 where PROCESSLIST_ID=connection_id();
+ERROR HY000: Invalid performance_schema usage.
+update performance_schema.threads
+set instrumented= 'NO' where PROCESSLIST_ID=connection_id();
+select instrumented from performance_schema.threads
+where PROCESSLIST_ID=connection_id();
+instrumented
+NO
+update performance_schema.threads
+set instrumented= 'YES' where PROCESSLIST_ID=connection_id();
+select instrumented from performance_schema.threads
+where PROCESSLIST_ID=connection_id();
+instrumented
+YES
delete from performance_schema.threads
where id=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'threads'
delete from performance_schema.threads;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'threads'
LOCK TABLES performance_schema.threads READ;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'threads'
UNLOCK TABLES;
LOCK TABLES performance_schema.threads WRITE;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'threads'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_tiws_by_index_usage.result b/mysql-test/suite/perfschema/r/dml_tiws_by_index_usage.result
new file mode 100644
index 00000000000..cf1ed766731
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_tiws_by_index_usage.result
@@ -0,0 +1,26 @@
+select * from performance_schema.table_io_waits_summary_by_index_usage
+limit 1;
+select * from performance_schema.table_io_waits_summary_by_index_usage
+where object_name='FOO';
+insert into performance_schema.table_io_waits_summary_by_index_usage
+set object_type='TABLE', object_name='FOO', object_schema='BAR',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_index_usage'
+update performance_schema.table_io_waits_summary_by_index_usage
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_index_usage'
+update performance_schema.table_io_waits_summary_by_index_usage
+set count_star=12 where object_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_index_usage'
+delete from performance_schema.table_io_waits_summary_by_index_usage
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_index_usage'
+delete from performance_schema.table_io_waits_summary_by_index_usage;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_index_usage'
+LOCK TABLES performance_schema.table_io_waits_summary_by_index_usage READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_index_usage'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.table_io_waits_summary_by_index_usage WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_index_usage'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_tiws_by_table.result b/mysql-test/suite/perfschema/r/dml_tiws_by_table.result
new file mode 100644
index 00000000000..1ec1940194a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_tiws_by_table.result
@@ -0,0 +1,26 @@
+select * from performance_schema.table_io_waits_summary_by_table
+limit 1;
+select * from performance_schema.table_io_waits_summary_by_table
+where object_name='FOO';
+insert into performance_schema.table_io_waits_summary_by_table
+set object_type='TABLE', object_name='FOO', object_schema='BAR',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_table'
+update performance_schema.table_io_waits_summary_by_table
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_table'
+update performance_schema.table_io_waits_summary_by_table
+set count_star=12 where object_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_table'
+delete from performance_schema.table_io_waits_summary_by_table
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_table'
+delete from performance_schema.table_io_waits_summary_by_table;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_table'
+LOCK TABLES performance_schema.table_io_waits_summary_by_table READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_table'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.table_io_waits_summary_by_table WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_table'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_tlws_by_table.result b/mysql-test/suite/perfschema/r/dml_tlws_by_table.result
new file mode 100644
index 00000000000..1d39794d6c8
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_tlws_by_table.result
@@ -0,0 +1,26 @@
+select * from performance_schema.table_lock_waits_summary_by_table
+limit 1;
+select * from performance_schema.table_lock_waits_summary_by_table
+where object_name='FOO';
+insert into performance_schema.table_lock_waits_summary_by_table
+set object_type='TABLE', object_name='FOO', object_schema='BAR',
+count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'table_lock_waits_summary_by_table'
+update performance_schema.table_lock_waits_summary_by_table
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'table_lock_waits_summary_by_table'
+update performance_schema.table_lock_waits_summary_by_table
+set count_star=12 where object_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'table_lock_waits_summary_by_table'
+delete from performance_schema.table_lock_waits_summary_by_table
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'table_lock_waits_summary_by_table'
+delete from performance_schema.table_lock_waits_summary_by_table;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'table_lock_waits_summary_by_table'
+LOCK TABLES performance_schema.table_lock_waits_summary_by_table READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'table_lock_waits_summary_by_table'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.table_lock_waits_summary_by_table WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'table_lock_waits_summary_by_table'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_users.result b/mysql-test/suite/perfschema/r/dml_users.result
new file mode 100644
index 00000000000..fa2d29731da
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_users.result
@@ -0,0 +1,25 @@
+select * from performance_schema.users
+limit 1;
+select * from performance_schema.users
+where user='FOO';
+insert into performance_schema.users
+set user='FOO',
+current_connections=1, total_connections=2;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'users'
+update performance_schema.users
+set current_connections=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'users'
+update performance_schema.users
+set current_connections=12 where user like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'users'
+delete from performance_schema.users
+where total_connections=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'users'
+delete from performance_schema.users;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'users'
+LOCK TABLES performance_schema.users READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'users'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.users WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'users'
+UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/event_aggregate.result b/mysql-test/suite/perfschema/r/event_aggregate.result
new file mode 100644
index 00000000000..6863ac6e2ce
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/event_aggregate.result
@@ -0,0 +1,5271 @@
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 1
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 1
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 1
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 1
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 4
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 2
+localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 3
+localhost stage/sql/closing tables 3
+localhost stage/sql/init 6
+localhost stage/sql/Opening tables 3
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 1
+localhost statement/sql/select 2
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 1
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 5
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 2
+localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 3
+localhost stage/sql/closing tables 3
+localhost stage/sql/init 6
+localhost stage/sql/Opening tables 3
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 1
+localhost statement/sql/select 2
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 8
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 4
+localhost wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 6
+localhost stage/sql/closing tables 6
+localhost stage/sql/init 12
+localhost stage/sql/Opening tables 6
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 2
+localhost statement/sql/select 4
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 1
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 9
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 4
+localhost wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 6
+localhost stage/sql/closing tables 6
+localhost stage/sql/init 12
+localhost stage/sql/Opening tables 6
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 2
+localhost statement/sql/select 4
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 12
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 6
+localhost wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 9
+localhost stage/sql/closing tables 9
+localhost stage/sql/init 18
+localhost stage/sql/Opening tables 9
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 3
+localhost statement/sql/select 6
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 1
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 13
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 6
+localhost wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 9
+localhost stage/sql/closing tables 9
+localhost stage/sql/init 18
+localhost stage/sql/Opening tables 9
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 3
+localhost statement/sql/select 6
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 16
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 24
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+"================== con1 disconnected =================="
+"================== Step 10 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 17
+localhost wait/synch/mutex/sql/LOCK_connection_count 1
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 25
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 1
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 5
+"================== con2 disconnected =================="
+"================== Step 11 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 18
+localhost wait/synch/mutex/sql/LOCK_connection_count 2
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 26
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 2
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 5
+"================== con3 disconnected =================="
+"================== Step 12 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 19
+localhost wait/synch/mutex/sql/LOCK_connection_count 3
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 27
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 3
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 5
+"================== con4 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 5
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== WAITS_BY_THREAD truncated =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 5
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== WAITS_BY_ACCOUNT truncated =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== WAITS_BY_USER truncated =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== WAITS_BY_HOST truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== WAITS_GLOBAL truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+"================== STAGES_BY_THREAD truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_account_by_event_name;
+"================== STAGES_BY_ACCOUNT truncated =================="
+"================== Step 20 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_user_by_event_name;
+"================== STAGES_BY_USER truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_host_by_event_name;
+"================== STAGES_BY_HOST truncated =================="
+"================== Step 22 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_global_by_event_name;
+"================== STAGES_GLOBAL truncated =================="
+"================== Step 23 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+"================== STATEMENTS_BY_THREAD truncated =================="
+"================== Step 24 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_account_by_event_name;
+"================== STATEMENTS_BY_ACCOUNT truncated =================="
+"================== Step 25 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_user_by_event_name;
+"================== STATEMENTS_BY_USER truncated =================="
+"================== Step 26 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_host_by_event_name;
+"================== STATEMENTS_BY_HOST truncated =================="
+"================== Step 27 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_global_by_event_name;
+"================== STATEMENTS_GLOBAL truncated =================="
+"================== Step 28 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.accounts;
+"================== ACCOUNTS truncated =================="
+"================== Step 29 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.users;
+"================== USERS truncated =================="
+"================== Step 30 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.hosts;
+"================== HOSTS truncated =================="
+"================== Step 31 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
new file mode 100644
index 00000000000..ad2440bd2d1
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
@@ -0,0 +1,3992 @@
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 1
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 1
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 1
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 4
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 2
+localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 3
+localhost stage/sql/closing tables 3
+localhost stage/sql/init 6
+localhost stage/sql/Opening tables 3
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 1
+localhost statement/sql/select 2
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 5
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 2
+localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 3
+localhost stage/sql/closing tables 3
+localhost stage/sql/init 6
+localhost stage/sql/Opening tables 3
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 1
+localhost statement/sql/select 2
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 8
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 4
+localhost wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 6
+localhost stage/sql/closing tables 6
+localhost stage/sql/init 12
+localhost stage/sql/Opening tables 6
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 2
+localhost statement/sql/select 4
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 9
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 4
+localhost wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 6
+localhost stage/sql/closing tables 6
+localhost stage/sql/init 12
+localhost stage/sql/Opening tables 6
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 2
+localhost statement/sql/select 4
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 12
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 6
+localhost wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 9
+localhost stage/sql/closing tables 9
+localhost stage/sql/init 18
+localhost stage/sql/Opening tables 9
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 3
+localhost statement/sql/select 6
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 13
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 6
+localhost wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 9
+localhost stage/sql/closing tables 9
+localhost stage/sql/init 18
+localhost stage/sql/Opening tables 9
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 3
+localhost statement/sql/select 6
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 16
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 24
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+"================== con1 disconnected =================="
+"================== Step 10 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 17
+localhost wait/synch/mutex/sql/LOCK_connection_count 1
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 25
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 1
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 5
+"================== con2 disconnected =================="
+"================== Step 11 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 18
+localhost wait/synch/mutex/sql/LOCK_connection_count 2
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 26
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 2
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 5
+"================== con3 disconnected =================="
+"================== Step 12 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 19
+localhost wait/synch/mutex/sql/LOCK_connection_count 3
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 27
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 3
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 5
+"================== con4 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== WAITS_BY_THREAD truncated =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== WAITS_BY_ACCOUNT truncated =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== WAITS_BY_USER truncated =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== WAITS_BY_HOST truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== WAITS_GLOBAL truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+"================== STAGES_BY_THREAD truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_account_by_event_name;
+"================== STAGES_BY_ACCOUNT truncated =================="
+"================== Step 20 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_user_by_event_name;
+"================== STAGES_BY_USER truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_host_by_event_name;
+"================== STAGES_BY_HOST truncated =================="
+"================== Step 22 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_global_by_event_name;
+"================== STAGES_GLOBAL truncated =================="
+"================== Step 23 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+"================== STATEMENTS_BY_THREAD truncated =================="
+"================== Step 24 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_account_by_event_name;
+"================== STATEMENTS_BY_ACCOUNT truncated =================="
+"================== Step 25 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_user_by_event_name;
+"================== STATEMENTS_BY_USER truncated =================="
+"================== Step 26 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_host_by_event_name;
+"================== STATEMENTS_BY_HOST truncated =================="
+"================== Step 27 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_global_by_event_name;
+"================== STATEMENTS_GLOBAL truncated =================="
+"================== Step 28 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.accounts;
+"================== ACCOUNTS truncated =================="
+"================== Step 29 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.users;
+"================== USERS truncated =================="
+"================== Step 30 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.hosts;
+"================== HOSTS truncated =================="
+"================== Step 31 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
new file mode 100644
index 00000000000..6faff1992c7
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
@@ -0,0 +1,3589 @@
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 1
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 1
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con1 disconnected =================="
+"================== Step 10 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con2 disconnected =================="
+"================== Step 11 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con3 disconnected =================="
+"================== Step 12 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con4 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== WAITS_BY_THREAD truncated =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== WAITS_BY_ACCOUNT truncated =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== WAITS_BY_USER truncated =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== WAITS_BY_HOST truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== WAITS_GLOBAL truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+"================== STAGES_BY_THREAD truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_account_by_event_name;
+"================== STAGES_BY_ACCOUNT truncated =================="
+"================== Step 20 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_user_by_event_name;
+"================== STAGES_BY_USER truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_host_by_event_name;
+"================== STAGES_BY_HOST truncated =================="
+"================== Step 22 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_global_by_event_name;
+"================== STAGES_GLOBAL truncated =================="
+"================== Step 23 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+"================== STATEMENTS_BY_THREAD truncated =================="
+"================== Step 24 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_account_by_event_name;
+"================== STATEMENTS_BY_ACCOUNT truncated =================="
+"================== Step 25 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_user_by_event_name;
+"================== STATEMENTS_BY_USER truncated =================="
+"================== Step 26 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_host_by_event_name;
+"================== STATEMENTS_BY_HOST truncated =================="
+"================== Step 27 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_global_by_event_name;
+"================== STATEMENTS_GLOBAL truncated =================="
+"================== Step 28 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.accounts;
+"================== ACCOUNTS truncated =================="
+"================== Step 29 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.users;
+"================== USERS truncated =================="
+"================== Step 30 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.hosts;
+"================== HOSTS truncated =================="
+"================== Step 31 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
new file mode 100644
index 00000000000..87b81a54b6b
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
@@ -0,0 +1,2661 @@
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 1
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 1
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 1
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 4
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 2
+localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 3
+localhost stage/sql/closing tables 3
+localhost stage/sql/init 6
+localhost stage/sql/Opening tables 3
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 1
+localhost statement/sql/select 2
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 5
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 2
+localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 3
+localhost stage/sql/closing tables 3
+localhost stage/sql/init 6
+localhost stage/sql/Opening tables 3
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 1
+localhost statement/sql/select 2
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 8
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 4
+localhost wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 6
+localhost stage/sql/closing tables 6
+localhost stage/sql/init 12
+localhost stage/sql/Opening tables 6
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 2
+localhost statement/sql/select 4
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 9
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 4
+localhost wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 6
+localhost stage/sql/closing tables 6
+localhost stage/sql/init 12
+localhost stage/sql/Opening tables 6
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 2
+localhost statement/sql/select 4
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 12
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 6
+localhost wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 9
+localhost stage/sql/closing tables 9
+localhost stage/sql/init 18
+localhost stage/sql/Opening tables 9
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 3
+localhost statement/sql/select 6
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 13
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 6
+localhost wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 9
+localhost stage/sql/closing tables 9
+localhost stage/sql/init 18
+localhost stage/sql/Opening tables 9
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 3
+localhost statement/sql/select 6
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 16
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 24
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+"================== con1 disconnected =================="
+"================== Step 10 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 17
+localhost wait/synch/mutex/sql/LOCK_connection_count 1
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 25
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 1
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 5
+"================== con2 disconnected =================="
+"================== Step 11 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 18
+localhost wait/synch/mutex/sql/LOCK_connection_count 2
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 26
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 2
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 5
+"================== con3 disconnected =================="
+"================== Step 12 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 19
+localhost wait/synch/mutex/sql/LOCK_connection_count 3
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 27
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 3
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 5
+"================== con4 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== WAITS_BY_THREAD truncated =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== WAITS_BY_ACCOUNT truncated =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== WAITS_BY_USER truncated =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== WAITS_BY_HOST truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== WAITS_GLOBAL truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+"================== STAGES_BY_THREAD truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_account_by_event_name;
+"================== STAGES_BY_ACCOUNT truncated =================="
+"================== Step 20 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_user_by_event_name;
+"================== STAGES_BY_USER truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_host_by_event_name;
+"================== STAGES_BY_HOST truncated =================="
+"================== Step 22 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_global_by_event_name;
+"================== STAGES_GLOBAL truncated =================="
+"================== Step 23 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+"================== STATEMENTS_BY_THREAD truncated =================="
+"================== Step 24 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_account_by_event_name;
+"================== STATEMENTS_BY_ACCOUNT truncated =================="
+"================== Step 25 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_user_by_event_name;
+"================== STATEMENTS_BY_USER truncated =================="
+"================== Step 26 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_host_by_event_name;
+"================== STATEMENTS_BY_HOST truncated =================="
+"================== Step 27 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_global_by_event_name;
+"================== STATEMENTS_GLOBAL truncated =================="
+"================== Step 28 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.accounts;
+"================== ACCOUNTS truncated =================="
+"================== Step 29 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.users;
+"================== USERS truncated =================="
+"================== Step 30 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.hosts;
+"================== HOSTS truncated =================="
+"================== Step 31 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
new file mode 100644
index 00000000000..09144e3641b
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
@@ -0,0 +1,2258 @@
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 1
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 1
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con1 disconnected =================="
+"================== Step 10 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con2 disconnected =================="
+"================== Step 11 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con3 disconnected =================="
+"================== Step 12 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con4 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== WAITS_BY_THREAD truncated =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== WAITS_BY_ACCOUNT truncated =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== WAITS_BY_USER truncated =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== WAITS_BY_HOST truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== WAITS_GLOBAL truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+"================== STAGES_BY_THREAD truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_account_by_event_name;
+"================== STAGES_BY_ACCOUNT truncated =================="
+"================== Step 20 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_user_by_event_name;
+"================== STAGES_BY_USER truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_host_by_event_name;
+"================== STAGES_BY_HOST truncated =================="
+"================== Step 22 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_global_by_event_name;
+"================== STAGES_GLOBAL truncated =================="
+"================== Step 23 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+"================== STATEMENTS_BY_THREAD truncated =================="
+"================== Step 24 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_account_by_event_name;
+"================== STATEMENTS_BY_ACCOUNT truncated =================="
+"================== Step 25 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_user_by_event_name;
+"================== STATEMENTS_BY_USER truncated =================="
+"================== Step 26 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_host_by_event_name;
+"================== STATEMENTS_BY_HOST truncated =================="
+"================== Step 27 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_global_by_event_name;
+"================== STATEMENTS_GLOBAL truncated =================="
+"================== Step 28 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.accounts;
+"================== ACCOUNTS truncated =================="
+"================== Step 29 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.users;
+"================== USERS truncated =================="
+"================== Step 30 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.hosts;
+"================== HOSTS truncated =================="
+"================== Step 31 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
new file mode 100644
index 00000000000..e50d2b1f837
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
@@ -0,0 +1,4868 @@
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 1
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 1
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 1
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 1
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 1
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 1
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 6
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 1 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con1 disconnected =================="
+"================== Step 10 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 6
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 1 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con2 disconnected =================="
+"================== Step 11 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 6
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 1 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con3 disconnected =================="
+"================== Step 12 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 6
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con4 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 5
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== WAITS_BY_THREAD truncated =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 5
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== WAITS_BY_ACCOUNT truncated =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 5
+user1 wait/synch/mutex/sql/LOCK_connection_count 1
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+user2 wait/io/file/sql/query_log 5
+user2 wait/synch/mutex/sql/LOCK_connection_count 1
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+user3 wait/io/file/sql/query_log 5
+user3 wait/synch/mutex/sql/LOCK_connection_count 1
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+user4 wait/io/file/sql/query_log 5
+user4 wait/synch/mutex/sql/LOCK_connection_count 1
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== WAITS_BY_USER truncated =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== WAITS_BY_HOST truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== WAITS_GLOBAL truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+"================== STAGES_BY_THREAD truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_account_by_event_name;
+"================== STAGES_BY_ACCOUNT truncated =================="
+"================== Step 20 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 3
+user1 stage/sql/closing tables 3
+user1 stage/sql/init 7
+user1 stage/sql/Opening tables 3
+user2 stage/sql/checking permissions 3
+user2 stage/sql/closing tables 3
+user2 stage/sql/init 7
+user2 stage/sql/Opening tables 3
+user3 stage/sql/checking permissions 3
+user3 stage/sql/closing tables 3
+user3 stage/sql/init 7
+user3 stage/sql/Opening tables 3
+user4 stage/sql/checking permissions 3
+user4 stage/sql/closing tables 3
+user4 stage/sql/init 7
+user4 stage/sql/Opening tables 3
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_user_by_event_name;
+"================== STAGES_BY_USER truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_host_by_event_name;
+"================== STAGES_BY_HOST truncated =================="
+"================== Step 22 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_global_by_event_name;
+"================== STAGES_GLOBAL truncated =================="
+"================== Step 23 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+"================== STATEMENTS_BY_THREAD truncated =================="
+"================== Step 24 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_account_by_event_name;
+"================== STATEMENTS_BY_ACCOUNT truncated =================="
+"================== Step 25 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 1
+user1 statement/sql/insert 1
+user1 statement/sql/select 2
+user2 statement/com/Error 0
+user2 statement/com/Quit 1
+user2 statement/sql/insert 1
+user2 statement/sql/select 2
+user3 statement/com/Error 0
+user3 statement/com/Quit 1
+user3 statement/sql/insert 1
+user3 statement/sql/select 2
+user4 statement/com/Error 0
+user4 statement/com/Quit 1
+user4 statement/sql/insert 1
+user4 statement/sql/select 2
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_user_by_event_name;
+"================== STATEMENTS_BY_USER truncated =================="
+"================== Step 26 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_host_by_event_name;
+"================== STATEMENTS_BY_HOST truncated =================="
+"================== Step 27 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_global_by_event_name;
+"================== STATEMENTS_GLOBAL truncated =================="
+"================== Step 28 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.accounts;
+"================== ACCOUNTS truncated =================="
+"================== Step 29 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/file/sql/query_log 0
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+user2 wait/io/file/sql/query_log 0
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+user3 wait/io/file/sql/query_log 0
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+user4 wait/io/file/sql/query_log 0
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+user1 stage/sql/checking permissions 0
+user1 stage/sql/closing tables 0
+user1 stage/sql/init 0
+user1 stage/sql/Opening tables 0
+user2 stage/sql/checking permissions 0
+user2 stage/sql/closing tables 0
+user2 stage/sql/init 0
+user2 stage/sql/Opening tables 0
+user3 stage/sql/checking permissions 0
+user3 stage/sql/closing tables 0
+user3 stage/sql/init 0
+user3 stage/sql/Opening tables 0
+user4 stage/sql/checking permissions 0
+user4 stage/sql/closing tables 0
+user4 stage/sql/init 0
+user4 stage/sql/Opening tables 0
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+user1 statement/com/Error 0
+user1 statement/com/Quit 0
+user1 statement/sql/insert 0
+user1 statement/sql/select 0
+user2 statement/com/Error 0
+user2 statement/com/Quit 0
+user2 statement/sql/insert 0
+user2 statement/sql/select 0
+user3 statement/com/Error 0
+user3 statement/com/Quit 0
+user3 statement/sql/insert 0
+user3 statement/sql/select 0
+user4 statement/com/Error 0
+user4 statement/com/Quit 0
+user4 statement/sql/insert 0
+user4 statement/sql/select 0
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+user1 0 1
+user2 0 1
+user3 0 1
+user4 0 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.users;
+"================== USERS truncated =================="
+"================== Step 30 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.hosts;
+"================== HOSTS truncated =================="
+"================== Step 31 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root 1 1
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
new file mode 100644
index 00000000000..4f1dddb3f16
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
@@ -0,0 +1,3940 @@
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 1
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 1
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 1
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 1
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 4
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 2
+localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 3
+localhost stage/sql/closing tables 3
+localhost stage/sql/init 6
+localhost stage/sql/Opening tables 3
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 1
+localhost statement/sql/select 2
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 2
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 1
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 5
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 2
+localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 3
+localhost stage/sql/closing tables 3
+localhost stage/sql/init 6
+localhost stage/sql/Opening tables 3
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 1
+localhost statement/sql/select 2
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 8
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 4
+localhost wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 6
+localhost stage/sql/closing tables 6
+localhost stage/sql/init 12
+localhost stage/sql/Opening tables 6
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 2
+localhost statement/sql/select 4
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 3
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 1
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 9
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 4
+localhost wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 6
+localhost stage/sql/closing tables 6
+localhost stage/sql/init 12
+localhost stage/sql/Opening tables 6
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 2
+localhost statement/sql/select 4
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 12
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 6
+localhost wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 9
+localhost stage/sql/closing tables 9
+localhost stage/sql/init 18
+localhost stage/sql/Opening tables 9
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 3
+localhost statement/sql/select 6
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 4
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 1
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 13
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 6
+localhost wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 9
+localhost stage/sql/closing tables 9
+localhost stage/sql/init 18
+localhost stage/sql/Opening tables 9
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 3
+localhost statement/sql/select 6
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 16
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 24
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 5 5
+"================== con1 disconnected =================="
+"================== Step 10 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 17
+localhost wait/synch/mutex/sql/LOCK_connection_count 1
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 25
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 1
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 4 5
+"================== con2 disconnected =================="
+"================== Step 11 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 18
+localhost wait/synch/mutex/sql/LOCK_connection_count 2
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 26
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 2
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 3 5
+"================== con3 disconnected =================="
+"================== Step 12 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 19
+localhost wait/synch/mutex/sql/LOCK_connection_count 3
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 27
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 3
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 2 5
+"================== con4 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 5
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== WAITS_BY_THREAD truncated =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 5
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== WAITS_BY_ACCOUNT truncated =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== WAITS_BY_USER truncated =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 20
+localhost wait/synch/mutex/sql/LOCK_connection_count 4
+localhost wait/synch/mutex/sql/LOCK_user_locks 8
+localhost wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== WAITS_BY_HOST truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== WAITS_GLOBAL truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+"================== STAGES_BY_THREAD truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_account_by_event_name;
+"================== STAGES_BY_ACCOUNT truncated =================="
+"================== Step 20 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_user_by_event_name;
+"================== STAGES_BY_USER truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 12
+localhost stage/sql/closing tables 12
+localhost stage/sql/init 28
+localhost stage/sql/Opening tables 12
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_by_host_by_event_name;
+"================== STAGES_BY_HOST truncated =================="
+"================== Step 22 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_stages_summary_global_by_event_name;
+"================== STAGES_GLOBAL truncated =================="
+"================== Step 23 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+"================== STATEMENTS_BY_THREAD truncated =================="
+"================== Step 24 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_account_by_event_name;
+"================== STATEMENTS_BY_ACCOUNT truncated =================="
+"================== Step 25 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_user_by_event_name;
+"================== STATEMENTS_BY_USER truncated =================="
+"================== Step 26 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 4
+localhost statement/sql/insert 4
+localhost statement/sql/select 8
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_by_host_by_event_name;
+"================== STATEMENTS_BY_HOST truncated =================="
+"================== Step 27 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.events_statements_summary_global_by_event_name;
+"================== STATEMENTS_GLOBAL truncated =================="
+"================== Step 28 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.accounts;
+"================== ACCOUNTS truncated =================="
+"================== Step 29 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.users;
+"================== USERS truncated =================="
+"================== Step 30 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 5
+truncate performance_schema.hosts;
+"================== HOSTS truncated =================="
+"================== Step 31 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/file/sql/query_log 0
+localhost wait/synch/mutex/sql/LOCK_connection_count 0
+localhost wait/synch/mutex/sql/LOCK_user_locks 0
+localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+localhost stage/sql/checking permissions 0
+localhost stage/sql/closing tables 0
+localhost stage/sql/init 0
+localhost stage/sql/Opening tables 0
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+localhost statement/com/Error 0
+localhost statement/com/Quit 0
+localhost statement/sql/insert 0
+localhost statement/sql/select 0
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+localhost 1 1
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
new file mode 100644
index 00000000000..6de38e218ab
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
@@ -0,0 +1,3537 @@
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 1
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 0
+user1 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 1
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 1
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 1
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 4
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 1
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 0
+user2 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 1
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 5
+wait/synch/mutex/sql/LOCK_user_locks 2
+wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 3
+stage/sql/closing tables 3
+stage/sql/init 6
+stage/sql/Opening tables 3
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 1
+statement/sql/select 2
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 8
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 1
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 0
+user3 wait/synch/rwlock/sql/LOCK_grant 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 1
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 9
+wait/synch/mutex/sql/LOCK_user_locks 4
+wait/synch/rwlock/sql/LOCK_grant 4
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 6
+stage/sql/closing tables 6
+stage/sql/init 12
+stage/sql/Opening tables 6
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 2
+statement/sql/select 4
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 12
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 1
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 0
+user4 wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 1
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 13
+wait/synch/mutex/sql/LOCK_user_locks 6
+wait/synch/rwlock/sql/LOCK_grant 6
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 9
+stage/sql/closing tables 9
+stage/sql/init 18
+stage/sql/Opening tables 9
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 3
+statement/sql/select 6
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select get_lock("marker", 10);
+get_lock("marker", 10)
+1
+select release_lock("marker");
+release_lock("marker")
+1
+insert into test.t1 values ("marker");
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/file/sql/query_log 4
+user1 wait/synch/mutex/sql/LOCK_connection_count 0
+user1 wait/synch/mutex/sql/LOCK_user_locks 2
+user1 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 4
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 16
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 6
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 24
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 1 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con1 disconnected =================="
+"================== Step 10 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/file/sql/query_log 4
+user2 wait/synch/mutex/sql/LOCK_connection_count 0
+user2 wait/synch/mutex/sql/LOCK_user_locks 2
+user2 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 4
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 17
+wait/synch/mutex/sql/LOCK_connection_count 1
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 6
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 25
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 1
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 1 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con2 disconnected =================="
+"================== Step 11 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/file/sql/query_log 4
+user3 wait/synch/mutex/sql/LOCK_connection_count 0
+user3 wait/synch/mutex/sql/LOCK_user_locks 2
+user3 wait/synch/rwlock/sql/LOCK_grant 2
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 4
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 18
+wait/synch/mutex/sql/LOCK_connection_count 2
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 6
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 26
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 2
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 1 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con3 disconnected =================="
+"================== Step 12 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/file/sql/query_log 4
+user4 wait/synch/mutex/sql/LOCK_connection_count 0
+user4 wait/synch/mutex/sql/LOCK_user_locks 2
+user4 wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 4
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 19
+wait/synch/mutex/sql/LOCK_connection_count 3
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 6
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 27
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 3
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+"================== con4 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 5
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== WAITS_BY_THREAD truncated =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 5
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user2 localhost wait/io/file/sql/query_log 5
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user3 localhost wait/io/file/sql/query_log 5
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 2
+user4 localhost wait/io/file/sql/query_log 5
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 2
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== WAITS_BY_ACCOUNT truncated =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== WAITS_BY_USER truncated =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== WAITS_BY_HOST truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== WAITS_GLOBAL truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_thread_by_event_name;
+"================== STAGES_BY_THREAD truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 3
+user1 localhost stage/sql/closing tables 3
+user1 localhost stage/sql/init 7
+user1 localhost stage/sql/Opening tables 3
+user2 localhost stage/sql/checking permissions 3
+user2 localhost stage/sql/closing tables 3
+user2 localhost stage/sql/init 7
+user2 localhost stage/sql/Opening tables 3
+user3 localhost stage/sql/checking permissions 3
+user3 localhost stage/sql/closing tables 3
+user3 localhost stage/sql/init 7
+user3 localhost stage/sql/Opening tables 3
+user4 localhost stage/sql/checking permissions 3
+user4 localhost stage/sql/closing tables 3
+user4 localhost stage/sql/init 7
+user4 localhost stage/sql/Opening tables 3
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_account_by_event_name;
+"================== STAGES_BY_ACCOUNT truncated =================="
+"================== Step 20 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_user_by_event_name;
+"================== STAGES_BY_USER truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_by_host_by_event_name;
+"================== STAGES_BY_HOST truncated =================="
+"================== Step 22 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_stages_summary_global_by_event_name;
+"================== STAGES_GLOBAL truncated =================="
+"================== Step 23 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_thread_by_event_name;
+"================== STATEMENTS_BY_THREAD truncated =================="
+"================== Step 24 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 1
+user1 localhost statement/sql/insert 1
+user1 localhost statement/sql/select 2
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 1
+user2 localhost statement/sql/insert 1
+user2 localhost statement/sql/select 2
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 1
+user3 localhost statement/sql/insert 1
+user3 localhost statement/sql/select 2
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 1
+user4 localhost statement/sql/insert 1
+user4 localhost statement/sql/select 2
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_account_by_event_name;
+"================== STATEMENTS_BY_ACCOUNT truncated =================="
+"================== Step 25 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_user_by_event_name;
+"================== STATEMENTS_BY_USER truncated =================="
+"================== Step 26 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_by_host_by_event_name;
+"================== STATEMENTS_BY_HOST truncated =================="
+"================== Step 27 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.events_statements_summary_global_by_event_name;
+"================== STATEMENTS_GLOBAL truncated =================="
+"================== Step 28 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/file/sql/query_log 0
+user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user1 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user2 localhost wait/io/file/sql/query_log 0
+user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user2 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user3 localhost wait/io/file/sql/query_log 0
+user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user3 localhost wait/synch/rwlock/sql/LOCK_grant 0
+user4 localhost wait/io/file/sql/query_log 0
+user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0
+user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0
+user4 localhost wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+user1 localhost stage/sql/checking permissions 0
+user1 localhost stage/sql/closing tables 0
+user1 localhost stage/sql/init 0
+user1 localhost stage/sql/Opening tables 0
+user2 localhost stage/sql/checking permissions 0
+user2 localhost stage/sql/closing tables 0
+user2 localhost stage/sql/init 0
+user2 localhost stage/sql/Opening tables 0
+user3 localhost stage/sql/checking permissions 0
+user3 localhost stage/sql/closing tables 0
+user3 localhost stage/sql/init 0
+user3 localhost stage/sql/Opening tables 0
+user4 localhost stage/sql/checking permissions 0
+user4 localhost stage/sql/closing tables 0
+user4 localhost stage/sql/init 0
+user4 localhost stage/sql/Opening tables 0
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+user1 localhost statement/com/Error 0
+user1 localhost statement/com/Quit 0
+user1 localhost statement/sql/insert 0
+user1 localhost statement/sql/select 0
+user2 localhost statement/com/Error 0
+user2 localhost statement/com/Quit 0
+user2 localhost statement/sql/insert 0
+user2 localhost statement/sql/select 0
+user3 localhost statement/com/Error 0
+user3 localhost statement/com/Quit 0
+user3 localhost statement/sql/insert 0
+user3 localhost statement/sql/select 0
+user4 localhost statement/com/Error 0
+user4 localhost statement/com/Quit 0
+user4 localhost statement/sql/insert 0
+user4 localhost statement/sql/select 0
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+user1 localhost 0 1
+user2 localhost 0 1
+user3 localhost 0 1
+user4 localhost 0 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.accounts;
+"================== ACCOUNTS truncated =================="
+"================== Step 29 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.users;
+"================== USERS truncated =================="
+"================== Step 30 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+truncate performance_schema.hosts;
+"================== HOSTS truncated =================="
+"================== Step 31 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+execute dump_waits_global;
+event_name count_star
+wait/io/file/sql/query_log 0
+wait/synch/mutex/sql/LOCK_connection_count 0
+wait/synch/mutex/sql/LOCK_user_locks 0
+wait/synch/rwlock/sql/LOCK_grant 0
+execute dump_waits_history;
+event_name count(event_name)
+wait/io/file/sql/query_log 20
+wait/synch/mutex/sql/LOCK_connection_count 4
+wait/synch/mutex/sql/LOCK_user_locks 8
+wait/synch/rwlock/sql/LOCK_grant 8
+execute dump_stages_account;
+user host event_name count_star
+execute dump_stages_user;
+user event_name count_star
+execute dump_stages_host;
+host event_name count_star
+execute dump_stages_global;
+event_name count_star
+stage/sql/checking permissions 0
+stage/sql/closing tables 0
+stage/sql/init 0
+stage/sql/Opening tables 0
+execute dump_stages_history;
+event_name count(event_name)
+stage/sql/checking permissions 12
+stage/sql/closing tables 12
+stage/sql/init 28
+stage/sql/Opening tables 12
+execute dump_statements_account;
+user host event_name count_star
+execute dump_statements_user;
+user event_name count_star
+execute dump_statements_host;
+host event_name count_star
+execute dump_statements_global;
+event_name count_star
+statement/com/Error 0
+statement/com/Quit 0
+statement/sql/insert 0
+statement/sql/select 0
+execute dump_statements_history;
+event_name count(event_name)
+statement/com/Quit 4
+statement/sql/insert 4
+statement/sql/select 8
+execute dump_accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+root localhost 1 1
+execute dump_users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+execute dump_hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
diff --git a/mysql-test/suite/perfschema/r/func_file_io.result b/mysql-test/suite/perfschema/r/func_file_io.result
index d99e77dcd8c..b66ab0b4eaa 100644
--- a/mysql-test/suite/perfschema/r/func_file_io.result
+++ b/mysql-test/suite/perfschema/r/func_file_io.result
@@ -1,6 +1,8 @@
UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
+update performance_schema.threads SET instrumented = 'YES'
+ WHERE PROCESSLIST_ID=connection_id();
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
@@ -65,17 +67,17 @@ SELECT * FROM performance_schema.events_waits_history_long
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME INDEX_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID NESTING_EVENT_TYPE OPERATION NUMBER_OF_BYTES FLAGS
SELECT * FROM performance_schema.events_waits_history
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME INDEX_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID NESTING_EVENT_TYPE OPERATION NUMBER_OF_BYTES FLAGS
SELECT * FROM performance_schema.events_waits_current
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME INDEX_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID NESTING_EVENT_TYPE OPERATION NUMBER_OF_BYTES FLAGS
UPDATE performance_schema.setup_instruments SET timed = 'YES';
SELECT * FROM t1 WHERE id < 4;
id b
@@ -94,10 +96,23 @@ FROM performance_schema.events_waits_summary_global_by_event_name
WHERE COUNT_STAR > 0
ORDER BY SUM_TIMER_WAIT DESC
LIMIT 10;
+SELECT p.processlist_user, SUM(TIMER_WAIT) SUM_WAIT
+# ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
+FROM performance_schema.events_waits_history_long h
+INNER JOIN performance_schema.threads p USING (THREAD_ID)
+GROUP BY p.processlist_user
+ORDER BY SUM_WAIT DESC
+LIMIT 20;
SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT
FROM performance_schema.events_waits_history_long h
INNER JOIN performance_schema.threads p USING (THREAD_ID)
WHERE p.PROCESSLIST_ID = 1
GROUP BY h.EVENT_NAME
HAVING TOTAL_WAIT > 0;
-UPDATE performance_schema.setup_instruments SET enabled = 'YES';
+SELECT p.processlist_user, h.operation, SUM(NUMBER_OF_BYTES) bytes
+FROM performance_schema.events_waits_history_long h
+INNER JOIN performance_schema.threads p USING (THREAD_ID)
+GROUP BY p.processlist_user, h.operation
+HAVING BYTES > 0
+ORDER BY p.processlist_user, h.operation;
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
diff --git a/mysql-test/suite/perfschema/r/func_mutex.result b/mysql-test/suite/perfschema/r/func_mutex.result
index 93a8ae5d218..462e9c046c3 100644
--- a/mysql-test/suite/perfschema/r/func_mutex.result
+++ b/mysql-test/suite/perfschema/r/func_mutex.result
@@ -112,3 +112,4 @@ test_fm2_rw_timed
Success
UPDATE performance_schema.setup_instruments SET enabled = 'YES';
DROP TABLE t1;
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
new file mode 100644
index 00000000000..d2e99912200
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
@@ -0,0 +1,85 @@
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'192.0.2.4';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 1
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 2
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'192.0.2.4';
+drop user 'root'@'192.0.2.4';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result
new file mode 100644
index 00000000000..39057797b76
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result
@@ -0,0 +1,72 @@
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 1
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 2
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
new file mode 100644
index 00000000000..7bddddb44a2
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
@@ -0,0 +1,85 @@
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'192.0.2.4';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 1
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 1
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'192.0.2.4';
+drop user 'root'@'192.0.2.4';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result
new file mode 100644
index 00000000000..4bb67d51eb7
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result
@@ -0,0 +1,72 @@
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 1
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 1
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
new file mode 100644
index 00000000000..dd69ff95ccd
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
@@ -0,0 +1,85 @@
+call mtr.add_suppression("192.0.2.4");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN null
+LAST_ERROR_SEEN null
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN null
+LAST_ERROR_SEEN null
+revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
+drop user 'root'@'santa.claus.ipv4.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result
new file mode 100644
index 00000000000..1443c9708a6
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result
@@ -0,0 +1,72 @@
+call mtr.add_suppression("192.0.2.4");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
new file mode 100644
index 00000000000..a67937e32b2
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
@@ -0,0 +1,88 @@
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+grant select on test.* to 'root'@'192.0.2.4';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_noname";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 1
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 1
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
+revoke select on test.* from 'root'@'192.0.2.4';
+drop user 'root'@'santa.claus.ipv4.example.com';
+drop user 'root'@'192.0.2.4';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result
new file mode 100644
index 00000000000..0ec0b833d0e
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result
@@ -0,0 +1,72 @@
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_noname";
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 1
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 1
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result
new file mode 100644
index 00000000000..4e1cbacf228
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result
@@ -0,0 +1,180 @@
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+CREATE USER 'plug'@'santa.claus.ipv4.example.com'
+ IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER 'plug_dest'@'santa.claus.ipv4.example.com'
+ IDENTIFIED BY 'plug_test_passwd';
+GRANT SELECT ON test.* TO 'plug_dest'@'santa.claus.ipv4.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+uninstall plugin test_plugin_server;
+ERROR HY000: Plugin 'test_plugin_server' is not loaded
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 1
+COUNT_AUTH_PLUGIN_ERRORS 1
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Plugin 'test_plugin_server' is not loaded
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 2
+COUNT_AUTH_PLUGIN_ERRORS 2
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+install plugin test_plugin_server soname 'PLUGIN_AUTH';
+ERROR 28000: Access denied for user 'plug'@'santa.claus.ipv4.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 2
+COUNT_AUTH_PLUGIN_ERRORS 2
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 1
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'plug'@'santa.claus.ipv4.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 2
+COUNT_AUTH_PLUGIN_ERRORS 2
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 2
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+GRANT PROXY ON 'plug_dest'@'santa.claus.ipv4.example.com'
+ TO 'plug'@'santa.claus.ipv4.example.com';
+select "Con4 is alive";
+Con4 is alive
+Con4 is alive
+select user();
+user()
+plug@santa.claus.ipv4.example.com
+select current_user();
+current_user()
+plug_dest@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 2
+COUNT_AUTH_PLUGIN_ERRORS 2
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 2
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+REVOKE ALL PRIVILEGES ON *.* FROM 'plug_dest'@'santa.claus.ipv4.example.com';
+REVOKE PROXY ON 'plug_dest'@'santa.claus.ipv4.example.com'
+ FROM 'plug'@'santa.claus.ipv4.example.com';
+DROP USER 'plug'@'santa.claus.ipv4.example.com';
+DROP USER 'plug_dest'@'santa.claus.ipv4.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
new file mode 100644
index 00000000000..8e378e52bf5
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
@@ -0,0 +1,198 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+select @@global.max_connect_errors;
+@@global.max_connect_errors
+10
+select @@global.max_connect_errors into @saved_max_connect_errors;
+set global max_connect_errors = 2;
+grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4,native_password_bad_reply";
+ERROR 28000: Access denied for user 'quota'@'santa.claus.ipv4.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 1
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 1
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'quota'@'santa.claus.ipv4.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 2
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 2
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'quota'@'santa.claus.ipv4.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 3
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 3
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '192.0.2.4' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 3
+COUNT_HOST_BLOCKED_ERRORS 1
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 3
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '192.0.2.4' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 3
+COUNT_HOST_BLOCKED_ERRORS 2
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 3
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+flush hosts;
+ERROR 28000: Access denied for user 'quota'@'santa.claus.ipv4.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 1
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 1
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
+drop user 'root'@'santa.claus.ipv4.example.com';
+set global max_connect_errors = @saved_max_connect_errors;
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result
new file mode 100644
index 00000000000..5389dd43d11
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result
@@ -0,0 +1,72 @@
+call mtr.add_suppression("192.0.2.4");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_format_ipv4";
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 1
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 2
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
new file mode 100644
index 00000000000..069fac2ddb8
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
@@ -0,0 +1,645 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+select @@global.max_user_connections;
+@@global.max_user_connections
+0
+select @@global.max_connections;
+@@global.max_connections
+151
+select @@global.max_connections into @saved_max_connections;
+create user 'quota'@'santa.claus.ipv4.example.com';
+grant select on test.* to 'quota'@'santa.claus.ipv4.example.com';
+grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
+ with max_connections_per_hour 3;
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+select "Con2a is alive";
+Con2a is alive
+Con2a is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN null
+LAST_ERROR_SEEN null
+select "Con2b is alive";
+Con2b is alive
+Con2b is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN null
+LAST_ERROR_SEEN null
+select "Con2c is alive";
+Con2c is alive
+Con2c is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN null
+LAST_ERROR_SEEN null
+ERROR 42000: User 'quota' has exceeded the 'max_connections_per_hour' resource (current value: 3)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 1
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 42000: User 'quota' has exceeded the 'max_connections_per_hour' resource (current value: 3)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
+ with max_connections_per_hour 0;
+grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
+ with max_user_connections 3;
+flush user_resources;
+select "Con7 is alive";
+Con7 is alive
+Con7 is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3b is alive";
+Con3b is alive
+Con3b is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3c is alive";
+Con3c is alive
+Con3c is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 42000: User 'quota' has exceeded the 'max_user_connections' resource (current value: 3)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 1
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 42000: User 'quota' has exceeded the 'max_user_connections' resource (current value: 3)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 2
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
+ with max_user_connections 0;
+flush user_resources;
+set global max_user_connections = 3;
+select "Con4a is alive";
+Con4a is alive
+Con4a is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 2
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con4b is alive";
+Con4b is alive
+Con4b is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 2
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con4c is alive";
+Con4c is alive
+Con4c is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 2
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 42000: User quota already has more than 'max_user_connections' active connections
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 3
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 42000: User quota already has more than 'max_user_connections' active connections
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global max_user_connections = 0;
+set global max_connections = 3;
+flush user_resources;
+select "Con4a is alive";
+Con4a is alive
+Con4a is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con5b is alive";
+Con5b is alive
+Con5b is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv4.example.com
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+Got one of the listed errors
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+Got one of the listed errors
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global max_connections = @saved_max_connections;
+drop user 'quota'@'santa.claus.ipv4.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
new file mode 100644
index 00000000000..c2163a2d5b1
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
@@ -0,0 +1,157 @@
+call mtr.add_suppression("192.0.2.4");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'192.0.2.4';
+grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 1
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+select "Con4 is alive";
+Con4 is alive
+Con4 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con5 is alive";
+Con5 is alive
+Con5 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'192.0.2.4';
+revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
+drop user 'root'@'192.0.2.4';
+drop user 'root'@'santa.claus.ipv4.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result
new file mode 100644
index 00000000000..048081756bb
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result
@@ -0,0 +1,131 @@
+call mtr.add_suppression("192.0.2.4");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 1
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 3
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 4
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
new file mode 100644
index 00000000000..85a825f3907
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
@@ -0,0 +1,85 @@
+call mtr.add_suppression("192.0.2.4");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'192.0.2.4';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_noname";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 1
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@192.0.2.4
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 1
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'192.0.2.4';
+drop user 'root'@'192.0.2.4';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result
new file mode 100644
index 00000000000..6bb381888f9
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result
@@ -0,0 +1,72 @@
+call mtr.add_suppression("192.0.2.4");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_noname";
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 1
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 1
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result
new file mode 100644
index 00000000000..a7d34ede333
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result
@@ -0,0 +1,195 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+create user 'user_without'@'santa.claus.ipv4.example.com';
+create user 'user_with'@'santa.claus.ipv4.example.com'
+ identified by 'good_password';
+grant select on test.* to 'user_without'@'santa.claus.ipv4.example.com';
+grant select on test.* to 'user_with'@'santa.claus.ipv4.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv4.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 1
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv4.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 2
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 3
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 4
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 5
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 6
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+drop user 'user_with'@'santa.claus.ipv4.example.com';
+drop user 'user_without'@'santa.claus.ipv4.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result
new file mode 100644
index 00000000000..e6e5b99392f
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result
@@ -0,0 +1,141 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+create user 'user_ssl'@'santa.claus.ipv4.example.com';
+create user 'user_ssl_x509'@'santa.claus.ipv4.example.com'
+ identified by 'good_password';
+grant select on test.* to 'user_ssl'@'santa.claus.ipv4.example.com'
+ REQUIRE SSL;
+grant select on test.* to 'user_ssl_x509'@'santa.claus.ipv4.example.com'
+ REQUIRE SUBJECT '/C=??/ST=??/L=??/
+ O=No such thing/
+ CN=Santa Claus/emailAddress=santa.claus@example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv4.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 1
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv4.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 2
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv4.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 3
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv4.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+drop user 'user_ssl'@'santa.claus.ipv4.example.com';
+drop user 'user_ssl_x509'@'santa.claus.ipv4.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
new file mode 100644
index 00000000000..599fcfe9130
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
@@ -0,0 +1,85 @@
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'2001:db8::6:6';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_again";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 1
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 2
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'2001:db8::6:6';
+drop user 'root'@'2001:db8::6:6';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result
new file mode 100644
index 00000000000..d6b579fcb57
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result
@@ -0,0 +1,72 @@
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_again";
+ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 1
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 2
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
new file mode 100644
index 00000000000..2a41f269159
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
@@ -0,0 +1,85 @@
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'2001:db8::6:6';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_bad_ipv6";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 1
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 1
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'2001:db8::6:6';
+drop user 'root'@'2001:db8::6:6';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result
new file mode 100644
index 00000000000..786936acc20
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result
@@ -0,0 +1,72 @@
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_bad_ipv6";
+ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 1
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 1
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
new file mode 100644
index 00000000000..b0269234e11
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
@@ -0,0 +1,85 @@
+call mtr.add_suppression("192.0.2.4");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN null
+LAST_ERROR_SEEN null
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN null
+LAST_ERROR_SEEN null
+revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
+drop user 'root'@'santa.claus.ipv6.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result
new file mode 100644
index 00000000000..9bef9efb93c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result
@@ -0,0 +1,71 @@
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+ERROR HY000: Host 'santa.claus.ipv6.example.com' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host 'santa.claus.ipv6.example.com' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
new file mode 100644
index 00000000000..432a0b4eaaf
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
@@ -0,0 +1,88 @@
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+grant select on test.* to 'root'@'2001:db8::6:6';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 1
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 1
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
+revoke select on test.* from 'root'@'2001:db8::6:6';
+drop user 'root'@'santa.claus.ipv6.example.com';
+drop user 'root'@'2001:db8::6:6';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result
new file mode 100644
index 00000000000..ea5c6e357ef
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result
@@ -0,0 +1,72 @@
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
+ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 1
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 1
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result
new file mode 100644
index 00000000000..61fd1573067
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result
@@ -0,0 +1,180 @@
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+CREATE USER 'plug'@'santa.claus.ipv6.example.com'
+ IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER 'plug_dest'@'santa.claus.ipv6.example.com'
+ IDENTIFIED BY 'plug_test_passwd';
+GRANT SELECT ON test.* TO 'plug_dest'@'santa.claus.ipv6.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+uninstall plugin test_plugin_server;
+ERROR HY000: Plugin 'test_plugin_server' is not loaded
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 1
+COUNT_AUTH_PLUGIN_ERRORS 1
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Plugin 'test_plugin_server' is not loaded
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 2
+COUNT_AUTH_PLUGIN_ERRORS 2
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+install plugin test_plugin_server soname 'PLUGIN_AUTH';
+ERROR 28000: Access denied for user 'plug'@'santa.claus.ipv6.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 2
+COUNT_AUTH_PLUGIN_ERRORS 2
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 1
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'plug'@'santa.claus.ipv6.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 2
+COUNT_AUTH_PLUGIN_ERRORS 2
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 2
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+GRANT PROXY ON 'plug_dest'@'santa.claus.ipv6.example.com'
+ TO 'plug'@'santa.claus.ipv6.example.com';
+select "Con4 is alive";
+Con4 is alive
+Con4 is alive
+select user();
+user()
+plug@santa.claus.ipv6.example.com
+select current_user();
+current_user()
+plug_dest@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 2
+COUNT_AUTH_PLUGIN_ERRORS 2
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 2
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+REVOKE ALL PRIVILEGES ON *.* FROM 'plug_dest'@'santa.claus.ipv6.example.com';
+REVOKE PROXY ON 'plug_dest'@'santa.claus.ipv6.example.com'
+ FROM 'plug'@'santa.claus.ipv6.example.com';
+DROP USER 'plug'@'santa.claus.ipv6.example.com';
+DROP USER 'plug_dest'@'santa.claus.ipv6.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
new file mode 100644
index 00000000000..07121b6031f
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
@@ -0,0 +1,198 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+select @@global.max_connect_errors;
+@@global.max_connect_errors
+10
+select @@global.max_connect_errors into @saved_max_connect_errors;
+set global max_connect_errors = 2;
+grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6,native_password_bad_reply";
+ERROR 28000: Access denied for user 'quota'@'santa.claus.ipv6.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 1
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 1
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'quota'@'santa.claus.ipv6.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 2
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 2
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'quota'@'santa.claus.ipv6.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 3
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 3
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '2001:db8::6:6' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 3
+COUNT_HOST_BLOCKED_ERRORS 1
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 3
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '2001:db8::6:6' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 3
+COUNT_HOST_BLOCKED_ERRORS 2
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 3
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+flush hosts;
+ERROR 28000: Access denied for user 'quota'@'santa.claus.ipv6.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 1
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 1
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
+drop user 'root'@'santa.claus.ipv6.example.com';
+set global max_connect_errors = @saved_max_connect_errors;
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
new file mode 100644
index 00000000000..3bf09f19843
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
@@ -0,0 +1,645 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+select @@global.max_user_connections;
+@@global.max_user_connections
+0
+select @@global.max_connections;
+@@global.max_connections
+151
+select @@global.max_connections into @saved_max_connections;
+create user 'quota'@'santa.claus.ipv6.example.com';
+grant select on test.* to 'quota'@'santa.claus.ipv6.example.com';
+grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
+ with max_connections_per_hour 3;
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+select "Con2a is alive";
+Con2a is alive
+Con2a is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN null
+LAST_ERROR_SEEN null
+select "Con2b is alive";
+Con2b is alive
+Con2b is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN null
+LAST_ERROR_SEEN null
+select "Con2c is alive";
+Con2c is alive
+Con2c is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN null
+LAST_ERROR_SEEN null
+ERROR 42000: User 'quota' has exceeded the 'max_connections_per_hour' resource (current value: 3)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 1
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 42000: User 'quota' has exceeded the 'max_connections_per_hour' resource (current value: 3)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
+ with max_connections_per_hour 0;
+grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
+ with max_user_connections 3;
+flush user_resources;
+select "Con7 is alive";
+Con7 is alive
+Con7 is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3b is alive";
+Con3b is alive
+Con3b is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3c is alive";
+Con3c is alive
+Con3c is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 42000: User 'quota' has exceeded the 'max_user_connections' resource (current value: 3)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 1
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 42000: User 'quota' has exceeded the 'max_user_connections' resource (current value: 3)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 2
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
+ with max_user_connections 0;
+flush user_resources;
+set global max_user_connections = 3;
+select "Con4a is alive";
+Con4a is alive
+Con4a is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 2
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con4b is alive";
+Con4b is alive
+Con4b is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 2
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con4c is alive";
+Con4c is alive
+Con4c is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 2
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 42000: User quota already has more than 'max_user_connections' active connections
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 3
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 42000: User quota already has more than 'max_user_connections' active connections
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global max_user_connections = 0;
+set global max_connections = 3;
+flush user_resources;
+select "Con4a is alive";
+Con4a is alive
+Con4a is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con5b is alive";
+Con5b is alive
+Con5b is alive
+select current_user();
+current_user()
+quota@santa.claus.ipv6.example.com
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+Got one of the listed errors
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+Got one of the listed errors
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 2
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global max_connections = @saved_max_connections;
+drop user 'quota'@'santa.claus.ipv6.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
new file mode 100644
index 00000000000..755f5b2037d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
@@ -0,0 +1,157 @@
+call mtr.add_suppression("2001:db8::6:6");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'2001:db8::6:6';
+grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_again";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 1
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+select "Con4 is alive";
+Con4 is alive
+Con4 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con5 is alive";
+Con5 is alive
+Con5 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'2001:db8::6:6';
+revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
+drop user 'root'@'2001:db8::6:6';
+drop user 'root'@'santa.claus.ipv6.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result
new file mode 100644
index 00000000000..da240b24ca6
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result
@@ -0,0 +1,131 @@
+call mtr.add_suppression("2001:db8::6:6");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_again";
+ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 1
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED NO
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+ERROR HY000: Host 'santa.claus.ipv6.example.com' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 3
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host 'santa.claus.ipv6.example.com' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 2
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 4
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
new file mode 100644
index 00000000000..8a4dee22aa2
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
@@ -0,0 +1,85 @@
+call mtr.add_suppression("2001:db8::6:6");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+grant select on test.* to 'root'@'2001:db8::6:6';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_noname";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 1
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@2001:db8::6:6
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 1
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+revoke select on test.* from 'root'@'2001:db8::6:6';
+drop user 'root'@'2001:db8::6:6';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result
new file mode 100644
index 00000000000..63b8a33b8bf
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result
@@ -0,0 +1,72 @@
+call mtr.add_suppression("2001:db8::6:6");
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_noname";
+ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 1
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 1
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MySQL server
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST NULL
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 1
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 2
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result
new file mode 100644
index 00000000000..5d67dc8d943
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result
@@ -0,0 +1,195 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+create user 'user_without'@'santa.claus.ipv6.example.com';
+create user 'user_with'@'santa.claus.ipv6.example.com'
+ identified by 'good_password';
+grant select on test.* to 'user_without'@'santa.claus.ipv6.example.com';
+grant select on test.* to 'user_with'@'santa.claus.ipv6.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv6.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 1
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv6.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 2
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 3
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 4
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 5
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 6
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+drop user 'user_with'@'santa.claus.ipv6.example.com';
+drop user 'user_without'@'santa.claus.ipv6.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result
new file mode 100644
index 00000000000..29c151d24c1
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result
@@ -0,0 +1,141 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+create user 'user_ssl'@'santa.claus.ipv6.example.com';
+create user 'user_ssl_x509'@'santa.claus.ipv6.example.com'
+ identified by 'good_password';
+grant select on test.* to 'user_ssl'@'santa.claus.ipv6.example.com'
+ REQUIRE SSL;
+grant select on test.* to 'user_ssl_x509'@'santa.claus.ipv6.example.com'
+ REQUIRE SUBJECT '/C=??/ST=??/L=??/
+ O=No such thing/
+ CN=Santa Claus/emailAddress=santa.claus@example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv6.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 1
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv6.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 2
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv6.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 3
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv6.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 2001:db8::6:6
+HOST santa.claus.ipv6.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 0
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 4
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+drop user 'user_ssl'@'santa.claus.ipv6.example.com';
+drop user 'user_ssl_x509'@'santa.claus.ipv6.example.com';
+set global debug= default;
diff --git a/mysql-test/suite/perfschema/r/hostcache_peer_addr.result b/mysql-test/suite/perfschema/r/hostcache_peer_addr.result
new file mode 100644
index 00000000000..0eff14b50f0
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_peer_addr.result
@@ -0,0 +1,50 @@
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+show global status like "connection_errors_%";
+Variable_name Value
+Connection_errors_accept 0
+Connection_errors_internal 0
+Connection_errors_max_connections 0
+Connection_errors_peer_address 0
+Connection_errors_select 0
+Connection_errors_tcpwrap 0
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_error";
+ERROR HY000: Can't get hostname for your address
+show global status like "connection_errors_%";
+Variable_name Value
+Connection_errors_accept 0
+Connection_errors_internal 0
+Connection_errors_max_connections 0
+Connection_errors_peer_address 1
+Connection_errors_select 0
+Connection_errors_tcpwrap 0
+"Dumping performance_schema.host_cache"
+ERROR HY000: Can't get hostname for your address
+show global status like "connection_errors_%";
+Variable_name Value
+Connection_errors_accept 0
+Connection_errors_internal 0
+Connection_errors_max_connections 0
+Connection_errors_peer_address 2
+Connection_errors_select 0
+Connection_errors_tcpwrap 0
+"Dumping performance_schema.host_cache"
+set global debug= default;
+flush status;
+show global status like "connection_errors_%";
+Variable_name Value
+Connection_errors_accept 0
+Connection_errors_internal 0
+Connection_errors_max_connections 0
+Connection_errors_peer_address 0
+Connection_errors_select 0
+Connection_errors_tcpwrap 0
diff --git a/mysql-test/suite/perfschema/r/indexed_table_io.result b/mysql-test/suite/perfschema/r/indexed_table_io.result
new file mode 100644
index 00000000000..6b420323b74
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/indexed_table_io.result
@@ -0,0 +1,158 @@
+drop table if exists test.no_index_tab;
+drop table if exists test.index_tab;
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+create table test.no_index_tab
+( a int, b char(30) default 'Default') engine = MyISAM;
+create table test.index_tab
+( a int, b char(30) default 'Default', unique key uidx(a)) engine = MyISAM;
+show create table test.no_index_tab;
+Table Create Table
+no_index_tab CREATE TABLE `no_index_tab` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(30) DEFAULT 'Default'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create table test.index_tab;
+Table Create Table
+index_tab CREATE TABLE `index_tab` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(30) DEFAULT 'Default',
+ UNIQUE KEY `uidx` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+# Printing of 100 inserts per table is suppressed
+update performance_schema.setup_consumers set enabled='NO';
+select COUNT(*)
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+and object_schema = 'test'
+and object_name = 'no_index_tab';
+COUNT(*)
+100
+select COUNT(*)
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+and object_schema = 'test'
+and object_name = 'index_tab';
+COUNT(*)
+100
+select count(*) from test.no_index_tab;
+count(*)
+100
+select count(*) from test.index_tab;
+count(*)
+100
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+select avg(a) from test.no_index_tab;
+avg(a)
+50.5000
+update performance_schema.setup_consumers set enabled='NO';
+select COUNT(*)
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+and object_schema = 'test'
+and object_name = 'no_index_tab';
+COUNT(*)
+101
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+select avg(a) from test.index_tab;
+avg(a)
+50.5000
+update performance_schema.setup_consumers set enabled='NO';
+select COUNT(*)
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+and object_schema = 'test'
+and object_name = 'index_tab';
+COUNT(*)
+101
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+select 1 as my_column from test.no_index_tab where a = 50;
+my_column
+1
+update performance_schema.setup_consumers set enabled='NO';
+select COUNT(*)
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+and object_schema = 'test'
+and object_name = 'no_index_tab';
+COUNT(*)
+101
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+select 1 as my_column from test.index_tab where a = 50;
+my_column
+1
+update performance_schema.setup_consumers set enabled='NO';
+select COUNT(*)
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+and object_schema = 'test'
+and object_name = 'index_tab';
+COUNT(*)
+1
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+delete from test.no_index_tab where a = 51;
+update performance_schema.setup_consumers set enabled='NO';
+select COUNT(*)
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+and object_schema = 'test'
+and object_name = 'no_index_tab';
+COUNT(*)
+102
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+delete from test.index_tab where a = 51;
+update performance_schema.setup_consumers set enabled='NO';
+select COUNT(*)
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+and object_schema = 'test'
+and object_name = 'index_tab';
+COUNT(*)
+2
+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_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
+drop table test.no_index_tab;
+drop table test.index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/information_schema.result b/mysql-test/suite/perfschema/r/information_schema.result
index ab464cce687..e38c13213b7 100644
--- a/mysql-test/suite/perfschema/r/information_schema.result
+++ b/mysql-test/suite/perfschema/r/information_schema.result
@@ -2,188 +2,485 @@ select TABLE_SCHEMA, lower(TABLE_NAME), TABLE_CATALOG
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
TABLE_SCHEMA lower(TABLE_NAME) TABLE_CATALOG
+performance_schema accounts def
performance_schema cond_instances def
+performance_schema events_stages_current def
+performance_schema events_stages_history def
+performance_schema events_stages_history_long def
+performance_schema events_stages_summary_by_account_by_event_name def
+performance_schema events_stages_summary_by_host_by_event_name def
+performance_schema events_stages_summary_by_thread_by_event_name def
+performance_schema events_stages_summary_by_user_by_event_name def
+performance_schema events_stages_summary_global_by_event_name def
+performance_schema events_statements_current def
+performance_schema events_statements_history def
+performance_schema events_statements_history_long def
+performance_schema events_statements_summary_by_account_by_event_name def
+performance_schema events_statements_summary_by_digest def
+performance_schema events_statements_summary_by_host_by_event_name def
+performance_schema events_statements_summary_by_thread_by_event_name def
+performance_schema events_statements_summary_by_user_by_event_name def
+performance_schema events_statements_summary_global_by_event_name def
performance_schema events_waits_current def
performance_schema events_waits_history def
performance_schema events_waits_history_long def
+performance_schema events_waits_summary_by_account_by_event_name def
+performance_schema events_waits_summary_by_host_by_event_name def
performance_schema events_waits_summary_by_instance def
performance_schema events_waits_summary_by_thread_by_event_name def
+performance_schema events_waits_summary_by_user_by_event_name def
performance_schema events_waits_summary_global_by_event_name def
performance_schema file_instances def
performance_schema file_summary_by_event_name def
performance_schema file_summary_by_instance def
+performance_schema host_cache def
+performance_schema hosts def
performance_schema mutex_instances def
+performance_schema objects_summary_global_by_type def
performance_schema performance_timers def
performance_schema rwlock_instances def
+performance_schema setup_actors def
performance_schema setup_consumers def
performance_schema setup_instruments def
+performance_schema setup_objects def
performance_schema setup_timers def
+performance_schema socket_instances def
+performance_schema socket_summary_by_event_name def
+performance_schema socket_summary_by_instance def
+performance_schema table_io_waits_summary_by_index_usage def
+performance_schema table_io_waits_summary_by_table def
+performance_schema table_lock_waits_summary_by_table def
performance_schema threads def
+performance_schema users def
select lower(TABLE_NAME), TABLE_TYPE, ENGINE
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
lower(TABLE_NAME) TABLE_TYPE ENGINE
+accounts BASE TABLE PERFORMANCE_SCHEMA
cond_instances BASE TABLE PERFORMANCE_SCHEMA
+events_stages_current BASE TABLE PERFORMANCE_SCHEMA
+events_stages_history BASE TABLE PERFORMANCE_SCHEMA
+events_stages_history_long BASE TABLE PERFORMANCE_SCHEMA
+events_stages_summary_by_account_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_stages_summary_by_host_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_stages_summary_by_thread_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_stages_summary_by_user_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_stages_summary_global_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_statements_current BASE TABLE PERFORMANCE_SCHEMA
+events_statements_history BASE TABLE PERFORMANCE_SCHEMA
+events_statements_history_long BASE TABLE PERFORMANCE_SCHEMA
+events_statements_summary_by_account_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_statements_summary_by_digest BASE TABLE PERFORMANCE_SCHEMA
+events_statements_summary_by_host_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_statements_summary_by_thread_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_statements_summary_by_user_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_statements_summary_global_by_event_name BASE TABLE PERFORMANCE_SCHEMA
events_waits_current BASE TABLE PERFORMANCE_SCHEMA
events_waits_history BASE TABLE PERFORMANCE_SCHEMA
events_waits_history_long BASE TABLE PERFORMANCE_SCHEMA
+events_waits_summary_by_account_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_waits_summary_by_host_by_event_name BASE TABLE PERFORMANCE_SCHEMA
events_waits_summary_by_instance BASE TABLE PERFORMANCE_SCHEMA
events_waits_summary_by_thread_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_waits_summary_by_user_by_event_name BASE TABLE PERFORMANCE_SCHEMA
events_waits_summary_global_by_event_name BASE TABLE PERFORMANCE_SCHEMA
file_instances BASE TABLE PERFORMANCE_SCHEMA
file_summary_by_event_name BASE TABLE PERFORMANCE_SCHEMA
file_summary_by_instance BASE TABLE PERFORMANCE_SCHEMA
+host_cache BASE TABLE PERFORMANCE_SCHEMA
+hosts BASE TABLE PERFORMANCE_SCHEMA
mutex_instances BASE TABLE PERFORMANCE_SCHEMA
+objects_summary_global_by_type BASE TABLE PERFORMANCE_SCHEMA
performance_timers BASE TABLE PERFORMANCE_SCHEMA
rwlock_instances BASE TABLE PERFORMANCE_SCHEMA
+setup_actors BASE TABLE PERFORMANCE_SCHEMA
setup_consumers BASE TABLE PERFORMANCE_SCHEMA
setup_instruments BASE TABLE PERFORMANCE_SCHEMA
+setup_objects BASE TABLE PERFORMANCE_SCHEMA
setup_timers BASE TABLE PERFORMANCE_SCHEMA
+socket_instances BASE TABLE PERFORMANCE_SCHEMA
+socket_summary_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+socket_summary_by_instance BASE TABLE PERFORMANCE_SCHEMA
+table_io_waits_summary_by_index_usage BASE TABLE PERFORMANCE_SCHEMA
+table_io_waits_summary_by_table BASE TABLE PERFORMANCE_SCHEMA
+table_lock_waits_summary_by_table BASE TABLE PERFORMANCE_SCHEMA
threads BASE TABLE PERFORMANCE_SCHEMA
+users BASE TABLE PERFORMANCE_SCHEMA
select lower(TABLE_NAME), VERSION, ROW_FORMAT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
lower(TABLE_NAME) VERSION ROW_FORMAT
+accounts 10 Fixed
cond_instances 10 Dynamic
+events_stages_current 10 Dynamic
+events_stages_history 10 Dynamic
+events_stages_history_long 10 Dynamic
+events_stages_summary_by_account_by_event_name 10 Dynamic
+events_stages_summary_by_host_by_event_name 10 Dynamic
+events_stages_summary_by_thread_by_event_name 10 Dynamic
+events_stages_summary_by_user_by_event_name 10 Dynamic
+events_stages_summary_global_by_event_name 10 Dynamic
+events_statements_current 10 Dynamic
+events_statements_history 10 Dynamic
+events_statements_history_long 10 Dynamic
+events_statements_summary_by_account_by_event_name 10 Dynamic
+events_statements_summary_by_digest 10 Dynamic
+events_statements_summary_by_host_by_event_name 10 Dynamic
+events_statements_summary_by_thread_by_event_name 10 Dynamic
+events_statements_summary_by_user_by_event_name 10 Dynamic
+events_statements_summary_global_by_event_name 10 Dynamic
events_waits_current 10 Dynamic
events_waits_history 10 Dynamic
events_waits_history_long 10 Dynamic
+events_waits_summary_by_account_by_event_name 10 Dynamic
+events_waits_summary_by_host_by_event_name 10 Dynamic
events_waits_summary_by_instance 10 Dynamic
events_waits_summary_by_thread_by_event_name 10 Dynamic
+events_waits_summary_by_user_by_event_name 10 Dynamic
events_waits_summary_global_by_event_name 10 Dynamic
file_instances 10 Dynamic
file_summary_by_event_name 10 Dynamic
file_summary_by_instance 10 Dynamic
+host_cache 10 Dynamic
+hosts 10 Fixed
mutex_instances 10 Dynamic
+objects_summary_global_by_type 10 Dynamic
performance_timers 10 Fixed
rwlock_instances 10 Dynamic
+setup_actors 10 Fixed
setup_consumers 10 Dynamic
setup_instruments 10 Dynamic
+setup_objects 10 Dynamic
setup_timers 10 Dynamic
+socket_instances 10 Dynamic
+socket_summary_by_event_name 10 Dynamic
+socket_summary_by_instance 10 Dynamic
+table_io_waits_summary_by_index_usage 10 Dynamic
+table_io_waits_summary_by_table 10 Dynamic
+table_lock_waits_summary_by_table 10 Dynamic
threads 10 Dynamic
+users 10 Fixed
select lower(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
lower(TABLE_NAME) TABLE_ROWS AVG_ROW_LENGTH
+accounts 1000 0
cond_instances 1000 0
+events_stages_current 1000 0
+events_stages_history 1000 0
+events_stages_history_long 10000 0
+events_stages_summary_by_account_by_event_name 1000 0
+events_stages_summary_by_host_by_event_name 1000 0
+events_stages_summary_by_thread_by_event_name 1000 0
+events_stages_summary_by_user_by_event_name 1000 0
+events_stages_summary_global_by_event_name 1000 0
+events_statements_current 1000 0
+events_statements_history 1000 0
+events_statements_history_long 10000 0
+events_statements_summary_by_account_by_event_name 1000 0
+events_statements_summary_by_digest 1000 0
+events_statements_summary_by_host_by_event_name 1000 0
+events_statements_summary_by_thread_by_event_name 1000 0
+events_statements_summary_by_user_by_event_name 1000 0
+events_statements_summary_global_by_event_name 1000 0
events_waits_current 1000 0
events_waits_history 1000 0
events_waits_history_long 10000 0
+events_waits_summary_by_account_by_event_name 1000 0
+events_waits_summary_by_host_by_event_name 1000 0
events_waits_summary_by_instance 1000 0
events_waits_summary_by_thread_by_event_name 1000 0
+events_waits_summary_by_user_by_event_name 1000 0
events_waits_summary_global_by_event_name 1000 0
file_instances 1000 0
file_summary_by_event_name 1000 0
file_summary_by_instance 1000 0
+host_cache 1000 0
+hosts 1000 0
mutex_instances 1000 0
+objects_summary_global_by_type 1000 0
performance_timers 5 0
rwlock_instances 1000 0
-setup_consumers 8 0
+setup_actors 1 0
+setup_consumers 12 0
setup_instruments 1000 0
-setup_timers 1 0
+setup_objects 4 0
+setup_timers 4 0
+socket_instances 1000 0
+socket_summary_by_event_name 1000 0
+socket_summary_by_instance 1000 0
+table_io_waits_summary_by_index_usage 1000 0
+table_io_waits_summary_by_table 1000 0
+table_lock_waits_summary_by_table 1000 0
threads 1000 0
+users 1000 0
select lower(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
lower(TABLE_NAME) DATA_LENGTH MAX_DATA_LENGTH
+accounts 0 0
cond_instances 0 0
+events_stages_current 0 0
+events_stages_history 0 0
+events_stages_history_long 0 0
+events_stages_summary_by_account_by_event_name 0 0
+events_stages_summary_by_host_by_event_name 0 0
+events_stages_summary_by_thread_by_event_name 0 0
+events_stages_summary_by_user_by_event_name 0 0
+events_stages_summary_global_by_event_name 0 0
+events_statements_current 0 0
+events_statements_history 0 0
+events_statements_history_long 0 0
+events_statements_summary_by_account_by_event_name 0 0
+events_statements_summary_by_digest 0 0
+events_statements_summary_by_host_by_event_name 0 0
+events_statements_summary_by_thread_by_event_name 0 0
+events_statements_summary_by_user_by_event_name 0 0
+events_statements_summary_global_by_event_name 0 0
events_waits_current 0 0
events_waits_history 0 0
events_waits_history_long 0 0
+events_waits_summary_by_account_by_event_name 0 0
+events_waits_summary_by_host_by_event_name 0 0
events_waits_summary_by_instance 0 0
events_waits_summary_by_thread_by_event_name 0 0
+events_waits_summary_by_user_by_event_name 0 0
events_waits_summary_global_by_event_name 0 0
file_instances 0 0
file_summary_by_event_name 0 0
file_summary_by_instance 0 0
+host_cache 0 0
+hosts 0 0
mutex_instances 0 0
+objects_summary_global_by_type 0 0
performance_timers 0 0
rwlock_instances 0 0
+setup_actors 0 0
setup_consumers 0 0
setup_instruments 0 0
+setup_objects 0 0
setup_timers 0 0
+socket_instances 0 0
+socket_summary_by_event_name 0 0
+socket_summary_by_instance 0 0
+table_io_waits_summary_by_index_usage 0 0
+table_io_waits_summary_by_table 0 0
+table_lock_waits_summary_by_table 0 0
threads 0 0
+users 0 0
select lower(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
lower(TABLE_NAME) INDEX_LENGTH DATA_FREE AUTO_INCREMENT
+accounts 0 0 NULL
cond_instances 0 0 NULL
+events_stages_current 0 0 NULL
+events_stages_history 0 0 NULL
+events_stages_history_long 0 0 NULL
+events_stages_summary_by_account_by_event_name 0 0 NULL
+events_stages_summary_by_host_by_event_name 0 0 NULL
+events_stages_summary_by_thread_by_event_name 0 0 NULL
+events_stages_summary_by_user_by_event_name 0 0 NULL
+events_stages_summary_global_by_event_name 0 0 NULL
+events_statements_current 0 0 NULL
+events_statements_history 0 0 NULL
+events_statements_history_long 0 0 NULL
+events_statements_summary_by_account_by_event_name 0 0 NULL
+events_statements_summary_by_digest 0 0 NULL
+events_statements_summary_by_host_by_event_name 0 0 NULL
+events_statements_summary_by_thread_by_event_name 0 0 NULL
+events_statements_summary_by_user_by_event_name 0 0 NULL
+events_statements_summary_global_by_event_name 0 0 NULL
events_waits_current 0 0 NULL
events_waits_history 0 0 NULL
events_waits_history_long 0 0 NULL
+events_waits_summary_by_account_by_event_name 0 0 NULL
+events_waits_summary_by_host_by_event_name 0 0 NULL
events_waits_summary_by_instance 0 0 NULL
events_waits_summary_by_thread_by_event_name 0 0 NULL
+events_waits_summary_by_user_by_event_name 0 0 NULL
events_waits_summary_global_by_event_name 0 0 NULL
file_instances 0 0 NULL
file_summary_by_event_name 0 0 NULL
file_summary_by_instance 0 0 NULL
+host_cache 0 0 NULL
+hosts 0 0 NULL
mutex_instances 0 0 NULL
+objects_summary_global_by_type 0 0 NULL
performance_timers 0 0 NULL
rwlock_instances 0 0 NULL
+setup_actors 0 0 NULL
setup_consumers 0 0 NULL
setup_instruments 0 0 NULL
+setup_objects 0 0 NULL
setup_timers 0 0 NULL
+socket_instances 0 0 NULL
+socket_summary_by_event_name 0 0 NULL
+socket_summary_by_instance 0 0 NULL
+table_io_waits_summary_by_index_usage 0 0 NULL
+table_io_waits_summary_by_table 0 0 NULL
+table_lock_waits_summary_by_table 0 0 NULL
threads 0 0 NULL
+users 0 0 NULL
select lower(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
lower(TABLE_NAME) CREATE_TIME UPDATE_TIME CHECK_TIME
+accounts NULL NULL NULL
cond_instances NULL NULL NULL
+events_stages_current NULL NULL NULL
+events_stages_history NULL NULL NULL
+events_stages_history_long NULL NULL NULL
+events_stages_summary_by_account_by_event_name NULL NULL NULL
+events_stages_summary_by_host_by_event_name NULL NULL NULL
+events_stages_summary_by_thread_by_event_name NULL NULL NULL
+events_stages_summary_by_user_by_event_name NULL NULL NULL
+events_stages_summary_global_by_event_name NULL NULL NULL
+events_statements_current NULL NULL NULL
+events_statements_history NULL NULL NULL
+events_statements_history_long NULL NULL NULL
+events_statements_summary_by_account_by_event_name NULL NULL NULL
+events_statements_summary_by_digest NULL NULL NULL
+events_statements_summary_by_host_by_event_name NULL NULL NULL
+events_statements_summary_by_thread_by_event_name NULL NULL NULL
+events_statements_summary_by_user_by_event_name NULL NULL NULL
+events_statements_summary_global_by_event_name NULL NULL NULL
events_waits_current NULL NULL NULL
events_waits_history NULL NULL NULL
events_waits_history_long NULL NULL NULL
+events_waits_summary_by_account_by_event_name NULL NULL NULL
+events_waits_summary_by_host_by_event_name NULL NULL NULL
events_waits_summary_by_instance NULL NULL NULL
events_waits_summary_by_thread_by_event_name NULL NULL NULL
+events_waits_summary_by_user_by_event_name NULL NULL NULL
events_waits_summary_global_by_event_name NULL NULL NULL
file_instances NULL NULL NULL
file_summary_by_event_name NULL NULL NULL
file_summary_by_instance NULL NULL NULL
+host_cache NULL NULL NULL
+hosts NULL NULL NULL
mutex_instances NULL NULL NULL
+objects_summary_global_by_type NULL NULL NULL
performance_timers NULL NULL NULL
rwlock_instances NULL NULL NULL
+setup_actors NULL NULL NULL
setup_consumers NULL NULL NULL
setup_instruments NULL NULL NULL
+setup_objects NULL NULL NULL
setup_timers NULL NULL NULL
+socket_instances NULL NULL NULL
+socket_summary_by_event_name NULL NULL NULL
+socket_summary_by_instance NULL NULL NULL
+table_io_waits_summary_by_index_usage NULL NULL NULL
+table_io_waits_summary_by_table NULL NULL NULL
+table_lock_waits_summary_by_table NULL NULL NULL
threads NULL NULL NULL
+users NULL NULL NULL
select lower(TABLE_NAME), TABLE_COLLATION, CHECKSUM
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
lower(TABLE_NAME) TABLE_COLLATION CHECKSUM
+accounts utf8_general_ci NULL
cond_instances utf8_general_ci NULL
+events_stages_current utf8_general_ci NULL
+events_stages_history utf8_general_ci NULL
+events_stages_history_long utf8_general_ci NULL
+events_stages_summary_by_account_by_event_name utf8_general_ci NULL
+events_stages_summary_by_host_by_event_name utf8_general_ci NULL
+events_stages_summary_by_thread_by_event_name utf8_general_ci NULL
+events_stages_summary_by_user_by_event_name utf8_general_ci NULL
+events_stages_summary_global_by_event_name utf8_general_ci NULL
+events_statements_current utf8_general_ci NULL
+events_statements_history utf8_general_ci NULL
+events_statements_history_long utf8_general_ci NULL
+events_statements_summary_by_account_by_event_name utf8_general_ci NULL
+events_statements_summary_by_digest utf8_general_ci NULL
+events_statements_summary_by_host_by_event_name utf8_general_ci NULL
+events_statements_summary_by_thread_by_event_name utf8_general_ci NULL
+events_statements_summary_by_user_by_event_name utf8_general_ci NULL
+events_statements_summary_global_by_event_name utf8_general_ci NULL
events_waits_current utf8_general_ci NULL
events_waits_history utf8_general_ci NULL
events_waits_history_long utf8_general_ci NULL
+events_waits_summary_by_account_by_event_name utf8_general_ci NULL
+events_waits_summary_by_host_by_event_name utf8_general_ci NULL
events_waits_summary_by_instance utf8_general_ci NULL
events_waits_summary_by_thread_by_event_name utf8_general_ci NULL
+events_waits_summary_by_user_by_event_name utf8_general_ci NULL
events_waits_summary_global_by_event_name utf8_general_ci NULL
file_instances utf8_general_ci NULL
file_summary_by_event_name utf8_general_ci NULL
file_summary_by_instance utf8_general_ci NULL
+host_cache utf8_general_ci NULL
+hosts utf8_general_ci NULL
mutex_instances utf8_general_ci NULL
+objects_summary_global_by_type utf8_general_ci NULL
performance_timers utf8_general_ci NULL
rwlock_instances utf8_general_ci NULL
+setup_actors utf8_general_ci NULL
setup_consumers utf8_general_ci NULL
setup_instruments utf8_general_ci NULL
+setup_objects utf8_general_ci NULL
setup_timers utf8_general_ci NULL
+socket_instances utf8_general_ci NULL
+socket_summary_by_event_name utf8_general_ci NULL
+socket_summary_by_instance utf8_general_ci NULL
+table_io_waits_summary_by_index_usage utf8_general_ci NULL
+table_io_waits_summary_by_table utf8_general_ci NULL
+table_lock_waits_summary_by_table utf8_general_ci NULL
threads utf8_general_ci NULL
+users utf8_general_ci NULL
select lower(TABLE_NAME), TABLE_COMMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
lower(TABLE_NAME) TABLE_COMMENT
+accounts
cond_instances
+events_stages_current
+events_stages_history
+events_stages_history_long
+events_stages_summary_by_account_by_event_name
+events_stages_summary_by_host_by_event_name
+events_stages_summary_by_thread_by_event_name
+events_stages_summary_by_user_by_event_name
+events_stages_summary_global_by_event_name
+events_statements_current
+events_statements_history
+events_statements_history_long
+events_statements_summary_by_account_by_event_name
+events_statements_summary_by_digest
+events_statements_summary_by_host_by_event_name
+events_statements_summary_by_thread_by_event_name
+events_statements_summary_by_user_by_event_name
+events_statements_summary_global_by_event_name
events_waits_current
events_waits_history
events_waits_history_long
+events_waits_summary_by_account_by_event_name
+events_waits_summary_by_host_by_event_name
events_waits_summary_by_instance
events_waits_summary_by_thread_by_event_name
+events_waits_summary_by_user_by_event_name
events_waits_summary_global_by_event_name
file_instances
file_summary_by_event_name
file_summary_by_instance
+host_cache
+hosts
mutex_instances
+objects_summary_global_by_type
performance_timers
rwlock_instances
+setup_actors
setup_consumers
setup_instruments
+setup_objects
setup_timers
+socket_instances
+socket_summary_by_event_name
+socket_summary_by_instance
+table_io_waits_summary_by_index_usage
+table_io_waits_summary_by_table
+table_lock_waits_summary_by_table
threads
+users
diff --git a/mysql-test/suite/perfschema/r/innodb_table_io.result b/mysql-test/suite/perfschema/r/innodb_table_io.result
new file mode 100644
index 00000000000..d6dd7e3b122
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/innodb_table_io.result
@@ -0,0 +1,149 @@
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+drop table if exists test.no_index_tab;
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+create table test.no_index_tab
+( a varchar(255) not null, b int not null) engine = InnoDB;
+insert into marker set a = 1;
+show create table test.no_index_tab;
+Table Create Table
+no_index_tab CREATE TABLE `no_index_tab` (
+ `a` varchar(255) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 1;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 2;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+foo 1
+foo 2
+foo 3
+insert into marker set a = 1;
+update test.no_index_tab set a = 'bar';
+insert into marker set a = 1;
+select * from test.no_index_tab limit 2;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+delete from test.no_index_tab where b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+optimize table test.no_index_tab;
+Table Op Msg_type Msg_text
+test.no_index_tab optimize note Table does not support optimize, doing recreate + analyze instead
+test.no_index_tab optimize status OK
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+truncate table test.no_index_tab;
+insert into marker set a = 1;
+drop table test.no_index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ("test")
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/memory_table_io.result b/mysql-test/suite/perfschema/r/memory_table_io.result
new file mode 100644
index 00000000000..8d314d52ec3
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/memory_table_io.result
@@ -0,0 +1,147 @@
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+drop table if exists test.no_index_tab;
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+create table test.no_index_tab
+( a varchar(255) not null, b int not null) engine = MEMORY;
+insert into marker set a = 1;
+show create table test.no_index_tab;
+Table Create Table
+no_index_tab CREATE TABLE `no_index_tab` (
+ `a` varchar(255) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 1;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 2;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+foo 1
+foo 2
+foo 3
+insert into marker set a = 1;
+update test.no_index_tab set a = 'bar';
+insert into marker set a = 1;
+select * from test.no_index_tab limit 2;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+delete from test.no_index_tab where b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+optimize table test.no_index_tab;
+Table Op Msg_type Msg_text
+test.no_index_tab optimize note The storage engine for the table doesn't support optimize
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+truncate table test.no_index_tab;
+insert into marker set a = 1;
+drop table test.no_index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ("test")
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/merge_table_io.result b/mysql-test/suite/perfschema/r/merge_table_io.result
new file mode 100644
index 00000000000..8d93d3798a4
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/merge_table_io.result
@@ -0,0 +1,177 @@
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+drop table if exists test.no_index_tab;
+drop table if exists test.no_index_tab_1;
+drop table if exists test.no_index_tab_2;
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+create table test.no_index_tab_1
+( a varchar(255) not null, b int not null) engine = MyISAM;
+insert into marker set a = 1;
+create table test.no_index_tab_2 like test.no_index_tab_1;
+insert into marker set a = 1;
+create table test.no_index_tab
+( a varchar(255) not null, b int not null) engine = merge
+union = (test.no_index_tab_1,test.no_index_tab_2) insert_method = first;
+insert into marker set a = 1;
+show create table test.no_index_tab_1;
+Table Create Table
+no_index_tab_1 CREATE TABLE `no_index_tab_1` (
+ `a` varchar(255) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into marker set a = 1;
+show create table test.no_index_tab_2;
+Table Create Table
+no_index_tab_2 CREATE TABLE `no_index_tab_2` (
+ `a` varchar(255) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into marker set a = 1;
+show create table test.no_index_tab;
+Table Create Table
+no_index_tab CREATE TABLE `no_index_tab` (
+ `a` varchar(255) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST UNION=(`no_index_tab_1`,`no_index_tab_2`)
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 1;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 2;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+foo 1
+foo 2
+foo 3
+insert into marker set a = 1;
+update test.no_index_tab set a = 'bar';
+insert into marker set a = 1;
+select * from test.no_index_tab limit 2;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+delete from test.no_index_tab where b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+optimize table test.no_index_tab;
+Table Op Msg_type Msg_text
+test.no_index_tab optimize note The storage engine for the table doesn't support optimize
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+truncate table test.no_index_tab;
+insert into marker set a = 1;
+drop table test.no_index_tab_1;
+insert into marker set a = 1;
+drop table test.no_index_tab_2;
+insert into marker set a = 1;
+drop table test.no_index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ("test")
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result
index 1dbde982328..2481367950b 100644
--- a/mysql-test/suite/perfschema/r/misc.result
+++ b/mysql-test/suite/perfschema/r/misc.result
@@ -1,3 +1,39 @@
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema='test';
+object_schema object_name
+CREATE TABLE test.t_before(a INT);
+INSERT INTO test.t_before VALUES (1);
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema='test';
+object_schema object_name
+test t_before
+RENAME TABLE test.t_before TO test.t_after;
+SELECT COUNT(*) FROM test.t_after;
+COUNT(*)
+1
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema='test';
+object_schema object_name
+test t_after
+DROP TABLE test.t_after;
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema='test';
+object_schema object_name
+CREATE TABLE test.t1(a INT);
+INSERT INTO test.t1 VALUES (1);
+CREATE VIEW test.v1 AS SELECT * FROM test.t1;
+SELECT COUNT(*) FROM test.v1;
+COUNT(*)
+1
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema='test';
+object_schema object_name
+test t1
+DROP VIEW test.v1;
+DROP TABLE test.t1;
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema='test';
+object_schema object_name
SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE THREAD_ID IN
(SELECT THREAD_ID FROM performance_schema.threads)
@@ -6,11 +42,20 @@ AND EVENT_NAME IN
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
create table test.t1(a int) engine=performance_schema;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema='test';
+object_schema object_name
create table test.t1 like performance_schema.events_waits_current;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema='test';
+object_schema object_name
create table performance_schema.t1(a int);
ERROR 42000: CREATE command denied to user 'root'@'localhost' for table 't1'
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema='test';
+object_schema object_name
drop table if exists test.ghost;
create table test.ghost (a int, b int);
alter table test.ghost add index index_a(a);
@@ -27,3 +72,23 @@ where file_name like "%ghost%";
FILE_NAME EVENT_NAME OPEN_COUNT
select * from performance_schema.no_such_table;
ERROR 42S02: Table 'performance_schema.no_such_table' doesn't exist
+DROP TABLE IF EXISTS t_60905;
+CREATE TABLE t_60905 (i INT, j INT, KEY(i)) ENGINE = InnoDB;
+INSERT INTO t_60905 VALUES
+(1,2), (3,4), (5,6), (7,8), (9,10);
+DELETE FROM t_60905 WHERE i = 1;
+DELETE FROM t_60905 WHERE j = 8;
+SELECT object_schema,
+object_name,
+index_name,
+count_fetch,
+count_insert,
+count_update,
+count_delete
+FROM performance_schema.table_io_waits_summary_by_index_usage
+WHERE object_schema = 'test'
+ AND object_name = 't_60905';
+object_schema object_name index_name count_fetch count_insert count_update count_delete
+test t_60905 i 2 0 0 1
+test t_60905 NULL 5 5 0 1
+DROP TABLE t_60905;
diff --git a/mysql-test/suite/perfschema/r/multi_table_io.result b/mysql-test/suite/perfschema/r/multi_table_io.result
new file mode 100644
index 00000000000..b72cc6b164f
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/multi_table_io.result
@@ -0,0 +1,108 @@
+drop schema if exists test1;
+drop table if exists test.t1;
+create schema test1;
+create table test.t1 (col1 bigint, col2 varchar(30)) engine = myisam;
+insert into test.t1 values(1,'One');
+create table test1.t2 like test.t1;
+show create table test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` bigint(20) DEFAULT NULL,
+ `col2` varchar(30) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create table test1.t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `col1` bigint(20) DEFAULT NULL,
+ `col2` varchar(30) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+update performance_schema.setup_consumers set enabled = 'YES';
+insert into test1.t2 select * from test.t1;
+insert into marker set a = 1;
+select * from test.t1 natural join test1.t2;
+col1 col2
+1 One
+insert into marker set a = 1;
+select * from test.t1 where col2 = (select col2 from test1.t2 where test.t1.col1 = test1.t2.col1);
+col1 col2
+1 One
+insert into marker set a = 1;
+update test.t1 AS a natural join test1.t2 AS b SET a.col2 = 'updated' , b.col2 = 'updated';
+insert into marker set a = 1;
+delete from test.t1, test1.t2 using test.t1 inner join test1.t2
+where test.t1.col1 = test1.t2.col1;
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ('test','test1')
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test1 t2 insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test1 t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test1 t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test1 t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test1 t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test1 t2 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test1 t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test1 t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test1 t2 delete NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+drop table test.t1;
+drop schema test1;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/myisam_file_io.result b/mysql-test/suite/perfschema/r/myisam_file_io.result
index 5cdcf6ac789..1014abee53b 100644
--- a/mysql-test/suite/perfschema/r/myisam_file_io.result
+++ b/mysql-test/suite/perfschema/r/myisam_file_io.result
@@ -43,19 +43,27 @@ wait/io/file/myisam/dfile mi_dynrec.c: write 20 no_index_tab.MYD
wait/io/file/myisam/kfile mi_open.c: write 124 no_index_tab.MYI
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_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
update performance_schema.setup_instruments set enabled='YES';
drop table test.no_index_tab;
diff --git a/mysql-test/suite/perfschema/r/myisam_table_io.result b/mysql-test/suite/perfschema/r/myisam_table_io.result
new file mode 100644
index 00000000000..517252a9dd6
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/myisam_table_io.result
@@ -0,0 +1,145 @@
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+drop table if exists test.no_index_tab;
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+create table test.no_index_tab
+( a varchar(255) not null, b int not null) engine = MyISAM;
+insert into marker set a = 1;
+show create table test.no_index_tab;
+Table Create Table
+no_index_tab CREATE TABLE `no_index_tab` (
+ `a` varchar(255) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 1;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 2;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+foo 1
+foo 2
+foo 3
+insert into marker set a = 1;
+update test.no_index_tab set a = 'bar';
+insert into marker set a = 1;
+select * from test.no_index_tab limit 2;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+delete from test.no_index_tab where b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+optimize table test.no_index_tab;
+Table Op Msg_type Msg_text
+test.no_index_tab optimize status OK
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+truncate table test.no_index_tab;
+insert into marker set a = 1;
+drop table test.no_index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ("test")
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/nesting.result b/mysql-test/suite/perfschema/r/nesting.result
new file mode 100644
index 00000000000..33bdbd7036c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/nesting.result
@@ -0,0 +1,233 @@
+"================== con1 connected =================="
+select "MARKER_BEGIN" as marker;
+marker
+MARKER_BEGIN
+select "This is simple statement one" as payload;
+payload
+This is simple statement one
+select "This is simple statement two" as payload;
+payload
+This is simple statement two
+select "This is the first part of a multi query" as payload;
+select "And this is the second part of a multi query" as payload;
+select "With a third part to make things complete" as payload;
+$$
+payload
+This is the first part of a multi query
+payload
+And this is the second part of a multi query
+payload
+With a third part to make things complete
+select "MARKER_END" as marker;
+marker
+MARKER_END
+select "Con1 is done with payload" as status;
+status
+Con1 is done with payload
+"================== con1 done =================="
+set @con1_tid = (select thread_id from performance_schema.threads
+where processlist_user = 'user1');
+select (@con1_tid is not null) as expected;
+expected
+1
+set @marker_begin = (select event_id from performance_schema.events_statements_history_long
+where sql_text like "%MARKER_BEGIN%" and thread_id = @con1_tid);
+select (@marker_begin is not null) as expected;
+expected
+1
+set @marker_end = (select end_event_id from performance_schema.events_statements_history_long
+where sql_text like "%MARKER_END%" and thread_id = @con1_tid);
+select (@marker_end is not null) as expected;
+expected
+1
+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_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
+select * from (
+(
+select (event_id - @marker_begin) as relative_event_id,
+(end_event_id - @marker_begin) as relative_end_event_id,
+event_name,
+sql_text as comment,
+nesting_event_type,
+(nesting_event_id - @marker_begin) as relative_nesting_event_id
+from performance_schema.events_statements_history_long
+where (thread_id = @con1_tid)
+and (@marker_begin <= event_id)
+and (end_event_id <= @marker_end)
+)
+union
+(
+select (event_id - @marker_begin) as relative_event_id,
+(end_event_id - @marker_begin) as relative_end_event_id,
+event_name,
+"(stage)" as comment,
+nesting_event_type,
+(nesting_event_id - @marker_begin) as relative_nesting_event_id
+from performance_schema.events_stages_history_long
+where (thread_id = @con1_tid)
+and (@marker_begin <= event_id)
+and (end_event_id <= @marker_end)
+)
+union
+(
+select (event_id - @marker_begin) as relative_event_id,
+(end_event_id - @marker_begin) as relative_end_event_id,
+event_name,
+operation as comment,
+nesting_event_type,
+(nesting_event_id - @marker_begin) as relative_nesting_event_id
+from performance_schema.events_waits_history_long
+where (thread_id = @con1_tid)
+and (@marker_begin <= event_id)
+and (end_event_id <= @marker_end)
+)
+) all_events
+order by relative_event_id asc;
+relative_event_id relative_end_event_id event_name comment nesting_event_type relative_nesting_event_id
+0 17 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL
+1 5 stage/sql/init (stage) STATEMENT 0
+2 2 wait/io/socket/sql/client_connection recv STAGE 1
+3 3 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 1
+4 4 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 1
+5 5 wait/io/file/sql/query_log write STAGE 1
+6 6 stage/sql/checking permissions (stage) STATEMENT 0
+7 7 stage/sql/Opening tables (stage) STATEMENT 0
+8 8 stage/sql/init (stage) STATEMENT 0
+9 9 stage/sql/optimizing (stage) STATEMENT 0
+10 10 stage/sql/executing (stage) STATEMENT 0
+11 11 stage/sql/end (stage) STATEMENT 0
+12 12 stage/sql/query end (stage) STATEMENT 0
+13 13 stage/sql/closing tables (stage) STATEMENT 0
+14 15 stage/sql/freeing items (stage) STATEMENT 0
+15 15 wait/io/socket/sql/client_connection send STAGE 14
+16 17 stage/sql/cleaning up (stage) STATEMENT 0
+17 17 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 16
+18 18 idle idle NULL NULL
+19 36 statement/sql/select select "This is simple statement one" as payload NULL NULL
+20 24 stage/sql/init (stage) STATEMENT 19
+21 21 wait/io/socket/sql/client_connection recv STAGE 20
+22 22 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 20
+23 23 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 20
+24 24 wait/io/file/sql/query_log write STAGE 20
+25 25 stage/sql/checking permissions (stage) STATEMENT 19
+26 26 stage/sql/Opening tables (stage) STATEMENT 19
+27 27 stage/sql/init (stage) STATEMENT 19
+28 28 stage/sql/optimizing (stage) STATEMENT 19
+29 29 stage/sql/executing (stage) STATEMENT 19
+30 30 stage/sql/end (stage) STATEMENT 19
+31 31 stage/sql/query end (stage) STATEMENT 19
+32 32 stage/sql/closing tables (stage) STATEMENT 19
+33 34 stage/sql/freeing items (stage) STATEMENT 19
+34 34 wait/io/socket/sql/client_connection send STAGE 33
+35 36 stage/sql/cleaning up (stage) STATEMENT 19
+36 36 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 35
+37 37 idle idle NULL NULL
+38 55 statement/sql/select select "This is simple statement two" as payload NULL NULL
+39 43 stage/sql/init (stage) STATEMENT 38
+40 40 wait/io/socket/sql/client_connection recv STAGE 39
+41 41 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 39
+42 42 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 39
+43 43 wait/io/file/sql/query_log write STAGE 39
+44 44 stage/sql/checking permissions (stage) STATEMENT 38
+45 45 stage/sql/Opening tables (stage) STATEMENT 38
+46 46 stage/sql/init (stage) STATEMENT 38
+47 47 stage/sql/optimizing (stage) STATEMENT 38
+48 48 stage/sql/executing (stage) STATEMENT 38
+49 49 stage/sql/end (stage) STATEMENT 38
+50 50 stage/sql/query end (stage) STATEMENT 38
+51 51 stage/sql/closing tables (stage) STATEMENT 38
+52 53 stage/sql/freeing items (stage) STATEMENT 38
+53 53 wait/io/socket/sql/client_connection send STAGE 52
+54 55 stage/sql/cleaning up (stage) STATEMENT 38
+55 55 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 54
+56 56 idle idle NULL NULL
+57 72 statement/sql/select select "This is the first part of a multi query" as payload;
+select "And this is the second part of a multi query" as payload;
+select "With a third part to make things complete" as payload NULL NULL
+58 62 stage/sql/init (stage) STATEMENT 57
+59 59 wait/io/socket/sql/client_connection recv STAGE 58
+60 60 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 58
+61 61 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 58
+62 62 wait/io/file/sql/query_log write STAGE 58
+63 63 stage/sql/checking permissions (stage) STATEMENT 57
+64 64 stage/sql/Opening tables (stage) STATEMENT 57
+65 65 stage/sql/init (stage) STATEMENT 57
+66 66 stage/sql/optimizing (stage) STATEMENT 57
+67 67 stage/sql/executing (stage) STATEMENT 57
+68 68 stage/sql/end (stage) STATEMENT 57
+69 69 stage/sql/query end (stage) STATEMENT 57
+70 70 stage/sql/closing tables (stage) STATEMENT 57
+71 72 stage/sql/freeing items (stage) STATEMENT 57
+72 72 wait/io/socket/sql/client_connection send STAGE 71
+73 86 statement/sql/select select "And this is the second part of a multi query" as payload;
+select "With a third part to make things complete" as payload NULL NULL
+74 76 stage/sql/init (stage) STATEMENT 73
+75 75 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 74
+76 76 wait/io/file/sql/query_log write STAGE 74
+77 77 stage/sql/checking permissions (stage) STATEMENT 73
+78 78 stage/sql/Opening tables (stage) STATEMENT 73
+79 79 stage/sql/init (stage) STATEMENT 73
+80 80 stage/sql/optimizing (stage) STATEMENT 73
+81 81 stage/sql/executing (stage) STATEMENT 73
+82 82 stage/sql/end (stage) STATEMENT 73
+83 83 stage/sql/query end (stage) STATEMENT 73
+84 84 stage/sql/closing tables (stage) STATEMENT 73
+85 86 stage/sql/freeing items (stage) STATEMENT 73
+86 86 wait/io/socket/sql/client_connection send STAGE 85
+87 102 statement/sql/select select "With a third part to make things complete" as payload NULL NULL
+88 90 stage/sql/init (stage) STATEMENT 87
+89 89 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 88
+90 90 wait/io/file/sql/query_log write STAGE 88
+91 91 stage/sql/checking permissions (stage) STATEMENT 87
+92 92 stage/sql/Opening tables (stage) STATEMENT 87
+93 93 stage/sql/init (stage) STATEMENT 87
+94 94 stage/sql/optimizing (stage) STATEMENT 87
+95 95 stage/sql/executing (stage) STATEMENT 87
+96 96 stage/sql/end (stage) STATEMENT 87
+97 97 stage/sql/query end (stage) STATEMENT 87
+98 98 stage/sql/closing tables (stage) STATEMENT 87
+99 100 stage/sql/freeing items (stage) STATEMENT 87
+100 100 wait/io/socket/sql/client_connection send STAGE 99
+101 102 stage/sql/cleaning up (stage) STATEMENT 87
+102 102 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 101
+103 103 idle idle NULL NULL
+104 121 statement/sql/select select "MARKER_END" as marker NULL NULL
+105 109 stage/sql/init (stage) STATEMENT 104
+106 106 wait/io/socket/sql/client_connection recv STAGE 105
+107 107 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 105
+108 108 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 105
+109 109 wait/io/file/sql/query_log write STAGE 105
+110 110 stage/sql/checking permissions (stage) STATEMENT 104
+111 111 stage/sql/Opening tables (stage) STATEMENT 104
+112 112 stage/sql/init (stage) STATEMENT 104
+113 113 stage/sql/optimizing (stage) STATEMENT 104
+114 114 stage/sql/executing (stage) STATEMENT 104
+115 115 stage/sql/end (stage) STATEMENT 104
+116 116 stage/sql/query end (stage) STATEMENT 104
+117 117 stage/sql/closing tables (stage) STATEMENT 104
+118 119 stage/sql/freeing items (stage) STATEMENT 104
+119 119 wait/io/socket/sql/client_connection send STAGE 118
+120 121 stage/sql/cleaning up (stage) STATEMENT 104
+121 121 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 120
diff --git a/mysql-test/suite/perfschema/r/no_threads.result b/mysql-test/suite/perfschema/r/no_threads.result
index 89ae72c8df1..f78667f4f01 100644
--- a/mysql-test/suite/perfschema/r/no_threads.result
+++ b/mysql-test/suite/perfschema/r/no_threads.result
@@ -40,4 +40,5 @@ left(source, locate(":", source)) as short_source
from performance_schema.events_waits_history_long;
event_name operation short_source
wait/synch/mutex/mysys/THR_LOCK_myisam lock mi_create.c:
+update performance_schema.setup_instruments set enabled='YES';
drop table test.t1;
diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result
new file mode 100644
index 00000000000..72b1f35a8e6
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ortho_iter.result
@@ -0,0 +1,745 @@
+drop procedure if exists check_instrument;
+create procedure check_instrument(in instr_name varchar(128))
+begin
+declare count_expected integer;
+declare count_actual integer;
+declare is_wait integer;
+declare is_stage integer;
+declare is_statement integer;
+declare is_wait_table integer;
+declare is_stage_table integer;
+declare is_statement_table integer;
+declare pfs_table_name varchar(64);
+declare msg varchar(512);
+declare msg_detail varchar(512);
+declare cmd_1 varchar(512);
+declare cmd_2 varchar(512);
+declare done integer default 0;
+declare debug integer default 0;
+declare pfs_cursor CURSOR FOR
+select table_name from information_schema.tables
+where table_schema= 'performance_schema'
+ and table_name like "events_%_by_event_name%";
+declare continue handler for sqlstate '02000'
+ set done = 1;
+select (instr_name like "wait/%") or (instr_name like "idle/%") into is_wait;
+select (instr_name like "stage/%") into is_stage;
+select (instr_name like "statement/%") into is_statement;
+select instr_name, is_wait, is_stage, is_statement;
+select count(name)
+from performance_schema.setup_instruments
+where name like (concat(instr_name, "%"))
+into count_expected;
+set cmd_1= "select count(*) from (select distinct event_name from performance_schema.";
+set cmd_2= concat(" where event_name like \"",
+ instr_name,
+ "%\") t into @count_actual");
+open pfs_cursor;
+repeat
+fetch pfs_cursor into pfs_table_name;
+if not done then
+select (pfs_table_name like "%waits%") into is_wait_table;
+select (pfs_table_name like "%stages%") into is_stage_table;
+select (pfs_table_name like "%statements%") into is_statement_table;
+select concat("Checking table ", pfs_table_name, " ...") as status;
+select concat(cmd_1, pfs_table_name, cmd_2) into @cmd;
+if debug = 1
+then
+select @cmd;
+end if;
+prepare stmt from @cmd;
+execute stmt;
+drop prepare stmt;
+set msg_detail= concat("table ", pfs_table_name,
+", instruments ", count_expected,
+", found ", @count_actual);
+if is_wait = 1 and is_wait_table = 1 and @count_actual <> count_expected
+then
+set msg= concat("Missing wait events: ", msg_detail);
+signal sqlstate '05000' set message_text= msg;
+end if;
+if is_wait = 1 and is_wait_table = 0 and @count_actual <> 0
+then
+set msg= concat("Unexpected wait events: ", msg_detail);
+signal sqlstate '05000' set message_text= msg;
+end if;
+if is_stage = 1 and is_stage_table = 1 and @count_actual <> count_expected
+then
+set msg= concat("Missing stage events: ", msg_detail);
+signal sqlstate '05000' set message_text= msg;
+end if;
+if is_stage = 1 and is_stage_table = 0 and @count_actual <> 0
+then
+set msg= concat("Unexpected stage events: ", msg_detail);
+signal sqlstate '05000' set message_text= msg;
+end if;
+if is_statement = 1 and is_statement_table = 1 and @count_actual <> count_expected
+then
+set msg= concat("Missing statement events: ", msg_detail);
+signal sqlstate '05000' set message_text= msg;
+end if;
+if is_statement = 1 and is_statement_table = 0 and @count_actual <> 0
+then
+set msg= concat("Unexpected statement events: ", msg_detail);
+signal sqlstate '05000' set message_text= msg;
+end if;
+end if;
+until done
+end repeat;
+close pfs_cursor;
+-- Dont want to return a 02000 NOT FOUND, there should be a better way
+signal sqlstate '01000' set message_text='Done', mysql_errno=12000;
+end
+$
+show variables like "performance_schema%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("wait/synch/rwlock/");
+instr_name is_wait is_stage is_statement
+wait/synch/rwlock/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("wait/synch/cond/");
+instr_name is_wait is_stage is_statement
+wait/synch/cond/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("wait/synch/");
+instr_name is_wait is_stage is_statement
+wait/synch/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("wait/io/file/");
+instr_name is_wait is_stage is_statement
+wait/io/file/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("wait/io/net/");
+instr_name is_wait is_stage is_statement
+wait/io/net/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("wait/io/table/");
+instr_name is_wait is_stage is_statement
+wait/io/table/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("wait/io/");
+instr_name is_wait is_stage is_statement
+wait/io/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("wait/lock/table/");
+instr_name is_wait is_stage is_statement
+wait/lock/table/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("wait/lock/");
+instr_name is_wait is_stage is_statement
+wait/lock/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("wait/");
+instr_name is_wait is_stage is_statement
+wait/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("stage/");
+instr_name is_wait is_stage is_statement
+stage/ 0 1 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("statement/com/");
+instr_name is_wait is_stage is_statement
+statement/com/ 0 0 1
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("statement/sql/");
+instr_name is_wait is_stage is_statement
+statement/sql/ 0 0 1
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("statement/");
+instr_name is_wait is_stage is_statement
+statement/ 0 0 1
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("idle/io/socket");
+instr_name is_wait is_stage is_statement
+idle/io/socket 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+call check_instrument("idle/");
+instr_name is_wait is_stage is_statement
+idle/ 1 0 0
+status
+Checking table events_stages_summary_by_account_by_event_name ...
+status
+Checking table events_stages_summary_by_host_by_event_name ...
+status
+Checking table events_stages_summary_by_thread_by_event_name ...
+status
+Checking table events_stages_summary_by_user_by_event_name ...
+status
+Checking table events_stages_summary_global_by_event_name ...
+status
+Checking table events_statements_summary_by_account_by_event_name ...
+status
+Checking table events_statements_summary_by_host_by_event_name ...
+status
+Checking table events_statements_summary_by_thread_by_event_name ...
+status
+Checking table events_statements_summary_by_user_by_event_name ...
+status
+Checking table events_statements_summary_global_by_event_name ...
+status
+Checking table events_waits_summary_by_account_by_event_name ...
+status
+Checking table events_waits_summary_by_host_by_event_name ...
+status
+Checking table events_waits_summary_by_thread_by_event_name ...
+status
+Checking table events_waits_summary_by_user_by_event_name ...
+status
+Checking table events_waits_summary_global_by_event_name ...
+Warnings:
+Warning 12000 Done
+drop procedure check_instrument;
diff --git a/mysql-test/suite/perfschema/r/part_table_io.result b/mysql-test/suite/perfschema/r/part_table_io.result
new file mode 100644
index 00000000000..1fa91e82ae0
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/part_table_io.result
@@ -0,0 +1,177 @@
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+drop table if exists test.no_index_tab;
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+create table test.no_index_tab
+( a varchar(255) not null, b int not null) engine = MyISAM
+PARTITION BY KEY (b) PARTITIONS 2;
+insert into marker set a = 1;
+show create table test.no_index_tab;
+Table Create Table
+no_index_tab CREATE TABLE `no_index_tab` (
+ `a` varchar(255) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (b)
+PARTITIONS 2 */
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 1;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 2;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+foo 1
+foo 3
+foo 2
+insert into marker set a = 1;
+update test.no_index_tab set a = 'bar';
+insert into marker set a = 1;
+select * from test.no_index_tab limit 2;
+a b
+bar 1
+bar 3
+insert into marker set a = 1;
+delete from test.no_index_tab where b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+optimize table test.no_index_tab;
+Table Op Msg_type Msg_text
+test.no_index_tab optimize status OK
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+truncate table test.no_index_tab;
+insert into marker set a = 1;
+drop table test.no_index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ("test")
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade.result b/mysql-test/suite/perfschema/r/pfs_upgrade.result
index 4d7d9e28fe8..eff1d0d48a0 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result
@@ -8,24 +8,59 @@ use performance_schema;
show tables like "user_table";
Tables_in_performance_schema (user_table)
user_table
-ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 478: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1126: Unexpected content found in the performance_schema database.
+Warning: Using a password on the command line interface can be insecure.
+Warning: Using a password on the command line interface can be insecure.
+ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 291: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 322: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 429: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 438: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 452: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 462: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 472: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 481: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 489: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 498: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 509: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 517: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 562: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 606: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 685: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 705: Table 'threads' already exists
+ERROR 1050 (42S01) at line 721: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 737: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 753: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 766: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 779: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 792: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 806: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 818: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 864: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 910: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 956: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 988: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1020: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1052: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1085: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1116: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1125: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1134: Table 'users' already exists
+ERROR 1050 (42S01) at line 1144: Table 'accounts' already exists
+ERROR 1050 (42S01) at line 1178: Table 'events_statements_summary_by_digest' already exists
+ERROR 1644 (HY000) at line 1598: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
show tables like "user_table";
Tables_in_performance_schema (user_table)
@@ -38,24 +73,59 @@ use performance_schema;
show tables like "user_view";
Tables_in_performance_schema (user_view)
user_view
-ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 478: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1126: Unexpected content found in the performance_schema database.
+Warning: Using a password on the command line interface can be insecure.
+Warning: Using a password on the command line interface can be insecure.
+ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 291: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 322: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 429: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 438: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 452: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 462: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 472: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 481: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 489: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 498: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 509: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 517: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 562: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 606: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 685: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 705: Table 'threads' already exists
+ERROR 1050 (42S01) at line 721: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 737: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 753: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 766: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 779: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 792: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 806: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 818: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 864: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 910: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 956: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 988: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1020: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1052: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1085: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1116: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1125: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1134: Table 'users' already exists
+ERROR 1050 (42S01) at line 1144: Table 'accounts' already exists
+ERROR 1050 (42S01) at line 1178: Table 'events_statements_summary_by_digest' already exists
+ERROR 1644 (HY000) at line 1598: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
show tables like "user_view";
Tables_in_performance_schema (user_view)
@@ -66,24 +136,59 @@ drop view test.user_view;
create procedure test.user_proc()
select "Not supposed to be here";
update mysql.proc set db='performance_schema' where name='user_proc';
-ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 478: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1126: Unexpected content found in the performance_schema database.
+Warning: Using a password on the command line interface can be insecure.
+Warning: Using a password on the command line interface can be insecure.
+ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 291: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 322: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 429: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 438: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 452: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 462: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 472: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 481: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 489: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 498: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 509: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 517: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 562: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 606: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 685: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 705: Table 'threads' already exists
+ERROR 1050 (42S01) at line 721: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 737: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 753: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 766: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 779: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 792: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 806: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 818: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 864: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 910: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 956: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 988: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1020: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1052: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1085: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1116: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1125: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1134: Table 'users' already exists
+ERROR 1050 (42S01) at line 1144: Table 'accounts' already exists
+ERROR 1050 (42S01) at line 1178: Table 'events_statements_summary_by_digest' already exists
+ERROR 1644 (HY000) at line 1598: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
@@ -94,24 +199,59 @@ drop procedure test.user_proc;
create function test.user_func() returns integer
return 0;
update mysql.proc set db='performance_schema' where name='user_func';
-ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 478: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1126: Unexpected content found in the performance_schema database.
+Warning: Using a password on the command line interface can be insecure.
+Warning: Using a password on the command line interface can be insecure.
+ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 291: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 322: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 429: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 438: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 452: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 462: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 472: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 481: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 489: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 498: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 509: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 517: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 562: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 606: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 685: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 705: Table 'threads' already exists
+ERROR 1050 (42S01) at line 721: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 737: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 753: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 766: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 779: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 792: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 806: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 818: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 864: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 910: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 956: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 988: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1020: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1052: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1085: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1116: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1125: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1134: Table 'users' already exists
+ERROR 1050 (42S01) at line 1144: Table 'accounts' already exists
+ERROR 1050 (42S01) at line 1178: Table 'events_statements_summary_by_digest' already exists
+ERROR 1644 (HY000) at line 1598: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
@@ -122,24 +262,59 @@ drop function test.user_func;
create event test.user_event on schedule every 1 day do
select "not supposed to be here";
update mysql.event set db='performance_schema' where name='user_event';
-ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 478: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1126: Unexpected content found in the performance_schema database.
+Warning: Using a password on the command line interface can be insecure.
+Warning: Using a password on the command line interface can be insecure.
+ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 291: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 322: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 429: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 438: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 452: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 462: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 472: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 481: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 489: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 498: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 509: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 517: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 562: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 606: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 685: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 705: Table 'threads' already exists
+ERROR 1050 (42S01) at line 721: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 737: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 753: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 766: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 779: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 792: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 806: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 818: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 864: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 910: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 956: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 988: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1020: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1052: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1085: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1116: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1125: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1134: Table 'users' already exists
+ERROR 1050 (42S01) at line 1144: Table 'accounts' already exists
+ERROR 1050 (42S01) at line 1178: Table 'events_statements_summary_by_digest' already exists
+ERROR 1644 (HY000) at line 1598: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
select name from mysql.event where db='performance_schema';
name
diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result
index 019d8964523..18c9a8b86f9 100644
--- a/mysql-test/suite/perfschema/r/privilege.result
+++ b/mysql-test/suite/perfschema/r/privilege.result
@@ -53,9 +53,9 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_
grant TRIGGER on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
grant INSERT on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
-ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'setup_instruments'
+ERROR 42000: INSERT, GRANT command denied to user 'root'@'localhost' for table 'setup_instruments'
grant DELETE on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
-ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'setup_instruments'
+ERROR 42000: DELETE, GRANT command denied to user 'root'@'localhost' for table 'setup_instruments'
grant SELECT on performance_schema.setup_instruments to 'pfs_user_3'@localhost
with GRANT OPTION;
grant UPDATE on performance_schema.setup_instruments to 'pfs_user_3'@localhost
@@ -78,11 +78,11 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_
grant TRIGGER on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
grant INSERT on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
-ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'events_waits_current'
+ERROR 42000: INSERT, GRANT command denied to user 'root'@'localhost' for table 'events_waits_current'
grant UPDATE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
-ERROR 42000: UPDATE,GRANT command denied to user 'root'@'localhost' for table 'events_waits_current'
+ERROR 42000: UPDATE, GRANT command denied to user 'root'@'localhost' for table 'events_waits_current'
grant DELETE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
-ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'events_waits_current'
+ERROR 42000: DELETE, GRANT command denied to user 'root'@'localhost' for table 'events_waits_current'
grant SELECT on performance_schema.events_waits_current to 'pfs_user_3'@localhost
with GRANT OPTION;
grant ALL on performance_schema.file_instances to 'pfs_user_3'@localhost
@@ -103,11 +103,11 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_
grant TRIGGER on performance_schema.file_instances to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
grant INSERT on performance_schema.file_instances to 'pfs_user_3'@localhost;
-ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'file_instances'
+ERROR 42000: INSERT, GRANT command denied to user 'root'@'localhost' for table 'file_instances'
grant UPDATE on performance_schema.file_instances to 'pfs_user_3'@localhost;
-ERROR 42000: UPDATE,GRANT command denied to user 'root'@'localhost' for table 'file_instances'
+ERROR 42000: UPDATE, GRANT command denied to user 'root'@'localhost' for table 'file_instances'
grant DELETE on performance_schema.file_instances to 'pfs_user_3'@localhost;
-ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'file_instances'
+ERROR 42000: DELETE, GRANT command denied to user 'root'@'localhost' for table 'file_instances'
grant SELECT on performance_schema.file_instances to 'pfs_user_3'@localhost
with GRANT OPTION;
grant LOCK TABLES on performance_schema.* to 'pfs_user_3'@localhost
@@ -152,13 +152,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.setup_instruments;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.events_waits_current;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.file_instances;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'setup_instruments'
@@ -179,16 +179,16 @@ unlock tables;
lock table performance_schema.setup_instruments write;
unlock tables;
lock table performance_schema.events_waits_current read;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_current'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_current'
unlock tables;
lock table performance_schema.events_waits_current write;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_current'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_current'
unlock tables;
lock table performance_schema.file_instances read;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'file_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_instances'
unlock tables;
lock table performance_schema.file_instances write;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'root'@'localhost' for table 'file_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_instances'
unlock tables;
#
# WL#4818, NFS2: Can use grants to give normal user access
@@ -250,13 +250,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.setup_instruments;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.events_waits_current;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.file_instances;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'setup_instruments'
@@ -277,16 +277,16 @@ unlock tables;
lock table performance_schema.setup_instruments write;
unlock tables;
lock table performance_schema.events_waits_current read;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table 'events_waits_current'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table 'events_waits_current'
unlock tables;
lock table performance_schema.events_waits_current write;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table 'events_waits_current'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table 'events_waits_current'
unlock tables;
lock table performance_schema.file_instances read;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table 'file_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table 'file_instances'
unlock tables;
lock table performance_schema.file_instances write;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table 'file_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table 'file_instances'
unlock tables;
#
# WL#4818, NFS2: Can use grants to give normal user access
@@ -348,13 +348,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.setup_instruments;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.events_waits_current;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.file_instances;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'setup_instruments'
@@ -375,16 +375,16 @@ unlock tables;
lock table performance_schema.setup_instruments write;
unlock tables;
lock table performance_schema.events_waits_current read;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table 'events_waits_current'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table 'events_waits_current'
unlock tables;
lock table performance_schema.events_waits_current write;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table 'events_waits_current'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table 'events_waits_current'
unlock tables;
lock table performance_schema.file_instances read;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table 'file_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table 'file_instances'
unlock tables;
lock table performance_schema.file_instances write;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table 'file_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table 'file_instances'
unlock tables;
#
# WL#4818, NFS2: Can use grants to give normal user access
@@ -446,13 +446,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.setup_instruments;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.events_waits_current;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.file_instances;
-ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'setup_instruments'
@@ -473,16 +473,16 @@ unlock tables;
lock table performance_schema.setup_instruments write;
unlock tables;
lock table performance_schema.events_waits_current read;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_current'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_current'
unlock tables;
lock table performance_schema.events_waits_current write;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_current'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_current'
unlock tables;
lock table performance_schema.file_instances read;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table 'file_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table 'file_instances'
unlock tables;
lock table performance_schema.file_instances write;
-ERROR 42000: SELECT,LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table 'file_instances'
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table 'file_instances'
unlock tables;
#
# WL#4818, NFS2: Can use grants to give normal user access
@@ -575,4 +575,7 @@ DROP USER pfs_user_4;
flush privileges;
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
UPDATE performance_schema.setup_consumers SET enabled = 'YES';
-UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE';
+UPDATE performance_schema.setup_timers SET timer_name = 'MICROSECOND' where name="idle";
+UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE' where name="wait";
+UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="stage";
+UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="statement";
diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result
new file mode 100644
index 00000000000..eba7ed3c7e8
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/privilege_table_io.result
@@ -0,0 +1,138 @@
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+# We are forced to suppress here the server response.
+optimize table mysql.db;
+update performance_schema.setup_consumers set enabled='YES';
+update performance_schema.setup_objects set enabled='YES'
+ where object_type='TABLE' and object_schema= 'mysql';
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ("test", "mysql")
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE mysql host fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql user fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql user fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql user fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql user fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql user fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql db fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql db fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql db fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql proxies_priv fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql proxies_priv fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql proxies_priv fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql tables_priv fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql procs_priv fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE mysql servers fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
+update performance_schema.setup_objects set enabled='NO'
+ where object_type='TABLE' and object_schema= 'mysql';
diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result
index c49cb7b718e..9496dcc5aee 100644
--- a/mysql-test/suite/perfschema/r/query_cache.result
+++ b/mysql-test/suite/perfschema/r/query_cache.result
@@ -38,7 +38,7 @@ spins
NULL
select name from performance_schema.setup_instruments order by name limit 1;
name
-wait/io/file/aria/control
+idle
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
@@ -53,7 +53,7 @@ spins
NULL
select name from performance_schema.setup_instruments order by name limit 1;
name
-wait/io/file/aria/control
+idle
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result
index a1d10265f4d..195dcaa6917 100644
--- a/mysql-test/suite/perfschema/r/relaylog.result
+++ b/mysql-test/suite/perfschema/r/relaylog.result
@@ -1,10 +1,13 @@
include/master-slave.inc
+Warnings:
+Note 1756 Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note 1757 Storing MySQL user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MySQL Manual for more about this issue and possible alternatives.
[connection master]
drop table if exists test.t1;
reset master;
create table test.t1(a int);
drop table test.t1;
-show binlog events from <binlog_start>;
+include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; create table test.t1(a int)
slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
@@ -20,10 +23,10 @@ from performance_schema.file_summary_by_instance
where file_name like "%master-%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
-master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
+master-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
select * from performance_schema.file_summary_by_instance
where file_name like "%slave-%" order by file_name;
-FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+FILE_NAME EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT COUNT_READ SUM_TIMER_READ MIN_TIMER_READ AVG_TIMER_READ MAX_TIMER_READ SUM_NUMBER_OF_BYTES_READ COUNT_WRITE SUM_TIMER_WRITE MIN_TIMER_WRITE AVG_TIMER_WRITE MAX_TIMER_WRITE SUM_NUMBER_OF_BYTES_WRITE COUNT_MISC SUM_TIMER_MISC MIN_TIMER_MISC AVG_TIMER_MISC MAX_TIMER_MISC
"Expect a master binlog + binlog_index"
select
substring(file_name, locate("master-", file_name)) as FILE_NAME,
@@ -36,7 +39,7 @@ from performance_schema.file_summary_by_instance
where event_name like "%binlog%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
-master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
+master-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
select
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
@@ -47,7 +50,7 @@ from performance_schema.file_summary_by_event_name
where event_name like "%binlog%" order by event_name;
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
wait/io/file/sql/binlog MANY MANY MANY MANY
-wait/io/file/sql/binlog_index NONE MANY NONE MANY
+wait/io/file/sql/binlog_index MANY NONE NONE NONE
select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
@@ -57,29 +60,27 @@ where event_name like "%MYSQL_BIN_LOG%"
order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
-wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
"Expect no slave relay log"
select * from performance_schema.file_summary_by_instance
where event_name like "%relaylog%" order by file_name;
-FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+FILE_NAME EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT COUNT_READ SUM_TIMER_READ MIN_TIMER_READ AVG_TIMER_READ MAX_TIMER_READ SUM_NUMBER_OF_BYTES_READ COUNT_WRITE SUM_TIMER_WRITE MIN_TIMER_WRITE AVG_TIMER_WRITE MAX_TIMER_WRITE SUM_NUMBER_OF_BYTES_WRITE COUNT_MISC SUM_TIMER_MISC MIN_TIMER_MISC AVG_TIMER_MISC MAX_TIMER_MISC
select * from performance_schema.file_summary_by_event_name
where event_name like "%relaylog%" order by event_name;
-EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
-wait/io/file/sql/relaylog 0 0 0 0
-wait/io/file/sql/relaylog_index 0 0 0 0
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT COUNT_READ SUM_TIMER_READ MIN_TIMER_READ AVG_TIMER_READ MAX_TIMER_READ SUM_NUMBER_OF_BYTES_READ COUNT_WRITE SUM_TIMER_WRITE MIN_TIMER_WRITE AVG_TIMER_WRITE MAX_TIMER_WRITE SUM_NUMBER_OF_BYTES_WRITE COUNT_MISC SUM_TIMER_MISC MIN_TIMER_MISC AVG_TIMER_MISC MAX_TIMER_MISC
+wait/io/file/sql/relaylog 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+wait/io/file/sql/relaylog_index 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
select * from performance_schema.events_waits_summary_global_by_event_name
where event_name like "%MYSQL_RELAY_LOG%"
and event_name not like "%MYSQL_RELAY_LOG::update_cond"
order by event_name;
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy 0 0 0 0 0
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0
"============ Performance schema on slave ============"
select * from performance_schema.file_summary_by_instance
where file_name like "%master-%" order by file_name;
-FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+FILE_NAME EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT COUNT_READ SUM_TIMER_READ MIN_TIMER_READ AVG_TIMER_READ MAX_TIMER_READ SUM_NUMBER_OF_BYTES_READ COUNT_WRITE SUM_TIMER_WRITE MIN_TIMER_WRITE AVG_TIMER_WRITE MAX_TIMER_WRITE SUM_NUMBER_OF_BYTES_WRITE COUNT_MISC SUM_TIMER_MISC MIN_TIMER_MISC AVG_TIMER_MISC MAX_TIMER_MISC
select
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
EVENT_NAME,
@@ -95,10 +96,10 @@ where file_name like "%slave-%"
order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
-slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
+slave-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
-slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY
+slave-relay-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
"Expect a slave binlog + binlog_index"
select
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
@@ -111,7 +112,8 @@ from performance_schema.file_summary_by_instance
where event_name like "%binlog%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
-slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
+slave-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
+slave-relay-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
select
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
@@ -122,7 +124,7 @@ from performance_schema.file_summary_by_event_name
where event_name like "%binlog%" order by event_name;
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
wait/io/file/sql/binlog MANY MANY MANY MANY
-wait/io/file/sql/binlog_index NONE MANY NONE MANY
+wait/io/file/sql/binlog_index MANY NONE MANY NONE
select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
@@ -132,7 +134,6 @@ where event_name like "%MYSQL_BIN_LOG%"
order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
-wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
"Expect a slave relay log"
@@ -152,7 +153,6 @@ order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
-slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY
select
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
@@ -163,7 +163,7 @@ from performance_schema.file_summary_by_event_name
where event_name like "%relaylog%" order by event_name;
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
wait/io/file/sql/relaylog MANY MANY MANY MANY
-wait/io/file/sql/relaylog_index MANY MANY MANY MANY
+wait/io/file/sql/relaylog_index MANY NONE NONE NONE
select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
@@ -172,6 +172,5 @@ where event_name like "%MYSQL_RELAY_LOG%"
and event_name not like "%MYSQL_RELAY_LOG::update_cond"
order by event_name;
EVENT_NAME COUNT_STAR
-wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy NONE
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY
include/stop_slave.inc
diff --git a/mysql-test/suite/perfschema/r/rollback_table_io.result b/mysql-test/suite/perfschema/r/rollback_table_io.result
new file mode 100644
index 00000000000..a4053dd5bc3
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/rollback_table_io.result
@@ -0,0 +1,88 @@
+drop table if exists test.t1;
+create table test.t1 (col1 bigint, col2 varchar(30)) engine = InnoDB;
+show create table test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` bigint(20) DEFAULT NULL,
+ `col2` varchar(30) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+insert into test.t1 values(1,'One');
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+update performance_schema.setup_consumers set enabled = 'YES';
+set autocommit = off;
+delete from test.t1 where col1 = 1;
+insert into marker set a = 1;
+rollback;
+insert into marker set a = 1;
+update test.t1 set col2 = 'Updated' where col1 = 1;
+insert into marker set a = 1;
+rollback;
+insert into marker set a = 1;
+insert into test.t1 values(2,'Two');
+insert into marker set a = 1;
+rollback;
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ('test')
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+drop table test.t1;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/schema.result b/mysql-test/suite/perfschema/r/schema.result
index 5bafa137af5..7f1e1190634 100644
--- a/mysql-test/suite/perfschema/r/schema.result
+++ b/mysql-test/suite/perfschema/r/schema.result
@@ -1,41 +1,461 @@
-show databases;
-Database
-information_schema
-mtr
-mysql
+show databases like 'performance_schema';
+Database (performance_schema)
performance_schema
-test
+show create database performance_schema;
+Database Create Database
+performance_schema CREATE DATABASE `performance_schema` /*!40100 DEFAULT CHARACTER SET utf8 */
use performance_schema;
show tables;
Tables_in_performance_schema
+accounts
cond_instances
+events_stages_current
+events_stages_history
+events_stages_history_long
+events_stages_summary_by_account_by_event_name
+events_stages_summary_by_host_by_event_name
+events_stages_summary_by_thread_by_event_name
+events_stages_summary_by_user_by_event_name
+events_stages_summary_global_by_event_name
+events_statements_current
+events_statements_history
+events_statements_history_long
+events_statements_summary_by_account_by_event_name
+events_statements_summary_by_digest
+events_statements_summary_by_host_by_event_name
+events_statements_summary_by_thread_by_event_name
+events_statements_summary_by_user_by_event_name
+events_statements_summary_global_by_event_name
events_waits_current
events_waits_history
events_waits_history_long
+events_waits_summary_by_account_by_event_name
+events_waits_summary_by_host_by_event_name
events_waits_summary_by_instance
events_waits_summary_by_thread_by_event_name
+events_waits_summary_by_user_by_event_name
events_waits_summary_global_by_event_name
file_instances
file_summary_by_event_name
file_summary_by_instance
+host_cache
+hosts
mutex_instances
+objects_summary_global_by_type
performance_timers
rwlock_instances
+setup_actors
setup_consumers
setup_instruments
+setup_objects
setup_timers
+socket_instances
+socket_summary_by_event_name
+socket_summary_by_instance
+table_io_waits_summary_by_index_usage
+table_io_waits_summary_by_table
+table_lock_waits_summary_by_table
threads
+users
+show create table accounts;
+Table Create Table
+accounts CREATE TABLE `accounts` (
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `CURRENT_CONNECTIONS` bigint(20) NOT NULL,
+ `TOTAL_CONNECTIONS` bigint(20) NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table cond_instances;
Table Create Table
cond_instances CREATE TABLE `cond_instances` (
`NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_stages_current;
+Table Create Table
+events_stages_current CREATE TABLE `events_stages_current` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_stages_history;
+Table Create Table
+events_stages_history CREATE TABLE `events_stages_history` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_stages_history_long;
+Table Create Table
+events_stages_history_long CREATE TABLE `events_stages_history_long` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_stages_summary_by_host_by_event_name;
+Table Create Table
+events_stages_summary_by_host_by_event_name CREATE TABLE `events_stages_summary_by_host_by_event_name` (
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_stages_summary_by_thread_by_event_name;
+Table Create Table
+events_stages_summary_by_thread_by_event_name CREATE TABLE `events_stages_summary_by_thread_by_event_name` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_stages_summary_by_user_by_event_name;
+Table Create Table
+events_stages_summary_by_user_by_event_name CREATE TABLE `events_stages_summary_by_user_by_event_name` (
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_stages_summary_by_account_by_event_name;
+Table Create Table
+events_stages_summary_by_account_by_event_name CREATE TABLE `events_stages_summary_by_account_by_event_name` (
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_stages_summary_global_by_event_name;
+Table Create Table
+events_stages_summary_global_by_event_name CREATE TABLE `events_stages_summary_global_by_event_name` (
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_statements_current;
+Table Create Table
+events_statements_current CREATE TABLE `events_statements_current` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `LOCK_TIME` bigint(20) unsigned NOT NULL,
+ `SQL_TEXT` longtext,
+ `DIGEST` varchar(32) DEFAULT NULL,
+ `DIGEST_TEXT` longtext,
+ `CURRENT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned DEFAULT NULL,
+ `MYSQL_ERRNO` int(11) DEFAULT NULL,
+ `RETURNED_SQLSTATE` varchar(5) DEFAULT NULL,
+ `MESSAGE_TEXT` varchar(128) DEFAULT NULL,
+ `ERRORS` bigint(20) unsigned NOT NULL,
+ `WARNINGS` bigint(20) unsigned NOT NULL,
+ `ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
+ `ROWS_SENT` bigint(20) unsigned NOT NULL,
+ `ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
+ `CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
+ `CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
+ `SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
+ `SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
+ `SELECT_RANGE` bigint(20) unsigned NOT NULL,
+ `SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
+ `SELECT_SCAN` bigint(20) unsigned NOT NULL,
+ `SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
+ `SORT_RANGE` bigint(20) unsigned NOT NULL,
+ `SORT_ROWS` bigint(20) unsigned NOT NULL,
+ `SORT_SCAN` bigint(20) unsigned NOT NULL,
+ `NO_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_statements_history;
+Table Create Table
+events_statements_history CREATE TABLE `events_statements_history` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `LOCK_TIME` bigint(20) unsigned NOT NULL,
+ `SQL_TEXT` longtext,
+ `DIGEST` varchar(32) DEFAULT NULL,
+ `DIGEST_TEXT` longtext,
+ `CURRENT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned DEFAULT NULL,
+ `MYSQL_ERRNO` int(11) DEFAULT NULL,
+ `RETURNED_SQLSTATE` varchar(5) DEFAULT NULL,
+ `MESSAGE_TEXT` varchar(128) DEFAULT NULL,
+ `ERRORS` bigint(20) unsigned NOT NULL,
+ `WARNINGS` bigint(20) unsigned NOT NULL,
+ `ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
+ `ROWS_SENT` bigint(20) unsigned NOT NULL,
+ `ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
+ `CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
+ `CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
+ `SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
+ `SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
+ `SELECT_RANGE` bigint(20) unsigned NOT NULL,
+ `SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
+ `SELECT_SCAN` bigint(20) unsigned NOT NULL,
+ `SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
+ `SORT_RANGE` bigint(20) unsigned NOT NULL,
+ `SORT_ROWS` bigint(20) unsigned NOT NULL,
+ `SORT_SCAN` bigint(20) unsigned NOT NULL,
+ `NO_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_statements_history_long;
+Table Create Table
+events_statements_history_long CREATE TABLE `events_statements_history_long` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `LOCK_TIME` bigint(20) unsigned NOT NULL,
+ `SQL_TEXT` longtext,
+ `DIGEST` varchar(32) DEFAULT NULL,
+ `DIGEST_TEXT` longtext,
+ `CURRENT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned DEFAULT NULL,
+ `MYSQL_ERRNO` int(11) DEFAULT NULL,
+ `RETURNED_SQLSTATE` varchar(5) DEFAULT NULL,
+ `MESSAGE_TEXT` varchar(128) DEFAULT NULL,
+ `ERRORS` bigint(20) unsigned NOT NULL,
+ `WARNINGS` bigint(20) unsigned NOT NULL,
+ `ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
+ `ROWS_SENT` bigint(20) unsigned NOT NULL,
+ `ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
+ `CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
+ `CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
+ `SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
+ `SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
+ `SELECT_RANGE` bigint(20) unsigned NOT NULL,
+ `SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
+ `SELECT_SCAN` bigint(20) unsigned NOT NULL,
+ `SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
+ `SORT_RANGE` bigint(20) unsigned NOT NULL,
+ `SORT_ROWS` bigint(20) unsigned NOT NULL,
+ `SORT_SCAN` bigint(20) unsigned NOT NULL,
+ `NO_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_statements_summary_by_host_by_event_name;
+Table Create Table
+events_statements_summary_by_host_by_event_name CREATE TABLE `events_statements_summary_by_host_by_event_name` (
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL,
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_statements_summary_by_thread_by_event_name;
+Table Create Table
+events_statements_summary_by_thread_by_event_name CREATE TABLE `events_statements_summary_by_thread_by_event_name` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL,
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_statements_summary_by_user_by_event_name;
+Table Create Table
+events_statements_summary_by_user_by_event_name CREATE TABLE `events_statements_summary_by_user_by_event_name` (
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL,
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_statements_summary_by_account_by_event_name;
+Table Create Table
+events_statements_summary_by_account_by_event_name CREATE TABLE `events_statements_summary_by_account_by_event_name` (
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL,
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_statements_summary_global_by_event_name;
+Table Create Table
+events_statements_summary_global_by_event_name CREATE TABLE `events_statements_summary_global_by_event_name` (
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL,
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_current;
Table Create Table
events_waits_current CREATE TABLE `events_waits_current` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_ID` bigint(20) unsigned NOT NULL,
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`SOURCE` varchar(64) DEFAULT NULL,
`TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -44,11 +464,13 @@ events_waits_current CREATE TABLE `events_waits_current` (
`SPINS` int(10) unsigned DEFAULT NULL,
`OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
`OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `INDEX_NAME` varchar(64) DEFAULT NULL,
`OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
`NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `OPERATION` varchar(16) NOT NULL,
- `NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL,
+ `OPERATION` varchar(32) NOT NULL,
+ `NUMBER_OF_BYTES` bigint(20) DEFAULT NULL,
`FLAGS` int(10) unsigned DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_history;
@@ -56,6 +478,7 @@ Table Create Table
events_waits_history CREATE TABLE `events_waits_history` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_ID` bigint(20) unsigned NOT NULL,
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`SOURCE` varchar(64) DEFAULT NULL,
`TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -64,11 +487,13 @@ events_waits_history CREATE TABLE `events_waits_history` (
`SPINS` int(10) unsigned DEFAULT NULL,
`OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
`OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `INDEX_NAME` varchar(64) DEFAULT NULL,
`OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
`NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `OPERATION` varchar(16) NOT NULL,
- `NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL,
+ `OPERATION` varchar(32) NOT NULL,
+ `NUMBER_OF_BYTES` bigint(20) DEFAULT NULL,
`FLAGS` int(10) unsigned DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_history_long;
@@ -76,6 +501,7 @@ Table Create Table
events_waits_history_long CREATE TABLE `events_waits_history_long` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_ID` bigint(20) unsigned NOT NULL,
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`SOURCE` varchar(64) DEFAULT NULL,
`TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -84,18 +510,31 @@ events_waits_history_long CREATE TABLE `events_waits_history_long` (
`SPINS` int(10) unsigned DEFAULT NULL,
`OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
`OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `INDEX_NAME` varchar(64) DEFAULT NULL,
`OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
`NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `OPERATION` varchar(16) NOT NULL,
- `NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL,
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL,
+ `OPERATION` varchar(32) NOT NULL,
+ `NUMBER_OF_BYTES` bigint(20) DEFAULT NULL,
`FLAGS` int(10) unsigned DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_waits_summary_by_host_by_event_name;
+Table Create Table
+events_waits_summary_by_host_by_event_name CREATE TABLE `events_waits_summary_by_host_by_event_name` (
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_summary_by_instance;
Table Create Table
events_waits_summary_by_instance CREATE TABLE `events_waits_summary_by_instance` (
`EVENT_NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
`COUNT_STAR` bigint(20) unsigned NOT NULL,
`SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
@@ -113,6 +552,29 @@ events_waits_summary_by_thread_by_event_name CREATE TABLE `events_waits_summary_
`AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_waits_summary_by_user_by_event_name;
+Table Create Table
+events_waits_summary_by_user_by_event_name CREATE TABLE `events_waits_summary_by_user_by_event_name` (
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table events_waits_summary_by_account_by_event_name;
+Table Create Table
+events_waits_summary_by_account_by_event_name CREATE TABLE `events_waits_summary_by_account_by_event_name` (
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_summary_global_by_event_name;
Table Create Table
events_waits_summary_global_by_event_name CREATE TABLE `events_waits_summary_global_by_event_name` (
@@ -134,28 +596,117 @@ show create table file_summary_by_event_name;
Table Create Table
file_summary_by_event_name CREATE TABLE `file_summary_by_event_name` (
`EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`COUNT_READ` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) NOT NULL,
`COUNT_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) NOT NULL,
+ `COUNT_MISC` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table file_summary_by_instance;
Table Create Table
file_summary_by_instance CREATE TABLE `file_summary_by_instance` (
`FILE_NAME` varchar(512) NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`COUNT_READ` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) NOT NULL,
`COUNT_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) NOT NULL,
+ `COUNT_MISC` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table host_cache;
+Table Create Table
+host_cache CREATE TABLE `host_cache` (
+ `IP` varchar(64) NOT NULL,
+ `HOST` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `HOST_VALIDATED` enum('YES','NO') NOT NULL,
+ `SUM_CONNECT_ERRORS` bigint(20) NOT NULL,
+ `COUNT_HOST_BLOCKED_ERRORS` bigint(20) NOT NULL,
+ `COUNT_NAMEINFO_TRANSIENT_ERRORS` bigint(20) NOT NULL,
+ `COUNT_NAMEINFO_PERMANENT_ERRORS` bigint(20) NOT NULL,
+ `COUNT_FORMAT_ERRORS` bigint(20) NOT NULL,
+ `COUNT_ADDRINFO_TRANSIENT_ERRORS` bigint(20) NOT NULL,
+ `COUNT_ADDRINFO_PERMANENT_ERRORS` bigint(20) NOT NULL,
+ `COUNT_FCRDNS_ERRORS` bigint(20) NOT NULL,
+ `COUNT_HOST_ACL_ERRORS` bigint(20) NOT NULL,
+ `COUNT_NO_AUTH_PLUGIN_ERRORS` bigint(20) NOT NULL,
+ `COUNT_AUTH_PLUGIN_ERRORS` bigint(20) NOT NULL,
+ `COUNT_HANDSHAKE_ERRORS` bigint(20) NOT NULL,
+ `COUNT_PROXY_USER_ERRORS` bigint(20) NOT NULL,
+ `COUNT_PROXY_USER_ACL_ERRORS` bigint(20) NOT NULL,
+ `COUNT_AUTHENTICATION_ERRORS` bigint(20) NOT NULL,
+ `COUNT_SSL_ERRORS` bigint(20) NOT NULL,
+ `COUNT_MAX_USER_CONNECTIONS_ERRORS` bigint(20) NOT NULL,
+ `COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS` bigint(20) NOT NULL,
+ `COUNT_DEFAULT_DATABASE_ERRORS` bigint(20) NOT NULL,
+ `COUNT_INIT_CONNECT_ERRORS` bigint(20) NOT NULL,
+ `COUNT_LOCAL_ERRORS` bigint(20) NOT NULL,
+ `COUNT_UNKNOWN_ERRORS` bigint(20) NOT NULL,
+ `FIRST_SEEN` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `LAST_SEEN` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `FIRST_ERROR_SEEN` timestamp NULL DEFAULT '0000-00-00 00:00:00',
+ `LAST_ERROR_SEEN` timestamp NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table hosts;
+Table Create Table
+hosts CREATE TABLE `hosts` (
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `CURRENT_CONNECTIONS` bigint(20) NOT NULL,
+ `TOTAL_CONNECTIONS` bigint(20) NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table mutex_instances;
Table Create Table
mutex_instances CREATE TABLE `mutex_instances` (
`NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
`LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table objects_summary_global_by_type;
+Table Create Table
+objects_summary_global_by_type CREATE TABLE `objects_summary_global_by_type` (
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(64) DEFAULT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table performance_timers;
Table Create Table
performance_timers CREATE TABLE `performance_timers` (
@@ -168,10 +719,17 @@ show create table rwlock_instances;
Table Create Table
rwlock_instances CREATE TABLE `rwlock_instances` (
`NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
`WRITE_LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL,
`READ_LOCKED_BY_COUNT` int(10) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table setup_actors;
+Table Create Table
+setup_actors CREATE TABLE `setup_actors` (
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%',
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%',
+ `ROLE` char(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%'
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table setup_consumers;
Table Create Table
setup_consumers CREATE TABLE `setup_consumers` (
@@ -185,16 +743,271 @@ setup_instruments CREATE TABLE `setup_instruments` (
`ENABLED` enum('YES','NO') NOT NULL,
`TIMED` enum('YES','NO') NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table setup_objects;
+Table Create Table
+setup_objects CREATE TABLE `setup_objects` (
+ `OBJECT_TYPE` enum('TABLE') NOT NULL DEFAULT 'TABLE',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT '%',
+ `OBJECT_NAME` varchar(64) NOT NULL DEFAULT '%',
+ `ENABLED` enum('YES','NO') NOT NULL DEFAULT 'YES',
+ `TIMED` enum('YES','NO') NOT NULL DEFAULT 'YES'
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table setup_timers;
Table Create Table
setup_timers CREATE TABLE `setup_timers` (
`NAME` varchar(64) NOT NULL,
`TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table socket_instances;
+Table Create Table
+socket_instances CREATE TABLE `socket_instances` (
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
+ `THREAD_ID` int(11) DEFAULT NULL,
+ `SOCKET_ID` int(11) NOT NULL,
+ `IP` varchar(64) NOT NULL,
+ `PORT` int(11) NOT NULL,
+ `STATE` enum('IDLE','ACTIVE') NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table socket_summary_by_instance;
+Table Create Table
+socket_summary_by_instance CREATE TABLE `socket_summary_by_instance` (
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL,
+ `COUNT_MISC` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table socket_summary_by_event_name;
+Table Create Table
+socket_summary_by_event_name CREATE TABLE `socket_summary_by_event_name` (
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL,
+ `COUNT_MISC` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table table_io_waits_summary_by_index_usage;
+Table Create Table
+table_io_waits_summary_by_index_usage CREATE TABLE `table_io_waits_summary_by_index_usage` (
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(64) DEFAULT NULL,
+ `INDEX_NAME` varchar(64) DEFAULT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `COUNT_FETCH` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_FETCH` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_FETCH` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_FETCH` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_FETCH` bigint(20) unsigned NOT NULL,
+ `COUNT_INSERT` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_INSERT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_INSERT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_INSERT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_INSERT` bigint(20) unsigned NOT NULL,
+ `COUNT_UPDATE` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
+ `COUNT_DELETE` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_DELETE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_DELETE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_DELETE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_DELETE` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table table_io_waits_summary_by_table;
+Table Create Table
+table_io_waits_summary_by_table CREATE TABLE `table_io_waits_summary_by_table` (
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(64) DEFAULT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `COUNT_FETCH` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_FETCH` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_FETCH` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_FETCH` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_FETCH` bigint(20) unsigned NOT NULL,
+ `COUNT_INSERT` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_INSERT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_INSERT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_INSERT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_INSERT` bigint(20) unsigned NOT NULL,
+ `COUNT_UPDATE` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
+ `COUNT_DELETE` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_DELETE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_DELETE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_DELETE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_DELETE` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table table_lock_waits_summary_by_table;
+Table Create Table
+table_lock_waits_summary_by_table CREATE TABLE `table_lock_waits_summary_by_table` (
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(64) DEFAULT NULL,
+ `COUNT_STAR` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+ `COUNT_READ_NORMAL` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL,
+ `COUNT_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL,
+ `COUNT_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL,
+ `COUNT_READ_NO_INSERT` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL,
+ `COUNT_READ_EXTERNAL` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE_DELAYED` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE_NORMAL` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL,
+ `SUM_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL,
+ `MIN_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL,
+ `AVG_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL,
+ `MAX_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table threads;
Table Create Table
threads CREATE TABLE `threads` (
`THREAD_ID` int(11) NOT NULL,
+ `NAME` varchar(128) NOT NULL,
+ `TYPE` varchar(10) NOT NULL,
`PROCESSLIST_ID` int(11) DEFAULT NULL,
- `NAME` varchar(128) NOT NULL
+ `PROCESSLIST_USER` varchar(16) DEFAULT NULL,
+ `PROCESSLIST_HOST` varchar(60) DEFAULT NULL,
+ `PROCESSLIST_DB` varchar(64) DEFAULT NULL,
+ `PROCESSLIST_COMMAND` varchar(16) DEFAULT NULL,
+ `PROCESSLIST_TIME` bigint(20) DEFAULT NULL,
+ `PROCESSLIST_STATE` varchar(64) DEFAULT NULL,
+ `PROCESSLIST_INFO` longtext,
+ `PARENT_THREAD_ID` int(11) DEFAULT NULL,
+ `ROLE` varchar(64) DEFAULT NULL,
+ `INSTRUMENTED` enum('YES','NO') NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table users;
+Table Create Table
+users CREATE TABLE `users` (
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ `CURRENT_CONNECTIONS` bigint(20) NOT NULL,
+ `TOTAL_CONNECTIONS` bigint(20) NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
diff --git a/mysql-test/suite/perfschema/r/selects.result b/mysql-test/suite/perfschema/r/selects.result
index 4c59cc3338e..c14d152856f 100644
--- a/mysql-test/suite/perfschema/r/selects.result
+++ b/mysql-test/suite/perfschema/r/selects.result
@@ -1,4 +1,6 @@
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'NO'
+ where NAME='wait/io/table/sql/handler';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
@@ -110,3 +112,4 @@ DROP FUNCTION t_ps_func;
DROP EVENT t_ps_event;
DROP TABLE t1;
DROP TABLE t_event;
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
diff --git a/mysql-test/suite/perfschema/r/server_init.result b/mysql-test/suite/perfschema/r/server_init.result
index 5497267080e..ed267aeb8c2 100644
--- a/mysql-test/suite/perfschema/r/server_init.result
+++ b/mysql-test/suite/perfschema/r/server_init.result
@@ -12,10 +12,6 @@ where name like "wait/synch/mutex/mysys/THR_LOCK_open";
count(name)
1
select count(name) from mutex_instances
-where name like "wait/synch/mutex/mysys/THR_LOCK_isam";
-count(name)
-1
-select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
count(name)
1
@@ -44,6 +40,10 @@ where name like "wait/synch/mutex/sql/LOCK_thread_count";
count(name)
1
select count(name) from mutex_instances
+where name like "wait/synch/mutex/sql/LOCK_log_throttle_qni";
+count(name)
+1
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_status";
count(name)
1
@@ -56,7 +56,7 @@ where name like "wait/synch/mutex/sql/LOCK_delayed_insert";
count(name)
1
select count(name) from mutex_instances
-where name like "wait/synch/mutex/sql/LOCK_uuid_short_generator";
+where name like "wait/synch/mutex/sql/LOCK_uuid_generator";
count(name)
1
select count(name) from mutex_instances
@@ -82,7 +82,7 @@ count(name)
select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_manager";
count(name)
-0
+1
select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_global_system_variables";
count(name)
@@ -104,10 +104,6 @@ where name like "wait/synch/mutex/sql/LOCK_server_started";
count(name)
1
select count(name) from mutex_instances
-where name like "wait/synch/mutex/sql/LOCK_rpl_status";
-count(name)
-1
-select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/Query_cache::structure_guard_mutex";
count(name)
1
@@ -170,7 +166,7 @@ count(name)
select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_manager";
count(name)
-0
+1
select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_thread_cache";
count(name)
@@ -180,10 +176,6 @@ where name like "wait/synch/cond/sql/COND_flush_thread_cache";
count(name)
1
select count(name) from cond_instances
-where name like "wait/synch/cond/sql/COND_rpl_status";
-count(name)
-1
-select count(name) from cond_instances
where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed";
count(name)
1
diff --git a/mysql-test/suite/perfschema/r/setup_actors.result b/mysql-test/suite/perfschema/r/setup_actors.result
new file mode 100644
index 00000000000..038fb623ab6
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/setup_actors.result
@@ -0,0 +1,135 @@
+select * from performance_schema.setup_actors;
+HOST USER ROLE
+% % %
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+values ('hosta', 'user1', '%');
+insert into performance_schema.setup_actors
+values ('%', 'user2', '%');
+insert into performance_schema.setup_actors
+values ('localhost', 'user3', '%');
+insert into performance_schema.setup_actors
+values ('hostb', '%', '%');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+hostb % %
+hosta user1 %
+% user2 %
+localhost user3 %
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+grant select on test.* to user5@localhost;
+flush privileges;
+# Switch to (con1, localhost, user1, , )
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
+thread/sql/one_connection FOREGROUND NO user1 localhost
+# Switch to connection default
+insert into performance_schema.setup_actors
+values ('%', 'user1', '%');
+# Switch to connection con1
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
+thread/sql/one_connection FOREGROUND NO user1 localhost
+# Disconnect con1
+# Switch to (con2, localhost, user2, , )
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID=connection_id();
+NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
+thread/sql/one_connection FOREGROUND YES user2 localhost
+# Disconnect con2
+# Switch to connection default
+drop table if exists test.t1;
+create table test.t1 (col1 bigint);
+lock table test.t1 write;
+# Switch to (con3, localhost, user3, , )
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
+thread/sql/one_connection FOREGROUND YES user3 localhost
+# Send a statement to the server, but do not wait till the result
+# comes back. We will pull this later.
+insert into test.t1 set col1 = 1;
+# Switch to (con4, localhost, user4, , )
+# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
+select count(*) = 1
+from performance_schema.threads T inner join information_schema.PROCESSLIST P
+on T.PROCESSLIST_ID = P.ID and T.PROCESSLIST_USER = P.USER and
+T.PROCESSLIST_HOST = P.HOST and T.PROCESSLIST_DB = P.DB and
+T.PROCESSLIST_COMMAND = P.COMMAND and T.PROCESSLIST_INFO = P.INFO
+where T.PROCESSLIST_USER = 'user3' and T.NAME = 'thread/sql/one_connection';
+count(*) = 1
+1
+# Switch to connection default
+unlock tables;
+# Switch to connection con3 and reap the result of the no more blocked insert
+# Switch to connection default
+drop table test.t1;
+# Disconnect con3
+# Switch to connection con4
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
+thread/sql/one_connection FOREGROUND NO user4 localhost
+# Disconnect con4
+# Switch to connection default
+insert into performance_schema.setup_actors
+values ('localhost', '%', '%');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+hostb % %
+localhost % %
+% user1 %
+hosta user1 %
+% user2 %
+localhost user3 %
+# Switch to (con4b, localhost, user4, , )
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
+thread/sql/one_connection FOREGROUND YES user4 localhost
+# Disconnect con4b
+# Switch to connection default
+insert into performance_schema.setup_actors
+values ('%', 'user5', '%');
+create sql security definer view test.v1 as select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+# Switch to (con5, localhost, user5, , )
+select * from performance_schema.threads;
+ERROR 42000: SELECT command denied to user 'user5'@'localhost' for table 'threads'
+select * from test.v1;
+NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
+thread/sql/one_connection FOREGROUND YES user5 localhost
+# Disconnect con5
+# Switch to connection default and cleanup
+drop view test.v1;
+revoke all privileges, grant option from user1@localhost;
+revoke all privileges, grant option from user2@localhost;
+revoke all privileges, grant option from user3@localhost;
+revoke all privileges, grant option from user4@localhost;
+revoke all privileges, grant option from user5@localhost;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+drop user user5@localhost;
+flush privileges;
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+values ('%', '%', '%');
+select * from performance_schema.setup_actors;
+HOST USER ROLE
+% % %
diff --git a/mysql-test/suite/perfschema/r/setup_consumers_defaults.result b/mysql-test/suite/perfschema/r/setup_consumers_defaults.result
new file mode 100644
index 00000000000..c6e03513d75
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/setup_consumers_defaults.result
@@ -0,0 +1,20 @@
+SELECT * FROM performance_schema.setup_consumers ORDER BY name;
+NAME ENABLED
+events_stages_current NO
+events_stages_history YES
+events_stages_history_long NO
+events_statements_current YES
+events_statements_history NO
+events_statements_history_long YES
+events_waits_current NO
+events_waits_history YES
+events_waits_history_long NO
+global_instrumentation YES
+statements_digest YES
+thread_instrumentation YES
+SELECT @@performance_schema_consumer_events_stages_current;
+ERROR HY000: Unknown system variable 'performance_schema_consumer_events_stages_current'
+SET @@performance_schema_consumer_events_stages_current=0;
+ERROR HY000: Unknown system variable 'performance_schema_consumer_events_stages_current'
+SHOW VARIABLES LIKE "performance_schema_consumer%";
+Variable_name Value
diff --git a/mysql-test/suite/perfschema/r/setup_instruments_defaults.result b/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
new file mode 100644
index 00000000000..531af43d798
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
@@ -0,0 +1,36 @@
+SELECT * FROM performance_schema.setup_instruments
+WHERE name IN (
+'wait/synch/mutex/sql/LOCK_user_conn',
+'wait/synch/mutex/sql/LOCK_uuid_generator',
+'wait/synch/mutex/sql/LOCK_xid_cache'
+ 'stage/sql/creating table')
+AND enabled = 'yes' AND timed = 'no'
+ORDER BY name;
+NAME ENABLED TIMED
+wait/synch/mutex/sql/LOCK_user_conn YES NO
+wait/synch/mutex/sql/LOCK_uuid_generator YES NO
+SELECT * FROM performance_schema.setup_instruments
+WHERE name = 'wait/synch/mutex/sql/LOCK_thread_count'
+AND enabled = 'no' AND timed = 'no';
+NAME ENABLED TIMED
+wait/synch/mutex/sql/LOCK_thread_count NO NO
+SELECT * FROM performance_schema.setup_instruments
+WHERE name IN (
+'wait/synch/mutex/sql/LOG_INFO::lock',
+'wait/synch/mutex/sql/THD::LOCK_thd_data')
+AND enabled = 'yes' AND timed = 'yes'
+ORDER BY name;
+NAME ENABLED TIMED
+wait/synch/mutex/sql/LOG_INFO::lock YES YES
+wait/synch/mutex/sql/THD::LOCK_thd_data YES YES
+SELECT * FROM performance_schema.setup_instruments
+WHERE name IN (
+'wait/synch/mutex/sql/Delayed_insert::mutex',
+'wait/synch/mutex/sql/hash_filo::lock')
+AND enabled = 'no' AND timed = 'no'
+ORDER BY name;
+NAME ENABLED TIMED
+wait/synch/mutex/sql/Delayed_insert::mutex NO NO
+wait/synch/mutex/sql/hash_filo::lock NO NO
+SHOW VARIABLES LIKE "%/wait/synch/mutex%";
+Variable_name Value
diff --git a/mysql-test/suite/perfschema/r/setup_objects.result b/mysql-test/suite/perfschema/r/setup_objects.result
new file mode 100644
index 00000000000..e623aeb8521
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/setup_objects.result
@@ -0,0 +1,207 @@
+drop table if exists test.setup_objects;
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES', timed='YES'
+ where name in ('wait/io/table/sql/handler', 'wait/lock/table/sql/handler');
+truncate table performance_schema.events_waits_history_long;
+create table test.setup_objects as select * from performance_schema.setup_objects;
+truncate table performance_schema.setup_objects;
+insert into performance_schema.setup_objects
+values ('TABLE', 'db1', 't1', 'YES', 'YES');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db1', 't2', 'YES', 'NO');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db1', '%', 'YES', 'YES');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db2', 't1', 'YES', 'YES');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db2', 't2', 'YES', 'NO');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db3', 't1', 'YES', 'YES');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db3', 't2', 'NO', 'NO');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db3', '%', 'NO', 'YES');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db4', 't1', 'NO', 'YES');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db4', '%', 'YES', 'NO');
+insert into performance_schema.setup_objects
+values ('SOMETHING', 'bad1', 'bad1', 'YES', 'NO');
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+show warnings;
+Level Code Message
+Warning 1265 Data truncated for column 'OBJECT_TYPE' at row 1
+Error 1452 Cannot add or update a child row: a foreign key constraint fails ()
+insert into performance_schema.setup_objects
+values ('TABLE', 'bad2', 'bad2', 'MAYBE', 'NO');
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+show warnings;
+Level Code Message
+Warning 1265 Data truncated for column 'ENABLED' at row 1
+Error 1452 Cannot add or update a child row: a foreign key constraint fails ()
+insert into performance_schema.setup_objects
+values ('TABLE', 'bad3', 'bad3', 'YES', 'MAYBE NOT');
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+show warnings;
+Level Code Message
+Warning 1265 Data truncated for column 'TIMED' at row 1
+Error 1452 Cannot add or update a child row: a foreign key constraint fails ()
+select * from performance_schema.setup_objects
+order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE db1 % YES YES
+TABLE db1 t1 YES YES
+TABLE db1 t2 YES NO
+TABLE db2 t1 YES YES
+TABLE db2 t2 YES NO
+TABLE db3 % NO YES
+TABLE db3 t1 YES YES
+TABLE db3 t2 NO NO
+TABLE db4 % YES NO
+TABLE db4 t1 NO YES
+update performance_schema.setup_objects
+set OBJECT_TYPE='SOMETHING' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+ERROR HY000: Invalid performance_schema usage.
+update performance_schema.setup_objects
+set ENABLED='MAYBE' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+update performance_schema.setup_objects
+set TIMED='MAYBE NOT' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+select * from performance_schema.setup_objects
+order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE db1 % YES YES
+TABLE db1 t1 YES YES
+TABLE db1 t2 YES NO
+TABLE db2 t1 YES YES
+TABLE db2 t2 YES NO
+TABLE db3 % NO YES
+TABLE db3 t1 YES YES
+TABLE db3 t2 NO NO
+TABLE db4 % YES NO
+TABLE db4 t1 NO YES
+drop database if exists db1;
+drop database if exists db2;
+drop database if exists db3;
+drop database if exists db4;
+drop database if exists db5;
+create database db1;
+create database db2;
+create database db3;
+create database db4;
+create database db5;
+create table db1.t1(a int);
+create table db1.t2(a int);
+create table db1.t3(a int);
+create table db1.t4(a int);
+create table db1.t5(a int);
+create table db2.t1(a int);
+create table db2.t2(a int);
+create table db2.t3(a int);
+create table db2.t4(a int);
+create table db2.t5(a int);
+create table db3.t1(a int);
+create table db3.t2(a int);
+create table db3.t3(a int);
+create table db3.t4(a int);
+create table db3.t5(a int);
+create table db4.t1(a int);
+create table db4.t2(a int);
+create table db4.t3(a int);
+create table db4.t4(a int);
+create table db4.t5(a int);
+create table db5.t1(a int);
+select * from db1.t1;
+a
+select * from db1.t2;
+a
+select * from db1.t3;
+a
+select * from db1.t4;
+a
+select * from db1.t5;
+a
+select * from db2.t1;
+a
+select * from db2.t2;
+a
+select * from db2.t3;
+a
+select * from db2.t4;
+a
+select * from db2.t5;
+a
+select * from db3.t1;
+a
+select * from db3.t2;
+a
+select * from db3.t3;
+a
+select * from db3.t4;
+a
+select * from db3.t5;
+a
+select * from db4.t1;
+a
+select * from db4.t2;
+a
+select * from db4.t3;
+a
+select * from db4.t4;
+a
+select * from db4.t5;
+a
+select * from db5.t1;
+a
+create table db5.t2(a int);
+select * from db3.t2;
+a
+select distinct OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA
+from performance_schema.events_waits_history_long
+where OBJECT_SCHEMA like "db%"
+ group by OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA
+order by OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA;
+OBJECT_TYPE OBJECT_NAME OBJECT_SCHEMA
+TABLE t1 db1
+TABLE t1 db2
+TABLE t1 db3
+TABLE t2 db1
+TABLE t2 db2
+TABLE t2 db4
+TABLE t3 db1
+TABLE t3 db4
+TABLE t4 db1
+TABLE t4 db4
+TABLE t5 db1
+TABLE t5 db4
+select distinct OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA
+from performance_schema.events_waits_history_long
+where OBJECT_SCHEMA like "db%" and TIMER_END is not NULL
+group by OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA
+order by OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA;
+OBJECT_TYPE OBJECT_NAME OBJECT_SCHEMA
+TABLE t1 db1
+TABLE t1 db2
+TABLE t1 db3
+TABLE t3 db1
+TABLE t4 db1
+TABLE t5 db1
+update performance_schema.setup_objects
+set timed='YES' where OBJECT_SCHEMA = '%';
+create table db5.t3(a int);
+select * from db3.t3;
+a
+truncate table performance_schema.setup_objects;
+select count(*) from performance_schema.setup_objects;
+count(*)
+0
+drop database db1;
+drop database db2;
+drop database db3;
+drop database db4;
+drop database db5;
+truncate table performance_schema.setup_objects;
+insert into performance_schema.setup_objects select * from test.setup_objects;
+drop table test.setup_objects;
+update performance_schema.setup_instruments set enabled='YES', timed='YES';
diff --git a/mysql-test/suite/perfschema/r/short_option_1.result b/mysql-test/suite/perfschema/r/short_option_1.result
index d97ece1f67a..6004dc96327 100644
--- a/mysql-test/suite/perfschema/r/short_option_1.result
+++ b/mysql-test/suite/perfschema/r/short_option_1.result
@@ -19,8 +19,6 @@ log ON
show variables like 'general_log';
Variable_name Value
general_log ON
-show variables like 'new';
-Variable_name Value
show variables like 'log_warnings';
Variable_name Value
log_warnings 3
diff --git a/mysql-test/suite/perfschema/r/socket_connect.result b/mysql-test/suite/perfschema/r/socket_connect.result
new file mode 100644
index 00000000000..10540fd3071
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/socket_connect.result
@@ -0,0 +1,177 @@
+#==============================================================================
+# Establish the level of IPV6 support
+#==============================================================================
+#==============================================================================
+# Get hostname, port number
+#==============================================================================
+SELECT @@hostname INTO @MY_HOSTNAME;
+SELECT @@port INTO @MY_MASTER_PORT;
+#==============================================================================
+# 1.0 Get the default connection object_instance_begin, thread id and verify
+# the expected number of client connections.
+#==============================================================================
+
+# 1.1 Confirm only one client connection
+
+SELECT COUNT(*) INTO @my_client_connections
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE "%client_connection%";
+
+# 1.2 Get the default THREAD_ID;
+
+SELECT THREAD_ID INTO @my_thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+# 1.3 Get the default OBJECT_INSTANCE_BEGIN
+
+SELECT OBJECT_INSTANCE_BEGIN INTO @my_object_instance_begin
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @my_thread_id;
+#==============================================================================
+# 2.0 ESTABLISH TCP/IP CONNECTION 1
+# Connect with IP = localhost (127.0.0.1 or ::1)
+#==============================================================================
+
+# 2.1 Get the connection thread id
+
+SELECT THREAD_ID INTO @my_thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+# 2.2 Get the connection object instance begin
+
+SELECT OBJECT_INSTANCE_BEGIN INTO @my_object_instance_begin
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @my_thread_id;
+
+# 2.3 Get the connection port
+
+SELECT PORT INTO @my_port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @my_thread_id;
+
+# 2.4 Verify that the connection is 127.0.0.1 or ::1
+
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND (IP LIKE '%127.0.0.1' OR IP LIKE '%::1')
+AND PORT= @con1_port
+AND OBJECT_INSTANCE_BEGIN= @con1_object_id;
+Expect 1
+1
+
+# 2.5 Verify that the same connection is in the summary instance table
+
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN= @con1_object_id;
+Expect 1
+1
+
+# Switch to connection default
+
+#==============================================================================
+# 3.0 ESTABLISH TCP/IP CONNECTION 2
+# Connect with IP = localhost (127.0.0.1 or ::1)
+#==============================================================================
+
+# 3.1 Get the connection thread id
+
+SELECT THREAD_ID INTO @my_thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+# 3.2 Get the connection object instance begin
+
+SELECT OBJECT_INSTANCE_BEGIN INTO @my_object_instance_begin
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @my_thread_id;
+
+# 3.3 Get the connection port
+
+SELECT PORT INTO @my_port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @my_thread_id;
+
+# 3.4 Verify that the connection is 127.0.0.1 or ::1
+
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND (IP LIKE '%127.0.0.1' OR IP LIKE '%::1')
+AND PORT= @con2_port
+AND OBJECT_INSTANCE_BEGIN= @con2_object_id;
+Expect 1
+1
+
+# 3.5 Verify that the same connection is in the summary instance table
+
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN= @con2_object_id;
+Expect 1
+1
+
+# 3.6 Verify that the connection is 127.0.0.1 or ::1
+
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND (IP LIKE '%127.0.0.1' OR IP LIKE '%::1')
+AND PORT= @con2_port
+AND OBJECT_INSTANCE_BEGIN= @con2_object_id;
+Expect 1
+1
+#==============================================================================
+# 4.0 Verify both connections exist in the instance tables
+#==============================================================================
+
+# 4.1 Verify that there are two TCP/IP connections in the socket instance table
+
+SELECT COUNT(*) = 2 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+AND (IP LIKE '%127.0.0.1' OR IP LIKE '%::1');
+Expect 1
+1
+
+# 4.2 Verify that there are two TCP/IP connections in the summary instance table
+
+SELECT COUNT(*) = 2 AS 'Expect 1'
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
+Expect 1
+1
+#==============================================================================
+# 5.0 Drop the client connections
+#==============================================================================
+# 5.1 Disconnect con1
+# 5.2 Disconnect con2
+#==============================================================================
+# 6.0 Verify sockets were removed from the instance tables
+#==============================================================================
+
+# 6.1 Verify that there are no TCP/IP connections in the socket instance table
+
+SELECT COUNT(*) = 0 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+AND (IP LIKE '%127.0.0.1' OR IP LIKE '%::1');
+Expect 1
+1
+
+# 6.2 Verify that there are no TCP/IP connections in the summary instance table
+
+SELECT COUNT(*) = 0 AS 'Expect 1'
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
+Expect 1
+1
diff --git a/mysql-test/suite/perfschema/r/socket_instances_func.result b/mysql-test/suite/perfschema/r/socket_instances_func.result
new file mode 100644
index 00000000000..ee1eac73879
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/socket_instances_func.result
@@ -0,0 +1,208 @@
+# Take a snapshot of SOCKET_INSTANCES
+CREATE TEMPORARY TABLE my_socket_instances AS
+SELECT * FROM performance_schema.socket_instances;
+# Get thread id of the default connection
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+# Establish local TCP/IP connection (con1,localhost,root,,test,,)
+# Store the thread id of connection 1 (tcp/ip)
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+# Store the port of connection 1 (tcp/ip)
+SELECT PORT INTO @port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+# Switch to connection default
+# Establish second local TCP/IP connection (con1,localhost,root,,test,,)
+# Store the thread_id of connection 2 (tcp/ip)
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+# Store the port of connection 2 (tcp/ip)
+SELECT PORT INTO @port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+# Switch to connection default
+# Establish local unix domain connection (con3,localhost,root,,test,,)
+# Store the thread id of connection 3 (unix domain)
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+# Store the port of connection 3 (unix domain)
+SELECT PORT INTO @port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+# Switch to connection default
+# EVENT_NAME is the "wait/io/socket/*" instrument identifier.
+SELECT COUNT(*) = 0 AS "Expect 1"
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME NOT LIKE 'wait/io/socket/%';
+Expect 1
+1
+# OBJECT_INSTANCE_BEGIN is an arbitrary identifier, guaranteed to be unique.
+SELECT COUNT(*) = COUNT(DISTINCT OBJECT_INSTANCE_BEGIN) AS "Expect 1"
+FROM performance_schema.socket_instances;
+Expect 1
+1
+# SOCKET_ID is the internal file handle assigned to the socket.
+SELECT COUNT(*) = COUNT(DISTINCT SOCKET_ID) AS "Expect 1"
+FROM performance_schema.socket_instances;
+Expect 1
+1
+# Characteristics per our thread
+# There must be only one entry with our thread_id
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# TCP/IP connections should have a unique port number
+# Connection 1 (tcp/ip)
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE PORT = @port;
+Expect 1
+1
+# Connection 2 (tcp/ip)
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE PORT = @port;
+Expect 1
+1
+# Check the content for the default connection (unix domain)
+SELECT COUNT(*) = 1 as 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/client_connection'
+AND PORT = 0 AND THREAD_ID = @thread_id;
+Expect 1
+1
+# Characteristics of 'server_tcpip_socket' entry
+# Server listening socket, TCP/IP
+# There is only one entry with 'wait/io/socket/sql/server_tcpip_socket'.
+# It shares the same thread id as 'wait/io/socket/sql/server_unix_socket'.
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+Expect 1
+1
+# Get the 'server_tcpip_socket' thread id
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+# Check the content.
+SELECT THREAD_ID = @thread_id
+AND (IP = '0.0.0.0' OR IP = '::')
+AND PORT = @port
+AND STATE = 'ACTIVE' AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+Expect 1
+1
+# Characteristics of 'server_unix_socket' entry
+# Server listening socket, unix domain (socket file)
+# There is only one entry with 'wait/io/socket/sql/server_unix_socket'.
+# It shares the same thread id as 'wait/io/socket/sql/server_tcpip_socket'.
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_unix_socket';
+Expect 1
+1
+# Get the 'server_unix_socket' thread id
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_unix_socket';
+# Check the content.
+SELECT THREAD_ID = @thread_id
+AND IP = ''
+ AND PORT = 0
+AND STATE = 'ACTIVE' AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_unix_socket';
+Expect 1
+1
+# Server listening sockets (TCP and Unix) are handled on the same thread
+SELECT COUNT(*) = 2 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+SELECT COUNT(*) = 2 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+#Compare server listener socket thread ids
+select @match_thread_id;
+@match_thread_id
+1
+# Check content for client connection 1 (tcpip)
+SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND (IP LIKE '%127.0.0.1' OR IP = '::1')
+AND PORT = @port
+AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Characteristics of entries with THREAD_ID of con1
+# There is only one entry with this id.
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Check content for client connection 2 (tcpip)
+SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND (IP LIKE '%127.0.0.1' OR IP = '::1')
+AND PORT = @port
+AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Characteristics of entries with THREAD_ID of con2
+# There is only one entry with this id.
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Check the content for client connection 3 (unix domain).
+SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND IP = ''
+ AND PORT = 0
+AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Characteristics of entries with THREAD_ID of con3
+# There is only one entry with this id.
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Show differences to socket_instances before con1, con2 and con3 connecting
+SELECT EVENT_NAME, IP
+FROM performance_schema.socket_instances
+WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE)
+NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE
+FROM my_socket_instances)
+ORDER BY THREAD_ID;
+EVENT_NAME IP
+wait/io/socket/sql/client_connection <LOCALHOST>
+wait/io/socket/sql/client_connection <LOCALHOST>
+wait/io/socket/sql/client_connection
+# Disconnect con1, con2 and con3
+# After waiting a bit we should have no differences to socket_instances
+# before con1, con2, con3 connecting.
+SELECT *
+FROM performance_schema.socket_instances
+WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE)
+NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE
+FROM my_socket_instances)
+ORDER BY THREAD_ID;
+EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE
diff --git a/mysql-test/suite/perfschema/r/socket_instances_func_win.result b/mysql-test/suite/perfschema/r/socket_instances_func_win.result
new file mode 100644
index 00000000000..bb0f43abee3
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/socket_instances_func_win.result
@@ -0,0 +1,144 @@
+# Take a snapshot of SOCKET_INSTANCES
+CREATE TEMPORARY TABLE my_socket_instances AS
+SELECT * FROM performance_schema.socket_instances;
+# Get thread id of the default connection
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+# Establish local TCP/IP connection (con1,localhost,root,,test,,)
+# Store the thread id of connection 1 (tcp/ip)
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+# Store the port of connection 1 (tcp/ip)
+SELECT PORT INTO @port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+# Switch to connection default
+# Establish second local TCP/IP connection (con1,localhost,root,,test,,)
+# Store the thread_id of connection 2 (tcp/ip)
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+# Store the port of connection 2 (tcp/ip)
+SELECT PORT INTO @port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+# Switch to connection default
+# EVENT_NAME is the "wait/io/socket/*" instrument identifier.
+SELECT COUNT(*) = 0 AS "Expect 1"
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME NOT LIKE 'wait/io/socket/%';
+Expect 1
+1
+# OBJECT_INSTANCE_BEGIN is an arbitrary identifier, guaranteed to be unique.
+SELECT COUNT(*) = COUNT(DISTINCT OBJECT_INSTANCE_BEGIN) AS "Expect 1"
+FROM performance_schema.socket_instances;
+Expect 1
+1
+# SOCKET_ID is the internal file handle assigned to the socket.
+SELECT COUNT(*) = COUNT(DISTINCT SOCKET_ID) AS "Expect 1"
+FROM performance_schema.socket_instances;
+Expect 1
+1
+# Characteristics per our thread
+# There must be only one entry with our thread_id
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# TCP/IP connections should have a unique port number
+# Connection 1 (tcp/ip)
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE PORT = @port;
+Expect 1
+1
+# Connection 2 (tcp/ip)
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE PORT = @port;
+Expect 1
+1
+# Check the content for the default connection (tcpip)
+SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND (IP LIKE '%127.0.0.1' OR IP = '::1') AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Characteristics of 'server_tcpip_socket' entry
+# Server listening socket, TCP/IP
+# There is only one entry with 'wait/io/socket/sql/server_tcpip_socket'.
+# It shares the same thread id as 'wait/io/socket/sql/server_unix_socket'.
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+Expect 1
+1
+# Get the 'server_tcpip_socket' thread id
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+# Check the content.
+SELECT THREAD_ID = @thread_id
+AND (IP = '0.0.0.0' OR IP = '::')
+AND PORT = @port
+AND STATE = 'ACTIVE' AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+Expect 1
+1
+# Check content for client connection 1 (tcpip)
+SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND (IP LIKE '%127.0.0.1' OR IP = '::1')
+AND PORT = @port
+AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Characteristics of entries with THREAD_ID of con1
+# There is only one entry with this id.
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Check content for client connection 2 (tcpip)
+SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND (IP LIKE '%127.0.0.1' OR IP = '::1')
+AND PORT = @port
+AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Characteristics of entries with THREAD_ID of con2
+# There is only one entry with this id.
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+Expect 1
+1
+# Show differences to socket_instances before con1, con2 and con3 connecting
+SELECT EVENT_NAME, IP
+FROM performance_schema.socket_instances
+WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE)
+NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE
+FROM my_socket_instances)
+ORDER BY THREAD_ID;
+EVENT_NAME IP
+wait/io/socket/sql/client_connection <LOCALHOST>
+wait/io/socket/sql/client_connection <LOCALHOST>
+# Disconnect con1 and con2
+# After waiting a bit we should have no differences to socket_instances
+# before con1, con2 connecting.
+SELECT *
+FROM performance_schema.socket_instances
+WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE)
+NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE
+FROM my_socket_instances)
+ORDER BY THREAD_ID;
+EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE
diff --git a/mysql-test/suite/perfschema/r/socket_summary_by_event_name_func.result b/mysql-test/suite/perfschema/r/socket_summary_by_event_name_func.result
new file mode 100644
index 00000000000..9cd668c8e7a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/socket_summary_by_event_name_func.result
@@ -0,0 +1,121 @@
+#==============================================================================
+# Establish the level of IPV6 support
+#==============================================================================
+#==============================================================================
+# Get hostname, port number
+#==============================================================================
+SELECT @@hostname INTO @MY_HOSTNAME;
+SELECT @@port INTO @MY_MASTER_PORT;
+#==============================================================================
+# 1.0 TEST INITIALIZATION
+#==============================================================================
+
+# 1.1 Disable instrumentation of the default (this) connection
+
+UPDATE performance_schema.threads
+SET INSTRUMENTED='NO' WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+# 1.2 Get the default THREAD_ID;
+
+SELECT THREAD_ID INTO @my_thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+# 1.3 Get the default OBJECT_INSTANCE_BEGIN
+
+SELECT OBJECT_INSTANCE_BEGIN INTO @my_object_instance_begin
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @my_thread_id;
+
+# 1.4 Create a test database
+
+CREATE SCHEMA mysqltest;
+
+# 1.5 Create a table to store summary values from socket_summary_by_instance
+and socket_summary_by_event_name
+
+CREATE TABLE mysqltest.my_socket_summary AS
+SELECT * FROM performance_schema.socket_summary_by_instance
+WHERE 1 = 0;
+
+# 1.6 Drop object_instance_begin from my_socket_summary
+
+ALTER TABLE mysqltest.my_socket_summary
+DROP COLUMN OBJECT_INSTANCE_BEGIN;
+
+# 1.7 Add an auto_inc column to my_socket_summary
+
+ALTER TABLE mysqltest.my_socket_summary
+ADD COLUMN (n INT AUTO_INCREMENT, PRIMARY KEY(n));
+
+# 1.8 Create test tables
+
+CREATE TABLE mysqltest.t1 (n INT AUTO_INCREMENT, s1 VARCHAR(1024), PRIMARY KEY(n));
+CREATE TABLE mysqltest.t2 (n INT AUTO_INCREMENT, s1 VARCHAR(1024), PRIMARY KEY(n));
+#==============================================================================
+# 2.0 ESTABLISH CLIENT CONNECTIONS
+#==============================================================================
+
+# 2.1 Connection 1 (tcp/ip, 127.0.0.1 or ::1)
+
+
+# 2.2 Connection 2 (localhost or unix domain socket)
+
+#==============================================================================
+# 3.0 RUN THE TESTS
+#==============================================================================
+
+# 3.1 Clear performance schema tables
+
+TRUNCATE performance_schema.socket_summary_by_instance;
+TRUNCATE performance_schema.socket_summary_by_event_name;
+
+# 3.2 Get the 'before' sum of bytes written from socket_summary_by_instance
+for later comparison to the 'after' byte count as a simple confirmation
+that the table was updated.
+
+SELECT sum(SUM_NUMBER_OF_BYTES_WRITE) INTO @my_write_count
+FROM performance_schema.socket_summary_by_instance;
+
+# 3.3 From connection 1, insert one a 1K row of data into t1
+
+USE mysqltest;
+INSERT INTO t1 (s1) VALUES (REPEAT('a', 1024));
+INSERT INTO t1 (s1) SELECT s1 FROM t1;
+
+# 3.4 From connection 2, insert one a 1K row of data into t2
+
+USE mysqltest;
+INSERT INTO t2 (s1) VALUES (REPEAT('a', 1024));
+INSERT INTO t2 (s1) SELECT s1 FROM t2;
+
+# 3.5 Get the 'after' sum of bytes written from socket_summary_by_instance
+
+SELECT sum(SUM_NUMBER_OF_BYTES_WRITE) INTO @my_write_count
+FROM performance_schema.socket_summary_by_instance;
+
+# 3.6 Verify that SUM_NUMBER_OF_BYTES_WRITE increased
+
+
+# socket_summary_by_instance was updated
+
+#==============================================================================
+# 4.0 VERIFY RESULTS
+#==============================================================================
+
+# 4.1 Verify that the totals in socket_summary_by_event_name are
+consistent with totals in socket_summary_by_instance
+
+#==============================================================================
+# 5.0 Clean up
+#==============================================================================
+
+# 5.1 Disconnect con1
+
+
+# 5.2 Disconnect con2
+
+
+# 5.3 Drop mysqltest
+
+DROP DATABASE mysqltest;
diff --git a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
new file mode 100644
index 00000000000..a273bbde92c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
@@ -0,0 +1,205 @@
+# The logging of commands and result sets is mostly disabled.
+# There are some messages which help to observe the progress of the test.
+# In case some check fails
+# - a message about this will be printed
+# - some SQL commands which show the unexpected state will be executed
+# (logging enabled)
+# - the test might abort
+#
+# 0. Check, build or set prequisites
+UPDATE performance_schema.threads
+SET INSTRUMENTED='NO' WHERE PROCESSLIST_ID = CONNECTION_ID();
+# 1. Basic checks
+# 1.1 Check that the entry of the disconnected old default session really
+# disappeared from performance_schema.socket_summary_by_instance.
+TRUNCATE TABLE performance_schema.socket_summary_by_instance;
+# 1.2 Check the base line
+TRUNCATE TABLE mysqltest.my_socket_summary_by_instance;
+# 2. Variations on Connect
+# 2.1 Connect fails because the user is unknown
+# length of user name = 4 character
+# length of default db = 9 character
+ERROR 28000: Access denied for user 'boot'@'localhost' (using password: NO)
+# 2.2 Connect fails because the user is unknown
+# length of user name = 14 character (10 more than in 2.1)
+# length of default db = 9 character
+ERROR 28000: Access denied for user 'boot0123456789'@'localhost' (using password: NO)
+# 2.3 Connect should pass, host = localhost
+# length of user name = 4 character
+# length of default db = 9 character
+# 2.4 Connect should pass, host = localhost
+# length of user name = 4 character
+# length of default db = 14 character (5 more than 2.3)
+# 2.5 Connect should pass, host = localhost
+# length of user name = 10 character
+# length of default db = 9 character
+GRANT ALL PRIVILEGES ON *.* TO 'root012345'@'localhost';
+DROP USER 'root012345'@'localhost';
+# 2.6 Connect should pass, host = localhost
+# length of user name = 14 character
+# length of default db = 9 character
+GRANT ALL PRIVILEGES ON *.* to 'root0123456789'@'localhost';
+DROP USER 'root0123456789'@'localhost';
+# 2.7 Connect should pass, host = my_localhost
+# length of user name = 4 character
+# length of default db = 9 character
+# connection runs through server_tcpip_socket !
+DO 1;
+# 3 Variations on SELECT
+# 3.1 Check a SELECT ending with server sending an error message.
+# Error message is short (unknown table).
+SELECT col2 FROM does_not_exist;
+ERROR 42S02: Table 'mysqltest.does_not_exist' doesn't exist
+# 3.2 SELECT ending with server sending an error message.
+# Now the statement is a bit longer but the error message
+# length does again not depend on statement.
+SELECT col2 FROM does_not_exist WHERE col1 = 0;
+ERROR 42S02: Table 'mysqltest.does_not_exist' doesn't exist
+# 3.3 SELECT ending with server sending an error message.
+# The statement has the same length like in 3.2 but the error
+# message is now different and much longer.
+SELECT col2 FROM does_not_exist WHERE col1 A 0;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'A 0' at line 1
+# 3.4 SELECT ending with server sending an error message.
+# Statement and error message are a bit longer than in 3.1
+# because the table name is longer.
+SELECT col2 FROM does_not_exist0123;
+ERROR 42S02: Table 'mysqltest.does_not_exist0123' doesn't exist
+# 3.5 SELECT earning an empty result set.
+SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1;
+col2
+# 3.6 SELECT earning an empty result set.
+# Short column name is replaced by longer alias.
+SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1;
+my_super_col
+# 3.7 SELECT earning one row with an empty string.
+SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+col2
+
+# 3.8 SELECT earning one row with one string one char long.
+SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2;
+col2
+a
+# 3.9 SELECT earning one row with one string 1024 char long.
+SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3;
+col2
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+# 3.10 SELECT earning two rows with an empty string
+SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2;
+col2
+
+
+# 3.11 Check that the preceding Connects/SQL command runs have not
+# caused some unexpected state.
+# 4. Check delta (value_after_action - value_before_action) details
+# 4.1 Check that
+# - no change in COUNT_* leads to no change in
+# SUM_TIMER_* and no change in SUM_NUMBER_OF_BYTES_*
+# - increased COUNT_READ leads to increased
+# SUM_NUMBER_OF_BYTES_READ
+# - increased COUNT_WRITE leads to increased
+# SUM_NUMBER_OF_BYTES_WRITE
+# Attention:
+# The time required for some action might be below timer resolution.
+# Therefore some increased COUNT_* does not need to lead to an
+# increased SUM_TIMER_*.
+# 4.2 Results must be stable
+# 4.3 Counters must be 0 in client_connection for the default session
+# Instrumenting is disabled since a long time and the counter were
+# reset via TRUNCATE just after the disabling.
+# 4.4 Check the differences caused by SQL statements
+# 4.4.1 There must be no changes in counters of instances
+# NOT LIKE '%client_connection' because everything gets charged
+# into client_connection of the acting connection.
+# 4.4.2 In case of SELECT and our scenarios even COUNT_READ and COUNT_MISC
+# are stable.
+# 4.4.3 In our testing scenarios we get for the client_connection entry
+# of the acting connection
+# -> OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+# COUNT_MISC = 0 AND SUM_TIMER_MISC = 0
+# Check the differences between changes caused by SQL statements
+# These differences must correspond to parameters like
+# - statement, table name or column name length
+# - number of rows in result set, size of rows in result set etc.
+# 4.4.4 Compare impact of statements
+# SELECT col2 FROM does_not_exist WHERE col1 = 0
+# SELECT col2 FROM does_not_exist
+# One statement is longer than the other.
+# Both statements fail with the same error message (table does not exist)
+# 4.4.5 Compare impact of statements
+# SELECT col2 FROM does_not_exist WHERE col1 A 0
+# SELECT col2 FROM does_not_exist WHERE col1 = 0
+# Both statements have the same length and fail.
+# The length of the error messages differs.
+# 4.4.6 Compare impact of statements
+# SELECT col2 FROM does_not_exist0123
+# SELECT col2 FROM does_not_exist
+# Both statements fail (table does not exist).
+# The length of the statement and the length of the error messages differs.
+# Reason for both differences is the length of the table name.
+# 4.4.7 Compare impact of statements
+# SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1
+# Both statements get an empty result set.
+# The length of the statements and the length of the result sets differs.
+# Reason for both differences is the length of the some column name.
+# 4.4.8 Compare impact of statements
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1
+# Both statements differ in the statement length.
+# One statement earns an empty result set.
+# The other statement earns one row containing an empty string.
+# 4.4.9 Compare impact of statements
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns one row containing a string 1 byte long.
+# 4.4.10 Compare impact of statements
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns one row containing a string 1024 byte long.
+# 4.4.11 Compare impact of statements
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns two rows containing an empty string.
+# 4.5 Check the differences caused by Connects
+# Attention: Succesful Connects run an additional "DO 1".
+# 4.5.1 Connects do not charge anything into READ or WRITE counters
+# of the instance with EVENT_NAME NOT LIKE ('%client_connection%').
+# This mean all these counters must be 0.
+# 4.5.2 Connects using for host the value 'localhost'
+# 4.5.2.1 For the instance with EVENT_NAME LIKE '%server_tcpip_socket'
+# COUNT_MISC = 0 AND SUM_TIMER_MISC = 0 must be valid
+# because we run through server_unix_socket.
+# 4.5.2.2 For the instance with EVENT_NAME LIKE '%server_unix_socket'
+# COUNT_MISC > 0 must be valid.
+# 4.5.3 Connects using for host a value <> 'localhost'
+# 4.5.3.1 For the instance with EVENT_NAME LIKE '%server_unix_socket'
+# COUNT_MISC = 0 AND SUM_TIMER_MISC = 0 must be valid
+# because we run through server_tcpip_socket.
+# 4.5.3.2 For the instance with EVENT_NAME LIKE '%server_tcpip_socket'
+# COUNT_MISC > 0 must be valid.
+# 4.5.4 Failing Connects do not cause any row with EVENT_NAME
+# LIKE '%client_connection'
+# 4.5.5 Successful Connects cause a new instance with EVENT_NAME
+# LIKE '%client_connection'
+# 4.6 Check the differences caused by Connects
+# - INSTANCES with an EVENT_NAME like server_tcpip_socket or
+# server_unix_socket are already checked
+# - the stability of results is already checked
+# So we con go with the results of the first run.
+# 4.6.1 The SUM_OF_BYTES_WRITE value is the same for all Connects.
+# 4.6.2 The SUM_OF_BYTES_WRITE value hast to be > 100.
+# 4.6.3 COUNT_READ, COUNT_WRITE and COUNT_MISC have to be to be > 0
+# 4.6.4 Checks based on comparison of results for connects
+# 4.6.4 The user name length affects the SUM_OF_BYTES_READ value
+# 4.6.5 The database name length affects the SUM_OF_BYTES_READ value
+# 5. Check the impact of TRUNCATE on socket_summary_by_instance.
+# It must reset all counters.
+TRUNCATE TABLE performance_schema.socket_summary_by_instance;
+# 6. Cleanup
diff --git a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func_win.result b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func_win.result
new file mode 100644
index 00000000000..2bdc2524bbc
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func_win.result
@@ -0,0 +1,208 @@
+# The logging of commands and result sets is mostly disabled.
+# There are some messages which help to observe the progress of the test.
+# In case some check fails
+# - a message about this will be printed
+# - some SQL commands which show the unexpected state will be executed
+# (logging enabled)
+# - the test might abort
+#
+# 0. Check, build or set prequisites
+UPDATE performance_schema.threads
+SET INSTRUMENTED='NO' WHERE PROCESSLIST_ID = CONNECTION_ID();
+# 1. Basic checks
+# 1.1 Check that the entry of the disconnected old default session really
+# disappeared from performance_schema.socket_summary_by_instance.
+TRUNCATE TABLE performance_schema.socket_summary_by_instance;
+# 1.2 Check the base line
+TRUNCATE TABLE mysqltest.my_socket_summary_by_instance;
+# 2. Variations on Connect
+# 2.1 Connect fails because the user is unknown
+# length of user name = 4 character
+# length of default db = 9 character
+ERROR 28000: Access denied for user 'boot'@'localhost' (using password: NO)
+# 2.2 Connect fails because the user is unknown
+# length of user name = 14 character (10 more than in 2.1)
+# length of default db = 9 character
+ERROR 28000: Access denied for user 'boot0123456789'@'localhost' (using password: NO)
+# 2.3 Connect should pass, host = localhost
+# length of user name = 4 character
+# length of default db = 9 character
+# 2.4 Connect should pass, host = localhost
+# length of user name = 4 character
+# length of default db = 14 character (5 more than 2.3)
+# 2.5 Connect should pass, host = localhost
+# length of user name = 10 character
+# length of default db = 9 character
+GRANT ALL PRIVILEGES ON *.* TO 'root012345'@'localhost';
+DROP USER 'root012345'@'localhost';
+# 2.6 Connect should pass, host = localhost
+# length of user name = 14 character
+# length of default db = 9 character
+GRANT ALL PRIVILEGES ON *.* to 'root0123456789'@'localhost';
+DROP USER 'root0123456789'@'localhost';
+# 2.7 Connect should pass, host = my_localhost
+# length of user name = 4 character
+# length of default db = 9 character
+# connection runs through server_tcpip_socket !
+DO 1;
+# 3 Variations on SELECT
+# 3.1 Check a SELECT ending with server sending an error message.
+# Error message is short (unknown table).
+SELECT col2 FROM does_not_exist;
+ERROR 42S02: Table 'mysqltest.does_not_exist' doesn't exist
+# 3.2 SELECT ending with server sending an error message.
+# Now the statement is a bit longer but the error message
+# length does again not depend on statement.
+SELECT col2 FROM does_not_exist WHERE col1 = 0;
+ERROR 42S02: Table 'mysqltest.does_not_exist' doesn't exist
+# 3.3 SELECT ending with server sending an error message.
+# The statement has the same length like in 3.2 but the error
+# message is now different and much longer.
+SELECT col2 FROM does_not_exist WHERE col1 A 0;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'A 0' at line 1
+# 3.4 SELECT ending with server sending an error message.
+# Statement and error message are a bit longer than in 3.1
+# because the table name is longer.
+SELECT col2 FROM does_not_exist0123;
+ERROR 42S02: Table 'mysqltest.does_not_exist0123' doesn't exist
+# 3.5 SELECT earning an empty result set.
+SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1;
+col2
+# 3.6 SELECT earning an empty result set.
+# Short column name is replaced by longer alias.
+SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1;
+my_super_col
+# 3.7 SELECT earning one row with an empty string.
+SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+col2
+
+# 3.8 SELECT earning one row with one string one char long.
+SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2;
+col2
+a
+# 3.9 SELECT earning one row with one string 1024 char long.
+SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3;
+col2
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+# 3.10 SELECT earning two rows with an empty string
+SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2;
+col2
+
+
+# 3.11 Check that the preceding Connects/SQL command runs have not
+# caused some unexpected state.
+# 4. Check delta (value_after_action - value_before_action) details
+# 4.1 Check that
+# - no change in COUNT_* leads to no change in
+# SUM_TIMER_* and no change in SUM_NUMBER_OF_BYTES_*
+# - increased COUNT_READ leads to increased
+# SUM_NUMBER_OF_BYTES_READ
+# - increased COUNT_WRITE leads to increased
+# SUM_NUMBER_OF_BYTES_WRITE
+# Attention:
+# The time required for some action might be below timer resolution.
+# Therefore some increased COUNT_* does not need to lead to an
+# increased SUM_TIMER_*.
+# 4.2 Results must be stable
+# 4.3 Counters must be 0 in client_connection for the default session
+# Instrumenting is disabled since a long time and the counter were
+# reset via TRUNCATE just after the disabling.
+# 4.4 Check the differences caused by SQL statements
+# 4.4.1 There must be no changes in counters of instances
+# NOT LIKE '%client_connection' because everything gets charged
+# into client_connection of the acting connection.
+# 4.4.2 In case of SELECT and our scenarios even COUNT_READ and COUNT_MISC
+# are stable.
+# 4.4.3 In our testing scenarios we get for the client_connection entry
+# of the acting connection
+# -> OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+# COUNT_MISC = 0 AND SUM_TIMER_MISC = 0
+# SKIPPED FOR WINDOWS
+# Check the differences between changes caused by SQL statements
+# These differences must correspond to parameters like
+# - statement, table name or column name length
+# - number of rows in result set, size of rows in result set etc.
+# 4.4.4 Compare impact of statements
+# SELECT col2 FROM does_not_exist WHERE col1 = 0
+# SELECT col2 FROM does_not_exist
+# One statement is longer than the other.
+# Both statements fail with the same error message (table does not exist)
+# 4.4.5 Compare impact of statements
+# SELECT col2 FROM does_not_exist WHERE col1 A 0
+# SELECT col2 FROM does_not_exist WHERE col1 = 0
+# Both statements have the same length and fail.
+# The length of the error messages differs.
+# 4.4.6 Compare impact of statements
+# SELECT col2 FROM does_not_exist0123
+# SELECT col2 FROM does_not_exist
+# Both statements fail (table does not exist).
+# The length of the statement and the length of the error messages differs.
+# Reason for both differences is the length of the table name.
+# 4.4.7 Compare impact of statements
+# SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1
+# Both statements get an empty result set.
+# The length of the statements and the length of the result sets differs.
+# Reason for both differences is the length of the some column name.
+# 4.4.8 Compare impact of statements
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1
+# Both statements differ in the statement length.
+# One statement earns an empty result set.
+# The other statement earns one row containing an empty string.
+# 4.4.9 Compare impact of statements
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns one row containing a string 1 byte long.
+# 4.4.10 Compare impact of statements
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns one row containing a string 1024 byte long.
+# 4.4.11 Compare impact of statements
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2
+# SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns two rows containing an empty string.
+# 4.5 Check the differences caused by Connects
+# Attention: Succesful Connects run an additional "DO 1".
+# 4.5.1 Connects do not charge anything into READ or WRITE counters
+# of the instance with EVENT_NAME NOT LIKE ('%client_connection%').
+# This mean all these counters must be 0.
+# 4.5.2 Connects using for host the value 'localhost'
+# 4.5.2.1 For the instance with EVENT_NAME LIKE '%server_tcpip_socket'
+# COUNT_MISC = 0 AND SUM_TIMER_MISC = 0 must be valid
+# because we run through server_unix_socket.
+# 4.5.2.2 For the instance with EVENT_NAME LIKE '%server_unix_socket'
+# COUNT_MISC > 0 must be valid.
+# SKIPPED FOR WINDOWS
+# 4.5.3 Connects using for host a value <> 'localhost'
+# 4.5.3.1 For the instance with EVENT_NAME LIKE '%server_unix_socket'
+# COUNT_MISC = 0 AND SUM_TIMER_MISC = 0 must be valid
+# because we run through server_tcpip_socket.
+# SKIPPED FOR WINDOWS
+# 4.5.3.2 For the instance with EVENT_NAME LIKE '%server_tcpip_socket'
+# COUNT_MISC > 0 must be valid.
+# 4.5.4 Failing Connects do not cause any row with EVENT_NAME
+# LIKE '%client_connection'
+# 4.5.5 Successful Connects cause a new instance with EVENT_NAME
+# LIKE '%client_connection'
+# 4.6 Check the differences caused by Connects
+# - INSTANCES with an EVENT_NAME like server_tcpip_socket or
+# server_unix_socket are already checked
+# - the stability of results is already checked
+# So we con go with the results of the first run.
+# 4.6.1 The SUM_OF_BYTES_WRITE value is the same for all Connects.
+# 4.6.2 The SUM_OF_BYTES_WRITE value hast to be > 100.
+# 4.6.3 COUNT_READ, COUNT_WRITE and COUNT_MISC have to be to be > 0
+# 4.6.4 Checks based on comparison of results for connects
+# 4.6.4 The user name length affects the SUM_OF_BYTES_READ value
+# 4.6.5 The database name length affects the SUM_OF_BYTES_READ value
+# 5. Check the impact of TRUNCATE on socket_summary_by_instance.
+# It must reset all counters.
+TRUNCATE TABLE performance_schema.socket_summary_by_instance;
+# 6. Cleanup
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_function.result b/mysql-test/suite/perfschema/r/stage_mdl_function.result
new file mode 100644
index 00000000000..39cf2b08e85
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/stage_mdl_function.result
@@ -0,0 +1,34 @@
+drop function if exists test.f1;
+create function test.f1() returns int
+return 1;
+begin;
+select test.f1();
+test.f1()
+1
+drop function test.f1;
+call dump_one_thread('user1');
+username event_name sql_text
+user1 statement/sql/select select test.f1()
+username event_name nesting_event_type
+username event_name nesting_event_type
+user1 stage/sql/System lock STATEMENT
+user1 stage/sql/init STATEMENT
+user1 stage/sql/optimizing STATEMENT
+user1 stage/sql/executing STATEMENT
+user1 stage/sql/Opening tables STATEMENT
+user1 stage/sql/end STATEMENT
+user1 stage/sql/query end STATEMENT
+user1 stage/sql/closing tables STATEMENT
+user1 stage/sql/freeing items STATEMENT
+user1 stage/sql/cleaning up STATEMENT
+call dump_one_thread('user2');
+username event_name sql_text
+user2 statement/sql/drop_function drop function test.f1
+username event_name nesting_event_type
+user2 stage/sql/Waiting for stored function metadata lock STATEMENT
+username event_name nesting_event_type
+user2 stage/sql/init STATEMENT
+select f1();
+f1()
+1
+commit;
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_global.result b/mysql-test/suite/perfschema/r/stage_mdl_global.result
new file mode 100644
index 00000000000..de5df8f189a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/stage_mdl_global.result
@@ -0,0 +1,24 @@
+flush tables with read lock;
+insert into test.t1 values (1), (2), (3);
+call dump_one_thread('user1');
+username event_name sql_text
+user1 statement/sql/flush flush tables with read lock
+username event_name nesting_event_type
+username event_name nesting_event_type
+user1 stage/sql/init STATEMENT
+user1 stage/sql/Waiting for query cache lock STATEMENT
+user1 stage/sql/init STATEMENT
+user1 stage/sql/query end STATEMENT
+user1 stage/sql/closing tables STATEMENT
+user1 stage/sql/freeing items STATEMENT
+user1 stage/sql/cleaning up STATEMENT
+call dump_one_thread('user2');
+username event_name sql_text
+user2 statement/sql/insert insert into test.t1 values (1), (2), (3)
+username event_name nesting_event_type
+user2 stage/sql/Waiting for global read lock STATEMENT
+username event_name nesting_event_type
+user2 stage/sql/init STATEMENT
+user2 stage/sql/checking permissions STATEMENT
+user2 stage/sql/Opening tables STATEMENT
+unlock tables;
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_procedure.result b/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
new file mode 100644
index 00000000000..b214a8ec290
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
@@ -0,0 +1,42 @@
+drop function if exists test.f1;
+drop procedure if exists test.p1;
+create function test.f1() returns int
+begin
+call test.p1();
+return 1;
+end
+$$
+create procedure test.p1()
+begin end;
+begin;
+select test.f1();
+test.f1()
+1
+drop procedure test.p1;
+call dump_one_thread('user1');
+username event_name sql_text
+user1 statement/sql/select select test.f1()
+username event_name nesting_event_type
+username event_name nesting_event_type
+user1 stage/sql/executing STATEMENT
+user1 stage/sql/Opening tables STATEMENT
+user1 stage/sql/query end STATEMENT
+user1 stage/sql/closing tables STATEMENT
+user1 stage/sql/Opening tables STATEMENT
+user1 stage/sql/end STATEMENT
+user1 stage/sql/query end STATEMENT
+user1 stage/sql/closing tables STATEMENT
+user1 stage/sql/freeing items STATEMENT
+user1 stage/sql/cleaning up STATEMENT
+call dump_one_thread('user2');
+username event_name sql_text
+user2 statement/sql/drop_procedure drop procedure test.p1
+username event_name nesting_event_type
+user2 stage/sql/Waiting for stored procedure metadata lock STATEMENT
+username event_name nesting_event_type
+user2 stage/sql/init STATEMENT
+select test.f1();
+test.f1()
+1
+commit;
+drop function test.f1;
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_table.result b/mysql-test/suite/perfschema/r/stage_mdl_table.result
new file mode 100644
index 00000000000..b64d94f406c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/stage_mdl_table.result
@@ -0,0 +1,37 @@
+begin;
+insert into test.t1 values (1), (2), (3);
+commit;
+begin;
+select * from test.t1 for update;
+a
+1
+2
+3
+alter table test.t1 add column (b int);
+call dump_one_thread('user1');
+username event_name sql_text
+user1 statement/sql/select select * from test.t1 for update
+username event_name nesting_event_type
+username event_name nesting_event_type
+user1 stage/sql/optimizing STATEMENT
+user1 stage/sql/statistics STATEMENT
+user1 stage/sql/preparing STATEMENT
+user1 stage/sql/executing STATEMENT
+user1 stage/sql/Sending data STATEMENT
+user1 stage/sql/end STATEMENT
+user1 stage/sql/query end STATEMENT
+user1 stage/sql/closing tables STATEMENT
+user1 stage/sql/freeing items STATEMENT
+user1 stage/sql/cleaning up STATEMENT
+call dump_one_thread('user2');
+username event_name sql_text
+user2 statement/sql/alter_table alter table test.t1 add column (b int)
+username event_name nesting_event_type
+user2 stage/sql/Waiting for table metadata lock STATEMENT
+username event_name nesting_event_type
+user2 stage/sql/init STATEMENT
+user2 stage/sql/checking permissions STATEMENT
+user2 stage/sql/checking permissions STATEMENT
+user2 stage/sql/init STATEMENT
+user2 stage/sql/Opening tables STATEMENT
+commit;
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
new file mode 100644
index 00000000000..7f3746f15e1
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
@@ -0,0 +1,120 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+select * from performance_schema.setup_instruments
+where name like "idle" and enabled='YES';
+NAME ENABLED TIMED
+select * from performance_schema.events_waits_summary_global_by_event_name
+where event_name like "idle" and count_star > 0;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_thread_by_event_name
+where event_name like "idle" and count_star > 0;
+THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_user_by_event_name
+where event_name like "idle" and count_star > 0;
+USER EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_host_by_event_name
+where event_name like "idle" and count_star > 0;
+HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_account_by_event_name
+where event_name like "idle" and count_star > 0;
+USER HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
new file mode 100644
index 00000000000..bdc6e99ce1d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
@@ -0,0 +1,120 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+select * from performance_schema.setup_instruments
+where name like "stage/%" and enabled='YES';
+NAME ENABLED TIMED
+select * from performance_schema.events_stages_summary_global_by_event_name
+where count_star > 0;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_stages_summary_by_thread_by_event_name
+where count_star > 0;
+THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_stages_summary_by_user_by_event_name
+where count_star > 0;
+USER EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_stages_summary_by_host_by_event_name
+where count_star > 0;
+HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_stages_summary_by_account_by_event_name
+where count_star > 0;
+USER HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
new file mode 100644
index 00000000000..61c3f5a7a87
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
@@ -0,0 +1,120 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+select * from performance_schema.setup_instruments
+where name like "statement/%" and enabled='YES';
+NAME ENABLED TIMED
+select * from performance_schema.events_statements_summary_global_by_event_name
+where count_star > 0;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED
+select * from performance_schema.events_statements_summary_by_thread_by_event_name
+where count_star > 0;
+THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED
+select * from performance_schema.events_statements_summary_by_user_by_event_name
+where count_star > 0;
+USER EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED
+select * from performance_schema.events_statements_summary_by_host_by_event_name
+where count_star > 0;
+HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED
+select * from performance_schema.events_statements_summary_by_account_by_event_name
+where count_star > 0;
+USER HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
new file mode 100644
index 00000000000..5344a45e70e
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
@@ -0,0 +1,120 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+select * from performance_schema.setup_instruments
+where name like "wait/%" and enabled='YES';
+NAME ENABLED TIMED
+select * from performance_schema.events_waits_summary_global_by_event_name
+where event_name like "wait/%" and count_star > 0;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_thread_by_event_name
+where event_name like "wait/%" and count_star > 0;
+THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_user_by_event_name
+where event_name like "wait/%" and count_star > 0;
+USER EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_host_by_event_name
+where event_name like "wait/%" and count_star > 0;
+HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_account_by_event_name
+where event_name like "wait/%" and count_star > 0;
+USER HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result
new file mode 100644
index 00000000000..4fa005de8d5
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_innodb.result
@@ -0,0 +1,126 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+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_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
diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result
new file mode 100644
index 00000000000..b6320ee594d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_account.result
@@ -0,0 +1,112 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 0
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_accounts_size";
+Variable_name Value
+performance_schema_accounts_size 0
+select count(*) from performance_schema.accounts;
+count(*)
+0
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_ACCOUNTS_LOST';
+variable_value > 0
+1
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 f32ffe327a2..b876365fa18 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
@@ -10,48 +10,94 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 0
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_cond_classes";
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 ef853ccc710..415968733f6 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
@@ -10,48 +10,94 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 0
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_cond_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_digests.result b/mysql-test/suite/perfschema/r/start_server_no_digests.result
new file mode 100644
index 00000000000..38d6d2750f6
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_digests.result
@@ -0,0 +1,92 @@
+####################################
+# SETUP
+####################################
+CREATE DATABASE statements_digest;
+USE statements_digest;
+CREATE TABLE t1(a int);
+CREATE TABLE t2(a int);
+CREATE TABLE t3(a int, b int);
+CREATE TABLE t4(a int, b int);
+CREATE TABLE t5(a int, b int, c int);
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+####################################
+# EXECUTION
+####################################
+SELECT 1 FROM t1;
+1
+SELECT 1 FROM `t1`;
+1
+SELECT 1,2 FROM t1;
+1 2
+SELECT 1, 2, 3, 4 FROM t1;
+1 2 3 4
+SELECT 1 FROM t2;
+1
+SELECT 1,2 FROM t2;
+1 2
+SELECT 1, 2, 3, 4 FROM t2;
+1 2 3 4
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t4 VALUES (1, 2);
+INSERT INTO t5 VALUES (1, 2, 3);
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6);
+INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
+SELECT 1 + 1;
+1 + 1
+2
+SELECT 1;
+1
+1
+SELECT 1 /* This is an inline comment */ + 1;
+1 /* This is an inline comment */ + 1
+2
+SELECT 1+
+/*
+this is a
+multiple-line comment
+*/
+1;
+1+
+/*
+this is a
+multiple-line comment
+*/
+1
+2
+CREATE SCHEMA statements_digest_temp;
+DROP SCHEMA statements_digest_temp;
+CREATE DATABASE statements_digest_temp;
+DROP DATABASE statements_digest_temp;
+SELECT 1 from t11;
+ERROR 42S02: Table 'statements_digest.t11' doesn't exist
+create table t11 (c char(4));
+create table t11 (c char(4));
+ERROR 42S01: Table 't11' already exists
+insert into t11 values("MySQL");
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+####################################
+# QUERYING PS STATEMENT DIGEST
+####################################
+SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
+DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
+SHOW VARIABLES LIKE "performance_schema_digests_size";
+Variable_name Value
+performance_schema_digests_size 0
+SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest;
+COUNT(*)
+0
+####################################
+# CLEANUP
+####################################
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP TABLE IF EXISTS t5;
+DROP DATABASE IF EXISTS statements_digest;
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 bafb4cac270..12a7d9b0fb1 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
@@ -10,48 +10,94 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 0
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_file_classes";
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 2e557e5510a..af71c0e19a0 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
@@ -10,48 +10,94 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 0
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_file_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result
new file mode 100644
index 00000000000..98d6aaf0deb
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_host.result
@@ -0,0 +1,112 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 0
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_hosts_size";
+Variable_name Value
+performance_schema_hosts_size 0
+select count(*) from performance_schema.hosts;
+count(*)
+0
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_HOSTS_LOST';
+variable_value > 0
+1
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 b6d359ae5d2..13566a5ca81 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
@@ -10,48 +10,94 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 0
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_mutex_classes";
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 190d58378ac..bbe50aa7b9c 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
@@ -10,35 +10,74 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
@@ -47,11 +86,18 @@ performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 0
performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_mutex_classes";
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 b27159828f6..8f443e3e08e 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
@@ -10,48 +10,94 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 0
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_rwlock_classes";
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 7466235c42f..89af89e1314 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
@@ -10,48 +10,94 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 30
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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_rwlock_classes";
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
new file mode 100644
index 00000000000..d2e31d6eda7
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
@@ -0,0 +1,108 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 0
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_setup_actors_size";
+Variable_name Value
+performance_schema_setup_actors_size 0
+select count(*) from performance_schema.setup_actors;
+count(*)
+0
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
new file mode 100644
index 00000000000..9365d908ec7
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
@@ -0,0 +1,108 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 0
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_setup_objects_size";
+Variable_name Value
+performance_schema_setup_objects_size 0
+select count(*) from performance_schema.setup_objects;
+count(*)
+0
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
new file mode 100644
index 00000000000..526b163a2b5
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
@@ -0,0 +1,119 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_max_socket_classes";
+Variable_name Value
+performance_schema_max_socket_classes 0
+select count(*) from performance_schema.setup_instruments
+where name like "wait/io/socket/%";
+count(*)
+0
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_SOCKET_CLASSES_LOST';
+variable_value > 0
+1
+select count(*) from performance_schema.socket_instances;
+count(*)
+0
+show status like "performance_schema_socket_instances_lost";
+Variable_name Value
+Performance_schema_socket_instances_lost 0
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
new file mode 100644
index 00000000000..78b2d4aaad8
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
@@ -0,0 +1,122 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_max_socket_classes";
+Variable_name Value
+performance_schema_max_socket_classes 10
+select count(*) > 0 from performance_schema.setup_instruments
+where name like "wait/io/socket/%";
+count(*) > 0
+1
+show status like "performance_schema_socket_classes_lost";
+Variable_name Value
+Performance_schema_socket_classes_lost 0
+show variables like "performance_schema_max_socket_instances";
+Variable_name Value
+performance_schema_max_socket_instances 0
+select count(*) from performance_schema.socket_instances;
+count(*)
+0
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_SOCKET_INSTANCES_LOST';
+variable_value > 0
+1
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
new file mode 100644
index 00000000000..de41ea4e3f3
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
@@ -0,0 +1,128 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_max_stage_classes";
+Variable_name Value
+performance_schema_max_stage_classes 0
+select count(*) from performance_schema.setup_instruments
+where name like "stage/%";
+count(*)
+0
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_STAGE_CLASSES_LOST';
+variable_value > 0
+1
+select count(*) from performance_schema.events_stages_current;
+count(*)
+0
+select count(*) from performance_schema.events_stages_history;
+count(*)
+0
+select count(*) from performance_schema.events_stages_history_long;
+count(*)
+0
+select count(*) from performance_schema.events_stages_summary_by_thread_by_event_name;
+count(*)
+0
+select count(*) from performance_schema.events_stages_summary_global_by_event_name;
+count(*)
+0
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
new file mode 100644
index 00000000000..33c20cf8dfd
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
@@ -0,0 +1,109 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 0
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_events_stages_history_size";
+Variable_name Value
+performance_schema_events_stages_history_size 0
+select count(*) from performance_schema.events_stages_history;
+count(*)
+0
+truncate table performance_schema.events_stages_history;
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
new file mode 100644
index 00000000000..3cbec7fe891
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
@@ -0,0 +1,109 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 0
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_events_stages_history_long_size";
+Variable_name Value
+performance_schema_events_stages_history_long_size 0
+select count(*) from performance_schema.events_stages_history_long;
+count(*)
+0
+truncate table performance_schema.events_stages_history_long;
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
new file mode 100644
index 00000000000..f918d5a47f1
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
@@ -0,0 +1,128 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_max_statement_classes";
+Variable_name Value
+performance_schema_max_statement_classes 0
+select count(*) from performance_schema.setup_instruments
+where name like "statement/%";
+count(*)
+0
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_STATEMENT_CLASSES_LOST';
+variable_value > 0
+1
+select count(*) from performance_schema.events_statements_current;
+count(*)
+0
+select count(*) from performance_schema.events_statements_history;
+count(*)
+0
+select count(*) from performance_schema.events_statements_history_long;
+count(*)
+0
+select count(*) from performance_schema.events_statements_summary_by_thread_by_event_name;
+count(*)
+0
+select count(*) from performance_schema.events_statements_summary_global_by_event_name;
+count(*)
+0
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
new file mode 100644
index 00000000000..d304e0c8f49
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
@@ -0,0 +1,109 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 0
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_events_statements_history_size";
+Variable_name Value
+performance_schema_events_statements_history_size 0
+select count(*) from performance_schema.events_statements_history;
+count(*)
+0
+truncate table performance_schema.events_statements_history;
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
new file mode 100644
index 00000000000..d7bb4ca598a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
@@ -0,0 +1,109 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 0
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_events_statements_history_long_size";
+Variable_name Value
+performance_schema_events_statements_history_long_size 0
+select count(*) from performance_schema.events_statements_history_long;
+count(*)
+0
+truncate table performance_schema.events_statements_history_long;
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
new file mode 100644
index 00000000000..eef0a0d60ae
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
@@ -0,0 +1,124 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 0
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_max_table_instances";
+Variable_name Value
+performance_schema_max_table_instances 500
+show variables like "performance_schema_max_table_handles";
+Variable_name Value
+performance_schema_max_table_handles 0
+drop table if exists test.instrument_me;
+create table test.instrument_me(a int);
+insert into test.instrument_me values (1), (2), (3);
+select * from test.instrument_me;
+a
+1
+2
+3
+drop table test.instrument_me;
+show variables like "performance_schema_max_table_instances";
+Variable_name Value
+performance_schema_max_table_instances 500
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_TABLE_HANDLES_LOST';
+variable_value > 0
+1
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
new file mode 100644
index 00000000000..9a54dc8168c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
@@ -0,0 +1,124 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 0
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_max_table_instances";
+Variable_name Value
+performance_schema_max_table_instances 0
+show variables like "performance_schema_max_table_handles";
+Variable_name Value
+performance_schema_max_table_handles 1000
+drop table if exists test.instrument_me;
+create table test.instrument_me(a int);
+insert into test.instrument_me values (1), (2), (3);
+select * from test.instrument_me;
+a
+1
+2
+3
+drop table test.instrument_me;
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_TABLE_INSTANCES_LOST';
+variable_value > 0
+1
+show status like "performance_schema_table_handles_lost";
+Variable_name Value
+Performance_schema_table_handles_lost 0
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 075c22bc405..b1fb2a4718a 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
@@ -10,48 +10,94 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 0
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_thread_classes";
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 763b5b69ca1..7e95947dab0 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
@@ -10,48 +10,94 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 0
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_thread_classes";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result
new file mode 100644
index 00000000000..96e80f3fefd
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_user.result
@@ -0,0 +1,112 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 0
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_users_size";
+Variable_name Value
+performance_schema_users_size 0
+select count(*) from performance_schema.users;
+count(*)
+0
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_USERS_LOST';
+variable_value > 0
+1
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
new file mode 100644
index 00000000000..63d80712f25
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
@@ -0,0 +1,109 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 0
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_events_waits_history_size";
+Variable_name Value
+performance_schema_events_waits_history_size 0
+select count(*) from performance_schema.events_waits_history;
+count(*)
+0
+truncate table performance_schema.events_waits_history;
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
new file mode 100644
index 00000000000..705be71b828
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
@@ -0,0 +1,109 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 0
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_events_waits_history_long_size";
+Variable_name Value
+performance_schema_events_waits_history_long_size 0
+select count(*) from performance_schema.events_waits_history_long;
+count(*)
+0
+truncate table performance_schema.events_waits_history_long;
diff --git a/mysql-test/suite/perfschema/r/start_server_nothing.result b/mysql-test/suite/perfschema/r/start_server_nothing.result
new file mode 100644
index 00000000000..6d81d08d30e
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/start_server_nothing.result
@@ -0,0 +1,251 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
+0
+select count(*) from performance_schema.setup_timers;
+count(*)
+4
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 0
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 0
+performance_schema_events_stages_history_size 0
+performance_schema_events_statements_history_long_size 0
+performance_schema_events_statements_history_size 0
+performance_schema_events_waits_history_long_size 0
+performance_schema_events_waits_history_size 0
+performance_schema_hosts_size 0
+performance_schema_max_cond_classes 0
+performance_schema_max_cond_instances 0
+performance_schema_max_file_classes 0
+performance_schema_max_file_handles 0
+performance_schema_max_file_instances 0
+performance_schema_max_mutex_classes 0
+performance_schema_max_mutex_instances 0
+performance_schema_max_rwlock_classes 0
+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
+performance_schema_max_thread_instances 0
+performance_schema_setup_actors_size 0
+performance_schema_setup_objects_size 0
+performance_schema_users_size 0
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 0
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 0
+performance_schema_events_stages_history_size 0
+performance_schema_events_statements_history_long_size 0
+performance_schema_events_statements_history_size 0
+performance_schema_events_waits_history_long_size 0
+performance_schema_events_waits_history_size 0
+performance_schema_hosts_size 0
+performance_schema_max_cond_classes 0
+performance_schema_max_cond_instances 0
+performance_schema_max_file_classes 0
+performance_schema_max_file_handles 0
+performance_schema_max_file_instances 0
+performance_schema_max_mutex_classes 0
+performance_schema_max_mutex_instances 0
+performance_schema_max_rwlock_classes 0
+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
+performance_schema_max_thread_instances 0
+performance_schema_setup_actors_size 0
+performance_schema_setup_objects_size 0
+performance_schema_users_size 0
+select * from performance_schema.setup_instruments;
+NAME ENABLED TIMED
+wait/io/table/sql/handler YES YES
+wait/lock/table/sql/handler YES YES
+idle YES YES
+select TIMER_NAME from performance_schema.performance_timers;
+TIMER_NAME
+CYCLE
+NANOSECOND
+MICROSECOND
+MILLISECOND
+TICK
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+select * from performance_schema.setup_timers;
+NAME TIMER_NAME
+idle MICROSECOND
+wait CYCLE
+stage NANOSECOND
+statement NANOSECOND
+select * from performance_schema.accounts;
+USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select * from performance_schema.cond_instances;
+NAME OBJECT_INSTANCE_BEGIN
+select * from performance_schema.events_stages_current;
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT NESTING_EVENT_ID NESTING_EVENT_TYPE
+select * from performance_schema.events_stages_history;
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT NESTING_EVENT_ID NESTING_EVENT_TYPE
+select * from performance_schema.events_stages_history_long;
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT NESTING_EVENT_ID NESTING_EVENT_TYPE
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+USER HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+USER EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_stages_summary_global_by_event_name;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_statements_current;
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT LOCK_TIME SQL_TEXT DIGEST DIGEST_TEXT CURRENT_SCHEMA OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME OBJECT_INSTANCE_BEGIN MYSQL_ERRNO RETURNED_SQLSTATE MESSAGE_TEXT ERRORS WARNINGS ROWS_AFFECTED ROWS_SENT ROWS_EXAMINED CREATED_TMP_DISK_TABLES CREATED_TMP_TABLES SELECT_FULL_JOIN SELECT_FULL_RANGE_JOIN SELECT_RANGE SELECT_RANGE_CHECK SELECT_SCAN SORT_MERGE_PASSES SORT_RANGE SORT_ROWS SORT_SCAN NO_INDEX_USED NO_GOOD_INDEX_USED NESTING_EVENT_ID NESTING_EVENT_TYPE
+select * from performance_schema.events_statements_history;
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT LOCK_TIME SQL_TEXT DIGEST DIGEST_TEXT CURRENT_SCHEMA OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME OBJECT_INSTANCE_BEGIN MYSQL_ERRNO RETURNED_SQLSTATE MESSAGE_TEXT ERRORS WARNINGS ROWS_AFFECTED ROWS_SENT ROWS_EXAMINED CREATED_TMP_DISK_TABLES CREATED_TMP_TABLES SELECT_FULL_JOIN SELECT_FULL_RANGE_JOIN SELECT_RANGE SELECT_RANGE_CHECK SELECT_SCAN SORT_MERGE_PASSES SORT_RANGE SORT_ROWS SORT_SCAN NO_INDEX_USED NO_GOOD_INDEX_USED NESTING_EVENT_ID NESTING_EVENT_TYPE
+select * from performance_schema.events_statements_history_long;
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT LOCK_TIME SQL_TEXT DIGEST DIGEST_TEXT CURRENT_SCHEMA OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME OBJECT_INSTANCE_BEGIN MYSQL_ERRNO RETURNED_SQLSTATE MESSAGE_TEXT ERRORS WARNINGS ROWS_AFFECTED ROWS_SENT ROWS_EXAMINED CREATED_TMP_DISK_TABLES CREATED_TMP_TABLES SELECT_FULL_JOIN SELECT_FULL_RANGE_JOIN SELECT_RANGE SELECT_RANGE_CHECK SELECT_SCAN SORT_MERGE_PASSES SORT_RANGE SORT_ROWS SORT_SCAN NO_INDEX_USED NO_GOOD_INDEX_USED NESTING_EVENT_ID NESTING_EVENT_TYPE
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+USER HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+USER EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED
+select * from performance_schema.events_statements_summary_global_by_event_name;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED
+select * from performance_schema.events_waits_current;
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME INDEX_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID NESTING_EVENT_TYPE OPERATION NUMBER_OF_BYTES FLAGS
+select * from performance_schema.events_waits_history;
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME INDEX_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID NESTING_EVENT_TYPE OPERATION NUMBER_OF_BYTES FLAGS
+select * from performance_schema.events_waits_history_long;
+THREAD_ID EVENT_ID END_EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME INDEX_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID NESTING_EVENT_TYPE OPERATION NUMBER_OF_BYTES FLAGS
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+USER HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+HOST EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_instance;
+EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+USER EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.events_waits_summary_global_by_event_name;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+wait/io/table/sql/handler 0 0 0 0 0
+wait/lock/table/sql/handler 0 0 0 0 0
+idle 0 0 0 0 0
+select * from performance_schema.file_instances;
+FILE_NAME EVENT_NAME OPEN_COUNT
+select * from performance_schema.file_summary_by_event_name;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT COUNT_READ SUM_TIMER_READ MIN_TIMER_READ AVG_TIMER_READ MAX_TIMER_READ SUM_NUMBER_OF_BYTES_READ COUNT_WRITE SUM_TIMER_WRITE MIN_TIMER_WRITE AVG_TIMER_WRITE MAX_TIMER_WRITE SUM_NUMBER_OF_BYTES_WRITE COUNT_MISC SUM_TIMER_MISC MIN_TIMER_MISC AVG_TIMER_MISC MAX_TIMER_MISC
+select * from performance_schema.file_summary_by_instance;
+FILE_NAME EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT COUNT_READ SUM_TIMER_READ MIN_TIMER_READ AVG_TIMER_READ MAX_TIMER_READ SUM_NUMBER_OF_BYTES_READ COUNT_WRITE SUM_TIMER_WRITE MIN_TIMER_WRITE AVG_TIMER_WRITE MAX_TIMER_WRITE SUM_NUMBER_OF_BYTES_WRITE COUNT_MISC SUM_TIMER_MISC MIN_TIMER_MISC AVG_TIMER_MISC MAX_TIMER_MISC
+select * from performance_schema.socket_instances;
+EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE
+select * from performance_schema.socket_summary_by_instance;
+EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT COUNT_READ SUM_TIMER_READ MIN_TIMER_READ AVG_TIMER_READ MAX_TIMER_READ SUM_NUMBER_OF_BYTES_READ COUNT_WRITE SUM_TIMER_WRITE MIN_TIMER_WRITE AVG_TIMER_WRITE MAX_TIMER_WRITE SUM_NUMBER_OF_BYTES_WRITE COUNT_MISC SUM_TIMER_MISC MIN_TIMER_MISC AVG_TIMER_MISC MAX_TIMER_MISC
+select * from performance_schema.socket_summary_by_event_name;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT COUNT_READ SUM_TIMER_READ MIN_TIMER_READ AVG_TIMER_READ MAX_TIMER_READ SUM_NUMBER_OF_BYTES_READ COUNT_WRITE SUM_TIMER_WRITE MIN_TIMER_WRITE AVG_TIMER_WRITE MAX_TIMER_WRITE SUM_NUMBER_OF_BYTES_WRITE COUNT_MISC SUM_TIMER_MISC MIN_TIMER_MISC AVG_TIMER_MISC MAX_TIMER_MISC
+select * from performance_schema.hosts;
+HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+select * from performance_schema.mutex_instances;
+NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID
+select * from performance_schema.objects_summary_global_by_type;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+select * from performance_schema.rwlock_instances;
+NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT
+select * from performance_schema.setup_actors;
+HOST USER ROLE
+select * from performance_schema.setup_objects;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+select * from performance_schema.threads;
+THREAD_ID NAME TYPE PROCESSLIST_ID PROCESSLIST_USER PROCESSLIST_HOST PROCESSLIST_DB PROCESSLIST_COMMAND PROCESSLIST_TIME PROCESSLIST_STATE PROCESSLIST_INFO PARENT_THREAD_ID ROLE INSTRUMENTED
+select * from performance_schema.users;
+USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result
index 4cdfad654ae..264d71d2ecb 100644
--- a/mysql-test/suite/perfschema/r/start_server_off.result
+++ b/mysql-test/suite/perfschema/r/start_server_off.result
@@ -10,63 +10,143 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
0
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema OFF
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
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_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
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation NO
+thread_instrumentation NO
+statements_digest YES
+select * from performance_schema.setup_instruments;
+NAME ENABLED TIMED
+select * from performance_schema.setup_actors;
+HOST USER ROLE
+select * from performance_schema.setup_objects;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+select * from performance_schema.setup_timers;
+NAME TIMER_NAME
+idle MICROSECOND
+wait CYCLE
+stage NANOSECOND
+statement NANOSECOND
diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result
index a17f78b27db..4fa005de8d5 100644
--- a/mysql-test/suite/perfschema/r/start_server_on.result
+++ b/mysql-test/suite/perfschema/r/start_server_on.result
@@ -10,63 +10,117 @@ count(*)
5
select count(*) from performance_schema.setup_consumers;
count(*)
-8
-select count(*) > 0 from performance_schema.setup_instruments;
-count(*) > 0
+12
+select count(*) > 3 from performance_schema.setup_instruments;
+count(*) > 3
1
select count(*) from performance_schema.setup_timers;
count(*)
-1
+4
+select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+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%";
Variable_name Value
performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 10000
+performance_schema_max_mutex_instances 5000
performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 10000
+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 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 1000
+performance_schema_max_thread_instances 200
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+performance_schema_users_size 100
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
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_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
diff --git a/mysql-test/suite/perfschema/r/statement_digest.result b/mysql-test/suite/perfschema/r/statement_digest.result
new file mode 100644
index 00000000000..c6a1cf16c66
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/statement_digest.result
@@ -0,0 +1,108 @@
+####################################
+# SETUP
+####################################
+CREATE DATABASE statements_digest;
+USE statements_digest;
+CREATE TABLE t1(a int);
+CREATE TABLE t2(a int);
+CREATE TABLE t3(a int, b int);
+CREATE TABLE t4(a int, b int);
+CREATE TABLE t5(a int, b int, c int);
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+####################################
+# EXECUTION
+####################################
+SELECT 1 FROM t1;
+1
+SELECT 1 FROM `t1`;
+1
+SELECT 1,2 FROM t1;
+1 2
+SELECT 1, 2, 3, 4 FROM t1;
+1 2 3 4
+SELECT 1 FROM t2;
+1
+SELECT 1,2 FROM t2;
+1 2
+SELECT 1, 2, 3, 4 FROM t2;
+1 2 3 4
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t4 VALUES (1, 2);
+INSERT INTO t5 VALUES (1, 2, 3);
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6);
+INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
+SELECT 1 + 1;
+1 + 1
+2
+SELECT 1;
+1
+1
+SELECT 1 /* This is an inline comment */ + 1;
+1 /* This is an inline comment */ + 1
+2
+SELECT 1+
+/*
+this is a
+multiple-line comment
+*/
+1;
+1+
+/*
+this is a
+multiple-line comment
+*/
+1
+2
+CREATE SCHEMA statements_digest_temp;
+DROP SCHEMA statements_digest_temp;
+CREATE DATABASE statements_digest_temp;
+DROP DATABASE statements_digest_temp;
+SELECT 1 from t11;
+ERROR 42S02: Table 'statements_digest.t11' doesn't exist
+create table t11 (c char(4));
+create table t11 (c char(4));
+ERROR 42S01: Table 't11' already exists
+insert into t11 values("MySQL");
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+####################################
+# QUERYING PS STATEMENT DIGEST
+####################################
+SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
+DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
+dee8f4f04e57a5e456c31892855e6835 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
+658a159558b029617bfa7c090827fc31 SELECT ? FROM t1 1 0 0 0
+66c495c9ee7e052e0db2212a0cd7a3cd SELECT ? FROM `t1` 1 0 0 0
+e7f8dc15f1156f57978116e457cc7488 SELECT ?, ... FROM t1 2 0 0 0
+5098d41dbf74d89d261b29400c46dae7 SELECT ? FROM t2 1 0 0 0
+3b8d5477aa795a19c9e9183e4ad04e6b SELECT ?, ... FROM t2 2 0 0 0
+5737343d989b1c42464fd3632614d25e INSERT INTO t1 VALUES (?) 1 1 0 0
+1e7fe109d5dd49394ee079690a029452 INSERT INTO t2 VALUES (?) 1 1 0 0
+d63092ea2fa59316f398af6283bf80a5 INSERT INTO t3 VALUES (...) 1 1 0 0
+7383272b3a17c661872524713abae82f INSERT INTO t4 VALUES (...) 1 1 0 0
+42e8c9d8a502b06ac931886d3ff1ed1e INSERT INTO t5 VALUES (...) 1 1 0 0
+db545539039d269501474510fbc2da56 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0
+446dead39135f87b4fc4168f00dff254 INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0
+3ec23fcc5b568c4ad359703ff996e0bd INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0
+6b473a776aa59140774b6ee689e68c9e SELECT ? + ? 3 0 0 0
+b608da273ea6dffe2120354f751cc8ba SELECT ? 1 0 0 0
+30046d97cfdc44c95bdaa7f3987d0a20 CREATE SCHEMA statements_digest_temp 2 2 0 0
+8e40e6461f3ab4454ddb8f21b5cda3ba DROP SCHEMA statements_digest_temp 2 0 0 0
+b2a18812618a648d37136507aa1abf76 SELECT ? FROM t11 1 0 0 1
+26b3a8aaadea1ef0afd3658728b3b2c9 CREATE TABLE t11 ( c CHARACTER (?) ) 2 0 0 1
+fe695877d27d136594145ebd4f683491 INSERT INTO t11 VALUES (?) 1 1 1 0
+09dae9a52da4bcb4bd4f396e3f723980 SHOW WARNINGS 1 0 0 0
+####################################
+# CLEANUP
+####################################
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP TABLE IF EXISTS t5;
+DROP DATABASE IF EXISTS statements_digest;
diff --git a/mysql-test/suite/perfschema/r/statement_digest_consumers.result b/mysql-test/suite/perfschema/r/statement_digest_consumers.result
new file mode 100644
index 00000000000..c01ae691a8b
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/statement_digest_consumers.result
@@ -0,0 +1,123 @@
+####################################
+# SETUP
+####################################
+CREATE DATABASE statements_digest;
+USE statements_digest;
+CREATE TABLE t1(a int);
+CREATE TABLE t2(a int);
+CREATE TABLE t3(a int, b int);
+CREATE TABLE t4(a int, b int);
+CREATE TABLE t5(a int, b int, c int);
+SELECT * FROM performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current NO
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+####################################
+# EXECUTION
+####################################
+SELECT 1 FROM t1;
+1
+SELECT 1 FROM `t1`;
+1
+SELECT 1,2 FROM t1;
+1 2
+SELECT 1, 2, 3, 4 FROM t1;
+1 2 3 4
+SELECT 1 FROM t2;
+1
+SELECT 1,2 FROM t2;
+1 2
+SELECT 1, 2, 3, 4 FROM t2;
+1 2 3 4
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t4 VALUES (1, 2);
+INSERT INTO t5 VALUES (1, 2, 3);
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6);
+INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
+SELECT 1 + 1;
+1 + 1
+2
+SELECT 1;
+1
+1
+SELECT 1 /* This is an inline comment */ + 1;
+1 /* This is an inline comment */ + 1
+2
+SELECT 1+
+/*
+this is a
+multiple-line comment
+*/
+1;
+1+
+/*
+this is a
+multiple-line comment
+*/
+1
+2
+CREATE SCHEMA statements_digest_temp;
+DROP SCHEMA statements_digest_temp;
+CREATE DATABASE statements_digest_temp;
+DROP DATABASE statements_digest_temp;
+SELECT 1 from t11;
+ERROR 42S02: Table 'statements_digest.t11' doesn't exist
+create table t11 (c char(4));
+create table t11 (c char(4));
+ERROR 42S01: Table 't11' already exists
+insert into t11 values("MySQL");
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+####################################
+# QUERYING PS STATEMENT DIGEST
+####################################
+SELECT digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
+digest digest_text count_star
+dee8f4f04e57a5e456c31892855e6835 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1
+658a159558b029617bfa7c090827fc31 SELECT ? FROM t1 1
+66c495c9ee7e052e0db2212a0cd7a3cd SELECT ? FROM `t1` 1
+e7f8dc15f1156f57978116e457cc7488 SELECT ?, ... FROM t1 2
+5098d41dbf74d89d261b29400c46dae7 SELECT ? FROM t2 1
+3b8d5477aa795a19c9e9183e4ad04e6b SELECT ?, ... FROM t2 2
+5737343d989b1c42464fd3632614d25e INSERT INTO t1 VALUES (?) 1
+1e7fe109d5dd49394ee079690a029452 INSERT INTO t2 VALUES (?) 1
+d63092ea2fa59316f398af6283bf80a5 INSERT INTO t3 VALUES (...) 1
+7383272b3a17c661872524713abae82f INSERT INTO t4 VALUES (...) 1
+42e8c9d8a502b06ac931886d3ff1ed1e INSERT INTO t5 VALUES (...) 1
+db545539039d269501474510fbc2da56 INSERT INTO t1 VALUES (?) /* , ... */ 2
+446dead39135f87b4fc4168f00dff254 INSERT INTO t3 VALUES (...) /* , ... */ 1
+3ec23fcc5b568c4ad359703ff996e0bd INSERT INTO t5 VALUES (...) /* , ... */ 1
+6b473a776aa59140774b6ee689e68c9e SELECT ? + ? 3
+b608da273ea6dffe2120354f751cc8ba SELECT ? 1
+30046d97cfdc44c95bdaa7f3987d0a20 CREATE SCHEMA statements_digest_temp 2
+8e40e6461f3ab4454ddb8f21b5cda3ba DROP SCHEMA statements_digest_temp 2
+b2a18812618a648d37136507aa1abf76 SELECT ? FROM t11 1
+26b3a8aaadea1ef0afd3658728b3b2c9 CREATE TABLE t11 ( c CHARACTER (?) ) 2
+fe695877d27d136594145ebd4f683491 INSERT INTO t11 VALUES (?) 1
+09dae9a52da4bcb4bd4f396e3f723980 SHOW WARNINGS 1
+SELECT digest, digest_text FROM performance_schema.events_statements_current;
+digest digest_text
+####################################
+# CLEANUP
+####################################
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP TABLE IF EXISTS t5;
+DROP DATABASE IF EXISTS statements_digest;
diff --git a/mysql-test/suite/perfschema/r/statement_digest_consumers2.result b/mysql-test/suite/perfschema/r/statement_digest_consumers2.result
new file mode 100644
index 00000000000..57c92aca988
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/statement_digest_consumers2.result
@@ -0,0 +1,102 @@
+####################################
+# SETUP
+####################################
+CREATE DATABASE statements_digest;
+USE statements_digest;
+CREATE TABLE t1(a int);
+CREATE TABLE t2(a int);
+CREATE TABLE t3(a int, b int);
+CREATE TABLE t4(a int, b int);
+CREATE TABLE t5(a int, b int, c int);
+SELECT * FROM performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest NO
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+####################################
+# EXECUTION
+####################################
+SELECT 1 FROM t1;
+1
+SELECT 1 FROM `t1`;
+1
+SELECT 1,2 FROM t1;
+1 2
+SELECT 1, 2, 3, 4 FROM t1;
+1 2 3 4
+SELECT 1 FROM t2;
+1
+SELECT 1,2 FROM t2;
+1 2
+SELECT 1, 2, 3, 4 FROM t2;
+1 2 3 4
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t4 VALUES (1, 2);
+INSERT INTO t5 VALUES (1, 2, 3);
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6);
+INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
+SELECT 1 + 1;
+1 + 1
+2
+SELECT 1;
+1
+1
+SELECT 1 /* This is an inline comment */ + 1;
+1 /* This is an inline comment */ + 1
+2
+SELECT 1+
+/*
+this is a
+multiple-line comment
+*/
+1;
+1+
+/*
+this is a
+multiple-line comment
+*/
+1
+2
+CREATE SCHEMA statements_digest_temp;
+DROP SCHEMA statements_digest_temp;
+CREATE DATABASE statements_digest_temp;
+DROP DATABASE statements_digest_temp;
+SELECT 1 from t11;
+ERROR 42S02: Table 'statements_digest.t11' doesn't exist
+create table t11 (c char(4));
+create table t11 (c char(4));
+ERROR 42S01: Table 't11' already exists
+insert into t11 values("MySQL");
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+####################################
+# QUERYING PS STATEMENT DIGEST
+####################################
+SELECT digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
+digest digest_text count_star
+SELECT digest, digest_text FROM performance_schema.events_statements_current;
+digest digest_text
+NULL NULL
+####################################
+# CLEANUP
+####################################
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP TABLE IF EXISTS t5;
+DROP DATABASE IF EXISTS statements_digest;
diff --git a/mysql-test/suite/perfschema/r/statement_digest_long_query.result b/mysql-test/suite/perfschema/r/statement_digest_long_query.result
new file mode 100644
index 00000000000..c074b704147
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/statement_digest_long_query.result
@@ -0,0 +1,12 @@
+USE performance_schema;
+truncate table events_statements_summary_by_digest;
+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+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+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+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+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
+511
+####################################
+# QUERYING PS STATEMENT DIGEST
+####################################
+SELECT digest, digest_text, count_star FROM events_statements_summary_by_digest;
+digest digest_text count_star
+56ae4a1bea5f5babaa469039be3fd979 TRUNCATE TABLE events_statements_summary_by_digest 1
+abda1fecf4bb4811f508a861272700a8 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
new file mode 100644
index 00000000000..a0dbf56d48c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
@@ -0,0 +1,1742 @@
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 72
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 72
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 0
+TABLE test t3 123
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 0
+TABLE test t3 123
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 96
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 93
+TABLE test t2 0
+TABLE test t3 184
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..19855924ab6
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
@@ -0,0 +1,1741 @@
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 54
+TABLE test t3 72
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 54
+TABLE test t3 72
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 90
+TABLE test t3 123
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 90
+TABLE test t3 123
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 144
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 48 16 32 8 0 0 0 8 0 0 16
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 93
+TABLE test t2 132
+TABLE test t3 184
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..0dde7f5408d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
@@ -0,0 +1,1742 @@
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 72
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 72
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 0
+TABLE test t3 123
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 0
+TABLE test t3 123
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 96
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 93
+TABLE test t2 0
+TABLE test t3 184
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..ee4d0445baf
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
@@ -0,0 +1,1741 @@
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 54
+TABLE test t3 72
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 54
+TABLE test t3 72
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 90
+TABLE test t3 123
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 90
+TABLE test t3 123
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 144
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 48 16 32 8 0 0 0 8 0 0 16
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 93
+TABLE test t2 132
+TABLE test t3 184
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..9d2904f2ae3
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
@@ -0,0 +1,1816 @@
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 0
+TABLE test t3 82
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 0
+TABLE test t3 82
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 0
+TABLE test t3 82
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..c8f5d3100b4
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
@@ -0,0 +1,1853 @@
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 24 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 60
+TABLE test t3 82
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 24 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 60
+TABLE test t3 82
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 24 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 60
+TABLE test t3 82
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..944d3dd2e61
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
@@ -0,0 +1,1816 @@
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 64
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 44 TABLE test t3
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 72
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 64
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 44 TABLE test t3
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 72
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 116
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 35 TABLE test t1
+wait/lock/table/sql/handler 30 TABLE test t1
+wait/io/table/sql/handler 81 TABLE test t3
+wait/lock/table/sql/handler 42 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 0
+TABLE test t3 123
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 116
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 35 TABLE test t1
+wait/lock/table/sql/handler 30 TABLE test t1
+wait/io/table/sql/handler 81 TABLE test t3
+wait/lock/table/sql/handler 42 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 0
+TABLE test t3 123
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 96
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 96
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 40 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 56 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 93
+TABLE test t2 0
+TABLE test t3 184
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..997838562ca
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
@@ -0,0 +1,1853 @@
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 94
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 30 TABLE test t2
+wait/lock/table/sql/handler 24 TABLE test t2
+wait/io/table/sql/handler 44 TABLE test t3
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 54
+TABLE test t3 72
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 94
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 30 TABLE test t2
+wait/lock/table/sql/handler 24 TABLE test t2
+wait/io/table/sql/handler 44 TABLE test t3
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 54
+TABLE test t3 72
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 170
+localhost wait/lock/table/sql/handler 108
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 35 TABLE test t1
+wait/lock/table/sql/handler 30 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t2
+wait/lock/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 81 TABLE test t3
+wait/lock/table/sql/handler 42 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 90
+TABLE test t3 123
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 170
+localhost wait/lock/table/sql/handler 108
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 35 TABLE test t1
+wait/lock/table/sql/handler 30 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t2
+wait/lock/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 81 TABLE test t3
+wait/lock/table/sql/handler 42 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 90
+TABLE test t3 123
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 144
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 144
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 40 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 48 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 56 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 48 16 32 8 0 0 0 8 0 0 16
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 93
+TABLE test t2 132
+TABLE test t3 184
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_off.result b/mysql-test/suite/perfschema/r/table_aggregate_off.result
new file mode 100644
index 00000000000..1f74e0dcb3b
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result
@@ -0,0 +1,1741 @@
+update performance_schema.setup_consumers
+set enabled='NO' where name='global_instrumentation';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation NO
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..f3d8d996144
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
@@ -0,0 +1,1742 @@
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 0
+TABLE test t3 82
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 0
+TABLE test t3 82
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 0
+TABLE test t3 82
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 0
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..ef619f555b4
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
@@ -0,0 +1,1741 @@
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 60
+TABLE test t3 82
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 60
+TABLE test t3 82
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 43
+TABLE test t2 60
+TABLE test t3 82
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 47
+TABLE test t2 64
+TABLE test t3 86
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..852578cb83c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
@@ -0,0 +1,1742 @@
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 0
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 64
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 72
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 64
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 72
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 116
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 0
+TABLE test t3 123
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 116
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 0
+TABLE test t3 123
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 96
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 96
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 93
+TABLE test t2 0
+TABLE test t3 184
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 0
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..1139727f5fb
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
@@ -0,0 +1,1741 @@
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 18
+TABLE test t2 24
+TABLE test t3 31
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 94
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 54
+TABLE test t3 72
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 94
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 54
+TABLE test t3 72
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 170
+localhost wait/lock/table/sql/handler 108
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 90
+TABLE test t3 123
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 170
+localhost wait/lock/table/sql/handler 108
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 65
+TABLE test t2 90
+TABLE test t3 123
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 144
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 144
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 48 16 32 8 0 0 0 8 0 0 16
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 93
+TABLE test t2 132
+TABLE test t3 184
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 97
+TABLE test t2 136
+TABLE test t3 188
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..18e3e473f63
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
@@ -0,0 +1,1744 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 44
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 44
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 0
+TABLE test t3 81
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 0
+TABLE test t3 81
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..1f7711b6a88
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
@@ -0,0 +1,1743 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 30
+TABLE test t3 44
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 30
+TABLE test t3 44
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 54
+TABLE test t3 81
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 54
+TABLE test t3 81
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..777e6aefb28
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
@@ -0,0 +1,1744 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 44
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 44
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 0
+TABLE test t3 81
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 0
+TABLE test t3 81
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..16cfbcbc7e2
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
@@ -0,0 +1,1743 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 30
+TABLE test t3 44
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 30
+TABLE test t3 44
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 54
+TABLE test t3 81
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 54
+TABLE test t3 81
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..f17b7c59f03
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
@@ -0,0 +1,1780 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..7bfb0e79c14
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
@@ -0,0 +1,1798 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 23 TABLE test t1
+wait/io/table/sql/handler 36 TABLE test t2
+wait/io/table/sql/handler 54 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..0731e991cdc
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
@@ -0,0 +1,1780 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 64
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 44 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 44
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 64
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 44 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 44
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 116
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 35 TABLE test t1
+wait/io/table/sql/handler 81 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 0
+TABLE test t3 81
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 116
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 35 TABLE test t1
+wait/io/table/sql/handler 81 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 0
+TABLE test t3 81
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..eb6e7699b3a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
@@ -0,0 +1,1798 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 8 TABLE test t1
+wait/io/table/sql/handler 12 TABLE test t2
+wait/io/table/sql/handler 17 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 94
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 30 TABLE test t2
+wait/io/table/sql/handler 44 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 30
+TABLE test t3 44
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 94
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 20 TABLE test t1
+wait/io/table/sql/handler 30 TABLE test t2
+wait/io/table/sql/handler 44 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 30
+TABLE test t3 44
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 170
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 35 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t2
+wait/io/table/sql/handler 81 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 54
+TABLE test t3 81
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 170
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 35 TABLE test t1
+wait/io/table/sql/handler 54 TABLE test t2
+wait/io/table/sql/handler 81 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 54
+TABLE test t3 81
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/io/table/sql/handler 53 TABLE test t1
+wait/io/table/sql/handler 84 TABLE test t2
+wait/io/table/sql/handler 128 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..0af7102834c
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
@@ -0,0 +1,1744 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 77
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 77
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 0
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..de35029ac87
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
@@ -0,0 +1,1743 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 113
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 113
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 18 12 6 12 2 4 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 32 20 12 20 4 8 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 46 28 18 28 6 12 0
+TABLE test t3 index_b 6 6 0 6 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 23 15 8 15 2 6 0
+TABLE test t2 36 24 12 24 4 8 0
+TABLE test t3 54 36 18 36 6 12 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 23
+TABLE test t2 36
+TABLE test t3 54
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..1d0432aafb3
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
@@ -0,0 +1,1744 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 25
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 25
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 0
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 64
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 44
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 64
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 64
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 44
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 116
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 0
+TABLE test t3 81
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 116
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 116
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 0
+TABLE test t3 81
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 25
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 39
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 52
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 65
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 25
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 39
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 52
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 65
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 181
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 181
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 0
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..3b697344190
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
@@ -0,0 +1,1743 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/lock/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 37
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 37
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 6 4 2 4 1 1 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 2 1 1 1 0 1 0
+TABLE test t2 NULL 10 6 4 6 2 2 0
+TABLE test t2 index_b 1 1 0 1 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 1 1 0 1 0 0 0
+TABLE test t3 NULL 14 8 6 8 3 3 0
+TABLE test t3 index_b 2 2 0 2 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 1 1 0 1 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 8 5 3 5 1 2 0
+TABLE test t2 12 8 4 8 2 2 0
+TABLE test t3 17 11 6 11 3 3 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 8
+TABLE test t2 12
+TABLE test t3 17
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 94
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 30
+TABLE test t3 44
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 94
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 94
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 15 10 5 10 2 3 0
+TABLE test t1 index_b 1 1 0 1 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 4 2 2 2 0 2 0
+TABLE test t2 NULL 26 16 10 16 4 6 0
+TABLE test t2 index_b 2 2 0 2 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 2 2 0 2 0 0 0
+TABLE test t3 NULL 37 22 15 22 6 9 0
+TABLE test t3 index_b 5 5 0 5 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 2 2 0 2 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 20 13 7 13 2 5 0
+TABLE test t2 30 20 10 20 4 6 0
+TABLE test t3 44 29 15 29 6 9 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 30
+TABLE test t3 44
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 170
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 54
+TABLE test t3 81
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 170
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 170
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 27 18 9 18 3 6 0
+TABLE test t1 index_b 2 2 0 2 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 6 3 3 3 0 3 0
+TABLE test t2 NULL 48 30 18 30 6 12 0
+TABLE test t2 index_b 3 3 0 3 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 3 3 0 3 0 0 0
+TABLE test t3 NULL 69 42 27 42 9 18 0
+TABLE test t3 index_b 9 9 0 9 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 3 3 0 3 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 35 23 12 23 3 9 0
+TABLE test t2 54 36 18 36 6 12 0
+TABLE test t3 81 54 27 54 9 18 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 35
+TABLE test t2 54
+TABLE test t3 81
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 37
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 57
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 76
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 95
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 37
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 57
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 76
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 95
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 265
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 265
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 42 28 14 28 4 10 0
+TABLE test t1 index_b 3 3 0 3 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 8 4 4 4 0 4 0
+TABLE test t2 NULL 76 48 28 48 8 20 0
+TABLE test t2 index_b 4 4 0 4 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 4 4 0 4 0 0 0
+TABLE test t3 NULL 110 68 42 68 12 30 0
+TABLE test t3 index_b 14 14 0 14 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 4 4 0 4 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 53 35 18 35 4 14 0
+TABLE test t2 84 56 28 56 8 20 0
+TABLE test t3 128 86 42 86 12 30 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 53
+TABLE test t2 84
+TABLE test t3 128
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..11d10132af4
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
@@ -0,0 +1,1744 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 0
+TABLE test t3 42
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 0
+TABLE test t3 42
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 96
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 56
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..300d41bf2f7
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
@@ -0,0 +1,1743 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 36
+TABLE test t3 42
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 36
+TABLE test t3 42
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 144
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 48 16 32 8 0 0 0 8 0 0 16
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 48
+TABLE test t3 56
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..e21145b190f
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
@@ -0,0 +1,1744 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 0
+TABLE test t3 42
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 0
+TABLE test t3 42
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 96
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 56
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..2b9743a78d6
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
@@ -0,0 +1,1743 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name='thread_instrumentation';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation NO
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 36
+TABLE test t3 42
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 36
+TABLE test t3 42
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 144
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 48 16 32 8 0 0 0 8 0 0 16
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 48
+TABLE test t3 56
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..7c713a0d95d
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
@@ -0,0 +1,1780 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..da916174671
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
@@ -0,0 +1,1798 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 24 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t2
+wait/lock/table/sql/handler 32 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..8a917a421bb
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
@@ -0,0 +1,1780 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 30 TABLE test t1
+wait/lock/table/sql/handler 42 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 0
+TABLE test t3 42
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 30 TABLE test t1
+wait/lock/table/sql/handler 42 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 0
+TABLE test t3 42
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 96
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 96
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 40 TABLE test t1
+wait/lock/table/sql/handler 56 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 56
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..ae82e88135f
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
@@ -0,0 +1,1798 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current YES
+events_stages_history YES
+events_stages_history_long YES
+events_statements_current YES
+events_statements_history YES
+events_statements_history_long YES
+events_waits_current YES
+events_waits_history YES
+events_waits_history_long YES
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 10 TABLE test t1
+wait/lock/table/sql/handler 12 TABLE test t2
+wait/lock/table/sql/handler 14 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 20 TABLE test t1
+wait/lock/table/sql/handler 24 TABLE test t2
+wait/lock/table/sql/handler 28 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 108
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 30 TABLE test t1
+wait/lock/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 42 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 36
+TABLE test t3 42
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 108
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 30 TABLE test t1
+wait/lock/table/sql/handler 36 TABLE test t2
+wait/lock/table/sql/handler 42 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 36
+TABLE test t3 42
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 144
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 144
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 40 TABLE test t1
+wait/lock/table/sql/handler 48 TABLE test t2
+wait/lock/table/sql/handler 56 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 48 16 32 8 0 0 0 8 0 0 16
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 48
+TABLE test t3 56
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+wait/lock/table/sql/handler 44 TABLE test t1
+wait/lock/table/sql/handler 52 TABLE test t2
+wait/lock/table/sql/handler 60 TABLE test t3
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..cf0ab57f9ba
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
@@ -0,0 +1,1744 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 56
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 56
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 0
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..628ef237ffd
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
@@ -0,0 +1,1743 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+delete from performance_schema.setup_actors
+where user in ('user2', 'user4');
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user3 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 84
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 84
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 24 10 14 4 0 0 1 5 0 0 7
+TABLE test t2 28 10 18 4 0 0 1 5 0 0 9
+TABLE test t3 32 10 22 4 0 0 1 5 0 0 11
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 24
+TABLE test t2 28
+TABLE test t3 32
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..a19fa183531
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
@@ -0,0 +1,1744 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+delete from performance_schema.setup_objects
+where object_name='t2';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 24
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 24
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 0
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 48
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 48
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 0
+TABLE test t3 28
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 0
+TABLE test t3 42
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 0
+TABLE test t3 42
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 24
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 24
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 96
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 96
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 0
+TABLE test t3 56
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 32
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 24
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 24
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 24
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 32
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 24
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 24
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 24
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 104
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 104
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 0
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
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
new file mode 100644
index 00000000000..3a3377799f3
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
@@ -0,0 +1,1743 @@
+update performance_schema.setup_instruments
+set enabled='NO' where name='wait/io/table/sql/handler';
+update performance_schema.setup_consumers
+set enabled='NO' where name like 'event%';
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+HOST USER ROLE
+localhost user1 %
+localhost user2 %
+localhost user3 %
+localhost user4 %
+select * from performance_schema.setup_objects
+order by object_type, object_schema, object_name;
+OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
+TABLE test t1 YES YES
+TABLE test t2 YES NO
+TABLE test t3 YES NO
+select * from performance_schema.setup_consumers;
+NAME ENABLED
+events_stages_current NO
+events_stages_history NO
+events_stages_history_long NO
+events_statements_current NO
+events_statements_history NO
+events_statements_history_long NO
+events_waits_current NO
+events_waits_history NO
+events_waits_history_long NO
+global_instrumentation YES
+thread_instrumentation YES
+statements_digest YES
+flush tables;
+truncate performance_schema.objects_summary_global_by_type;
+truncate performance_schema.table_io_waits_summary_by_index_usage;
+truncate performance_schema.table_io_waits_summary_by_table;
+truncate performance_schema.table_lock_waits_summary_by_table;
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+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%";
+Variable_name Value
+performance_schema ON
+performance_schema_accounts_size 100
+performance_schema_digests_size 200
+performance_schema_events_stages_history_long_size 1000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 1000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_hosts_size 100
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 5000
+performance_schema_max_rwlock_classes 30
+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 168
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 200
+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_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
+"================== Step 1 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+execute dump_waits_user;
+user event_name count_star
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+"================== con1 connected =================="
+"================== Step 2 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+insert into test.t1 set a=101, b=1, c=1;
+insert into test.t2 set a=102, b=2, c=2;
+insert into test.t2 set a=103, b=3, c=3;
+insert into test.t3 set a=104, b=4, c=4;
+insert into test.t3 set a=105, b=5, c=5;
+insert into test.t3 set a=106, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 0
+103 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 0
+105 5 5 0
+106 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=101;
+update test.t2 set d=d+1 where a=101;
+update test.t3 set d=d+1 where a=101;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 1
+"================== con1 marker =================="
+"================== Step 3 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+"================== con2 connected =================="
+"================== Step 4 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 36
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 36
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 10 4 6 2 0 0 0 2 0 0 3
+TABLE test t2 12 4 8 2 0 0 0 2 0 0 4
+TABLE test t3 14 4 10 2 0 0 0 2 0 0 5
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 10
+TABLE test t2 12
+TABLE test t3 14
+insert into test.t1 set a=201, b=1, c=1;
+insert into test.t2 set a=202, b=2, c=2;
+insert into test.t2 set a=203, b=3, c=3;
+insert into test.t3 set a=204, b=4, c=4;
+insert into test.t3 set a=205, b=5, c=5;
+insert into test.t3 set a=206, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 2
+201 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 1
+103 3 3 1
+202 2 2 0
+203 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 1
+105 5 5 1
+106 6 6 1
+204 4 4 0
+205 5 5 0
+206 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=201;
+update test.t2 set d=d+1 where a=201;
+update test.t3 set d=d+1 where a=201;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 2
+205 5 5 1
+"================== con2 marker =================="
+"================== Step 5 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+"================== con3 connected =================="
+"================== Step 6 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 72
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 72
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 20 8 12 4 0 0 0 4 0 0 6
+TABLE test t2 24 8 16 4 0 0 0 4 0 0 8
+TABLE test t3 28 8 20 4 0 0 0 4 0 0 10
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 20
+TABLE test t2 24
+TABLE test t3 28
+insert into test.t1 set a=301, b=1, c=1;
+insert into test.t2 set a=302, b=2, c=2;
+insert into test.t2 set a=303, b=3, c=3;
+insert into test.t3 set a=304, b=4, c=4;
+insert into test.t3 set a=305, b=5, c=5;
+insert into test.t3 set a=306, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 3
+201 1 1 2
+301 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 2
+103 3 3 2
+202 2 2 1
+203 3 3 1
+302 2 2 0
+303 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 2
+105 5 5 2
+106 6 6 2
+204 4 4 1
+205 5 5 1
+206 6 6 1
+304 4 4 0
+305 5 5 0
+306 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=301;
+update test.t2 set d=d+1 where a=301;
+update test.t3 set d=d+1 where a=301;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 3
+205 5 5 2
+305 5 5 1
+"================== con3 marker =================="
+"================== Step 7 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 108
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 36
+TABLE test t3 42
+"================== con4 connected =================="
+"================== Step 8 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 108
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 108
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 30 12 18 6 0 0 0 6 0 0 9
+TABLE test t2 36 12 24 6 0 0 0 6 0 0 12
+TABLE test t3 42 12 30 6 0 0 0 6 0 0 15
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 30
+TABLE test t2 36
+TABLE test t3 42
+insert into test.t1 set a=401, b=1, c=1;
+insert into test.t2 set a=402, b=2, c=2;
+insert into test.t2 set a=403, b=3, c=3;
+insert into test.t3 set a=404, b=4, c=4;
+insert into test.t3 set a=405, b=5, c=5;
+insert into test.t3 set a=406, b=6, c=6;
+select * from test.t1;
+a b c d
+101 1 1 4
+201 1 1 3
+301 1 1 2
+401 1 1 0
+select * from test.t2;
+a b c d
+102 2 2 3
+103 3 3 3
+202 2 2 2
+203 3 3 2
+302 2 2 1
+303 3 3 1
+402 2 2 0
+403 3 3 0
+select * from test.t3;
+a b c d
+104 4 4 3
+105 5 5 3
+106 6 6 3
+204 4 4 2
+205 5 5 2
+206 6 6 2
+304 4 4 1
+305 5 5 1
+306 6 6 1
+404 4 4 0
+405 5 5 0
+406 6 6 0
+update test.t1 set d=d+1;
+update test.t2 set d=d+1;
+update test.t3 set d=d+1;
+update test.t1 set d=d+1 where a=401;
+update test.t2 set d=d+1 where a=401;
+update test.t3 set d=d+1 where a=401;
+select * from test.t1 where b=5;
+a b c d
+select * from test.t2 where b=5;
+a b c d
+select * from test.t3 where b=5;
+a b c d
+105 5 5 4
+205 5 5 3
+305 5 5 2
+405 5 5 1
+"================== con4 marker =================="
+"================== Step 9 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 36
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 36
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 144
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 144
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 40 16 24 8 0 0 0 8 0 0 12
+TABLE test t2 48 16 32 8 0 0 0 8 0 0 16
+TABLE test t3 56 16 40 8 0 0 0 8 0 0 20
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 40
+TABLE test t2 48
+TABLE test t3 56
+lock tables test.t1 read, test.t2 read, test.t3 read;
+unlock tables;
+lock tables test.t1 write, test.t2 write, test.t3 write;
+unlock tables;
+"================== con1 marker =================="
+"================== Step 10 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+flush tables;
+"================== flush marker =================="
+"================== Step 11 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+set global read_only=1;
+set global read_only=0;
+"================== global read_only marker =================="
+"================== Step 12 =================="
+call dump_thread();
+username event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con1 disconnected =================="
+"================== Step 13 =================="
+call dump_thread();
+username status
+user1 not found
+username event_name count_star
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con2 disconnected =================="
+"================== Step 14 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username event_name count_star
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con3 disconnected =================="
+"================== Step 15 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username event_name count_star
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+"================== con4 disconnected =================="
+"================== Step 16 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_thread_by_event_name;
+"================== BY_THREAD truncated =================="
+"================== Step 17 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 48
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 36
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 36
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 36
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_account_by_event_name;
+"================== BY_ACCOUNT truncated =================="
+"================== Step 18 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 48
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 36
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 36
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 36
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_user_by_event_name;
+"================== BY_USER truncated =================="
+"================== Step 19 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 156
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_by_host_by_event_name;
+"================== BY_HOST truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 156
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 44 18 26 8 0 0 1 9 0 0 13
+TABLE test t2 52 18 34 8 0 0 1 9 0 0 17
+TABLE test t3 60 18 42 8 0 0 1 9 0 0 21
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 44
+TABLE test t2 52
+TABLE test t3 60
+truncate performance_schema.events_waits_summary_global_by_event_name;
+"================== GLOBAL truncated =================="
+"================== Step 21 =================="
+call dump_thread();
+username status
+user1 not found
+username status
+user2 not found
+username status
+user3 not found
+username status
+user4 not found
+execute dump_waits_account;
+user host event_name count_star
+user1 localhost wait/io/table/sql/handler 0
+user1 localhost wait/lock/table/sql/handler 0
+user2 localhost wait/io/table/sql/handler 0
+user2 localhost wait/lock/table/sql/handler 0
+user3 localhost wait/io/table/sql/handler 0
+user3 localhost wait/lock/table/sql/handler 0
+user4 localhost wait/io/table/sql/handler 0
+user4 localhost wait/lock/table/sql/handler 0
+execute dump_waits_user;
+user event_name count_star
+user1 wait/io/table/sql/handler 0
+user1 wait/lock/table/sql/handler 0
+user2 wait/io/table/sql/handler 0
+user2 wait/lock/table/sql/handler 0
+user3 wait/io/table/sql/handler 0
+user3 wait/lock/table/sql/handler 0
+user4 wait/io/table/sql/handler 0
+user4 wait/lock/table/sql/handler 0
+execute dump_waits_host;
+host event_name count_star
+localhost wait/io/table/sql/handler 0
+localhost wait/lock/table/sql/handler 0
+execute dump_waits_global;
+event_name count_star
+wait/io/table/sql/handler 0
+wait/lock/table/sql/handler 0
+execute dump_waits_history;
+event_name count(event_name) object_type object_schema object_name
+execute dump_waits_index_io;
+object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 NULL 0 0 0 0 0 0 0
+TABLE test t1 index_b 0 0 0 0 0 0 0
+TABLE test t1 index_cb 0 0 0 0 0 0 0
+TABLE test t1 PRIMARY 0 0 0 0 0 0 0
+TABLE test t2 NULL 0 0 0 0 0 0 0
+TABLE test t2 index_b 0 0 0 0 0 0 0
+TABLE test t2 index_cb 0 0 0 0 0 0 0
+TABLE test t2 PRIMARY 0 0 0 0 0 0 0
+TABLE test t3 NULL 0 0 0 0 0 0 0
+TABLE test t3 index_b 0 0 0 0 0 0 0
+TABLE test t3 index_cb 0 0 0 0 0 0 0
+TABLE test t3 PRIMARY 0 0 0 0 0 0 0
+execute dump_waits_table_io;
+object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete
+TABLE test t1 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0
+execute dump_waits_table_lock;
+object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_delayed count_write_low_priority count_write_external
+TABLE test t1 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t2 0 0 0 0 0 0 0 0 0 0 0
+TABLE test t3 0 0 0 0 0 0 0 0 0 0 0
+execute dump_objects_summary;
+object_type object_schema object_name count_star
+TABLE test t1 0
+TABLE test t2 0
+TABLE test t3 0
+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_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
diff --git a/mysql-test/suite/perfschema/r/table_schema.result b/mysql-test/suite/perfschema/r/table_schema.result
new file mode 100644
index 00000000000..731925578b1
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/table_schema.result
@@ -0,0 +1,815 @@
+select * from information_schema.columns where table_schema="performance_schema"
+ order by table_name, ordinal_position;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
+def performance_schema accounts USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references
+def performance_schema accounts HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references
+def performance_schema accounts CURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema accounts TOTAL_CONNECTIONS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema cond_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema cond_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_current THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_stages_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_stages_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_stages_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_current NESTING_EVENT_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_current NESTING_EVENT_TYPE 10 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references
+def performance_schema events_stages_history THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_stages_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_stages_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_stages_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history NESTING_EVENT_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history NESTING_EVENT_TYPE 10 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references
+def performance_schema events_stages_history_long THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_stages_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_stages_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_stages_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history_long NESTING_EVENT_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_history_long NESTING_EVENT_TYPE 10 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references
+def performance_schema events_stages_summary_by_account_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references
+def performance_schema events_stages_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references
+def performance_schema events_stages_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_stages_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references
+def performance_schema events_stages_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_stages_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_thread_by_event_name THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_stages_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_stages_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_user_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references
+def performance_schema events_stages_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_stages_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_stages_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_stages_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_statements_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references
+def performance_schema events_statements_current DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references
+def performance_schema events_statements_current DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references
+def performance_schema events_statements_current CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_current OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_current OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_current OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_current OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_statements_current RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8 utf8_general_ci varchar(5) select,insert,update,references
+def performance_schema events_statements_current MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_current ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_current NESTING_EVENT_TYPE 40 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references
+def performance_schema events_statements_history THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_statements_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references
+def performance_schema events_statements_history DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references
+def performance_schema events_statements_history DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references
+def performance_schema events_statements_history CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_history OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_history OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_history OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_history OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_statements_history RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8 utf8_general_ci varchar(5) select,insert,update,references
+def performance_schema events_statements_history MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_history ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history NESTING_EVENT_TYPE 40 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references
+def performance_schema events_statements_history_long THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_statements_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references
+def performance_schema events_statements_history_long DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references
+def performance_schema events_statements_history_long DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references
+def performance_schema events_statements_history_long CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_history_long OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_history_long OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_history_long OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_statements_history_long OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_statements_history_long RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8 utf8_general_ci varchar(5) select,insert,update,references
+def performance_schema events_statements_history_long MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_history_long ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_history_long NESTING_EVENT_TYPE 40 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ERRORS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_WARNINGS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_AFFECTED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_SENT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_EXAMINED 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_CREATED_TMP_DISK_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_CREATED_TMP_TABLES 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_FULL_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_FULL_RANGE_JOIN 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_RANGE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_RANGE_CHECK 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_SCAN 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_MERGE_PASSES 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_RANGE 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_ROWS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_SCAN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_NO_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_account_by_event_name SUM_NO_GOOD_INDEX_USED 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest DIGEST 1 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references
+def performance_schema events_statements_summary_by_digest DIGEST_TEXT 2 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references
+def performance_schema events_statements_summary_by_digest COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_digest FIRST_SEEN 27 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references
+def performance_schema events_statements_summary_by_digest LAST_SEEN 28 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_host_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_by_user_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_LOCK_TIME 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_ERRORS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_WARNINGS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_AFFECTED 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_SENT 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_EXAMINED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_CREATED_TMP_DISK_TABLES 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_CREATED_TMP_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_FULL_JOIN 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_FULL_RANGE_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_RANGE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_RANGE_CHECK 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_SCAN 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_MERGE_PASSES 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_RANGE 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_ROWS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_SCAN 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_NO_INDEX_USED 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_statements_summary_global_by_event_name SUM_NO_GOOD_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_current THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_waits_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_waits_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_current SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
+def performance_schema events_waits_current OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_current OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references
+def performance_schema events_waits_current INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_current OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_current OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_current NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_current NESTING_EVENT_TYPE 16 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references
+def performance_schema events_waits_current OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references
+def performance_schema events_waits_current NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema events_waits_current FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
+def performance_schema events_waits_history THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_waits_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_waits_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
+def performance_schema events_waits_history OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_history OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references
+def performance_schema events_waits_history INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_history OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_history OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history NESTING_EVENT_TYPE 16 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references
+def performance_schema events_waits_history OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references
+def performance_schema events_waits_history NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema events_waits_history FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
+def performance_schema events_waits_history_long THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_waits_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_waits_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history_long SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
+def performance_schema events_waits_history_long OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_history_long OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references
+def performance_schema events_waits_history_long INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_history_long OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema events_waits_history_long OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history_long NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_history_long NESTING_EVENT_TYPE 16 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references
+def performance_schema events_waits_history_long OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references
+def performance_schema events_waits_history_long NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema events_waits_history_long FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_account_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references
+def performance_schema events_waits_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references
+def performance_schema events_waits_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_waits_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references
+def performance_schema events_waits_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_waits_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_instance EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_waits_summary_by_instance OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_instance COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_instance SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_instance MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_instance AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_instance MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_thread_by_event_name THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema events_waits_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_waits_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_user_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references
+def performance_schema events_waits_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_waits_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema events_waits_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema events_waits_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_instances FILE_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references
+def performance_schema file_instances EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema file_instances OPEN_COUNT 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema file_summary_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name COUNT_READ 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name SUM_TIMER_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name MIN_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name AVG_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name MAX_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name SUM_NUMBER_OF_BYTES_READ 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema file_summary_by_event_name COUNT_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name SUM_TIMER_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name MIN_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name AVG_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name MAX_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name SUM_NUMBER_OF_BYTES_WRITE 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema file_summary_by_event_name COUNT_MISC 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name SUM_TIMER_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name MIN_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name AVG_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_event_name MAX_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance FILE_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references
+def performance_schema file_summary_by_instance EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema file_summary_by_instance OBJECT_INSTANCE_BEGIN 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance SUM_NUMBER_OF_BYTES_READ 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema file_summary_by_instance COUNT_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance SUM_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance MIN_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance AVG_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance MAX_TIMER_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance SUM_NUMBER_OF_BYTES_WRITE 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema file_summary_by_instance COUNT_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance SUM_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance MIN_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance AVG_TIMER_MISC 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema file_summary_by_instance MAX_TIMER_MISC 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema hosts HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references
+def performance_schema hosts CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema hosts TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache IP 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema host_cache HOST 2 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255) select,insert,update,references
+def performance_schema host_cache HOST_VALIDATED 3 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
+def performance_schema host_cache SUM_CONNECT_ERRORS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_HOST_BLOCKED_ERRORS 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_NAMEINFO_TRANSIENT_ERRORS 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_NAMEINFO_PERMANENT_ERRORS 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_FORMAT_ERRORS 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_ADDRINFO_TRANSIENT_ERRORS 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_ADDRINFO_PERMANENT_ERRORS 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_FCRDNS_ERRORS 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_HOST_ACL_ERRORS 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_NO_AUTH_PLUGIN_ERRORS 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_AUTH_PLUGIN_ERRORS 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_HANDSHAKE_ERRORS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_PROXY_USER_ERRORS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_PROXY_USER_ACL_ERRORS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_AUTHENTICATION_ERRORS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_SSL_ERRORS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_MAX_USER_CONNECTIONS_ERRORS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_DEFAULT_DATABASE_ERRORS 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_INIT_CONNECT_ERRORS 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_LOCAL_ERRORS 24 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache COUNT_UNKNOWN_ERRORS 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema host_cache FIRST_SEEN 26 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references
+def performance_schema host_cache LAST_SEEN 27 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references
+def performance_schema host_cache FIRST_ERROR_SEEN 28 0000-00-00 00:00:00 YES timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references
+def performance_schema host_cache LAST_ERROR_SEEN 29 0000-00-00 00:00:00 YES timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references
+def performance_schema mutex_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema mutex_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema mutex_instances LOCKED_BY_THREAD_ID 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema objects_summary_global_by_type OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema objects_summary_global_by_type OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema objects_summary_global_by_type OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema objects_summary_global_by_type COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema objects_summary_global_by_type SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema objects_summary_global_by_type MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema objects_summary_global_by_type AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema objects_summary_global_by_type MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema performance_timers TIMER_NAME 1 NULL NO enum 11 33 NULL NULL NULL utf8 utf8_general_ci enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') select,insert,update,references
+def performance_schema performance_timers TIMER_FREQUENCY 2 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema performance_timers TIMER_RESOLUTION 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema performance_timers TIMER_OVERHEAD 4 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema rwlock_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema rwlock_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema rwlock_instances WRITE_LOCKED_BY_THREAD_ID 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema rwlock_instances READ_LOCKED_BY_COUNT 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
+def performance_schema setup_actors HOST 1 % NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references
+def performance_schema setup_actors USER 2 % NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references
+def performance_schema setup_actors ROLE 3 % NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references
+def performance_schema setup_consumers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema setup_consumers ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
+def performance_schema setup_instruments NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema setup_instruments ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
+def performance_schema setup_instruments TIMED 3 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
+def performance_schema setup_objects OBJECT_TYPE 1 TABLE NO enum 5 15 NULL NULL NULL utf8 utf8_general_ci enum('TABLE') select,insert,update,references
+def performance_schema setup_objects OBJECT_SCHEMA 2 % YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema setup_objects OBJECT_NAME 3 % NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema setup_objects ENABLED 4 YES NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
+def performance_schema setup_objects TIMED 5 YES NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
+def performance_schema setup_timers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema setup_timers TIMER_NAME 2 NULL NO enum 11 33 NULL NULL NULL utf8 utf8_general_ci enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') select,insert,update,references
+def performance_schema socket_instances EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema socket_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_instances THREAD_ID 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema socket_instances SOCKET_ID 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema socket_instances IP 5 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema socket_instances PORT 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema socket_instances STATE 7 NULL NO enum 6 18 NULL NULL NULL utf8 utf8_general_ci enum('IDLE','ACTIVE') select,insert,update,references
+def performance_schema socket_summary_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema socket_summary_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name COUNT_READ 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name SUM_TIMER_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name MIN_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name AVG_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name MAX_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name SUM_NUMBER_OF_BYTES_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name COUNT_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name SUM_TIMER_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name MIN_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name AVG_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name MAX_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name SUM_NUMBER_OF_BYTES_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name COUNT_MISC 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name SUM_TIMER_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name MIN_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name AVG_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_event_name MAX_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema socket_summary_by_instance OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance COUNT_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance SUM_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance MIN_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance AVG_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance MAX_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance SUM_NUMBER_OF_BYTES_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance SUM_NUMBER_OF_BYTES_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance COUNT_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance SUM_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance MIN_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance AVG_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema socket_summary_by_instance MAX_TIMER_MISC 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage INDEX_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage COUNT_STAR 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_WAIT 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage COUNT_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_READ 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage COUNT_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage COUNT_FETCH 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_FETCH 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_FETCH 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_FETCH 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_FETCH 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage COUNT_INSERT 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_INSERT 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_INSERT 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_INSERT 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_INSERT 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage COUNT_UPDATE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_UPDATE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_UPDATE 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_UPDATE 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_UPDATE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage COUNT_DELETE 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_DELETE 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_DELETE 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_DELETE 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_DELETE 39 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema table_io_waits_summary_by_table OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema table_io_waits_summary_by_table OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema table_io_waits_summary_by_table COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table COUNT_FETCH 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_FETCH 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_FETCH 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_FETCH 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_FETCH 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table COUNT_INSERT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_INSERT 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_INSERT 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_INSERT 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_INSERT 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table COUNT_UPDATE 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_UPDATE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_UPDATE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_UPDATE 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_UPDATE 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table COUNT_DELETE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_DELETE 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_DELETE 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_DELETE 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_DELETE 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_NORMAL 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_NORMAL 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_NORMAL 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_NORMAL 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_NORMAL 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_WITH_SHARED_LOCKS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_WITH_SHARED_LOCKS 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_WITH_SHARED_LOCKS 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_WITH_SHARED_LOCKS 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_WITH_SHARED_LOCKS 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_HIGH_PRIORITY 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_HIGH_PRIORITY 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_HIGH_PRIORITY 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_HIGH_PRIORITY 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_HIGH_PRIORITY 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_NO_INSERT 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_NO_INSERT 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_NO_INSERT 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_NO_INSERT 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_NO_INSERT 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_EXTERNAL 39 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_EXTERNAL 40 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_EXTERNAL 41 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_EXTERNAL 42 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_EXTERNAL 43 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_ALLOW_WRITE 44 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_ALLOW_WRITE 45 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_ALLOW_WRITE 46 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_ALLOW_WRITE 47 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_ALLOW_WRITE 48 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_CONCURRENT_INSERT 49 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_CONCURRENT_INSERT 50 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_CONCURRENT_INSERT 51 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_CONCURRENT_INSERT 52 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_CONCURRENT_INSERT 53 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_DELAYED 54 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_DELAYED 55 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_DELAYED 56 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_DELAYED 57 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_DELAYED 58 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_LOW_PRIORITY 59 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_LOW_PRIORITY 60 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_LOW_PRIORITY 61 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_LOW_PRIORITY 62 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_LOW_PRIORITY 63 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_NORMAL 64 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_NORMAL 65 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_NORMAL 66 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_NORMAL 67 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_NORMAL 68 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_EXTERNAL 69 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_EXTERNAL 70 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_EXTERNAL 71 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_EXTERNAL 72 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_EXTERNAL 73 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references
+def performance_schema threads THREAD_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema threads NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def performance_schema threads TYPE 3 NULL NO varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10) select,insert,update,references
+def performance_schema threads PROCESSLIST_ID 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema threads PROCESSLIST_USER 5 NULL YES varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select,insert,update,references
+def performance_schema threads PROCESSLIST_HOST 6 NULL YES varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) select,insert,update,references
+def performance_schema threads PROCESSLIST_DB 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema threads PROCESSLIST_COMMAND 8 NULL YES varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select,insert,update,references
+def performance_schema threads PROCESSLIST_TIME 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema threads PROCESSLIST_STATE 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema threads PROCESSLIST_INFO 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references
+def performance_schema threads PARENT_THREAD_ID 12 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
+def performance_schema threads ROLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def performance_schema threads INSTRUMENTED 14 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
+def performance_schema users USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references
+def performance_schema users CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+def performance_schema users TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references
+select count(*) from information_schema.columns
+where table_schema="performance_schema" and data_type = "bigint"
+ and column_name like "%number_of_bytes" into @count_byte_columns;
+select @count_byte_columns > 0;
+@count_byte_columns > 0
+1
+select count(*) from information_schema.columns
+where table_schema="performance_schema" and data_type="bigint"
+ and column_name like "%number_of_bytes"
+ and column_type not like "%unsigned" into @count_byte_signed;
+select (@count_byte_columns - @count_byte_signed) = 0;
+(@count_byte_columns - @count_byte_signed) = 0
+1
+select count(*) from information_schema.columns
+where table_schema="performance_schema" and data_type = "bigint"
+ and column_name like "%object_instance_begin" into @count_object_columns;
+select @count_object_columns > 0;
+@count_object_columns > 0
+1
+select count(*) from information_schema.columns
+where table_schema="performance_schema" and data_type="bigint"
+ and column_name like "%object_instance_begin"
+ and column_type like "%unsigned" into @count_object_unsigned;
+select (@count_object_columns - @count_object_unsigned) = 0;
+(@count_object_columns - @count_object_unsigned) = 0
+1
diff --git a/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result b/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
index 86252d4ca01..e9537e5474c 100644
--- a/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
+++ b/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
@@ -1,5 +1,5 @@
call mtr.add_suppression(
-"Column count of mysql.setup_instruments is wrong. "
+"Column count of performance_schema.setup_instruments is wrong. "
"Expected 4, found 3. The table is probably corrupted");
select * from performance_schema.setup_instruments limit 1;
ERROR HY000: Native table 'performance_schema'.'setup_instruments' has the wrong structure
diff --git a/mysql-test/suite/perfschema/r/temp_table_io.result b/mysql-test/suite/perfschema/r/temp_table_io.result
new file mode 100644
index 00000000000..732d1acac6a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/temp_table_io.result
@@ -0,0 +1,118 @@
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+drop temporary table if exists test.no_index_tab;
+update performance_schema.setup_consumers set enabled = 'YES';
+insert into marker set a = 1;
+create temporary table test.no_index_tab
+( a varchar(255) not null, b int not null) engine = MyISAM;
+insert into marker set a = 1;
+show create table test.no_index_tab;
+Table Create Table
+no_index_tab CREATE TEMPORARY TABLE `no_index_tab` (
+ `a` varchar(255) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 1;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 2;
+insert into marker set a = 1;
+insert into test.no_index_tab set a = 'foo', b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+foo 1
+foo 2
+foo 3
+insert into marker set a = 1;
+update test.no_index_tab set a = 'bar';
+insert into marker set a = 1;
+select * from test.no_index_tab limit 2;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+delete from test.no_index_tab where b = 3;
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+optimize table test.no_index_tab;
+Table Op Msg_type Msg_text
+test.no_index_tab optimize status OK
+insert into marker set a = 1;
+select * from test.no_index_tab;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+truncate table test.no_index_tab;
+insert into marker set a = 1;
+drop temporary table test.no_index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ("test")
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/threads_innodb.result b/mysql-test/suite/perfschema/r/threads_innodb.result
new file mode 100644
index 00000000000..fdbd7469c7e
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/threads_innodb.result
@@ -0,0 +1,14 @@
+SELECT name, type, processlist_user, processlist_host, processlist_db,
+processlist_command, processlist_time, processlist_state, processlist_info,
+parent_thread_id, role, instrumented
+FROM performance_schema.threads
+WHERE name LIKE 'thread/innodb/%'
+GROUP BY name;
+name type processlist_user processlist_host processlist_db processlist_command processlist_time processlist_state processlist_info parent_thread_id role instrumented
+thread/innodb/io_handler_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
+thread/innodb/page_cleaner_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
+thread/innodb/srv_error_monitor_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
+thread/innodb/srv_lock_timeout_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
+thread/innodb/srv_master_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
+thread/innodb/srv_monitor_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
+thread/innodb/srv_purge_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
diff --git a/mysql-test/suite/perfschema/r/threads_insert_delayed.result b/mysql-test/suite/perfschema/r/threads_insert_delayed.result
new file mode 100644
index 00000000000..b3bcdc49f58
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/threads_insert_delayed.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS t1;
+DROP TEMPORARY TABLE IF EXISTS t2;
+CREATE TABLE t1 (f1 BIGINT) ENGINE = MyISAM;
+CREATE TEMPORARY TABLE t2 AS
+SELECT thread_id FROM performance_schema.threads WHERE 1 = 2;
+SELECT COUNT(*) = 0 AS expect_1 FROM performance_schema.threads
+WHERE name = 'thread/sql/delayed_insert';
+expect_1
+1
+INSERT INTO t2 SELECT thread_id
+FROM performance_schema.threads;
+INSERT DELAYED INTO t1 SET f1 = SLEEP(3);
+SELECT name, type, instrumented, processlist_user, processlist_host
+FROM performance_schema.threads
+WHERE thread_id NOT IN (SELECT thread_id FROM t2);
+name type instrumented processlist_user processlist_host
+thread/sql/delayed_insert FOREGROUND YES root localhost
+DROP TABLE t1;
+DROP TEMPORARY TABLE t2;
diff --git a/mysql-test/suite/perfschema/r/threads_mysql.result b/mysql-test/suite/perfschema/r/threads_mysql.result
new file mode 100644
index 00000000000..4da857f83fc
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/threads_mysql.result
@@ -0,0 +1,108 @@
+SET GLOBAL event_scheduler = OFF;
+SELECT name, type, processlist_user, processlist_host, processlist_db,
+processlist_command, processlist_info,
+IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
+AS unified_parent_thread_id,
+role, instrumented
+FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%'
+ORDER BY name;
+name thread/sql/main
+type BACKGROUND
+processlist_user NULL
+processlist_host NULL
+processlist_db NULL
+processlist_command NULL
+processlist_info INTERNAL DDL LOG RECOVER IN PROGRESS
+unified_parent_thread_id NULL
+role NULL
+instrumented YES
+name thread/sql/one_connection
+type FOREGROUND
+processlist_user root
+processlist_host localhost
+processlist_db test
+processlist_command Query
+processlist_info SELECT name, type, processlist_user, processlist_host, processlist_db,
+processlist_command, processlist_info,
+IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
+AS unified_parent_thread_id,
+role, instrumented
+FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%'
+ORDER BY name
+unified_parent_thread_id unified parent_thread_id
+role NULL
+instrumented YES
+name thread/sql/signal_handler
+type BACKGROUND
+processlist_user NULL
+processlist_host NULL
+processlist_db NULL
+processlist_command NULL
+processlist_info NULL
+unified_parent_thread_id unified parent_thread_id
+role NULL
+instrumented YES
+CREATE TEMPORARY TABLE t1 AS
+SELECT thread_id FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%';
+SET GLOBAL event_scheduler = ON;
+SELECT name, type, processlist_user, processlist_host, processlist_db,
+processlist_command, processlist_info,
+IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
+AS unified_parent_thread_id,
+role, instrumented
+FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%'
+ AND thread_id NOT IN (SELECT thread_id FROM t1)
+ORDER BY name;
+name thread/sql/event_scheduler
+type FOREGROUND
+processlist_user root
+processlist_host localhost
+processlist_db NULL
+processlist_command Sleep
+processlist_info NULL
+unified_parent_thread_id unified parent_thread_id
+role NULL
+instrumented YES
+TRUNCATE t1;
+INSERT INTO t1
+SELECT thread_id FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%';
+SELECT COUNT(*) INTO @aux FROM t1;
+DROP EVENT IF EXISTS t_ps_event;
+CREATE EVENT t_ps_event
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
+DO SELECT SLEEP(3);
+SELECT name, type, processlist_user, processlist_host, processlist_db,
+processlist_command, processlist_info,
+IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
+AS unified_parent_thread_id,
+role, instrumented
+FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%'
+ AND thread_id NOT IN (SELECT thread_id FROM t1)
+ORDER BY name;
+name thread/sql/event_worker
+type FOREGROUND
+processlist_user root
+processlist_host localhost
+processlist_db NULL
+processlist_command Sleep
+processlist_info SELECT SLEEP(3)
+unified_parent_thread_id unified parent_thread_id
+role NULL
+instrumented YES
+SELECT t2.name AS parent_thread_name, t1.name AS child_thread_name
+FROM performance_schema.threads t1 INNER JOIN performance_schema.threads t2
+ON t1.parent_thread_id = t2.thread_id
+WHERE t1.name LIKE 'thread/sql%'
+ AND t1.parent_thread_id IS NOT NULL
+ORDER BY parent_thread_name, child_thread_name;
+parent_thread_name child_thread_name
+thread/sql/event_scheduler thread/sql/event_worker
+thread/sql/main thread/sql/one_connection
+thread/sql/main thread/sql/signal_handler
+thread/sql/one_connection thread/sql/event_scheduler
diff --git a/mysql-test/suite/perfschema/r/trigger_table_io.result b/mysql-test/suite/perfschema/r/trigger_table_io.result
new file mode 100644
index 00000000000..a8207a8b32a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/trigger_table_io.result
@@ -0,0 +1,205 @@
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+drop table if exists test.t1;
+drop table if exists test.t2;
+create table test.t1 (a int, v int) engine = MyISAM;
+create table test.t2 (b int, v int) engine = MyISAM;
+create trigger t1_bi before insert on t1
+for each row insert into test.t2 set b = new.a, v = 0;
+create trigger t1_ai after insert on t1
+for each row update test.t2 set v = 1 where b = new.a;
+create trigger t1_bu before update on t1
+for each row update test.t2 set v = 3 where b = old.a;
+create trigger t1_au after update on t1
+for each row update test.t2 set v = 4 where b = new.a;
+create trigger t1_bd before delete on t1
+for each row delete from test.t2 where b = old.a;
+create trigger t1_ad after delete on t1
+for each row insert into test.t2 set b = old.a, v = 99;
+update performance_schema.setup_consumers set enabled = 'YES';
+insert into marker set a = 1;
+insert into t1 set a = 1, v = 10;
+insert into marker set a = 1;
+insert into t1 set a = 2, v = 20;
+insert into marker set a = 1;
+select * from t1;
+a v
+1 10
+2 20
+insert into marker set a = 1;
+select * from t2;
+b v
+1 1
+2 1
+insert into marker set a = 1;
+update t1 set v = v + 100;
+insert into marker set a = 1;
+select * from t1;
+a v
+1 110
+2 120
+insert into marker set a = 1;
+select * from t2;
+b v
+1 4
+2 4
+insert into marker set a = 1;
+delete from t1 where a = 1;
+insert into marker set a = 1;
+select * from t1;
+a v
+2 120
+insert into marker set a = 1;
+select * from t2;
+b v
+1 99
+2 4
+insert into marker set a = 1;
+delete from t1 where a = 2;
+insert into marker set a = 1;
+select * from t1;
+a v
+insert into marker set a = 1;
+select * from t2;
+b v
+1 99
+2 99
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ("test")
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 update NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t1 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+drop table test.t1;
+drop table test.t2;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/view_table_io.result b/mysql-test/suite/perfschema/r/view_table_io.result
new file mode 100644
index 00000000000..1d05ad38f56
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/view_table_io.result
@@ -0,0 +1,154 @@
+drop table if exists test.marker;
+create table test.marker(a int);
+update performance_schema.setup_consumers set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/io/table/%";
+truncate table performance_schema.events_waits_history_long;
+flush status;
+flush tables;
+drop view if exists test.v1;
+drop table if exists test.no_index_tab;
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+create table test.no_index_tab
+( a varchar(255) not null, b int not null) engine = MyISAM;
+insert into marker set a = 1;
+show create table test.no_index_tab;
+Table Create Table
+no_index_tab CREATE TABLE `no_index_tab` (
+ `a` varchar(255) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into marker set a = 1;
+create view test.v1 as select * from test.no_index_tab;
+insert into marker set a = 1;
+insert into test.v1 set a = 'foo', b = 1;
+insert into marker set a = 1;
+insert into test.v1 set a = 'foo', b = 2;
+insert into marker set a = 1;
+insert into test.v1 set a = 'foo', b = 3;
+insert into marker set a = 1;
+select * from test.v1;
+a b
+foo 1
+foo 2
+foo 3
+insert into marker set a = 1;
+update test.v1 set a = 'bar';
+insert into marker set a = 1;
+select * from test.v1 limit 2;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+delete from test.v1 where b = 3;
+insert into marker set a = 1;
+select * from test.v1;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+optimize table test.v1;
+Table Op Msg_type Msg_text
+test.v1 optimize Error 'test.v1' is not BASE TABLE
+test.v1 optimize error Corrupt
+insert into marker set a = 1;
+select * from test.v1;
+a b
+bar 1
+bar 2
+insert into marker set a = 1;
+truncate table test.v1;
+ERROR 42S02: Table 'test.v1' doesn't exist
+insert into marker set a = 1;
+drop view test.v1;
+insert into marker set a = 1;
+drop table test.no_index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+select event_name,
+left(source, locate(":", source)) as short_source,
+object_type, object_schema,
+if (locate("#sql-", object_name), "#sql-XXXX", object_name)
+as pretty_name,
+operation, number_of_bytes
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+ and object_schema in ("test")
+order by thread_id, event_id;
+event_name short_source object_type object_schema pretty_name operation number_of_bytes
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab delete NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
+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_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
+truncate performance_schema.events_waits_history_long;
+flush status;
+update performance_schema.setup_consumers set enabled='NO';
+truncate performance_schema.events_waits_history_long;
+drop table test.marker;
+flush status;
+update performance_schema.setup_instruments set enabled='YES';
+update performance_schema.setup_consumers set enabled='YES';
diff --git a/mysql-test/suite/perfschema/t/aggregate.test b/mysql-test/suite/perfschema/t/aggregate.test
index 91794f04346..672737ae2a7 100644
--- a/mysql-test/suite/perfschema/t/aggregate.test
+++ b/mysql-test/suite/perfschema/t/aggregate.test
@@ -16,6 +16,8 @@ update performance_schema.setup_consumers set enabled = 'NO';
# Cleanup statistics
truncate table performance_schema.file_summary_by_event_name;
truncate table performance_schema.file_summary_by_instance;
+truncate table performance_schema.socket_summary_by_event_name;
+truncate table performance_schema.socket_summary_by_instance;
truncate table performance_schema.events_waits_summary_global_by_event_name;
truncate table performance_schema.events_waits_summary_by_instance;
truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
@@ -99,6 +101,20 @@ GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
+SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
+FROM performance_schema.socket_summary_by_event_name AS e
+JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
+GROUP BY EVENT_NAME
+HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
+OR @dump_all;
+
+SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
+FROM performance_schema.socket_summary_by_event_name AS e
+JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
+GROUP BY EVENT_NAME
+HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
+OR @dump_all;
+
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
diff --git a/mysql-test/suite/perfschema/t/all_instances.test b/mysql-test/suite/perfschema/t/all_instances.test
deleted file mode 100644
index 53d542b6650..00000000000
--- a/mysql-test/suite/perfschema/t/all_instances.test
+++ /dev/null
@@ -1,31 +0,0 @@
---source include/not_embedded.inc
---source include/have_perfschema.inc
---source include/have_maria.inc
---source include/have_archive.inc
---source include/have_blackhole.inc
---source include/have_ssl.inc
---source include/not_windows.inc
---source include/one_thread_per_connection.inc
-
-use performance_schema;
-
-#
-# list all instances of everything.
-#
-
-#
-# "group by" sorts and removes duplicates.
-# "where" filters out instances that can be conditionally compiled out
-#
-
-select name from mutex_instances
- where name not rlike '/(DEBUG_SYNC::mutex)$'
- and name != 'wait/synch/mutex/mysys/BITMAP::mutex'
- group by name;
-# CRYPTO_dynlock_value::lock exists only when building with OpenSSL (not YaSSL).
-select name from rwlock_instances
- where name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock")
- group by name;
-select name from cond_instances where name not rlike '/(DEBUG_SYNC::cond)$' group by name;
-select event_name from file_instances group by event_name;
-select name from threads group by name;
diff --git a/mysql-test/suite/perfschema/t/all_tests.test b/mysql-test/suite/perfschema/t/all_tests.test
new file mode 100644
index 00000000000..e0db6d459de
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/all_tests.test
@@ -0,0 +1,64 @@
+--source include/not_embedded.inc
+
+#
+# Test based on mysql-test/suite/sys_vars/t/all_vars.test
+# and adapted for the performance schema tables.
+#
+# This test verifies that *all* performance schema tables are tested
+# by the perfschema test suite.
+# In particular, every table there must be covered by:
+# - a ddl_<table_name>.test file.
+# - a dml_<table_name>.test file.
+#
+
+#
+# we can diff in perl or in sql, as it's my_SQL_test suite, do it in sql
+#
+
+perl;
+ use File::Basename;
+ my $dirname=dirname($ENV{MYSQLTEST_FILE});
+ my @all_tests=<$dirname/*.test>;
+ open(F, '>', "$ENV{MYSQLTEST_VARDIR}/tmp/perfschema-all_tests.txt") or die;
+ binmode F;
+ print F join "\n", sort map { basename $_ } @all_tests;
+EOF
+
+--disable_warnings
+drop table if exists t1;
+drop table if exists t2;
+--enable_warnings
+
+create table t1 (test_name text);
+create table t2 (test_name text);
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
+eval load data infile "$MYSQLTEST_VARDIR/tmp/perfschema-all_tests.txt" into table t1;
+
+insert into t2 select concat('ddl_', table_name, '.test') from information_schema.tables
+ where table_schema='performance_schema';
+insert into t2 select concat('dml_', table_name, '.test') from information_schema.tables
+ where table_schema='performance_schema';
+
+# Abbreviations used for naming test files:
+update t2 set test_name= replace(test_name, "events_waits_summary_", "ews_");
+update t2 set test_name= replace(test_name, "events_stages_summary_", "esgs_");
+update t2 set test_name= replace(test_name, "events_statements_summary_", "esms_");
+update t2 set test_name= replace(test_name, "file_summary_", "fs_");
+update t2 set test_name= replace(test_name, "objects_summary_", "os_");
+update t2 set test_name= replace(test_name, "table_io_waits_summary_", "tiws_");
+update t2 set test_name= replace(test_name, "table_lock_waits_summary_", "tlws_");
+
+# Debug
+# select test_name as 'FOUND' from t1;
+# select test_name as 'EXPECTED' from t2;
+
+delete from t2 where t2.test_name in (select t1.test_name from t1);
+
+# If this fails, the test listed in the output is missing from the test suite.
+# The way to fix the failure is to implement the missing test, not silence this select.
+select test_name as `MISSING DDL/DML TESTS` from t2;
+
+drop table t1;
+drop table t2;
+
+--remove_file $MYSQLTEST_VARDIR/tmp/perfschema-all_tests.txt
diff --git a/mysql-test/suite/perfschema/t/checksum.test b/mysql-test/suite/perfschema/t/checksum.test
index c0f8692d6f6..125573242cc 100644
--- a/mysql-test/suite/perfschema/t/checksum.test
+++ b/mysql-test/suite/perfschema/t/checksum.test
@@ -9,41 +9,97 @@
#
--disable_result_log
+checksum table performance_schema.accounts;
checksum table performance_schema.cond_instances;
+checksum table performance_schema.events_stages_current;
+checksum table performance_schema.events_stages_history;
+checksum table performance_schema.events_stages_history_long;
+checksum table performance_schema.events_stages_summary_by_account_by_event_name;
+checksum table performance_schema.events_stages_summary_by_host_by_event_name;
+checksum table performance_schema.events_stages_summary_by_thread_by_event_name;
+checksum table performance_schema.events_stages_summary_by_user_by_event_name;
+checksum table performance_schema.events_stages_summary_global_by_event_name;
+checksum table performance_schema.events_statements_current;
+checksum table performance_schema.events_statements_history;
+checksum table performance_schema.events_statements_history_long;
+checksum table performance_schema.events_statements_summary_by_account_by_event_name;
+checksum table performance_schema.events_statements_summary_by_host_by_event_name;
+checksum table performance_schema.events_statements_summary_by_thread_by_event_name;
+checksum table performance_schema.events_statements_summary_by_user_by_event_name;
+checksum table performance_schema.events_statements_summary_global_by_event_name;
checksum table performance_schema.events_waits_current;
checksum table performance_schema.events_waits_history;
checksum table performance_schema.events_waits_history_long;
+checksum table performance_schema.events_waits_summary_by_account_by_event_name;
+checksum table performance_schema.events_waits_summary_by_host_by_event_name;
checksum table performance_schema.events_waits_summary_by_instance;
checksum table performance_schema.events_waits_summary_by_thread_by_event_name;
+checksum table performance_schema.events_waits_summary_by_user_by_event_name;
checksum table performance_schema.events_waits_summary_global_by_event_name;
checksum table performance_schema.file_instances;
checksum table performance_schema.file_summary_by_event_name;
checksum table performance_schema.file_summary_by_instance;
+checksum table performance_schema.hosts;
checksum table performance_schema.mutex_instances;
+checksum table performance_schema.objects_summary_global_by_type;
checksum table performance_schema.performance_timers;
checksum table performance_schema.rwlock_instances;
+checksum table performance_schema.setup_actors;
checksum table performance_schema.setup_consumers;
checksum table performance_schema.setup_instruments;
+checksum table performance_schema.setup_objects;
checksum table performance_schema.setup_timers;
+checksum table performance_schema.table_io_waits_summary_by_index_usage;
+checksum table performance_schema.table_io_waits_summary_by_table;
+checksum table performance_schema.table_lock_waits_summary_by_table;
checksum table performance_schema.threads;
+checksum table performance_schema.users;
+checksum table performance_schema.accounts extended;
checksum table performance_schema.cond_instances extended;
+checksum table performance_schema.events_stages_current extended;
+checksum table performance_schema.events_stages_history extended;
+checksum table performance_schema.events_stages_history_long extended;
+checksum table performance_schema.events_stages_summary_by_account_by_event_name extended;
+checksum table performance_schema.events_stages_summary_by_host_by_event_name extended;
+checksum table performance_schema.events_stages_summary_by_thread_by_event_name extended;
+checksum table performance_schema.events_stages_summary_by_user_by_event_name extended;
+checksum table performance_schema.events_stages_summary_global_by_event_name extended;
+checksum table performance_schema.events_statements_current extended;
+checksum table performance_schema.events_statements_history extended;
+checksum table performance_schema.events_statements_history_long extended;
+checksum table performance_schema.events_statements_summary_by_account_by_event_name extended;
+checksum table performance_schema.events_statements_summary_by_host_by_event_name extended;
+checksum table performance_schema.events_statements_summary_by_thread_by_event_name extended;
+checksum table performance_schema.events_statements_summary_by_user_by_event_name extended;
+checksum table performance_schema.events_statements_summary_global_by_event_name extended;
checksum table performance_schema.events_waits_current extended;
checksum table performance_schema.events_waits_history extended;
checksum table performance_schema.events_waits_history_long extended;
+checksum table performance_schema.events_waits_summary_by_account_by_event_name extended;
+checksum table performance_schema.events_waits_summary_by_host_by_event_name extended;
checksum table performance_schema.events_waits_summary_by_instance extended;
checksum table performance_schema.events_waits_summary_by_thread_by_event_name extended;
+checksum table performance_schema.events_waits_summary_by_user_by_event_name extended;
checksum table performance_schema.events_waits_summary_global_by_event_name extended;
checksum table performance_schema.file_instances extended;
checksum table performance_schema.file_summary_by_event_name extended;
checksum table performance_schema.file_summary_by_instance extended;
+checksum table performance_schema.hosts extended;
checksum table performance_schema.mutex_instances extended;
+checksum table performance_schema.objects_summary_global_by_type extended;
checksum table performance_schema.performance_timers extended;
checksum table performance_schema.rwlock_instances extended;
+checksum table performance_schema.setup_actors extended;
checksum table performance_schema.setup_consumers extended;
checksum table performance_schema.setup_instruments extended;
+checksum table performance_schema.setup_objects extended;
checksum table performance_schema.setup_timers extended;
+checksum table performance_schema.table_io_waits_summary_by_index_usage extended;
+checksum table performance_schema.table_io_waits_summary_by_table extended;
+checksum table performance_schema.table_lock_waits_summary_by_table extended;
checksum table performance_schema.threads extended;
+checksum table performance_schema.users extended;
--enable_result_log
diff --git a/mysql-test/suite/perfschema/t/column_privilege.test b/mysql-test/suite/perfschema/t/column_privilege.test
index 649e7b0aa05..6fabdfb4229 100644
--- a/mysql-test/suite/perfschema/t/column_privilege.test
+++ b/mysql-test/suite/perfschema/t/column_privilege.test
@@ -58,6 +58,4 @@ REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'pfs_user_5'@localhost;
DROP USER 'pfs_user_5'@localhost;
flush privileges;
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
-UPDATE performance_schema.setup_consumers SET enabled = 'YES';
-UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE';
diff --git a/mysql-test/suite/perfschema/t/connection.test b/mysql-test/suite/perfschema/t/connection.test
new file mode 100644
index 00000000000..1ca0ce2f67b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/connection.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/connection_setup.inc
+--source ../include/connection_load.inc
+--source ../include/connection_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/connection_3a-master.opt b/mysql-test/suite/perfschema/t/connection_3a-master.opt
new file mode 100644
index 00000000000..315f0f27334
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/connection_3a-master.opt
@@ -0,0 +1 @@
+--loose-performance_schema_accounts_size=3
diff --git a/mysql-test/suite/perfschema/t/connection_3a.test b/mysql-test/suite/perfschema/t/connection_3a.test
new file mode 100644
index 00000000000..1ca0ce2f67b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/connection_3a.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/connection_setup.inc
+--source ../include/connection_load.inc
+--source ../include/connection_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/connection_3a_3u-master.opt b/mysql-test/suite/perfschema/t/connection_3a_3u-master.opt
new file mode 100644
index 00000000000..945dc5a0117
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/connection_3a_3u-master.opt
@@ -0,0 +1,2 @@
+--loose-performance_schema_accounts_size=3
+--loose-performance_schema_users_size=3
diff --git a/mysql-test/suite/perfschema/t/connection_3a_3u.test b/mysql-test/suite/perfschema/t/connection_3a_3u.test
new file mode 100644
index 00000000000..1ca0ce2f67b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/connection_3a_3u.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/connection_setup.inc
+--source ../include/connection_load.inc
+--source ../include/connection_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/connection_3u-master.opt b/mysql-test/suite/perfschema/t/connection_3u-master.opt
new file mode 100644
index 00000000000..ac3ef727f8a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/connection_3u-master.opt
@@ -0,0 +1 @@
+--loose-performance_schema_users_size=3
diff --git a/mysql-test/suite/perfschema/t/connection_3u.test b/mysql-test/suite/perfschema/t/connection_3u.test
new file mode 100644
index 00000000000..1ca0ce2f67b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/connection_3u.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/connection_setup.inc
+--source ../include/connection_load.inc
+--source ../include/connection_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/csv_table_io.test b/mysql-test/suite/perfschema/t/csv_table_io.test
new file mode 100644
index 00000000000..862b488caee
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/csv_table_io.test
@@ -0,0 +1,28 @@
+# Tests for PERFORMANCE_SCHEMA table io
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/table_io_setup_helper.inc
+
+let $engine_type= CSV;
+let $table_item= test.no_index_tab;
+--disable_warnings
+eval drop table if exists $table_item;
+--enable_warnings
+
+# Start recording events
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+eval create table $table_item
+( a varchar(255) not null, b int not null) engine = $engine_type;
+insert into marker set a = 1;
+eval show create table $table_item;
+--source ../include/table_io_basic_dml.inc
+eval drop table $table_item;
+
+# Stop recording events + pull result
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/suite/perfschema/t/ddl_accounts.test b/mysql-test/suite/perfschema/t/ddl_accounts.test
new file mode 100644
index 00000000000..c29553b22fc
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_accounts.test
@@ -0,0 +1,17 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.accounts
+ add column foo integer;
+
+truncate table performance_schema.accounts;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.accounts ADD INDEX test_index(CURRENT_CONNECTIONS);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.accounts(CURRENT_CONNECTIONS);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esgs_by_account_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_esgs_by_account_by_event_name.test
new file mode 100644
index 00000000000..da15335d068
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esgs_by_account_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_stages_summary_by_account_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_stages_summary_by_account_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_stages_summary_by_account_by_event_name
+ ADD INDEX test_index(USERNAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_stages_summary_by_account_by_event_name(USERNAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esgs_by_host_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_esgs_by_host_by_event_name.test
new file mode 100644
index 00000000000..b6c90ab42e7
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esgs_by_host_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_stages_summary_by_host_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_stages_summary_by_host_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_stages_summary_by_host_by_event_name
+ ADD INDEX test_index(HOSTNAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_stages_summary_by_host_by_event_name(HOSTNAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esgs_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_esgs_by_thread_by_event_name.test
new file mode 100644
index 00000000000..87d90d5e58c
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esgs_by_thread_by_event_name.test
@@ -0,0 +1,18 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_stages_summary_by_thread_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_stages_summary_by_thread_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_stages_summary_by_thread_by_event_name ADD INDEX test_index(THREAD_ID);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_stages_summary_by_thread_by_event_name(THREAD_ID);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esgs_by_user_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_esgs_by_user_by_event_name.test
new file mode 100644
index 00000000000..81503c5a4f1
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esgs_by_user_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_stages_summary_by_user_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_stages_summary_by_user_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_stages_summary_by_user_by_event_name
+ ADD INDEX test_index(USERNAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_stages_summary_by_user_by_event_name(USERNAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esgs_global_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_esgs_global_by_event_name.test
new file mode 100644
index 00000000000..60a74064c87
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esgs_global_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_stages_summary_global_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_stages_summary_global_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_stages_summary_global_by_event_name
+ ADD INDEX test_index(EVENT_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_stages_summary_global_by_event_name(EVENT_NAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esms_by_account_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_esms_by_account_by_event_name.test
new file mode 100644
index 00000000000..02c508e919b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esms_by_account_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_statements_summary_by_account_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_statements_summary_by_account_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_statements_summary_by_account_by_event_name
+ ADD INDEX test_index(USERNAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_statements_summary_by_account_by_event_name(USERNAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esms_by_digest.test b/mysql-test/suite/perfschema/t/ddl_esms_by_digest.test
new file mode 100644
index 00000000000..b674dc8d385
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esms_by_digest.test
@@ -0,0 +1,33 @@
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_statements_summary_by_digest
+ add column foo integer;
+
+truncate table performance_schema.events_statements_summary_by_digest;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_statements_summary_by_digest ADD INDEX test_index(DIGEST);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_statements_summary_by_digest(DIGEST);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esms_by_host_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_esms_by_host_by_event_name.test
new file mode 100644
index 00000000000..9ff8401894b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esms_by_host_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_statements_summary_by_host_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_statements_summary_by_host_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_statements_summary_by_host_by_event_name
+ ADD INDEX test_index(HOSTNAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_statements_summary_by_host_by_event_name(HOSTNAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esms_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_esms_by_thread_by_event_name.test
new file mode 100644
index 00000000000..53775a88779
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esms_by_thread_by_event_name.test
@@ -0,0 +1,18 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_statements_summary_by_thread_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_statements_summary_by_thread_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_statements_summary_by_thread_by_event_name ADD INDEX test_index(THREAD_ID);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_statements_summary_by_thread_by_event_name(THREAD_ID);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esms_by_user_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_esms_by_user_by_event_name.test
new file mode 100644
index 00000000000..4af935374a8
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esms_by_user_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_statements_summary_by_user_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_statements_summary_by_user_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_statements_summary_by_user_by_event_name
+ ADD INDEX test_index(USERNAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_statements_summary_by_user_by_event_name(USERNAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_esms_global_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_esms_global_by_event_name.test
new file mode 100644
index 00000000000..7f8e5484cef
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_esms_global_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_statements_summary_global_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_statements_summary_global_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_statements_summary_global_by_event_name
+ ADD INDEX test_index(EVENT_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_statements_summary_global_by_event_name(EVENT_NAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_events_stages_current.test b/mysql-test/suite/perfschema/t/ddl_events_stages_current.test
new file mode 100644
index 00000000000..6085e41a7fd
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_events_stages_current.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_stages_current add column foo integer;
+
+truncate table performance_schema.events_stages_current;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_stages_current ADD INDEX test_index(EVENT_ID);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_current(EVENT_ID);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_events_stages_history.test b/mysql-test/suite/perfschema/t/ddl_events_stages_history.test
new file mode 100644
index 00000000000..1dd186571b2
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_events_stages_history.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_stages_history add column foo integer;
+
+truncate table performance_schema.events_stages_history;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_stages_history ADD INDEX test_index(EVENT_ID);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_history(EVENT_ID);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_events_stages_history_long.test b/mysql-test/suite/perfschema/t/ddl_events_stages_history_long.test
new file mode 100644
index 00000000000..8298500cf6d
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_events_stages_history_long.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_stages_history_long add column foo integer;
+
+truncate table performance_schema.events_stages_history_long;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_stages_history_long ADD INDEX test_index(EVENT_ID);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_history_long(EVENT_ID);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_events_statements_current.test b/mysql-test/suite/perfschema/t/ddl_events_statements_current.test
new file mode 100644
index 00000000000..1bff625805f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_events_statements_current.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_statements_current add column foo integer;
+
+truncate table performance_schema.events_statements_current;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_statements_current ADD INDEX test_index(EVENT_ID);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.events_statements_current(EVENT_ID);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_events_statements_history.test b/mysql-test/suite/perfschema/t/ddl_events_statements_history.test
new file mode 100644
index 00000000000..2113fc7f05f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_events_statements_history.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_statements_history add column foo integer;
+
+truncate table performance_schema.events_statements_history;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_statements_history ADD INDEX test_index(EVENT_ID);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.events_statements_history(EVENT_ID);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_events_statements_history_long.test b/mysql-test/suite/perfschema/t/ddl_events_statements_history_long.test
new file mode 100644
index 00000000000..6a42c957c21
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_events_statements_history_long.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_statements_history_long add column foo integer;
+
+truncate table performance_schema.events_statements_history_long;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_statements_history_long ADD INDEX test_index(EVENT_ID);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.events_statements_history_long(EVENT_ID);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_ews_by_account_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_ews_by_account_by_event_name.test
new file mode 100644
index 00000000000..cbca37ffd44
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_ews_by_account_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_waits_summary_by_account_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_waits_summary_by_account_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_waits_summary_by_account_by_event_name
+ ADD INDEX test_index(USERNAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_waits_summary_by_account_by_event_name(USERNAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_ews_by_host_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_ews_by_host_by_event_name.test
new file mode 100644
index 00000000000..5957d193f7d
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_ews_by_host_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_waits_summary_by_host_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_waits_summary_by_host_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_waits_summary_by_host_by_event_name
+ ADD INDEX test_index(HOSTNAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_waits_summary_by_host_by_event_name(HOSTNAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_ews_by_user_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_ews_by_user_by_event_name.test
new file mode 100644
index 00000000000..47f09752aa6
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_ews_by_user_by_event_name.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.events_waits_summary_by_user_by_event_name
+ add column foo integer;
+
+truncate table performance_schema.events_waits_summary_by_user_by_event_name;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.events_waits_summary_by_user_by_event_name
+ ADD INDEX test_index(USERNAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.events_waits_summary_by_user_by_event_name(USERNAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_host_cache.test b/mysql-test/suite/perfschema/t/ddl_host_cache.test
new file mode 100644
index 00000000000..0e8d153d33f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_host_cache.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.host_cache add column foo integer;
+
+truncate table performance_schema.host_cache;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.host_cache ADD INDEX test_index(IP);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.host_cache(IP);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_hosts.test b/mysql-test/suite/perfschema/t/ddl_hosts.test
new file mode 100644
index 00000000000..9651196c856
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_hosts.test
@@ -0,0 +1,17 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.hosts
+ add column foo integer;
+
+truncate table performance_schema.hosts;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.hosts ADD INDEX test_index(CURRENT_CONNECTIONS);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.hosts(CURRENT_CONNECTIONS);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_os_global_by_type.test b/mysql-test/suite/perfschema/t/ddl_os_global_by_type.test
new file mode 100644
index 00000000000..43c9017ac16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_os_global_by_type.test
@@ -0,0 +1,19 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.objects_summary_global_by_type
+ add column foo integer;
+
+truncate table performance_schema.objects_summary_global_by_type;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.objects_summary_global_by_type
+ ADD INDEX test_index(OBJECT_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+ ON performance_schema.objects_summary_global_by_type(OBJECT_NAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_setup_actors.test b/mysql-test/suite/perfschema/t/ddl_setup_actors.test
new file mode 100644
index 00000000000..836fe559d77
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_setup_actors.test
@@ -0,0 +1,29 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.setup_actors add column foo integer;
+
+--disable_warnings
+drop table if exists test.setup_actors;
+--enable_warnings
+
+create table test.setup_actors as
+ select * from performance_schema.setup_actors;
+
+truncate table performance_schema.setup_actors;
+
+select count(*) from performance_schema.setup_actors;
+
+insert into performance_schema.setup_actors
+ select * from test.setup_actors;
+drop table test.setup_actors;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.setup_actors ADD INDEX test_index(HOST);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.setup_actors(HOST);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_setup_objects.test b/mysql-test/suite/perfschema/t/ddl_setup_objects.test
new file mode 100644
index 00000000000..adf09ae1ccf
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_setup_objects.test
@@ -0,0 +1,29 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.setup_objects add column foo integer;
+
+--disable_warnings
+drop table if exists test.setup_objects;
+--enable_warnings
+
+create table test.setup_objects as
+ select * from performance_schema.setup_objects;
+
+truncate table performance_schema.setup_objects;
+
+select count(*) from performance_schema.setup_objects;
+
+insert into performance_schema.setup_objects
+ select * from test.setup_objects;
+drop table test.setup_objects;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.setup_objects ADD INDEX test_index(OBJECT_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.setup_objects(OBJECT_NAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_socket_instances.test b/mysql-test/suite/perfschema/t/ddl_socket_instances.test
new file mode 100644
index 00000000000..c84a04b02b4
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_socket_instances.test
@@ -0,0 +1,17 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.socket_instances add column foo integer;
+
+-- error ER_WRONG_PERFSCHEMA_USAGE
+truncate table performance_schema.socket_instances;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.socket_instances ADD INDEX test_index(FILE_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.socket_instances(FILE_NAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_socket_summary_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_socket_summary_by_event_name.test
new file mode 100644
index 00000000000..01895a78da3
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_socket_summary_by_event_name.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.socket_summary_by_instance add column foo integer;
+
+truncate table performance_schema.socket_summary_by_instance;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.socket_summary_by_instance ADD INDEX test_index(FILE_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.socket_summary_by_instance(FILE_NAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_socket_summary_by_instance.test b/mysql-test/suite/perfschema/t/ddl_socket_summary_by_instance.test
new file mode 100644
index 00000000000..01895a78da3
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_socket_summary_by_instance.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.socket_summary_by_instance add column foo integer;
+
+truncate table performance_schema.socket_summary_by_instance;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.socket_summary_by_instance ADD INDEX test_index(FILE_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.socket_summary_by_instance(FILE_NAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_threads.test b/mysql-test/suite/perfschema/t/ddl_threads.test
index 05c4a193399..3709d5c7fd3 100644
--- a/mysql-test/suite/perfschema/t/ddl_threads.test
+++ b/mysql-test/suite/perfschema/t/ddl_threads.test
@@ -10,8 +10,8 @@ alter table performance_schema.threads add column foo integer;
truncate table performance_schema.threads;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.threads ADD INDEX test_index(ID);
+ALTER TABLE performance_schema.threads ADD INDEX test_index(PROCESSLIST_ID);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.threads(ID);
+CREATE UNIQUE INDEX test_index ON performance_schema.threads(PROCESSLIST_ID);
diff --git a/mysql-test/suite/perfschema/t/ddl_tiws_by_index_usage.test b/mysql-test/suite/perfschema/t/ddl_tiws_by_index_usage.test
new file mode 100644
index 00000000000..34f4475d986
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_tiws_by_index_usage.test
@@ -0,0 +1,17 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.table_io_waits_summary_by_index_usage
+ add column foo integer;
+
+truncate table performance_schema.table_io_waits_summary_by_index_usage;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.table_io_waits_summary_by_index_usage ADD INDEX test_index(TABLE_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.table_io_waits_summary_by_index_usage(TABLE_NAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_tiws_by_table.test b/mysql-test/suite/perfschema/t/ddl_tiws_by_table.test
new file mode 100644
index 00000000000..422949512e5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_tiws_by_table.test
@@ -0,0 +1,17 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.table_io_waits_summary_by_table
+ add column foo integer;
+
+truncate table performance_schema.table_io_waits_summary_by_table;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.table_io_waits_summary_by_table ADD INDEX test_index(TABLE_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.table_io_waits_summary_by_table(TABLE_NAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_tlws_by_table.test b/mysql-test/suite/perfschema/t/ddl_tlws_by_table.test
new file mode 100644
index 00000000000..d796e3d4dd9
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_tlws_by_table.test
@@ -0,0 +1,17 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.table_lock_waits_summary_by_table
+ add column foo integer;
+
+truncate table performance_schema.table_lock_waits_summary_by_table;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.table_lock_waits_summary_by_table ADD INDEX test_index(TABLE_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.table_lock_waits_summary_by_table(TABLE_NAME);
+
diff --git a/mysql-test/suite/perfschema/t/ddl_users.test b/mysql-test/suite/perfschema/t/ddl_users.test
new file mode 100644
index 00000000000..84aba78aed2
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_users.test
@@ -0,0 +1,17 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.users
+ add column foo integer;
+
+truncate table performance_schema.users;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.users ADD INDEX test_index(CURRENT_CONNECTIONS);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.users(CURRENT_CONNECTIONS);
+
diff --git a/mysql-test/suite/perfschema/t/digest_table_full-master.opt b/mysql-test/suite/perfschema/t/digest_table_full-master.opt
new file mode 100644
index 00000000000..62798dfdc71
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/digest_table_full-master.opt
@@ -0,0 +1 @@
+--loose-performance-schema-digests-size=2
diff --git a/mysql-test/suite/perfschema/t/digest_table_full.test b/mysql-test/suite/perfschema/t/digest_table_full.test
new file mode 100644
index 00000000000..b0ff0ab6f21
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/digest_table_full.test
@@ -0,0 +1,32 @@
+# ----------------------------------------------------
+# Tests for the performance schema statement Digests.
+# ----------------------------------------------------
+
+# Test case to show behavior of statements digest when
+# statement-digest-size is 0
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+# Initial Setup for Digest
+--source ../include/digest_setup.inc
+
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+
+# Executing queries
+--source ../include/digest_execution.inc
+
+--echo ####################################
+--echo # QUERYING PS STATEMENT DIGEST
+--echo ####################################
+SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+ SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
+
+
+# Expect no digest
+SHOW VARIABLES LIKE "performance_schema_digests_size";
+SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest;
+
+# Cleanup for Digest
+--source ../include/digest_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/disabled.def b/mysql-test/suite/perfschema/t/disabled.def
new file mode 100644
index 00000000000..888298bbb09
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/disabled.def
@@ -0,0 +1,11 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
diff --git a/mysql-test/suite/perfschema/t/dml_accounts.test b/mysql-test/suite/perfschema/t/dml_accounts.test
new file mode 100644
index 00000000000..e462847279c
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_accounts.test
@@ -0,0 +1,41 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.accounts
+ limit 1;
+
+select * from performance_schema.accounts
+ where user='FOO' or host='BAR';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.accounts
+ set user='FOO', host='BAR',
+ current_connections=1, total_connections=2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.accounts
+ set current_connections=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.accounts
+ set current_connections=12 where host like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.accounts
+ where total_connections=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.accounts;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.accounts READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.accounts WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esgs_by_account_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esgs_by_account_by_event_name.test
new file mode 100644
index 00000000000..b9633ec8ea7
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esgs_by_account_by_event_name.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_stages_summary_by_account_by_event_name
+ where event_name like 'stage/%' limit 1;
+
+select * from performance_schema.events_stages_summary_by_account_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_stages_summary_by_account_by_event_name
+ set event_name='FOO', user='BAR', host='BAZ',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_summary_by_account_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_summary_by_account_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_summary_by_account_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_summary_by_account_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_summary_by_account_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_summary_by_account_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esgs_by_host_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esgs_by_host_by_event_name.test
new file mode 100644
index 00000000000..bb973cd31ed
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esgs_by_host_by_event_name.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_stages_summary_by_host_by_event_name
+ where event_name like 'stage/%' limit 1;
+
+select * from performance_schema.events_stages_summary_by_host_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_stages_summary_by_host_by_event_name
+ set event_name='FOO', thread_id=1,
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_summary_by_host_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_summary_by_host_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_summary_by_host_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_summary_by_host_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_summary_by_host_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_summary_by_host_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esgs_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esgs_by_thread_by_event_name.test
new file mode 100644
index 00000000000..50fc1fff848
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esgs_by_thread_by_event_name.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_stages_summary_by_thread_by_event_name
+ where event_name like 'stage/%' limit 1;
+
+select * from performance_schema.events_stages_summary_by_thread_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_stages_summary_by_thread_by_event_name
+ set event_name='FOO', thread_id=1,
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_summary_by_thread_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_summary_by_thread_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_summary_by_thread_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_summary_by_thread_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_summary_by_thread_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_summary_by_thread_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esgs_by_user_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esgs_by_user_by_event_name.test
new file mode 100644
index 00000000000..a3f0bdfd5c9
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esgs_by_user_by_event_name.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_stages_summary_by_user_by_event_name
+ where event_name like 'stage/%' limit 1;
+
+select * from performance_schema.events_stages_summary_by_user_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_stages_summary_by_user_by_event_name
+ set event_name='FOO', user='BAR',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_summary_by_user_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_summary_by_user_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_summary_by_user_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_summary_by_user_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_summary_by_user_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_summary_by_user_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esgs_global_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esgs_global_by_event_name.test
new file mode 100644
index 00000000000..8f466517a90
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esgs_global_by_event_name.test
@@ -0,0 +1,41 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_stages_summary_global_by_event_name
+ where event_name like 'stage/%' limit 1;
+
+select * from performance_schema.events_stages_summary_global_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_stages_summary_global_by_event_name
+ set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_summary_global_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_summary_global_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_summary_global_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_summary_global_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_summary_global_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_summary_global_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_account_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esms_by_account_by_event_name.test
new file mode 100644
index 00000000000..92e58c83a56
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_account_by_event_name.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_statements_summary_by_account_by_event_name
+ where event_name like 'statement/%' limit 1;
+
+select * from performance_schema.events_statements_summary_by_account_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_statements_summary_by_account_by_event_name
+ set event_name='FOO', user='BAR', host='BAZ',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_account_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_account_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_account_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_account_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_account_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_account_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_digest.test b/mysql-test/suite/perfschema/t/dml_esms_by_digest.test
new file mode 100644
index 00000000000..6fdc8ec9fdc
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_digest.test
@@ -0,0 +1,56 @@
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#--disable_result_log
+select * from performance_schema.events_statements_summary_by_digest
+ where digest like 'XXYYZZ%' limit 1;
+
+select * from performance_schema.events_statements_summary_by_digest
+ where digest='XXYYZZ';
+#--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_statements_summary_by_digest
+ set digest='XXYYZZ', count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_digest
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_digest
+ set count_star=12 where digest like "XXYYZZ";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_digest
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_digest;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_digest READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_digest WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_host_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esms_by_host_by_event_name.test
new file mode 100644
index 00000000000..7a8c0498a97
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_host_by_event_name.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_statements_summary_by_host_by_event_name
+ where event_name like 'statement/%' limit 1;
+
+select * from performance_schema.events_statements_summary_by_host_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_statements_summary_by_host_by_event_name
+ set event_name='FOO', thread_id=1,
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_host_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_host_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_host_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_host_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_host_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_host_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esms_by_thread_by_event_name.test
new file mode 100644
index 00000000000..5c079ade643
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_thread_by_event_name.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_statements_summary_by_thread_by_event_name
+ where event_name like 'statement/%' limit 1;
+
+select * from performance_schema.events_statements_summary_by_thread_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_statements_summary_by_thread_by_event_name
+ set event_name='FOO', thread_id=1,
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_thread_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_thread_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_thread_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_thread_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_thread_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_thread_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_user_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esms_by_user_by_event_name.test
new file mode 100644
index 00000000000..21b65e182d3
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_user_by_event_name.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_statements_summary_by_user_by_event_name
+ where event_name like 'statement/%' limit 1;
+
+select * from performance_schema.events_statements_summary_by_user_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_statements_summary_by_user_by_event_name
+ set event_name='FOO', user='BAR',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_user_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_user_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_user_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_user_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_user_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_user_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_esms_global_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esms_global_by_event_name.test
new file mode 100644
index 00000000000..5ef477aea6f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_esms_global_by_event_name.test
@@ -0,0 +1,41 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_statements_summary_global_by_event_name
+ where event_name like 'statement/%' limit 1;
+
+select * from performance_schema.events_statements_summary_global_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_statements_summary_global_by_event_name
+ set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_global_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_global_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_global_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_global_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_global_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_global_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_events_stages_current.test b/mysql-test/suite/perfschema/t/dml_events_stages_current.test
new file mode 100644
index 00000000000..8db105fe01e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_events_stages_current.test
@@ -0,0 +1,41 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_stages_current
+ where event_name like 'stage/%' limit 1;
+
+select * from performance_schema.events_stages_current
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_stages_current
+ set thread_id='1', event_id=1,
+ event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_current
+ set timer_start=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_current
+ set timer_start=12 where thread_id=0;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_current
+ where thread_id=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_current;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_current READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_current WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_events_stages_history.test b/mysql-test/suite/perfschema/t/dml_events_stages_history.test
new file mode 100644
index 00000000000..54bebc8a328
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_events_stages_history.test
@@ -0,0 +1,47 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_stages_history
+ where event_name like 'stage/%' limit 1;
+
+select * from performance_schema.events_stages_history
+ where event_name='FOO';
+
+select * from performance_schema.events_stages_history
+ where event_name like 'stage/%' order by timer_wait limit 1;
+
+select * from performance_schema.events_stages_history
+ where event_name like 'stage/%' order by timer_wait desc limit 1;
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_stages_history
+ set thread_id='1', event_id=1,
+ event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_history
+ set timer_start=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_history
+ set timer_start=12 where thread_id=0;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_history
+ where thread_id=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_history;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_history READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_history WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_events_stages_history_long.test b/mysql-test/suite/perfschema/t/dml_events_stages_history_long.test
new file mode 100644
index 00000000000..b52f539871d
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_events_stages_history_long.test
@@ -0,0 +1,47 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_stages_history_long
+ where event_name like 'stage/%' limit 1;
+
+select * from performance_schema.events_stages_history_long
+ where event_name='FOO';
+
+select * from performance_schema.events_stages_history_long
+ where event_name like 'stage/%' order by timer_wait limit 1;
+
+select * from performance_schema.events_stages_history_long
+ where event_name like 'stage/%' order by timer_wait desc limit 1;
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_stages_history_long
+ set thread_id='1', event_id=1,
+ event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_history_long
+ set timer_start=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_stages_history_long
+ set timer_start=12 where thread_id=0;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_history_long
+ where thread_id=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_stages_history_long;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_history_long READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_stages_history_long WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_events_statements_current.test b/mysql-test/suite/perfschema/t/dml_events_statements_current.test
new file mode 100644
index 00000000000..152d9b74d42
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_events_statements_current.test
@@ -0,0 +1,41 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_statements_current
+ where event_name like 'statement/%' limit 1;
+
+select * from performance_schema.events_statements_current
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_statements_current
+ set thread_id='1', event_id=1,
+ event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_current
+ set timer_start=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_current
+ set timer_start=12 where thread_id=0;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_current
+ where thread_id=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_current;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_current READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_current WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_events_statements_history.test b/mysql-test/suite/perfschema/t/dml_events_statements_history.test
new file mode 100644
index 00000000000..4b84e6e7200
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_events_statements_history.test
@@ -0,0 +1,47 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_statements_history
+ where event_name like 'statement/%' limit 1;
+
+select * from performance_schema.events_statements_history
+ where event_name='FOO';
+
+select * from performance_schema.events_statements_history
+ where event_name like 'statement/%' order by timer_wait limit 1;
+
+select * from performance_schema.events_statements_history
+ where event_name like 'statement/%' order by timer_wait desc limit 1;
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_statements_history
+ set thread_id='1', event_id=1,
+ event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_history
+ set timer_start=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_history
+ set timer_start=12 where thread_id=0;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_history
+ where thread_id=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_history;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_history READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_history WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_events_statements_history_long.test b/mysql-test/suite/perfschema/t/dml_events_statements_history_long.test
new file mode 100644
index 00000000000..79580fcf13e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_events_statements_history_long.test
@@ -0,0 +1,47 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.events_statements_history_long
+ where event_name like 'statement/%' limit 1;
+
+select * from performance_schema.events_statements_history_long
+ where event_name='FOO';
+
+select * from performance_schema.events_statements_history_long
+ where event_name like 'statement/%' order by timer_wait limit 1;
+
+select * from performance_schema.events_statements_history_long
+ where event_name like 'statement/%' order by timer_wait desc limit 1;
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_statements_history_long
+ set thread_id='1', event_id=1,
+ event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_history_long
+ set timer_start=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_history_long
+ set timer_start=12 where thread_id=0;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_history_long
+ where thread_id=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_history_long;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_history_long READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_history_long WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_account_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_account_by_event_name.test
new file mode 100644
index 00000000000..e9eda8ece2a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_account_by_event_name.test
@@ -0,0 +1,41 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 #
+select * from performance_schema.events_waits_summary_by_account_by_event_name
+ where event_name like 'Wait/Synch/%' limit 1;
+
+select * from performance_schema.events_waits_summary_by_account_by_event_name
+ where event_name='FOO';
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_waits_summary_by_account_by_event_name
+ set event_name='FOO', user='BAR', host='BAZ',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_waits_summary_by_account_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_waits_summary_by_account_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_waits_summary_by_account_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_waits_summary_by_account_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_waits_summary_by_account_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_waits_summary_by_account_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_host_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_host_by_event_name.test
new file mode 100644
index 00000000000..add375bf6c1
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_host_by_event_name.test
@@ -0,0 +1,41 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
+select * from performance_schema.events_waits_summary_by_host_by_event_name
+ where event_name like 'Wait/Synch/%' limit 1;
+
+select * from performance_schema.events_waits_summary_by_host_by_event_name
+ where event_name='FOO';
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_waits_summary_by_host_by_event_name
+ set event_name='FOO', thread_id=1,
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_waits_summary_by_host_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_waits_summary_by_host_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_waits_summary_by_host_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_waits_summary_by_host_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_waits_summary_by_host_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_waits_summary_by_host_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_user_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_user_by_event_name.test
new file mode 100644
index 00000000000..1b927dd12a6
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_user_by_event_name.test
@@ -0,0 +1,41 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
+select * from performance_schema.events_waits_summary_by_user_by_event_name
+ where event_name like 'Wait/Synch/%' limit 1;
+
+select * from performance_schema.events_waits_summary_by_user_by_event_name
+ where event_name='FOO';
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_waits_summary_by_user_by_event_name
+ set event_name='FOO', user='BAR',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_waits_summary_by_user_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_waits_summary_by_user_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_waits_summary_by_user_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_waits_summary_by_user_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_waits_summary_by_user_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_waits_summary_by_user_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test b/mysql-test/suite/perfschema/t/dml_fs_by_event_name.test
index dbf31d1963d..dbf31d1963d 100644
--- a/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_fs_by_event_name.test
diff --git a/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test b/mysql-test/suite/perfschema/t/dml_fs_by_instance.test
index 5f69c2d0dc7..5f69c2d0dc7 100644
--- a/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test
+++ b/mysql-test/suite/perfschema/t/dml_fs_by_instance.test
diff --git a/mysql-test/suite/perfschema/t/dml_handler.test b/mysql-test/suite/perfschema/t/dml_handler.test
new file mode 100644
index 00000000000..db74c85350a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_handler.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#==============================================================================
+# This test verifies that the peformance schema storage engine does not support
+# HANDLER operations.
+#
+# Get the list of tables from information_schema.tables, store the table names
+# in a temporary table. For each table in the list, attempt a HANDLER ... OPEN,
+# which should return error 1031, "Table storage engine for '<table name>'
+# doesn't have this option."
+#
+--echo
+--echo # Create a temporary table of performance schema table names
+--echo
+
+CREATE TEMPORARY TABLE table_list (id INT AUTO_INCREMENT, PRIMARY KEY (id)) AS
+ SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
+ WHERE TABLE_SCHEMA='performance_schema';
+
+SELECT COUNT(*) FROM table_list INTO @table_count;
+
+let $count=`SELECT @table_count`;
+
+--echo
+--echo # For each table in the performance schema, attempt HANDLER...OPEN,
+--echo # which should fail with an error 1031, ER_ILLEGAL_HA.
+--echo
+
+while ($count > 0)
+{
+ eval SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=$count;
+ let $table_name = `SELECT @table_name`;
+ --error ER_ILLEGAL_HA
+ eval HANDLER performance_schema.$table_name OPEN;
+ dec $count;
+}
+
+DROP TEMPORARY TABLE table_list;
+
diff --git a/mysql-test/suite/perfschema/t/dml_host_cache.test b/mysql-test/suite/perfschema/t/dml_host_cache.test
new file mode 100644
index 00000000000..c56099ab748
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_host_cache.test
@@ -0,0 +1,43 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.host_cache
+ where IP like '%' limit 1;
+
+select * from performance_schema.host_cache
+ where IP='localhost';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.host_cache
+ set IP='FOO', SUM_BLOCKING_ERRORS=1, COUNT_FCRDNS_ERRORS=2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.host_cache
+ set COUNT_UNKNOWN_ERRORS=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.host_cache
+ set SUM_BLOCKING_ERRORS=12 where IP='127.0.0.1';
+
+select HOST from performance_schema.host_cache
+ where IP='::1';
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.host_cache
+ where IP='::1';
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.host_cache;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.host_cache READ;
+UNLOCK TABLES;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.host_cache WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_hosts.test b/mysql-test/suite/perfschema/t/dml_hosts.test
new file mode 100644
index 00000000000..d23f6f69339
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_hosts.test
@@ -0,0 +1,41 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.hosts
+ limit 1;
+
+select * from performance_schema.hosts
+ where host='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.hosts
+ set host='FOO',
+ current_connections=1, total_connections=2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.hosts
+ set current_connections=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.hosts
+ set current_connections=12 where host like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.hosts
+ where total_connections=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.hosts;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.hosts READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.hosts WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_os_global_by_type.test b/mysql-test/suite/perfschema/t/dml_os_global_by_type.test
new file mode 100644
index 00000000000..1ea8381bc56
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_os_global_by_type.test
@@ -0,0 +1,57 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 #
+select * from performance_schema.objects_summary_global_by_type
+ where object_schema = 'performance_schema' limit 1;
+
+select * from performance_schema.objects_summary_global_by_type
+ where object_schema='FOO';
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 #
+select * from performance_schema.objects_summary_global_by_type
+ order by count_star limit 1;
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 #
+select * from performance_schema.objects_summary_global_by_type
+ order by count_star desc limit 1;
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 #
+select * from performance_schema.objects_summary_global_by_type
+ where object_type = 'TABLE' order by object_schema, object_name limit 1;
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 #
+select * from performance_schema.objects_summary_global_by_type
+ where object_type = 'TABLE' order by object_schema desc, object_name desc limit 1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.objects_summary_global_by_type
+ set object_type='TABLE', schema_name='FOO', object_name='BAR',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.objects_summary_global_by_type
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.objects_summary_global_by_type
+ set count_star=12 where object_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.objects_summary_global_by_type
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.objects_summary_global_by_type;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.objects_summary_global_by_type READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.objects_summary_global_by_type WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_setup_actors.test b/mysql-test/suite/perfschema/t/dml_setup_actors.test
new file mode 100644
index 00000000000..d5424cad7e3
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_setup_actors.test
@@ -0,0 +1,72 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_warnings
+drop table if exists test.setup_actors;
+--enable_warnings
+
+# Save the setup
+create table test.setup_actors as
+ select * from performance_schema.setup_actors;
+truncate table performance_schema.setup_actors;
+
+select * from performance_schema.setup_actors;
+
+select * from performance_schema.setup_actors
+ where user = '%';
+
+insert into performance_schema.setup_actors
+ set user='Joe', host='localhost';
+
+insert into performance_schema.setup_actors
+ set user='Joe', host='%';
+
+insert into performance_schema.setup_actors
+ set user='%', host='server1';
+
+insert into performance_schema.setup_actors
+ set user='%', host='%';
+
+select * from performance_schema.setup_actors
+ order by USER, HOST;
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.setup_actors
+ set user='ILLEGAL';
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.setup_actors
+ set host='ILLEGAL';
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.setup_actors
+ set role='ILLEGAL';
+
+select * from performance_schema.setup_actors
+ order by USER, HOST;
+
+delete from performance_schema.setup_actors
+ where user = 'Joe' and host = 'localhost';
+
+select * from performance_schema.setup_actors
+ order by USER, HOST;
+
+delete from performance_schema.setup_actors;
+
+select * from performance_schema.setup_actors
+ order by USER, HOST;
+
+LOCK TABLES performance_schema.setup_actors READ;
+UNLOCK TABLES;
+
+LOCK TABLES performance_schema.setup_actors WRITE;
+UNLOCK TABLES;
+
+# Restore the setup
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+ select * from test.setup_actors;
+drop table test.setup_actors;
+
diff --git a/mysql-test/suite/perfschema/t/dml_setup_objects.test b/mysql-test/suite/perfschema/t/dml_setup_objects.test
new file mode 100644
index 00000000000..29594bf32f9
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_setup_objects.test
@@ -0,0 +1,93 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_warnings
+drop table if exists test.setup_objects;
+--enable_warnings
+
+# Save the setup
+create table test.setup_objects as
+ select * from performance_schema.setup_objects;
+truncate table performance_schema.setup_objects;
+
+# Test
+
+select * from performance_schema.setup_objects;
+
+select * from performance_schema.setup_objects
+ order by object_type, object_schema, object_name;
+
+select * from performance_schema.setup_objects
+ where object_type = 'TABLE'
+ order by object_type, object_schema, object_name;
+
+select * from performance_schema.setup_objects
+ order by object_type, object_schema, object_name;
+
+--error ER_NO_REFERENCED_ROW_2
+insert into performance_schema.setup_objects
+ set object_type='ILLEGAL', object_schema='FOO', object_name='BAR',
+ enabled='YES', timed='YES';
+
+insert into performance_schema.setup_objects
+ set object_type='TABLE', object_schema='FOO', object_name='BAR',
+ enabled='YES', timed='YES';
+
+--error ER_DUP_KEY
+insert into performance_schema.setup_objects
+ set object_type='TABLE', object_schema='FOO', object_name='BAR',
+ enabled='YES', timed='NO';
+
+delete from performance_schema.setup_objects
+ where object_type='TABLE' and object_schema='FOO';
+
+select * from performance_schema.setup_objects
+ order by object_type, object_schema, object_name;
+
+insert into performance_schema.setup_objects
+ set object_type='TABLE', object_schema='FOO', object_name='BAR',
+ enabled='NO', timed='YES';
+
+select * from performance_schema.setup_objects
+ order by object_type, object_schema, object_name;
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.setup_objects
+ set object_type='ILLEGAL';
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.setup_objects
+ set object_schema='ILLEGAL';
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.setup_objects
+ set object_name='ILLEGAL';
+
+update performance_schema.setup_objects
+ set enabled='NO', timed='NO';
+
+select * from performance_schema.setup_objects
+ order by object_type, object_schema, object_name;
+
+update performance_schema.setup_objects
+ set enabled='YES', timed='YES';
+
+delete from performance_schema.setup_objects
+ where object_type = 'TABLE';
+
+delete from performance_schema.setup_objects;
+
+LOCK TABLES performance_schema.setup_objects READ;
+UNLOCK TABLES;
+
+LOCK TABLES performance_schema.setup_objects WRITE;
+UNLOCK TABLES;
+
+# Restore the setup
+truncate table performance_schema.setup_objects;
+insert into performance_schema.setup_objects
+ select * from test.setup_objects;
+drop table test.setup_objects;
+
diff --git a/mysql-test/suite/perfschema/t/dml_setup_timers.test b/mysql-test/suite/perfschema/t/dml_setup_timers.test
index 0956ae2cc95..641ac90b1c5 100644
--- a/mysql-test/suite/perfschema/t/dml_setup_timers.test
+++ b/mysql-test/suite/perfschema/t/dml_setup_timers.test
@@ -3,6 +3,16 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
+# Set to a known state
+update performance_schema.setup_timers
+ set timer_name='CYCLE' where name="wait";
+update performance_schema.setup_timers
+ set timer_name='NANOSECOND' where name="stage";
+update performance_schema.setup_timers
+ set timer_name='NANOSECOND' where name="statement";
+update performance_schema.setup_timers
+ set timer_name='MICROSECOND' where name="idle";
+
select * from performance_schema.setup_timers;
select * from performance_schema.setup_timers
@@ -40,3 +50,16 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.setup_timers WRITE;
UNLOCK TABLES;
+# Cleanup, restore the default values
+
+update performance_schema.setup_timers
+ set timer_name='CYCLE' where name="wait";
+update performance_schema.setup_timers
+ set timer_name='NANOSECOND' where name="stage";
+update performance_schema.setup_timers
+ set timer_name='NANOSECOND' where name="statement";
+update performance_schema.setup_timers
+ set timer_name='MICROSECOND' where name="idle";
+
+select * from performance_schema.setup_timers;
+
diff --git a/mysql-test/suite/perfschema/t/dml_socket_instances.test b/mysql-test/suite/perfschema/t/dml_socket_instances.test
new file mode 100644
index 00000000000..929853d574e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_socket_instances.test
@@ -0,0 +1,35 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.socket_instances limit 1;
+
+select * from performance_schema.socket_instances
+ where ip='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.socket_instances
+ set ip='FOO', event_name='BAR', port=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.socket_instances
+ set ip='FOO';
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.socket_instances
+ where event_name like "wait/%";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.socket_instances;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.socket_instances READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.socket_instances WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_socket_summary_by_event_name.test b/mysql-test/suite/perfschema/t/dml_socket_summary_by_event_name.test
new file mode 100644
index 00000000000..2c06fca77e4
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_socket_summary_by_event_name.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.socket_summary_by_event_name
+ limit 1;
+
+select * from performance_schema.socket_summary_by_event_name
+ where event_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.socket_summary_by_event_name
+ set event_name='FOO',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.socket_summary_by_event_name
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.socket_summary_by_event_name
+ set count_star=12 where event_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.socket_summary_by_event_name
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.socket_summary_by_event_name;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.socket_summary_by_event_name READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.socket_summary_by_event_name WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_socket_summary_by_instance.test b/mysql-test/suite/perfschema/t/dml_socket_summary_by_instance.test
new file mode 100644
index 00000000000..5a5d829308c
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_socket_summary_by_instance.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.socket_summary_by_instance
+ limit 1;
+
+select * from performance_schema.socket_summary_by_instance
+ where object_instance_begin='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.socket_summary_by_instance
+ set object_instance_begin=1,
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.socket_summary_by_instance
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.socket_summary_by_instance
+ set count_star=12 where object_instance_begin like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.socket_summary_by_instance
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.socket_summary_by_instance;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.socket_summary_by_instance READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.socket_summary_by_instance WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_threads.test b/mysql-test/suite/perfschema/t/dml_threads.test
index 324e6107834..328f6a6d989 100644
--- a/mysql-test/suite/perfschema/t/dml_threads.test
+++ b/mysql-test/suite/perfschema/t/dml_threads.test
@@ -15,13 +15,25 @@ select * from performance_schema.threads
insert into performance_schema.threads
set name='FOO', thread_id=1, processlist_id=2;
---error ER_TABLEACCESS_DENIED_ERROR
+--error ER_WRONG_PERFSCHEMA_USAGE
update performance_schema.threads
set thread_id=12;
---error ER_TABLEACCESS_DENIED_ERROR
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.threads
+ set thread_id=12 where PROCESSLIST_ID=connection_id();
+
update performance_schema.threads
- set thread_id=12 where name like "FOO";
+ set instrumented= 'NO' where PROCESSLIST_ID=connection_id();
+
+select instrumented from performance_schema.threads
+ where PROCESSLIST_ID=connection_id();
+
+update performance_schema.threads
+ set instrumented= 'YES' where PROCESSLIST_ID=connection_id();
+
+select instrumented from performance_schema.threads
+ where PROCESSLIST_ID=connection_id();
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.threads
@@ -30,11 +42,9 @@ delete from performance_schema.threads
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.threads;
--- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.threads READ;
UNLOCK TABLES;
--- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.threads WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_tiws_by_index_usage.test b/mysql-test/suite/perfschema/t/dml_tiws_by_index_usage.test
new file mode 100644
index 00000000000..ecd83987291
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_tiws_by_index_usage.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.table_io_waits_summary_by_index_usage
+ limit 1;
+
+select * from performance_schema.table_io_waits_summary_by_index_usage
+ where object_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.table_io_waits_summary_by_index_usage
+ set object_type='TABLE', object_name='FOO', object_schema='BAR',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.table_io_waits_summary_by_index_usage
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.table_io_waits_summary_by_index_usage
+ set count_star=12 where object_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.table_io_waits_summary_by_index_usage
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.table_io_waits_summary_by_index_usage;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.table_io_waits_summary_by_index_usage READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.table_io_waits_summary_by_index_usage WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_tiws_by_table.test b/mysql-test/suite/perfschema/t/dml_tiws_by_table.test
new file mode 100644
index 00000000000..4d2f9b7fba5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_tiws_by_table.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.table_io_waits_summary_by_table
+ limit 1;
+
+select * from performance_schema.table_io_waits_summary_by_table
+ where object_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.table_io_waits_summary_by_table
+ set object_type='TABLE', object_name='FOO', object_schema='BAR',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.table_io_waits_summary_by_table
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.table_io_waits_summary_by_table
+ set count_star=12 where object_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.table_io_waits_summary_by_table
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.table_io_waits_summary_by_table;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.table_io_waits_summary_by_table READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.table_io_waits_summary_by_table WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_tlws_by_table.test b/mysql-test/suite/perfschema/t/dml_tlws_by_table.test
new file mode 100644
index 00000000000..b88ca1a66aa
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_tlws_by_table.test
@@ -0,0 +1,42 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.table_lock_waits_summary_by_table
+ limit 1;
+
+select * from performance_schema.table_lock_waits_summary_by_table
+ where object_name='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.table_lock_waits_summary_by_table
+ set object_type='TABLE', object_name='FOO', object_schema='BAR',
+ count_star=1, sum_timer_wait=2, min_timer_wait=3,
+ avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.table_lock_waits_summary_by_table
+ set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.table_lock_waits_summary_by_table
+ set count_star=12 where object_name like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.table_lock_waits_summary_by_table
+ where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.table_lock_waits_summary_by_table;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.table_lock_waits_summary_by_table READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.table_lock_waits_summary_by_table WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/dml_users.test b/mysql-test/suite/perfschema/t/dml_users.test
new file mode 100644
index 00000000000..290a6d7f253
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_users.test
@@ -0,0 +1,41 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.users
+ limit 1;
+
+select * from performance_schema.users
+ where user='FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.users
+ set user='FOO',
+ current_connections=1, total_connections=2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.users
+ set current_connections=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.users
+ set current_connections=12 where user like "FOO";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.users
+ where total_connections=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.users;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.users READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.users WRITE;
+UNLOCK TABLES;
+
diff --git a/mysql-test/suite/perfschema/t/event_aggregate-master.opt b/mysql-test/suite/perfschema/t/event_aggregate-master.opt
new file mode 100644
index 00000000000..596f6bafe5a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate-master.opt
@@ -0,0 +1,2 @@
+--general_log
+--log-output=FILE
diff --git a/mysql-test/suite/perfschema/t/event_aggregate.test b/mysql-test/suite/perfschema/t/event_aggregate.test
new file mode 100644
index 00000000000..c1a895ec549
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/event_aggregate_setup.inc
+--source ../include/event_aggregate_load.inc
+--source ../include/event_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a-master.opt b/mysql-test/suite/perfschema/t/event_aggregate_no_a-master.opt
new file mode 100644
index 00000000000..276c2eb7201
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_a-master.opt
@@ -0,0 +1,3 @@
+--general_log
+--log-output=FILE
+--loose-performance_schema_accounts_size=0
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a.test b/mysql-test/suite/perfschema/t/event_aggregate_no_a.test
new file mode 100644
index 00000000000..c1a895ec549
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_a.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/event_aggregate_setup.inc
+--source ../include/event_aggregate_load.inc
+--source ../include/event_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h-master.opt b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h-master.opt
new file mode 100644
index 00000000000..dd39eca94a2
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h-master.opt
@@ -0,0 +1,4 @@
+--general_log
+--log-output=FILE
+--loose-performance_schema_accounts_size=0
+--loose-performance_schema_hosts_size=0
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h.test b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h.test
new file mode 100644
index 00000000000..c1a895ec549
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/event_aggregate_setup.inc
+--source ../include/event_aggregate_load.inc
+--source ../include/event_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u-master.opt b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u-master.opt
new file mode 100644
index 00000000000..0559a16c781
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u-master.opt
@@ -0,0 +1,4 @@
+--general_log
+--log-output=FILE
+--loose-performance_schema_accounts_size=0
+--loose-performance_schema_users_size=0
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u.test b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u.test
new file mode 100644
index 00000000000..c1a895ec549
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/event_aggregate_setup.inc
+--source ../include/event_aggregate_load.inc
+--source ../include/event_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h-master.opt b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h-master.opt
new file mode 100644
index 00000000000..795fa0139fd
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h-master.opt
@@ -0,0 +1,5 @@
+--general_log
+--log-output=FILE
+--loose-performance_schema_accounts_size=0
+--loose-performance_schema_users_size=0
+--loose-performance_schema_hosts_size=0
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h.test b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h.test
new file mode 100644
index 00000000000..c1a895ec549
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/event_aggregate_setup.inc
+--source ../include/event_aggregate_load.inc
+--source ../include/event_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_h-master.opt b/mysql-test/suite/perfschema/t/event_aggregate_no_h-master.opt
new file mode 100644
index 00000000000..89ecbaa6409
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_h-master.opt
@@ -0,0 +1,3 @@
+--general_log
+--log-output=FILE
+--loose-performance_schema_hosts_size=0
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_h.test b/mysql-test/suite/perfschema/t/event_aggregate_no_h.test
new file mode 100644
index 00000000000..c1a895ec549
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_h.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/event_aggregate_setup.inc
+--source ../include/event_aggregate_load.inc
+--source ../include/event_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_u-master.opt b/mysql-test/suite/perfschema/t/event_aggregate_no_u-master.opt
new file mode 100644
index 00000000000..d6ee950e037
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_u-master.opt
@@ -0,0 +1,3 @@
+--general_log
+--log-output=FILE
+--loose-performance_schema_users_size=0
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_u.test b/mysql-test/suite/perfschema/t/event_aggregate_no_u.test
new file mode 100644
index 00000000000..c1a895ec549
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_u.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/event_aggregate_setup.inc
+--source ../include/event_aggregate_load.inc
+--source ../include/event_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h-master.opt b/mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h-master.opt
new file mode 100644
index 00000000000..7ac607061ae
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h-master.opt
@@ -0,0 +1,4 @@
+--general_log
+--log-output=FILE
+--loose-performance_schema_users_size=0
+--loose-performance_schema_hosts_size=0
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h.test b/mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h.test
new file mode 100644
index 00000000000..c1a895ec549
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h.test
@@ -0,0 +1,7 @@
+# Tests for the performance schema
+#
+
+--source ../include/event_aggregate_setup.inc
+--source ../include/event_aggregate_load.inc
+--source ../include/event_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/func_file_io.test b/mysql-test/suite/perfschema/t/func_file_io.test
index bcf29a7daa2..a20929481c5 100644
--- a/mysql-test/suite/perfschema/t/func_file_io.test
+++ b/mysql-test/suite/perfschema/t/func_file_io.test
@@ -12,6 +12,9 @@ UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
+update performance_schema.threads SET instrumented = 'YES'
+ WHERE PROCESSLIST_ID=connection_id();
+
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -139,16 +142,15 @@ LIMIT 10;
# Total and average wait time for different users
#
-## --disable_result_log
-## SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
-## # ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
-## FROM performance_schema.events_waits_history_long h
-## INNER JOIN performance_schema.threads p USING (THREAD_ID)
-## LEFT JOIN information_schema.PROCESSLIST i USING (ID)
-## GROUP BY i.user
-## ORDER BY SUM_WAIT DESC
-## LIMIT 20;
-## --enable_result_log
+--disable_result_log
+SELECT p.processlist_user, SUM(TIMER_WAIT) SUM_WAIT
+# ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
+FROM performance_schema.events_waits_history_long h
+INNER JOIN performance_schema.threads p USING (THREAD_ID)
+GROUP BY p.processlist_user
+ORDER BY SUM_WAIT DESC
+LIMIT 20;
+--enable_result_log
#
# Total and average wait times for different events for a session
@@ -166,15 +168,14 @@ HAVING TOTAL_WAIT > 0;
# Which user reads and writes data
#
-## --disable_result_log
-## SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
-## FROM performance_schema.events_waits_history_long h
-## INNER JOIN performance_schema.threads p USING (THREAD_ID)
-## LEFT JOIN information_schema.PROCESSLIST i USING (ID)
-## GROUP BY i.user, h.operation
-## HAVING BYTES > 0
-## ORDER BY i.user, h.operation;
-## --enable_result_log
+--disable_result_log
+SELECT p.processlist_user, h.operation, SUM(NUMBER_OF_BYTES) bytes
+FROM performance_schema.events_waits_history_long h
+INNER JOIN performance_schema.threads p USING (THREAD_ID)
+GROUP BY p.processlist_user, h.operation
+HAVING BYTES > 0
+ORDER BY p.processlist_user, h.operation;
+--enable_result_log
# Clean-up.
-UPDATE performance_schema.setup_instruments SET enabled = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
diff --git a/mysql-test/suite/perfschema/t/func_mutex.test b/mysql-test/suite/perfschema/t/func_mutex.test
index c0af600077e..652d53bf17e 100644
--- a/mysql-test/suite/perfschema/t/func_mutex.test
+++ b/mysql-test/suite/perfschema/t/func_mutex.test
@@ -116,3 +116,6 @@ SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success
# Clean-up.
UPDATE performance_schema.setup_instruments SET enabled = 'YES';
DROP TABLE t1;
+
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test
new file mode 100644
index 00000000000..4113618b0cf
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test
@@ -0,0 +1,51 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getaddrinfo() fails with AGAIN
+# - reported in COUNT_ADDRINFO_TRANSIENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] Host name 'santa.claus.ipv4.example.com' could not be resolved:
+# Temporary failure in name resolution
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'192.0.2.4';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
+
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'192.0.2.4';
+drop user 'root'@'192.0.2.4';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test
new file mode 100644
index 00000000000..0c3bc365ae1
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test
@@ -0,0 +1,46 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getaddrinfo() fails with AGAIN
+# - reported in COUNT_ADDRINFO_TRANSIENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] Host name 'santa.claus.ipv4.example.com' could not be resolved:
+# Temporary failure in name resolution
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test
new file mode 100644
index 00000000000..6de091eae67
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test
@@ -0,0 +1,53 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS full round trip (FCRDNS):
+# - IP --> HOST --> IP returns no match
+# - reported in COUNT_FCRDNS_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] Hostname 'santa.claus.ipv4.example.com' does not resolve to '192.0.2.4'.
+# [Note] Hostname 'santa.claus.ipv4.example.com' has the following IP addresses:
+# [Note] - 192.0.2.126
+# [Note] - 192.0.2.127
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'192.0.2.4';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
+
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'192.0.2.4';
+drop user 'root'@'192.0.2.4';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test
new file mode 100644
index 00000000000..c5a9f33177d
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test
@@ -0,0 +1,48 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS full round trip (FCRDNS):
+# - IP --> HOST --> IP returns no match
+# - reported in COUNT_FCRDNS_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] Hostname 'santa.claus.ipv4.example.com' does not resolve to '192.0.2.4'.
+# [Note] Hostname 'santa.claus.ipv4.example.com' has the following IP addresses:
+# [Note] - 192.0.2.126
+# [Note] - 192.0.2.127
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test
new file mode 100644
index 00000000000..e479944183b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test
@@ -0,0 +1,51 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate success from DNS full round trip (FCRDNS):
+# - IP --> HOST --> IP returns the client IP
+# - completes host validation in HOST_VALIDATED
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '192.0.2.4' could not be resolved:
+# no reverse address mapping.
+call mtr.add_suppression("192.0.2.4");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
+drop user 'root'@'santa.claus.ipv4.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test
new file mode 100644
index 00000000000..cf31acf1da2
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test
@@ -0,0 +1,46 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate success from DNS full round trip (FCRDNS):
+# - IP --> HOST --> IP returns the client IP
+# - completes host validation in HOST_VALIDATED
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '192.0.2.4' could not be resolved:
+# no reverse address mapping.
+call mtr.add_suppression("192.0.2.4");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test
new file mode 100644
index 00000000000..4932dd0a924
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test
@@ -0,0 +1,54 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getaddrinfo() fails with AGAIN
+# - reported in COUNT_ADDRINFO_TRANSIENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] Host name 'santa.claus.ipv4.example.com' could not be resolved:
+# Name or service not known
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+grant select on test.* to 'root'@'192.0.2.4';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_noname";
+
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
+revoke select on test.* from 'root'@'192.0.2.4';
+drop user 'root'@'santa.claus.ipv4.example.com';
+drop user 'root'@'192.0.2.4';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test
new file mode 100644
index 00000000000..0c10c53d933
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test
@@ -0,0 +1,46 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getaddrinfo() fails with NONAME
+# - reported in COUNT_ADDRINFO_PERMANENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] Host name 'santa.claus.ipv4.example.com' could not be resolved:
+# Name or service not known
+call mtr.add_suppression("santa.claus.ipv4.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_noname";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test
new file mode 100644
index 00000000000..2ce251bb77b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test
@@ -0,0 +1,89 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Test authorization with auth plugins.
+# error reporting in:
+# - column COUNT_AUTH_PLUGIN_ERRORS
+# - column COUNT_PROXY_USER_ERRORS
+# - column COUNT_PROXY_USER_ACL_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+--source include/have_plugin_auth.inc
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+CREATE USER 'plug'@'santa.claus.ipv4.example.com'
+ IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER 'plug_dest'@'santa.claus.ipv4.example.com'
+ IDENTIFIED BY 'plug_test_passwd';
+GRANT SELECT ON test.* TO 'plug_dest'@'santa.claus.ipv4.example.com';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+uninstall plugin test_plugin_server;
+
+--disable_query_log
+--error ER_PLUGIN_IS_NOT_LOADED
+connect (con2,"127.0.0.1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_PLUGIN_IS_NOT_LOADED
+connect (con3,"127.0.0.1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--replace_result $PLUGIN_AUTH PLUGIN_AUTH
+eval install plugin test_plugin_server soname '$PLUGIN_AUTH';
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2,"127.0.0.1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con3,"127.0.0.1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+GRANT PROXY ON 'plug_dest'@'santa.claus.ipv4.example.com'
+ TO 'plug'@'santa.claus.ipv4.example.com';
+
+connect (con4,"127.0.0.1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
+select "Con4 is alive";
+select user();
+select current_user();
+disconnect con4;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+REVOKE ALL PRIVILEGES ON *.* FROM 'plug_dest'@'santa.claus.ipv4.example.com';
+REVOKE PROXY ON 'plug_dest'@'santa.claus.ipv4.example.com'
+ FROM 'plug'@'santa.claus.ipv4.example.com';
+DROP USER 'plug'@'santa.claus.ipv4.example.com';
+DROP USER 'plug_dest'@'santa.claus.ipv4.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
new file mode 100644
index 00000000000..fcfb1b9631b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
@@ -0,0 +1,90 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from client / server protocol:
+# - reported in COUNT_HANDSHAKE_ERRORS
+# aud further causes blocking errors:
+# - reported in SUM_CONNECT_ERRORS
+# - reported in COUNT_HOST_BLOCKED_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+select @@global.max_connect_errors;
+select @@global.max_connect_errors into @saved_max_connect_errors;
+
+set global max_connect_errors = 2;
+
+grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4,native_password_bad_reply";
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_IS_BLOCKED
+connect (con2d,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_IS_BLOCKED
+connect (con2e,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+# Now that the host is blocked, check that flush works
+flush hosts;
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
+drop user 'root'@'santa.claus.ipv4.example.com';
+
+set global max_connect_errors = @saved_max_connect_errors;
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_format.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_format.test
new file mode 100644
index 00000000000..a5a06171be7
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_format.test
@@ -0,0 +1,45 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from host names formats:
+# - reported in COUNT_FORMAT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '192.0.2.4' could not be resolved:
+# Name or service not known
+call mtr.add_suppression("192.0.2.4");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_format_ipv4";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test
new file mode 100644
index 00000000000..98d9ccbe83b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test
@@ -0,0 +1,250 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from per user quotas:
+# - reported in COUNT_MAX_USER_CONNECTION_ERRORS
+# - reported in COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS
+# Simulate failures from server quotas:
+# - reported in COUNT_MAX_CONNECTION_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# Enforce a clean state
+--source ../include/wait_for_pfs_thread_count.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+select @@global.max_user_connections;
+select @@global.max_connections;
+select @@global.max_connections into @saved_max_connections;
+
+create user 'quota'@'santa.claus.ipv4.example.com';
+grant select on test.* to 'quota'@'santa.claus.ipv4.example.com';
+grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
+ with max_connections_per_hour 3;
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+connect (con2a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con2a is alive";
+select current_user();
+disconnect con2a;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con2b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con2b is alive";
+select current_user();
+disconnect con2b;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con2c is alive";
+select current_user();
+disconnect con2c;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_USER_LIMIT_REACHED
+connect (con2d,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_USER_LIMIT_REACHED
+connect (con2e,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+# Wait for all disconnects
+--source ../include/wait_for_pfs_thread_count.inc
+
+grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
+ with max_connections_per_hour 0;
+grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
+ with max_user_connections 3;
+flush user_resources;
+
+connect (con3a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con7 is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con3b is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con3c is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_USER_LIMIT_REACHED
+connect (con3d,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_USER_LIMIT_REACHED
+connect (con3e,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+disconnect con3a;
+disconnect con3b;
+disconnect con3c;
+
+# Wait for all disconnects
+--source ../include/wait_for_pfs_thread_count.inc
+
+grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
+ with max_user_connections 0;
+flush user_resources;
+
+set global max_user_connections = 3;
+
+connect (con4a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con4a is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con4b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con4b is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con4c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con4c is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_TOO_MANY_USER_CONNECTIONS
+connect (con4d,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_TOO_MANY_USER_CONNECTIONS
+connect (con4e,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+disconnect con4a;
+disconnect con4b;
+disconnect con4c;
+
+# Wait for all disconnects
+--source ../include/wait_for_pfs_thread_count.inc
+
+set global max_user_connections = 0;
+set global max_connections = 3;
+flush user_resources;
+
+connect (con5a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con4a is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con5b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Con5b is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+# About error ER_CON_COUNT_ERROR:
+# - this error is associated with SQLSTATE 08004,
+# and returned from 2 places in the server code.
+# - which path returns the error is not predictable,
+# as it depends on the server load and thread scheduling
+# - one path returns a SQLSTATE of 08004
+# - another path returns no SQLSTATE at all,
+# and then the client sets a default value of HY000 for SQLSTATE
+#
+# Testing for error ER_CON_COUNT_ERROR alone causes this to
+# be printed in the result file:
+# - ERROR 08004: Too many connections
+# which in turn causes spurious test failures.
+#
+# To work around this, this scripts expect to see either
+# the error number ER_CON_COUNT_ERROR (it always does)
+# or the error number 9999 (it never does, this error does not exist).
+# The exact error number and SQLSTATE is not printed in the result file,
+# makig this test robust for both cases:
+# - ERROR 08004: Too many connections
+# - ERROR HY000: Too many connections
+
+--disable_query_log
+--error ER_CON_COUNT_ERROR, 9999
+connect (con5c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_CON_COUNT_ERROR, 9999
+connect (con5d,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+disconnect con5a;
+disconnect con5b;
+
+# Wait for all disconnects
+--source ../include/wait_for_pfs_thread_count.inc
+
+set global max_connections = @saved_max_connections;
+
+# revoke all privileges on test.* from 'quota'@'santa.claus.ipv4.example.com';
+drop user 'quota'@'santa.claus.ipv4.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test
new file mode 100644
index 00000000000..de30b4a98d3
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test
@@ -0,0 +1,72 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getnameinfo() fails with AGAIN
+# - reported in COUNT_NAMEINFO_TRANSIENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '192.0.2.4' could not be resolved:
+# Temporary failure in name resolution
+call mtr.add_suppression("192.0.2.4");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'192.0.2.4';
+grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
+
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+connect (con4,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con4 is alive";
+select current_user();
+disconnect con4;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con5,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con5 is alive";
+select current_user();
+disconnect con5;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'192.0.2.4';
+revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
+drop user 'root'@'192.0.2.4';
+drop user 'root'@'santa.claus.ipv4.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test
new file mode 100644
index 00000000000..4498d5921ac
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test
@@ -0,0 +1,64 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getnameinfo() fails with AGAIN
+# - reported in COUNT_NAMEINFO_TRANSIENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '192.0.2.4' could not be resolved:
+# Temporary failure in name resolution
+call mtr.add_suppression("192.0.2.4");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con4,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con5,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test
new file mode 100644
index 00000000000..c5a5e4d76a0
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test
@@ -0,0 +1,51 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getnameinfo() fails with NONAME
+# - reported in COUNT_NAMEINFO_PERMANENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '192.0.2.4' could not be resolved:
+# no reverse address mapping.
+call mtr.add_suppression("192.0.2.4");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'192.0.2.4';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_noname";
+
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'192.0.2.4';
+drop user 'root'@'192.0.2.4';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test
new file mode 100644
index 00000000000..9684f676818
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test
@@ -0,0 +1,46 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getnameinfo() fails with NONAME
+# - reported in COUNT_NAMEINFO_PERMANENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '192.0.2.4' could not be resolved:
+# no reverse address mapping.
+call mtr.add_suppression("192.0.2.4");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_noname";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test
new file mode 100644
index 00000000000..c77fc625954
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test
@@ -0,0 +1,86 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from user authentication:
+# - reported in COUNT_AUTHENTICATION_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# Enforce a clean state
+--source ../include/wait_for_pfs_thread_count.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+
+create user 'user_without'@'santa.claus.ipv4.example.com';
+create user 'user_with'@'santa.claus.ipv4.example.com'
+ identified by 'good_password';
+grant select on test.* to 'user_without'@'santa.claus.ipv4.example.com';
+grant select on test.* to 'user_with'@'santa.claus.ipv4.example.com';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2a,"127.0.0.1",user_without,extra_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2b,"127.0.0.1",user_without,extra_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"127.0.0.1",user_with,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2d,"127.0.0.1",user_with,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2e,"127.0.0.1",user_with,wrong_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2f,"127.0.0.1",user_with,wrong_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+drop user 'user_with'@'santa.claus.ipv4.example.com';
+drop user 'user_without'@'santa.claus.ipv4.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test
new file mode 100644
index 00000000000..3e9161302d1
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test
@@ -0,0 +1,74 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from SSL:
+# - reported in COUNT_SSL_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# Enforce a clean state
+--source ../include/wait_for_pfs_thread_count.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+
+create user 'user_ssl'@'santa.claus.ipv4.example.com';
+create user 'user_ssl_x509'@'santa.claus.ipv4.example.com'
+ identified by 'good_password';
+grant select on test.* to 'user_ssl'@'santa.claus.ipv4.example.com'
+ REQUIRE SSL;
+grant select on test.* to 'user_ssl_x509'@'santa.claus.ipv4.example.com'
+ REQUIRE SUBJECT '/C=??/ST=??/L=??/
+ O=No such thing/
+ CN=Santa Claus/emailAddress=santa.claus@example.com';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2a,"127.0.0.1",user_ssl,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2b,"127.0.0.1",user_ssl,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"127.0.0.1",user_ssl_x509,good_password,test,$MASTER_MYPORT,,SSL);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2d,"127.0.0.1",user_ssl_x509,good_password,test,$MASTER_MYPORT,,SSL);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+drop user 'user_ssl'@'santa.claus.ipv4.example.com';
+drop user 'user_ssl_x509'@'santa.claus.ipv4.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..14c92597f95
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test
@@ -0,0 +1,52 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getaddrinfo() fails with AGAIN
+# - reported in COUNT_ADDRINFO_TRANSIENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved:
+# Temporary failure in name resolution
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'2001:db8::6:6';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_again";
+
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'2001:db8::6:6';
+drop user 'root'@'2001:db8::6:6';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..1b2f3f865dc
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test
@@ -0,0 +1,47 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getaddrinfo() fails with AGAIN
+# - reported in COUNT_ADDRINFO_TRANSIENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved:
+# Temporary failure in name resolution
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_again";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..ad478a763e5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test
@@ -0,0 +1,54 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS full round trip (FCRDNS):
+# - IP --> HOST --> IP returns no match
+# - reported in COUNT_FCRDNS_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] Hostname 'santa.claus.ipv6.example.com' does not resolve to '2001:db8::6:6'.
+# [Note] Hostname 'santa.claus.ipv6.example.com' has the following IP addresses:
+# [Note] - 2001:db8::6:7e
+# [Note] - 2001:db8::6:7f
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'2001:db8::6:6';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_bad_ipv6";
+
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'2001:db8::6:6';
+drop user 'root'@'2001:db8::6:6';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..758fc973a34
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test
@@ -0,0 +1,50 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS full round trip (FCRDNS):
+# - IP --> HOST --> IP returns no match
+# - reported in COUNT_FCRDNS_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] Hostname 'santa.claus.ipv6.example.com' does not resolve to '2001:db8::6:6'.
+# [Note] Hostname 'santa.claus.ipv6.example.com' has the following IP addresses:
+# [Note] - 2001:db8::6:7e
+# [Note] - 2001:db8::6:7f
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_bad_ipv6";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..19a3c2d11f3
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test
@@ -0,0 +1,52 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate success from DNS full round trip (FCRDNS):
+# - IP --> HOST --> IP returns the client IP
+# - completes host validation in HOST_VALIDATED
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '192.0.2.4' could not be resolved:
+# no reverse address mapping.
+call mtr.add_suppression("192.0.2.4");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
+drop user 'root'@'santa.claus.ipv6.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..543f056534a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test
@@ -0,0 +1,43 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate success from DNS full round trip (FCRDNS):
+# - IP --> HOST --> IP returns the client IP
+# - completes host validation in HOST_VALIDATED
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..be304140ba2
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test
@@ -0,0 +1,55 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getaddrinfo() fails with AGAIN
+# - reported in COUNT_ADDRINFO_TRANSIENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved:
+# Name or service not known
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+grant select on test.* to 'root'@'2001:db8::6:6';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
+
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
+revoke select on test.* from 'root'@'2001:db8::6:6';
+drop user 'root'@'santa.claus.ipv6.example.com';
+drop user 'root'@'2001:db8::6:6';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..101abc86a20
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test
@@ -0,0 +1,47 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getaddrinfo() fails with NONAME
+# - reported in COUNT_ADDRINFO_PERMANENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved:
+# Name or service not known
+call mtr.add_suppression("santa.claus.ipv6.example.com");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test
new file mode 100644
index 00000000000..89bbc016224
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test
@@ -0,0 +1,91 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Test authorization with auth plugins.
+# error reporting in:
+# - column COUNT_AUTH_PLUGIN_ERRORS
+# - column COUNT_PROXY_USER_ERRORS
+# - column COUNT_PROXY_USER_ACL_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+--source include/have_plugin_auth.inc
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+CREATE USER 'plug'@'santa.claus.ipv6.example.com'
+ IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER 'plug_dest'@'santa.claus.ipv6.example.com'
+ IDENTIFIED BY 'plug_test_passwd';
+GRANT SELECT ON test.* TO 'plug_dest'@'santa.claus.ipv6.example.com';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+uninstall plugin test_plugin_server;
+
+--disable_query_log
+--error ER_PLUGIN_IS_NOT_LOADED
+connect (con2,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_PLUGIN_IS_NOT_LOADED
+connect (con3,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+#--replace_result $PLUGIN_AUTH PLUGIN_AUTH
+#eval install plugin test_plugin_server soname '$PLUGIN_AUTH';
+install plugin test_plugin_server soname 'auth_test_plugin';
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con3,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+GRANT PROXY ON 'plug_dest'@'santa.claus.ipv6.example.com'
+ TO 'plug'@'santa.claus.ipv6.example.com';
+
+connect (con4,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
+select "Con4 is alive";
+select user();
+select current_user();
+disconnect con4;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+REVOKE ALL PRIVILEGES ON *.* FROM 'plug_dest'@'santa.claus.ipv6.example.com';
+REVOKE PROXY ON 'plug_dest'@'santa.claus.ipv6.example.com'
+ FROM 'plug'@'santa.claus.ipv6.example.com';
+DROP USER 'plug'@'santa.claus.ipv6.example.com';
+DROP USER 'plug_dest'@'santa.claus.ipv6.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
new file mode 100644
index 00000000000..ef276db982e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
@@ -0,0 +1,91 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from client / server protocol:
+# - reported in COUNT_HANDSHAKE_ERRORS
+# aud further causes blocking errors:
+# - reported in SUM_CONNECT_ERRORS
+# - reported in COUNT_HOST_BLOCKED_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+select @@global.max_connect_errors;
+select @@global.max_connect_errors into @saved_max_connect_errors;
+
+set global max_connect_errors = 2;
+
+grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6,native_password_bad_reply";
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2a,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2b,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_IS_BLOCKED
+connect (con2d,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_IS_BLOCKED
+connect (con2e,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+# Now that the host is blocked, check that flush works
+flush hosts;
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
+drop user 'root'@'santa.claus.ipv6.example.com';
+
+set global max_connect_errors = @saved_max_connect_errors;
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
new file mode 100644
index 00000000000..c8d6d524cb0
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
@@ -0,0 +1,232 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from per user quotas:
+# - reported in COUNT_MAX_USER_CONNECTION_ERRORS
+# - reported in COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS
+# Simulate failures from server quotas:
+# - reported in COUNT_MAX_CONNECTION_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# Enforce a clean state
+--source ../include/wait_for_pfs_thread_count.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+select @@global.max_user_connections;
+select @@global.max_connections;
+select @@global.max_connections into @saved_max_connections;
+
+create user 'quota'@'santa.claus.ipv6.example.com';
+grant select on test.* to 'quota'@'santa.claus.ipv6.example.com';
+grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
+ with max_connections_per_hour 3;
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+
+connect (con2a,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con2a is alive";
+select current_user();
+disconnect con2a;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con2b,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con2b is alive";
+select current_user();
+disconnect con2b;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con2c,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con2c is alive";
+select current_user();
+disconnect con2c;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_USER_LIMIT_REACHED
+connect (con2d,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_USER_LIMIT_REACHED
+connect (con2e,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+# Wait for all disconnects
+--source ../include/wait_for_pfs_thread_count.inc
+
+grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
+ with max_connections_per_hour 0;
+grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
+ with max_user_connections 3;
+flush user_resources;
+
+connect (con3a,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con7 is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3b,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con3b is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3c,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con3c is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_USER_LIMIT_REACHED
+connect (con3d,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_USER_LIMIT_REACHED
+connect (con3e,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+disconnect con3a;
+disconnect con3b;
+disconnect con3c;
+
+# Wait for all disconnects
+--source ../include/wait_for_pfs_thread_count.inc
+
+grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
+ with max_user_connections 0;
+flush user_resources;
+
+set global max_user_connections = 3;
+
+connect (con4a,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con4a is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con4b,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con4b is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con4c,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con4c is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_TOO_MANY_USER_CONNECTIONS
+connect (con4d,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_TOO_MANY_USER_CONNECTIONS
+connect (con4e,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+disconnect con4a;
+disconnect con4b;
+disconnect con4c;
+
+# Wait for all disconnects
+--source ../include/wait_for_pfs_thread_count.inc
+
+set global max_user_connections = 0;
+set global max_connections = 3;
+flush user_resources;
+
+connect (con5a,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con4a is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con5b,"::1",quota,,test,$MASTER_MYPORT,);
+select "Con5b is alive";
+select current_user();
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+# About ER_CON_COUNT_ERROR,
+# See comments in hostcache_ipv4_max_con.test
+
+--disable_query_log
+--error ER_CON_COUNT_ERROR, 9999
+connect (con5c,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_CON_COUNT_ERROR, 9999
+connect (con5d,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+disconnect con5a;
+disconnect con5b;
+
+# Wait for all disconnects
+--source ../include/wait_for_pfs_thread_count.inc
+
+set global max_connections = @saved_max_connections;
+
+# revoke all privileges on test.* from 'quota'@'santa.claus.ipv6.example.com';
+drop user 'quota'@'santa.claus.ipv6.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..ecf18ab55f4
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test
@@ -0,0 +1,73 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getnameinfo() fails with AGAIN
+# - reported in COUNT_NAMEINFO_TRANSIENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '2001:db8::6:6' could not be resolved:
+# Temporary failure in name resolution
+call mtr.add_suppression("2001:db8::6:6");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'2001:db8::6:6';
+grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_again";
+
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+
+connect (con4,"::1",root,,test,$MASTER_MYPORT,);
+select "Con4 is alive";
+select current_user();
+disconnect con4;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con5,"::1",root,,test,$MASTER_MYPORT,);
+select "Con5 is alive";
+select current_user();
+disconnect con5;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'2001:db8::6:6';
+revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
+drop user 'root'@'2001:db8::6:6';
+drop user 'root'@'santa.claus.ipv6.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..510318fae53
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test
@@ -0,0 +1,65 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getnameinfo() fails with AGAIN
+# - reported in COUNT_NAMEINFO_TRANSIENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '2001:db8::6:6' could not be resolved:
+# Temporary failure in name resolution
+call mtr.add_suppression("2001:db8::6:6");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_again";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con4,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con5,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..00b279aabe8
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test
@@ -0,0 +1,52 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getnameinfo() fails with NONAME
+# - reported in COUNT_NAMEINFO_PERMANENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '2001:db8::6:6' could not be resolved:
+# Name or service not known
+call mtr.add_suppression("2001:db8::6:6");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+grant select on test.* to 'root'@'2001:db8::6:6';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_noname";
+
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'2001:db8::6:6';
+drop user 'root'@'2001:db8::6:6';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
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
new file mode 100644
index 00000000000..03a207fccfb
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test
@@ -0,0 +1,47 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from DNS:
+# - getnameinfo() fails with NONAME
+# - reported in COUNT_NAMEINFO_PERMANENT_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '2001:db8::6:6' could not be resolved:
+# Name or service not known
+call mtr.add_suppression("2001:db8::6:6");
+
+flush status;
+flush hosts;
+select @@global.debug;
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_noname";
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con2,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_NOT_PRIVILEGED
+connect (con3,"::1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test
new file mode 100644
index 00000000000..9de453544bb
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test
@@ -0,0 +1,87 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from user authentication:
+# - reported in COUNT_AUTHENTICATION_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# Enforce a clean state
+--source ../include/wait_for_pfs_thread_count.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+
+create user 'user_without'@'santa.claus.ipv6.example.com';
+create user 'user_with'@'santa.claus.ipv6.example.com'
+ identified by 'good_password';
+grant select on test.* to 'user_without'@'santa.claus.ipv6.example.com';
+grant select on test.* to 'user_with'@'santa.claus.ipv6.example.com';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2a,"::1",user_without,extra_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2b,"::1",user_without,extra_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"::1",user_with,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2d,"::1",user_with,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2e,"::1",user_with,wrong_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2f,"::1",user_with,wrong_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+drop user 'user_with'@'santa.claus.ipv6.example.com';
+drop user 'user_without'@'santa.claus.ipv6.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt
new file mode 100644
index 00000000000..a0a6079ec16
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt
@@ -0,0 +1 @@
+--bind-addr=::
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test
new file mode 100644
index 00000000000..ce6f825f4fb
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test
@@ -0,0 +1,75 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from SSL:
+# - reported in COUNT_SSL_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_ipv6.inc
+--source include/have_perfschema.inc
+
+# Enforce a clean state
+--source ../include/wait_for_pfs_thread_count.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+
+create user 'user_ssl'@'santa.claus.ipv6.example.com';
+create user 'user_ssl_x509'@'santa.claus.ipv6.example.com'
+ identified by 'good_password';
+grant select on test.* to 'user_ssl'@'santa.claus.ipv6.example.com'
+ REQUIRE SSL;
+grant select on test.* to 'user_ssl_x509'@'santa.claus.ipv6.example.com'
+ REQUIRE SUBJECT '/C=??/ST=??/L=??/
+ O=No such thing/
+ CN=Santa Claus/emailAddress=santa.claus@example.com';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2a,"::1",user_ssl,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2b,"::1",user_ssl,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"::1",user_ssl_x509,good_password,test,$MASTER_MYPORT,,SSL);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2d,"::1",user_ssl_x509,good_password,test,$MASTER_MYPORT,,SSL);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+drop user 'user_ssl'@'santa.claus.ipv6.example.com';
+drop user 'user_ssl_x509'@'santa.claus.ipv6.example.com';
+
+set global debug= default;
+
diff --git a/mysql-test/suite/perfschema/t/hostcache_peer_addr.test b/mysql-test/suite/perfschema/t/hostcache_peer_addr.test
new file mode 100644
index 00000000000..022e20a9a64
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_peer_addr.test
@@ -0,0 +1,47 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from vio_peer_addr, reported in:
+# status variable Peer_address_errors
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+flush status;
+flush hosts;
+select @@global.debug;
+show global status like "connection_errors_%";
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_error";
+
+--disable_query_log
+--error ER_BAD_HOST_ERROR
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+show global status like "connection_errors_%";
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_BAD_HOST_ERROR
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+show global status like "connection_errors_%";
+--source ../include/hostcache_dump.inc
+
+set global debug= default;
+
+flush status;
+show global status like "connection_errors_%";
+
diff --git a/mysql-test/suite/perfschema/t/indexed_table_io.test b/mysql-test/suite/perfschema/t/indexed_table_io.test
new file mode 100644
index 00000000000..1a7597113d2
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/indexed_table_io.test
@@ -0,0 +1,112 @@
+# Tests for PERFORMANCE_SCHEMA table io
+# Show the impact of an index
+
+# Setup
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+let $engine_type= MyISAM;
+
+--disable_warnings
+drop table if exists test.no_index_tab;
+drop table if exists test.index_tab;
+--enable_warnings
+
+let $table_io_select= select COUNT(*)
+from performance_schema.events_waits_history_long
+where event_name like 'wait/io/table/%'
+and object_schema = 'test'
+and object_name = ;
+
+--source ../include/table_io_setup_helper.inc
+
+# Code to test
+
+eval create table test.no_index_tab
+ ( a int, b char(30) default 'Default') engine = $engine_type;
+eval create table test.index_tab
+ ( a int, b char(30) default 'Default', unique key uidx(a)) engine = $engine_type;
+# Make sure the proper engine is used
+show create table test.no_index_tab;
+show create table test.index_tab;
+
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+--echo # Printing of 100 inserts per table is suppressed
+--disable_query_log
+let $run= 100;
+while ($run)
+{
+ eval insert into test.no_index_tab set a = $run;
+ eval insert into test.index_tab set a = $run;
+ dec $run;
+}
+--enable_query_log
+update performance_schema.setup_consumers set enabled='NO';
+eval $table_io_select 'no_index_tab';
+# Attention: There is no visible impact of index maintenance on table io
+# because the maintenance is handled by the storage engine themself.
+eval $table_io_select 'index_tab';
+
+select count(*) from test.no_index_tab;
+select count(*) from test.index_tab;
+
+# Testing Code
+
+# For getting avg(a) inspection of
+# - all rows (test.no_index_tab)
+# - all unique index values (test.index_tab, assuming the optimizer decides to
+# process only the unique index)
+# --> No difference between numvber of accesses for no_index_tab and index_tab
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+select avg(a) from test.no_index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+eval $table_io_select 'no_index_tab';
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+select avg(a) from test.index_tab;
+update performance_schema.setup_consumers set enabled='NO';
+eval $table_io_select 'index_tab';
+
+# With where a = 50 inspection of
+# - all rows (test.no_index_tab)
+# - 1 up to maybe a few unique index values (test.index_tab, assuming that the
+# optimizer decides to exploit the unique index)
+# --> index_tab requires much less accesses than no_index_tab
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+select 1 as my_column from test.no_index_tab where a = 50;
+update performance_schema.setup_consumers set enabled='NO';
+eval $table_io_select 'no_index_tab';
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+select 1 as my_column from test.index_tab where a = 50;
+update performance_schema.setup_consumers set enabled='NO';
+eval $table_io_select 'index_tab';
+
+# With where a = 50 inspection of
+# - all rows (test.no_index_tab)
+# - 1 up to maybe a few unique index values (test.index_tab, assuming that the
+# optimizer decides to exploit the unique index)
+# and remove one row for both cases
+# --> index_tab requires much less accesses than no_index_tab
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+delete from test.no_index_tab where a = 51;
+update performance_schema.setup_consumers set enabled='NO';
+eval $table_io_select 'no_index_tab';
+truncate table performance_schema.events_waits_history_long;
+update performance_schema.setup_consumers set enabled='YES';
+delete from test.index_tab where a = 51;
+update performance_schema.setup_consumers set enabled='NO';
+eval $table_io_select 'index_tab';
+
+# In case of failures, this will tell if table io are lost.
+show status like 'performance_schema_%';
+
+# Cleanup
+drop table test.no_index_tab;
+drop table test.index_tab;
+--source ../include/table_io_cleanup_helper.inc
diff --git a/mysql-test/suite/perfschema/t/innodb_table_io.test b/mysql-test/suite/perfschema/t/innodb_table_io.test
new file mode 100644
index 00000000000..b3c78010731
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/innodb_table_io.test
@@ -0,0 +1,28 @@
+# Tests for PERFORMANCE_SCHEMA table io
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/table_io_setup_helper.inc
+
+let $engine_type= InnoDB;
+let $table_item= test.no_index_tab;
+--disable_warnings
+eval drop table if exists $table_item;
+--enable_warnings
+
+# Start recording events
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+eval create table $table_item
+( a varchar(255) not null, b int not null) engine = $engine_type;
+insert into marker set a = 1;
+eval show create table $table_item;
+--source ../include/table_io_basic_dml.inc
+eval drop table $table_item;
+
+# Stop recording events + pull result
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/suite/perfschema/t/memory_table_io.test b/mysql-test/suite/perfschema/t/memory_table_io.test
new file mode 100644
index 00000000000..f1e5f7027f7
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/memory_table_io.test
@@ -0,0 +1,28 @@
+# Tests for PERFORMANCE_SCHEMA table io
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/table_io_setup_helper.inc
+
+let $engine_type= MEMORY;
+let $table_item= test.no_index_tab;
+--disable_warnings
+eval drop table if exists $table_item;
+--enable_warnings
+
+# Start recording events
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+eval create table $table_item
+( a varchar(255) not null, b int not null) engine = $engine_type;
+insert into marker set a = 1;
+eval show create table $table_item;
+--source ../include/table_io_basic_dml.inc
+eval drop table $table_item;
+
+# Stop recording events + pull result
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/suite/perfschema/t/merge_table_io.test b/mysql-test/suite/perfschema/t/merge_table_io.test
new file mode 100644
index 00000000000..d4727525e70
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/merge_table_io.test
@@ -0,0 +1,46 @@
+# Tests for PERFORMANCE_SCHEMA table io
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/table_io_setup_helper.inc
+
+let $engine_type= MyISAM;
+let $table_item= test.no_index_tab;
+
+--disable_warnings
+eval drop table if exists $table_item;
+drop table if exists test.no_index_tab_1;
+drop table if exists test.no_index_tab_2;
+--enable_warnings
+
+# Start recording events
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+eval create table test.no_index_tab_1
+( a varchar(255) not null, b int not null) engine = $engine_type;
+insert into marker set a = 1;
+create table test.no_index_tab_2 like test.no_index_tab_1;
+insert into marker set a = 1;
+eval create table $table_item
+ ( a varchar(255) not null, b int not null) engine = merge
+ union = (test.no_index_tab_1,test.no_index_tab_2) insert_method = first;
+insert into marker set a = 1;
+# Make sure the proper engine is used
+show create table test.no_index_tab_1;
+insert into marker set a = 1;
+show create table test.no_index_tab_2;
+insert into marker set a = 1;
+eval show create table $table_item;
+--source ../include/table_io_basic_dml.inc
+drop table test.no_index_tab_1;
+insert into marker set a = 1;
+drop table test.no_index_tab_2;
+insert into marker set a = 1;
+eval drop table $table_item;
+
+# Stop recording events + pull result
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test
index 5cff586c5f0..ee6dfe95e8c 100644
--- a/mysql-test/suite/perfschema/t/misc.test
+++ b/mysql-test/suite/perfschema/t/misc.test
@@ -5,6 +5,60 @@
--source include/have_perfschema.inc
#
+# Bug#12790483 OBJECTS_SUMMARY_GLOBAL_BY_TYPE AND RENAME TABLE
+#
+# Rename table leaves old tables names behind in
+# performance_schema.objects_summary_global_by_type
+#
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+ WHERE object_schema='test';
+
+CREATE TABLE test.t_before(a INT);
+INSERT INTO test.t_before VALUES (1);
+
+# The new table should appear in OBJECTS_SUMMARY_GLOBAL_BY_TYPE.
+
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+ WHERE object_schema='test';
+
+RENAME TABLE test.t_before TO test.t_after;
+
+# The renamed table should appear in OBJECTS_SUMMARY_GLOBAL_BY_TYPE, but only
+# after it is accessed.
+
+SELECT COUNT(*) FROM test.t_after;
+
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+ WHERE object_schema='test';
+
+DROP TABLE test.t_after;
+
+# The renamed table should not appear in OBJECTS_SUMMARY_GLOBAL_BY_TYPE.
+
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+ WHERE object_schema='test';
+
+#
+# Verify table views are ignored by the table io instrumentation.
+#
+
+CREATE TABLE test.t1(a INT);
+INSERT INTO test.t1 VALUES (1);
+CREATE VIEW test.v1 AS SELECT * FROM test.t1;
+SELECT COUNT(*) FROM test.v1;
+
+# Verify that a PFS table share was not created for the view.
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+ WHERE object_schema='test';
+
+DROP VIEW test.v1;
+DROP TABLE test.t1;
+
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+ WHERE object_schema='test';
+
+
+#
# Bug#45496 Performance schema: assertion fails in
# ha_perfschema::rnd_init:223
#
@@ -26,6 +80,11 @@ LIMIT 1;
--error ER_CANT_CREATE_TABLE
create table test.t1(a int) engine=performance_schema;
+# The table should not appear in OBJECTS_SUMMARY_GLOBAL_BY_TYPE
+
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+ WHERE object_schema='test';
+
#
# Bug#44897 Performance Schema: can create a ghost table in another database
#
@@ -33,6 +92,11 @@ create table test.t1(a int) engine=performance_schema;
--error ER_CANT_CREATE_TABLE
create table test.t1 like performance_schema.events_waits_current;
+# The table should not appear in OBJECTS_SUMMARY_GLOBAL_BY_TYPE
+
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+ WHERE object_schema='test';
+
#
# Bug#44898 PerformanceSchema: can create a table in db performance_schema, cannot insert
#
@@ -40,6 +104,11 @@ create table test.t1 like performance_schema.events_waits_current;
--error ER_TABLEACCESS_DENIED_ERROR
create table performance_schema.t1(a int);
+# The table should not appear in OBJECTS_SUMMARY_GLOBAL_BY_TYPE
+
+SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type
+ WHERE object_schema='test';
+
#
# Bug#51447 performance schema evil twin files
#
@@ -68,3 +137,34 @@ select * from performance_schema.file_instances
--error ER_NO_SUCH_TABLE
select * from performance_schema.no_such_table;
+#
+# Bug#12370950 - 60905: TABLE_IO_WAITS_SUMMARY_BY_INDEX_USAGE AGGREGATES NON-INSERT DML WRONGLY
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t_60905;
+--enable_warnings
+CREATE TABLE t_60905 (i INT, j INT, KEY(i)) ENGINE = InnoDB;
+INSERT INTO t_60905 VALUES
+(1,2), (3,4), (5,6), (7,8), (9,10);
+
+# should delete with a "single" PRIMARY lookup (2 PRIMARY fetch, 1 PRIMARY delete)
+DELETE FROM t_60905 WHERE i = 1;
+
+# should delete with a full scan (5 NULL fetch, 1 NULL delete)
+DELETE FROM t_60905 WHERE j = 8;
+
+# show the instrument data
+SELECT object_schema,
+ object_name,
+ index_name,
+ count_fetch,
+ count_insert,
+ count_update,
+ count_delete
+ FROM performance_schema.table_io_waits_summary_by_index_usage
+ WHERE object_schema = 'test'
+ AND object_name = 't_60905';
+
+DROP TABLE t_60905;
+
diff --git a/mysql-test/suite/perfschema/t/multi_table_io.test b/mysql-test/suite/perfschema/t/multi_table_io.test
new file mode 100644
index 00000000000..d835f36be4b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/multi_table_io.test
@@ -0,0 +1,53 @@
+# Tests for PERFORMANCE_SCHEMA table io
+# Reveal that in case of statements using more than one base table
+# both show up in a correct way.
+
+# Setup
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_warnings
+drop schema if exists test1;
+drop table if exists test.t1;
+--enable_warnings
+
+create schema test1;
+let $engine_type= myisam;
+eval create table test.t1 (col1 bigint, col2 varchar(30)) engine = $engine_type;
+insert into test.t1 values(1,'One');
+create table test1.t2 like test.t1;
+# Make sure the proper engine is used
+show create table test.t1;
+show create table test1.t2;
+
+--source ../include/table_io_setup_helper.inc
+let $schema_to_dump= 'test','test1';
+
+# Start event recording
+update performance_schema.setup_consumers set enabled = 'YES';
+
+# INSERT ... SELECT ...
+insert into test1.t2 select * from test.t1;
+insert into marker set a = 1;
+# JOIN
+select * from test.t1 natural join test1.t2;
+insert into marker set a = 1;
+# CORRELATED SUBQUERY
+select * from test.t1 where col2 = (select col2 from test1.t2 where test.t1.col1 = test1.t2.col1);
+insert into marker set a = 1;
+# UPDATE
+update test.t1 AS a natural join test1.t2 AS b SET a.col2 = 'updated' , b.col2 = 'updated';
+insert into marker set a = 1;
+# DELETE
+delete from test.t1, test1.t2 using test.t1 inner join test1.t2
+where test.t1.col1 = test1.t2.col1;
+
+# Stop event recording + pull results
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+drop table test.t1;
+drop schema test1;
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/suite/perfschema/t/myisam_table_io.test b/mysql-test/suite/perfschema/t/myisam_table_io.test
new file mode 100644
index 00000000000..9d0b2560419
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/myisam_table_io.test
@@ -0,0 +1,28 @@
+# Tests for PERFORMANCE_SCHEMA table io
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/table_io_setup_helper.inc
+
+let $engine_type= MyISAM;
+let $table_item= test.no_index_tab;
+--disable_warnings
+eval drop table if exists $table_item;
+--enable_warnings
+
+# Start recording events
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+eval create table $table_item
+( a varchar(255) not null, b int not null) engine = $engine_type;
+insert into marker set a = 1;
+eval show create table $table_item;
+--source ../include/table_io_basic_dml.inc
+eval drop table $table_item;
+
+# Stop recording events + pull result
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/suite/perfschema/t/nesting.test b/mysql-test/suite/perfschema/t/nesting.test
new file mode 100644
index 00000000000..9b1458dca5d
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/nesting.test
@@ -0,0 +1,188 @@
+# Test to check the proper nesting of events
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+# 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/wait_for_pfs_thread_count.inc
+
+--disable_query_log
+
+grant ALL on *.* to user1@localhost;
+
+flush privileges;
+
+--disable_warnings
+drop table if exists test.setup_actors;
+--enable_warnings
+
+create table test.setup_actors as
+ select * from performance_schema.setup_actors;
+
+# Only instrument the user connections
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+ set host= 'localhost', user= 'user1', role= '%';
+
+update performance_schema.threads set instrumented='NO';
+
+# Only instrument a few events of each kind
+update performance_schema.setup_instruments set enabled='NO', timed='NO';
+
+update performance_schema.setup_instruments set enabled='YES', timed='YES'
+ where name in ('idle',
+ 'wait/io/table/sql/handler',
+ 'wait/lock/table/sql/handler',
+ 'wait/io/socket/sql/client_connection',
+ 'wait/synch/rwlock/sql/LOCK_grant',
+ 'wait/synch/mutex/sql/THD::LOCK_thd_data',
+ 'wait/io/file/sql/query_log');
+
+update performance_schema.setup_instruments set enabled='YES', timed='YES'
+ where name like ('stage/sql/%');
+
+update performance_schema.setup_instruments set enabled='YES', timed='YES'
+ where name in ('statement/sql/select',
+ 'statement/com/',
+ 'statement/com/Query',
+ 'statement/com/error');
+
+# Start from a known clean state, to avoid noise from previous tests
+flush tables;
+flush status;
+
+truncate performance_schema.events_waits_current;
+truncate performance_schema.events_waits_history;
+truncate performance_schema.events_waits_history_long;
+truncate performance_schema.events_stages_current;
+truncate performance_schema.events_stages_history;
+truncate performance_schema.events_stages_history_long;
+truncate performance_schema.events_statements_current;
+truncate performance_schema.events_statements_history;
+truncate performance_schema.events_statements_history_long;
+
+--enable_query_log
+
+connect (con1, localhost, user1, , );
+
+echo "================== con1 connected ==================";
+
+select "MARKER_BEGIN" as marker;
+
+select "This is simple statement one" as payload;
+
+select "This is simple statement two" as payload;
+
+delimiter $$;
+select "This is the first part of a multi query" as payload;
+select "And this is the second part of a multi query" as payload;
+select "With a third part to make things complete" as payload;
+$$
+delimiter ;$$
+
+select "MARKER_END" as marker;
+
+select "Con1 is done with payload" as status;
+
+echo "================== con1 done ==================";
+
+--connection default
+
+set @con1_tid = (select thread_id from performance_schema.threads
+ where processlist_user = 'user1');
+
+select (@con1_tid is not null) as expected;
+
+set @marker_begin = (select event_id from performance_schema.events_statements_history_long
+ where sql_text like "%MARKER_BEGIN%" and thread_id = @con1_tid);
+
+select (@marker_begin is not null) as expected;
+
+set @marker_end = (select end_event_id from performance_schema.events_statements_history_long
+ where sql_text like "%MARKER_END%" and thread_id = @con1_tid);
+
+select (@marker_end is not null) as expected;
+
+# Will point to what happened on spurious test failures
+show status like "performance_schema%";
+
+#
+# This is the test itself:
+# the full trace of every recorded event between MARKER_BEGIN
+# end MARKER_END is dumped.
+# The value of EVENT_ID, END_EVENT_ID, NESTING_EVENT_TYPE, NESTING_EVENT_ID
+# should reflect the relations between each events,
+# and this structure should stay the same between runs.
+#
+# Things to observe in the output:
+# - there are IDLE events between top level queries,
+# - there are no IDLE events between multi queries
+# - STATEMENT starts right after the IDLE event
+# - STAGE init starts right after
+# - SOCKET events, when receiving the command,
+# are childrens of the STATEMENT select / STAGE init
+
+select * from (
+(
+select (event_id - @marker_begin) as relative_event_id,
+ (end_event_id - @marker_begin) as relative_end_event_id,
+ event_name,
+ sql_text as comment,
+ nesting_event_type,
+ (nesting_event_id - @marker_begin) as relative_nesting_event_id
+ from performance_schema.events_statements_history_long
+ where (thread_id = @con1_tid)
+ and (@marker_begin <= event_id)
+ and (end_event_id <= @marker_end)
+)
+union
+(
+select (event_id - @marker_begin) as relative_event_id,
+ (end_event_id - @marker_begin) as relative_end_event_id,
+ event_name,
+ "(stage)" as comment,
+ nesting_event_type,
+ (nesting_event_id - @marker_begin) as relative_nesting_event_id
+ from performance_schema.events_stages_history_long
+ where (thread_id = @con1_tid)
+ and (@marker_begin <= event_id)
+ and (end_event_id <= @marker_end)
+)
+union
+(
+select (event_id - @marker_begin) as relative_event_id,
+ (end_event_id - @marker_begin) as relative_end_event_id,
+ event_name,
+ operation as comment,
+ nesting_event_type,
+ (nesting_event_id - @marker_begin) as relative_nesting_event_id
+ from performance_schema.events_waits_history_long
+ where (thread_id = @con1_tid)
+ and (@marker_begin <= event_id)
+ and (end_event_id <= @marker_end)
+)
+) all_events
+order by relative_event_id asc;
+
+# test cleanup
+
+--disconnect con1
+
+--disable_query_log
+revoke all privileges, grant option from user1@localhost;
+drop user user1@localhost;
+flush privileges;
+
+truncate table performance_schema.setup_actors;
+insert into performance_schema.setup_actors
+ select * from test.setup_actors;
+drop table test.setup_actors;
+
+update performance_schema.threads set instrumented='YES';
+update performance_schema.setup_instruments set enabled='YES', timed='YES';
+
+--enable_query_log
+
+
diff --git a/mysql-test/suite/perfschema/t/no_threads-master.opt b/mysql-test/suite/perfschema/t/no_threads-master.opt
index 63784bf7c66..64275d009d4 100644
--- a/mysql-test/suite/perfschema/t/no_threads-master.opt
+++ b/mysql-test/suite/perfschema/t/no_threads-master.opt
@@ -1 +1 @@
---one-thread --thread-handling=no-threads --loose-performance-schema-max-thread_instances=10 --default-storage-engine=MyISAM
+--thread-handling=no-threads --loose-performance-schema-max-thread_instances=10 --default-storage-engine=MyISAM --skip-innodb
diff --git a/mysql-test/suite/perfschema/t/no_threads.test b/mysql-test/suite/perfschema/t/no_threads.test
index 6192843f641..ee745bd87b0 100644
--- a/mysql-test/suite/perfschema/t/no_threads.test
+++ b/mysql-test/suite/perfschema/t/no_threads.test
@@ -51,5 +51,7 @@ select event_name, operation,
# Cleanup
+update performance_schema.setup_instruments set enabled='YES';
+
drop table test.t1;
diff --git a/mysql-test/suite/perfschema/t/ortho_iter.test b/mysql-test/suite/perfschema/t/ortho_iter.test
new file mode 100644
index 00000000000..09ecfa8a788
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ortho_iter.test
@@ -0,0 +1,146 @@
+# Tests for PERFORMANCE_SCHEMA
+# Verify the orthogonality of iterators (table*::rnd_next()),
+# for every table and instruments.
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_warnings
+drop procedure if exists check_instrument;
+--enable_warnings
+
+delimiter $;
+create procedure check_instrument(in instr_name varchar(128))
+begin
+ declare count_expected integer;
+ declare count_actual integer;
+ declare is_wait integer;
+ declare is_stage integer;
+ declare is_statement integer;
+ declare is_wait_table integer;
+ declare is_stage_table integer;
+ declare is_statement_table integer;
+ declare pfs_table_name varchar(64);
+ declare msg varchar(512);
+ declare msg_detail varchar(512);
+ declare cmd_1 varchar(512);
+ declare cmd_2 varchar(512);
+ declare done integer default 0;
+ declare debug integer default 0;
+
+ declare pfs_cursor CURSOR FOR
+ select table_name from information_schema.tables
+ where table_schema= 'performance_schema'
+ and table_name like "events_%_by_event_name%";
+
+ declare continue handler for sqlstate '02000'
+ set done = 1;
+
+ select (instr_name like "wait/%") or (instr_name like "idle/%") into is_wait;
+ select (instr_name like "stage/%") into is_stage;
+ select (instr_name like "statement/%") into is_statement;
+
+ select instr_name, is_wait, is_stage, is_statement;
+
+ select count(name)
+ from performance_schema.setup_instruments
+ where name like (concat(instr_name, "%"))
+ into count_expected;
+
+ set cmd_1= "select count(*) from (select distinct event_name from performance_schema.";
+ set cmd_2= concat(" where event_name like \"",
+ instr_name,
+ "%\") t into @count_actual");
+
+ open pfs_cursor;
+ repeat
+ fetch pfs_cursor into pfs_table_name;
+ if not done then
+ select (pfs_table_name like "%waits%") into is_wait_table;
+ select (pfs_table_name like "%stages%") into is_stage_table;
+ select (pfs_table_name like "%statements%") into is_statement_table;
+
+ select concat("Checking table ", pfs_table_name, " ...") as status;
+ select concat(cmd_1, pfs_table_name, cmd_2) into @cmd;
+ if debug = 1
+ then
+ select @cmd;
+ end if;
+ prepare stmt from @cmd;
+ execute stmt;
+ drop prepare stmt;
+ set msg_detail= concat("table ", pfs_table_name,
+ ", instruments ", count_expected,
+ ", found ", @count_actual);
+
+ if is_wait = 1 and is_wait_table = 1 and @count_actual <> count_expected
+ then
+ set msg= concat("Missing wait events: ", msg_detail);
+ signal sqlstate '05000' set message_text= msg;
+ end if;
+
+ if is_wait = 1 and is_wait_table = 0 and @count_actual <> 0
+ then
+ set msg= concat("Unexpected wait events: ", msg_detail);
+ signal sqlstate '05000' set message_text= msg;
+ end if;
+
+ if is_stage = 1 and is_stage_table = 1 and @count_actual <> count_expected
+ then
+ set msg= concat("Missing stage events: ", msg_detail);
+ signal sqlstate '05000' set message_text= msg;
+ end if;
+
+ if is_stage = 1 and is_stage_table = 0 and @count_actual <> 0
+ then
+ set msg= concat("Unexpected stage events: ", msg_detail);
+ signal sqlstate '05000' set message_text= msg;
+ end if;
+
+ if is_statement = 1 and is_statement_table = 1 and @count_actual <> count_expected
+ then
+ set msg= concat("Missing statement events: ", msg_detail);
+ signal sqlstate '05000' set message_text= msg;
+ end if;
+
+ if is_statement = 1 and is_statement_table = 0 and @count_actual <> 0
+ then
+ set msg= concat("Unexpected statement events: ", msg_detail);
+ signal sqlstate '05000' set message_text= msg;
+ end if;
+
+ end if;
+ until done
+ end repeat;
+ close pfs_cursor;
+
+ -- Dont want to return a 02000 NOT FOUND, there should be a better way
+ signal sqlstate '01000' set message_text='Done', mysql_errno=12000;
+end
+$
+delimiter ;$
+
+# Check the configuration is ok
+show variables like "performance_schema%";
+show status like "performance_schema%";
+
+call check_instrument("wait/synch/mutex/");
+call check_instrument("wait/synch/rwlock/");
+call check_instrument("wait/synch/cond/");
+call check_instrument("wait/synch/");
+call check_instrument("wait/io/file/");
+call check_instrument("wait/io/net/");
+call check_instrument("wait/io/table/");
+call check_instrument("wait/io/");
+call check_instrument("wait/lock/table/");
+call check_instrument("wait/lock/");
+call check_instrument("wait/");
+call check_instrument("stage/");
+call check_instrument("statement/com/");
+call check_instrument("statement/sql/");
+call check_instrument("statement/");
+call check_instrument("idle/io/socket");
+call check_instrument("idle/");
+
+drop procedure check_instrument;
+
diff --git a/mysql-test/suite/perfschema/t/part_table_io.test b/mysql-test/suite/perfschema/t/part_table_io.test
new file mode 100644
index 00000000000..0b94d7ca886
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/part_table_io.test
@@ -0,0 +1,30 @@
+# Tests for PERFORMANCE_SCHEMA table io
+
+--source include/have_partition.inc
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/table_io_setup_helper.inc
+
+let $engine_type= MyISAM;
+let $table_item= test.no_index_tab;
+--disable_warnings
+eval drop table if exists $table_item;
+--enable_warnings
+
+# Start recording events
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+eval create table $table_item
+( a varchar(255) not null, b int not null) engine = $engine_type
+PARTITION BY KEY (b) PARTITIONS 2;
+insert into marker set a = 1;
+eval show create table $table_item;
+--source ../include/table_io_basic_dml.inc
+eval drop table $table_item;
+
+# Stop recording events + pull result
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade.test b/mysql-test/suite/perfschema/t/pfs_upgrade.test
index ad5356a4b93..e297c52c000 100644
--- a/mysql-test/suite/perfschema/t/pfs_upgrade.test
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade.test
@@ -5,112 +5,5 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---source include/have_lowercase0.inc
-
-# Some initial settings + Preemptive cleanup
-let $MYSQLD_DATADIR= `SELECT @@datadir`;
-let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err;
-let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out;
---error 0,1
---remove_file $out_file
---error 0,1
---remove_file $err_file
-
---disable_warnings
-drop table if exists test.user_table;
-drop procedure if exists test.user_proc;
-drop function if exists test.user_func;
-drop event if exists test.user_event;
---enable_warnings
-
-
---echo "Testing mysql_upgrade with TABLE performance_schema.user_table"
-
-create table test.user_table(a int);
-
---error 0,1
---remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
---copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm
-
-# Make sure the table is visible
-use performance_schema;
-show tables like "user_table";
-
---source suite/perfschema/include/upgrade_check.inc
-
-# Make sure the table is still visible
-show tables like "user_table";
-
-use test;
-
---remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
-drop table test.user_table;
-
-
---echo "Testing mysql_upgrade with VIEW performance_schema.user_view"
-
-create view test.user_view as select "Not supposed to be here";
-
---error 0,1
---remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
---copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm
-
-# Make sure the view is visible
-use performance_schema;
-show tables like "user_view";
-
---source suite/perfschema/include/upgrade_check.inc
-
-# Make sure the view is still visible
-show tables like "user_view";
-
-use test;
-
---remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
-drop view test.user_view;
-
-
---echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
-
-create procedure test.user_proc()
- select "Not supposed to be here";
-
-update mysql.proc set db='performance_schema' where name='user_proc';
-
---source suite/perfschema/include/upgrade_check.inc
-
-select name from mysql.proc where db='performance_schema';
-
-update mysql.proc set db='test' where name='user_proc';
-drop procedure test.user_proc;
-
-
---echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func"
-
-create function test.user_func() returns integer
- return 0;
-
-update mysql.proc set db='performance_schema' where name='user_func';
-
---source suite/perfschema/include/upgrade_check.inc
-
-select name from mysql.proc where db='performance_schema';
-
-update mysql.proc set db='test' where name='user_func';
-drop function test.user_func;
-
-
---echo "Testing mysql_upgrade with EVENT performance_schema.user_event"
-
-create event test.user_event on schedule every 1 day do
- select "not supposed to be here";
-
-update mysql.event set db='performance_schema' where name='user_event';
-
---source suite/perfschema/include/upgrade_check.inc
-
-select name from mysql.event where db='performance_schema';
-
-update mysql.event set db='test' where name='user_event';
-drop event test.user_event;
+--source ../include/pfs_upgrade.inc
diff --git a/mysql-test/suite/perfschema/t/privilege.test b/mysql-test/suite/perfschema/t/privilege.test
index 3b4cd1a4d2b..1864a34bcfe 100644
--- a/mysql-test/suite/perfschema/t/privilege.test
+++ b/mysql-test/suite/perfschema/t/privilege.test
@@ -323,5 +323,9 @@ DROP USER pfs_user_4;
flush privileges;
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
UPDATE performance_schema.setup_consumers SET enabled = 'YES';
-UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE';
+
+UPDATE performance_schema.setup_timers SET timer_name = 'MICROSECOND' where name="idle";
+UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE' where name="wait";
+UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="stage";
+UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="statement";
diff --git a/mysql-test/suite/perfschema/t/privilege_table_io.test b/mysql-test/suite/perfschema/t/privilege_table_io.test
new file mode 100644
index 00000000000..aee8221dfc5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/privilege_table_io.test
@@ -0,0 +1,43 @@
+# Tests for PERFORMANCE_SCHEMA table io
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/table_io_setup_helper.inc
+
+# Remove "deleted" records from mysql.db that may come from previous tests,
+# to avoid displaying spurious fetch.
+# There are two possible server reactions which are both ok.
+# Table Op Msg_type Msg_text
+# mysql.db optimize status OK
+# or
+# mysql.db optimize status Table is already up to date
+# Therefore we suppress the query_log here.
+--echo # We are forced to suppress here the server response.
+--disable_result_log
+optimize table mysql.db;
+--enable_result_log
+
+# Start recording events
+update performance_schema.setup_consumers set enabled='YES';
+update performance_schema.setup_objects set enabled='YES'
+ where object_type='TABLE' and object_schema= 'mysql';
+
+# Code to test
+
+flush privileges;
+# This will cause table io in mysql system security tables
+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 status like "performance_schema%";
+# Stop recording events + pull results
+let $schema_to_dump= "test", "mysql";
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+--source ../include/table_io_cleanup_helper.inc
+
+update performance_schema.setup_objects set enabled='NO'
+ where object_type='TABLE' and object_schema= 'mysql';
diff --git a/mysql-test/suite/perfschema/t/rollback_table_io.test b/mysql-test/suite/perfschema/t/rollback_table_io.test
new file mode 100644
index 00000000000..8976a2f1b77
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/rollback_table_io.test
@@ -0,0 +1,47 @@
+# Tests for PERFORMANCE_SCHEMA table io
+# Show the impact of a rollback in case of the transactional engine InnoDB
+
+# Setup
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists test.t1;
+--enable_warnings
+
+let $engine_type= InnoDB;
+eval create table test.t1 (col1 bigint, col2 varchar(30)) engine = $engine_type;
+show create table test.t1;
+insert into test.t1 values(1,'One');
+
+--source ../include/table_io_setup_helper.inc
+let $schema_to_dump= 'test';
+
+# Start recording of events
+update performance_schema.setup_consumers set enabled = 'YES';
+
+set autocommit = off;
+
+# Code to test
+
+delete from test.t1 where col1 = 1;
+insert into marker set a = 1;
+rollback;
+insert into marker set a = 1;
+update test.t1 set col2 = 'Updated' where col1 = 1;
+insert into marker set a = 1;
+rollback;
+insert into marker set a = 1;
+insert into test.t1 values(2,'Two');
+insert into marker set a = 1;
+rollback;
+
+# Stop recording of events + pull results
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+drop table test.t1;
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/suite/perfschema/t/schema.test b/mysql-test/suite/perfschema/t/schema.test
index df6a100ee0d..d12ba2e2b36 100644
--- a/mysql-test/suite/perfschema/t/schema.test
+++ b/mysql-test/suite/perfschema/t/schema.test
@@ -1,30 +1,7 @@
# Tests for PERFORMANCE_SCHEMA
+# Show existing objects and information about their structure
--source include/not_embedded.inc
--source include/have_perfschema.inc
---source include/have_lowercase0.inc
-
-show databases;
-
-use performance_schema;
-
-show tables;
-
-show create table cond_instances;
-show create table events_waits_current;
-show create table events_waits_history;
-show create table events_waits_history_long;
-show create table events_waits_summary_by_instance;
-show create table events_waits_summary_by_thread_by_event_name;
-show create table events_waits_summary_global_by_event_name;
-show create table file_instances;
-show create table file_summary_by_event_name;
-show create table file_summary_by_instance;
-show create table mutex_instances;
-show create table performance_timers;
-show create table rwlock_instances;
-show create table setup_consumers;
-show create table setup_instruments;
-show create table setup_timers;
-show create table threads;
+--source ../include/schema.inc
diff --git a/mysql-test/suite/perfschema/t/selects.test b/mysql-test/suite/perfschema/t/selects.test
index eb8d8f7ed31..d2d447bd77e 100644
--- a/mysql-test/suite/perfschema/t/selects.test
+++ b/mysql-test/suite/perfschema/t/selects.test
@@ -9,6 +9,12 @@
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+# Disable ALL table IO, to avoid generating events from the selects
+# To be revised after WL#5342 PERFORMANCE SCHEMA SETUP OBJECTS
+
+UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'NO'
+ where NAME='wait/io/table/sql/handler';
+
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -168,3 +174,6 @@ DROP FUNCTION t_ps_func;
DROP EVENT t_ps_event;
DROP TABLE t1;
DROP TABLE t_event;
+
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+
diff --git a/mysql-test/suite/perfschema/t/server_init.test b/mysql-test/suite/perfschema/t/server_init.test
index cffcc0edee2..8f5e18623f0 100644
--- a/mysql-test/suite/perfschema/t/server_init.test
+++ b/mysql-test/suite/perfschema/t/server_init.test
@@ -23,9 +23,6 @@ select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_open";
select count(name) from mutex_instances
- where name like "wait/synch/mutex/mysys/THR_LOCK_isam";
-
-select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
select count(name) from mutex_instances
@@ -53,6 +50,9 @@ select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_thread_count";
select count(name) from mutex_instances
+ where name like "wait/synch/mutex/sql/LOCK_log_throttle_qni";
+
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_status";
select count(name) from mutex_instances
@@ -62,7 +62,7 @@ select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_delayed_insert";
select count(name) from mutex_instances
- where name like "wait/synch/mutex/sql/LOCK_uuid_short_generator";
+ where name like "wait/synch/mutex/sql/LOCK_uuid_generator";
select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_delayed_status";
@@ -97,9 +97,6 @@ select count(name) from mutex_instances
select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_server_started";
-select count(name) from mutex_instances
- where name like "wait/synch/mutex/sql/LOCK_rpl_status";
-
# LOG_INFO object are created on demand, and are not global.
# select count(name) from mutex_instances
# where name like "wait/synch/mutex/sql/LOG_INFO::lock";
@@ -171,9 +168,6 @@ select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_flush_thread_cache";
select count(name) from cond_instances
- where name like "wait/synch/cond/sql/COND_rpl_status";
-
-select count(name) from cond_instances
where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed";
# The event scheduler may be disabled
diff --git a/mysql-test/suite/perfschema/t/setup_actors.test b/mysql-test/suite/perfschema/t/setup_actors.test
new file mode 100644
index 00000000000..e975fa96782
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/setup_actors.test
@@ -0,0 +1,246 @@
+# Check the impact of different entries in performance_schema.setup_actors
+# on when and how activity of users is recordeed in performance_schema.threads.
+# The checks for indirect activity caused by users, system threads etc.
+# are within setup_actors1.test.
+
+--source include/not_windows.inc
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+# The initial number of rows is 1. The initial row always looks like this:
+# mysql> select * from performance_schema.setup_actors;
+# +------+------+------+
+# | Host | User | ROLE |
+# +------+------+------+
+# | % | % | % |
+# +------+------+------+
+select * from performance_schema.setup_actors;
+
+truncate table performance_schema.setup_actors;
+
+insert into performance_schema.setup_actors
+values ('hosta', 'user1', '%');
+
+insert into performance_schema.setup_actors
+values ('%', 'user2', '%');
+
+insert into performance_schema.setup_actors
+values ('localhost', 'user3', '%');
+
+insert into performance_schema.setup_actors
+values ('hostb', '%', '%');
+
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+grant select on test.* to user5@localhost;
+
+flush privileges;
+
+--echo # Switch to (con1, localhost, user1, , )
+connect (con1, localhost, user1, , );
+
+# INSTRUMENTED must be NO because there is no match in performance_schema.setup_actors
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+let $con1_thread_id= `select THREAD_ID from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
+
+--echo # Switch to connection default
+--connection default
+insert into performance_schema.setup_actors
+values ('%', 'user1', '%');
+
+--echo # Switch to connection con1
+--connection con1
+# INSTRUMENTED must be NO because there was no match in performance_schema.setup_actors
+# when our current session made its connect. Later changes in setup_actors have no
+# impact.
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+
+--echo # Disconnect con1
+--disconnect con1
+
+--echo # Switch to (con2, localhost, user2, , )
+connect (con2, localhost, user2, , );
+
+# INSTRUMENTED must be YES because there is a match via
+# (HOST,USER,ROLE) = ('%', 'user2', '%') in performance_schema.setup_actors.
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID=connection_id();
+let $con2_thread_id= `select THREAD_ID from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
+
+--echo # Disconnect con2
+--disconnect con2
+
+--echo # Switch to connection default
+--connection default
+# If a thread dies, we don't expect its THREAD_ID value will be re-used.
+if ($con2_thread_id <= $con1_thread_id)
+{
+ --echo ERROR: THREAD_ID of con2 is not bigger than THREAD_ID of con1
+ eval SELECT $con2_thread_id as THREAD_ID_con2, $con1_thread_id THREAD_ID_con1;
+}
+
+--disable_warnings
+drop table if exists test.t1;
+--enable_warnings
+create table test.t1 (col1 bigint);
+lock table test.t1 write;
+
+--echo # Switch to (con3, localhost, user3, , )
+connect (con3, localhost, user3, , );
+
+# INSTRUMENTED must be YES because there is a match via
+# (HOST,USER,ROLE) = ('localhost', 'user3', '%') in performance_schema.setup_actors.
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+
+# PROCESSLIST_ columns are:
+# (if name like '%OneConnection') all the same as what you'd get if you
+# run a select on INFORMATION_SCHEMA.PROCESSLIST for the corresponding thread.
+# Check at least once that this is fulfilled.
+# Note(mleich):
+# A join between INFORMATION_SCHEMA.PROCESSLIST and performance_schema.threads
+# Example:
+# select count(*) = 1
+# from performance_schema.threads T inner join information_schema.PROCESSLIST P
+# on T.PROCESSLIST_ID = P.ID and T.PROCESSLIST_USER = P.USER and
+# T.PROCESSLIST_HOST = P.HOST and T.PROCESSLIST_DB = P.DB and
+# T.PROCESSLIST_COMMAND = P.COMMAND and T.PROCESSLIST_INFO = P.INFO
+# where T.PROCESSLIST_ID = connection_id() and T.NAME = 'thread/sql/one_connection'
+# executed by the current connection looks like some of the most elegant solutions
+# for revealing this. But such a join suffers from sporadic differences like
+# column | observation
+# -------|-------------
+# state | "Sending data" vs. "executing"
+# time | 0 vs. 1 (high load on the testing box)
+# info | <full statement> vs. NULL (use of "--ps-protocol")
+# IMHO the differences are harmless.
+# Therefore we use here a different solution.
+#
+--echo # Send a statement to the server, but do not wait till the result
+--echo # comes back. We will pull this later.
+send
+insert into test.t1 set col1 = 1;
+--echo # Switch to (con4, localhost, user4, , )
+connect (con4, localhost, user4, , );
+--echo # Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
+let $wait_condition= select count(*) from information_schema.processlist
+ where user = 'user3' and info is not null
+ and state = 'Waiting for table metadata lock';
+--source include/wait_condition.inc
+# Expect to get 1 now
+select count(*) = 1
+from performance_schema.threads T inner join information_schema.PROCESSLIST P
+ on T.PROCESSLIST_ID = P.ID and T.PROCESSLIST_USER = P.USER and
+ T.PROCESSLIST_HOST = P.HOST and T.PROCESSLIST_DB = P.DB and
+ T.PROCESSLIST_COMMAND = P.COMMAND and T.PROCESSLIST_INFO = P.INFO
+where T.PROCESSLIST_USER = 'user3' and T.NAME = 'thread/sql/one_connection';
+
+# Resolve the situation + some cleanup
+--echo # Switch to connection default
+--connection default
+unlock tables;
+--echo # Switch to connection con3 and reap the result of the no more blocked insert
+--connection con3
+--reap
+--echo # Switch to connection default
+--connection default
+drop table test.t1;
+--echo # Disconnect con3
+--disconnect con3
+
+--echo # Switch to connection con4
+--connection con4
+# INSTRUMENTED must be NO because there is no match in performance_schema.setup_actors
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+
+--echo # Disconnect con4
+--disconnect con4
+
+--echo # Switch to connection default
+--connection default
+
+insert into performance_schema.setup_actors
+values ('localhost', '%', '%');
+
+select * from performance_schema.setup_actors
+order by USER, HOST, ROLE;
+
+--echo # Switch to (con4b, localhost, user4, , )
+connect (con4b, localhost, user4, , );
+
+# INSTRUMENTED must be YES because there is a match via
+# (HOST,USER,ROLE) = ('localhost', '%', '%') in performance_schema.setup_actors.
+select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+
+--echo # Disconnect con4b
+--disconnect con4b
+
+--echo # Switch to connection default
+--connection default
+insert into performance_schema.setup_actors
+values ('%', 'user5', '%');
+
+create sql security definer view test.v1 as select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
+from performance_schema.threads
+where PROCESSLIST_ID = connection_id();
+
+--echo # Switch to (con5, localhost, user5, , )
+connect (con5, localhost, user5, , );
+
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from performance_schema.threads;
+# 1. INSTRUMENTED must be YES because there are two matches
+# (HOST,USER,ROLE) = ('localhost', '%', '%')
+# (HOST,USER,ROLE) = ('%', 'user5', '%')
+# in performance_schema.setup_actors.
+# But the instrument will only count once which means we must get only one row.
+# 2. PROCESSLIST_USER refers to USER(), the user who connected,
+# not the user we might be temporarily acting as (with definer's rights).
+# Therefore PROCESSLIST_USER must be 'user5' though we run with right's of definer 'root'
+select * from test.v1;
+
+--echo # Disconnect con5
+--disconnect con5
+--source include/wait_until_disconnected.inc
+
+
+--echo # Switch to connection default and cleanup
+--connection default
+
+drop view test.v1;
+revoke all privileges, grant option from user1@localhost;
+revoke all privileges, grant option from user2@localhost;
+revoke all privileges, grant option from user3@localhost;
+revoke all privileges, grant option from user4@localhost;
+revoke all privileges, grant option from user5@localhost;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+drop user user5@localhost;
+flush privileges;
+
+truncate table performance_schema.setup_actors;
+
+insert into performance_schema.setup_actors
+values ('%', '%', '%');
+
+select * from performance_schema.setup_actors;
+
diff --git a/mysql-test/suite/perfschema/t/setup_consumers_defaults-master.opt b/mysql-test/suite/perfschema/t/setup_consumers_defaults-master.opt
new file mode 100644
index 00000000000..bc05fa8d5bc
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/setup_consumers_defaults-master.opt
@@ -0,0 +1,11 @@
+--loose-performance-schema-consumer-events-stages-current=OFF
+--loose-performance-schema-consumer-events-stages-history=ON
+--loose-performance-schema-consumer-events-stages-history-long=OFF
+--loose-performance-schema-consumer-events-statements-current=ON
+--loose-performance-schema-consumer-events-statements-history=OFF
+--loose-performance-schema-consumer-events-statements-history-long=ON
+--loose-performance-schema-consumer-events-waits-current=OFF
+--loose-performance-schema-consumer-events-waits-history=ON
+--loose-performance-schema-consumer-events-waits-history-long=OFF
+--loose-performance-schema-consumer-global-instrumentation=ON
+--loose-performance-schema-consumer-thread-instrumentation=ON
diff --git a/mysql-test/suite/perfschema/t/setup_consumers_defaults.test b/mysql-test/suite/perfschema/t/setup_consumers_defaults.test
new file mode 100644
index 00000000000..e845e577fb7
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/setup_consumers_defaults.test
@@ -0,0 +1,18 @@
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+SELECT * FROM performance_schema.setup_consumers ORDER BY name;
+
+#
+# Verify that the consumer option settings cannot be changed or seen
+#
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+SELECT @@performance_schema_consumer_events_stages_current;
+
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+SET @@performance_schema_consumer_events_stages_current=0;
+
+SHOW VARIABLES LIKE "performance_schema_consumer%";
diff --git a/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt b/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt
new file mode 100644
index 00000000000..71106aaaed0
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt
@@ -0,0 +1,21 @@
+--log-error=0
+--loose-performance-schema-instrument='%=ON'
+--loose-performance-schema-instrument='wait/synch/mutex/sql/% = OFF '
+--loose-performance-schema-instrument='wait/synch/mutex/sql/LOCK% = ON'
+--loose-performance-schema-instrument='wait/synch/mutex/sql/LOCK_thread_count = OFF'
+--loose-performance-schema-instrument=' wait/synch/mutex/sql/LOCK_user_conn = COUNTED'
+--loose-performance-schema-instrument='wait%/synch/mutex/sql/LOCK_uu%_genera%/ = COUNTED'
+--loose-performance-schema-instrument='%%wait/synch/mutex/sql/LOCK_xid_cache = COUNTED'
+--loose-performance-schema-instrument='%=FOO'
+--loose-performance-schema-instrument='%=%'
+--loose-performance-schema-instrument='%'
+--loose-performance-schema-instrument=''
+--loose-performance-schema-instrument=' unknown%instrument/event/name with blanks = YES'
+--loose-performance-schema-instrument='unknown/instrument/event/name = TRUE'
+--loose-performance-schema-instrument='stage/sql/creating table = COUNTED'
+--loose-performance-schema-instrument='wait/synch/mutex/sql/LOG_INFO::lock = 1'
+--loose-performance-schema-instrument='wait/synch/mutex/sql/Delayed_insert::mutex = 0'
+--loose-performance-schema-instrument='wait/synch/mutex/sql/THD::LOCK_thd_data = TRUE'
+--loose-performance-schema-instrument='wait/synch/mutex/sql/hash_filo::lock = FALSE'
+--loose-performance-schema-instrument='wait/synch/mutex/sql/TABLE_SHARE::LOCK_ha_data= NO'
+
diff --git a/mysql-test/suite/perfschema/t/setup_instruments_defaults.test b/mysql-test/suite/perfschema/t/setup_instruments_defaults.test
new file mode 100644
index 00000000000..b84b082c484
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/setup_instruments_defaults.test
@@ -0,0 +1,40 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+# Verify that the configuration options were applied correctly to the
+# setup_instruments table. These instruments that are known to persist across
+# platforms and the various compile options.
+
+SELECT * FROM performance_schema.setup_instruments
+WHERE name IN (
+ 'wait/synch/mutex/sql/LOCK_user_conn',
+ 'wait/synch/mutex/sql/LOCK_uuid_generator',
+ 'wait/synch/mutex/sql/LOCK_xid_cache'
+ 'stage/sql/creating table')
+AND enabled = 'yes' AND timed = 'no'
+ORDER BY name;
+
+SELECT * FROM performance_schema.setup_instruments
+WHERE name = 'wait/synch/mutex/sql/LOCK_thread_count'
+AND enabled = 'no' AND timed = 'no';
+
+SELECT * FROM performance_schema.setup_instruments
+WHERE name IN (
+ 'wait/synch/mutex/sql/LOG_INFO::lock',
+ 'wait/synch/mutex/sql/THD::LOCK_thd_data')
+AND enabled = 'yes' AND timed = 'yes'
+ORDER BY name;
+
+SELECT * FROM performance_schema.setup_instruments
+WHERE name IN (
+ 'wait/synch/mutex/sql/Delayed_insert::mutex',
+ 'wait/synch/mutex/sql/hash_filo::lock')
+AND enabled = 'no' AND timed = 'no'
+ORDER BY name;
+
+#
+# Verify that the instrument startup settings are not not visible.
+#
+SHOW VARIABLES LIKE "%/wait/synch/mutex%"; \ No newline at end of file
diff --git a/mysql-test/suite/perfschema/t/setup_objects.test b/mysql-test/suite/perfschema/t/setup_objects.test
new file mode 100644
index 00000000000..cd1b4ce80e0
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/setup_objects.test
@@ -0,0 +1,197 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_warnings
+drop table if exists test.setup_objects;
+--enable_warnings
+
+# Make sure only table io / table lock is instrumented and timed
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES', timed='YES'
+ where name in ('wait/io/table/sql/handler', 'wait/lock/table/sql/handler');
+
+# Remove noise from previous tests
+truncate table performance_schema.events_waits_history_long;
+
+# Save the setup
+create table test.setup_objects as select * from performance_schema.setup_objects;
+truncate table performance_schema.setup_objects;
+
+insert into performance_schema.setup_objects
+ values ('TABLE', 'db1', 't1', 'YES', 'YES');
+
+insert into performance_schema.setup_objects
+ values ('TABLE', 'db1', 't2', 'YES', 'NO');
+
+insert into performance_schema.setup_objects
+ values ('TABLE', 'db1', '%', 'YES', 'YES');
+
+insert into performance_schema.setup_objects
+ values ('TABLE', 'db2', 't1', 'YES', 'YES');
+
+insert into performance_schema.setup_objects
+ values ('TABLE', 'db2', 't2', 'YES', 'NO');
+
+insert into performance_schema.setup_objects
+ values ('TABLE', 'db3', 't1', 'YES', 'YES');
+
+insert into performance_schema.setup_objects
+ values ('TABLE', 'db3', 't2', 'NO', 'NO');
+
+insert into performance_schema.setup_objects
+ values ('TABLE', 'db3', '%', 'NO', 'YES');
+
+insert into performance_schema.setup_objects
+ values ('TABLE', 'db4', 't1', 'NO', 'YES');
+
+insert into performance_schema.setup_objects
+ values ('TABLE', 'db4', '%', 'YES', 'NO');
+
+# Also test insert of invalid enum values
+
+--error ER_NO_REFERENCED_ROW_2
+insert into performance_schema.setup_objects
+ values ('SOMETHING', 'bad1', 'bad1', 'YES', 'NO');
+show warnings;
+
+--error ER_NO_REFERENCED_ROW_2
+insert into performance_schema.setup_objects
+ values ('TABLE', 'bad2', 'bad2', 'MAYBE', 'NO');
+show warnings;
+
+--error ER_NO_REFERENCED_ROW_2
+insert into performance_schema.setup_objects
+ values ('TABLE', 'bad3', 'bad3', 'YES', 'MAYBE NOT');
+show warnings;
+
+select * from performance_schema.setup_objects
+ order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
+
+# Also test update of invalid enum values
+# Note: do not use SHOW WARNINGS in the test,
+# because error messages such as:
+# "Data truncated for column 'OBJECT_TYPE' at row <N>"
+# do not always use the same row number <N>.
+
+# ER_WRONG_PERFSCHEMA_USAGE because of privileges, expected.
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.setup_objects
+ set OBJECT_TYPE='SOMETHING' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+
+--error ER_NO_REFERENCED_ROW_2
+update performance_schema.setup_objects
+ set ENABLED='MAYBE' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+
+--error ER_NO_REFERENCED_ROW_2
+update performance_schema.setup_objects
+ set TIMED='MAYBE NOT' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+
+select * from performance_schema.setup_objects
+ order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
+
+--disable_warnings
+drop database if exists db1;
+drop database if exists db2;
+drop database if exists db3;
+drop database if exists db4;
+drop database if exists db5;
+--enable_warnings
+
+create database db1;
+create database db2;
+create database db3;
+create database db4;
+create database db5;
+
+create table db1.t1(a int);
+create table db1.t2(a int);
+create table db1.t3(a int);
+create table db1.t4(a int);
+create table db1.t5(a int);
+
+create table db2.t1(a int);
+create table db2.t2(a int);
+create table db2.t3(a int);
+create table db2.t4(a int);
+create table db2.t5(a int);
+
+create table db3.t1(a int);
+create table db3.t2(a int);
+create table db3.t3(a int);
+create table db3.t4(a int);
+create table db3.t5(a int);
+
+create table db4.t1(a int);
+create table db4.t2(a int);
+create table db4.t3(a int);
+create table db4.t4(a int);
+create table db4.t5(a int);
+
+create table db5.t1(a int);
+
+select * from db1.t1;
+select * from db1.t2;
+select * from db1.t3;
+select * from db1.t4;
+select * from db1.t5;
+
+select * from db2.t1;
+select * from db2.t2;
+select * from db2.t3;
+select * from db2.t4;
+select * from db2.t5;
+
+select * from db3.t1;
+select * from db3.t2;
+select * from db3.t3;
+select * from db3.t4;
+select * from db3.t5;
+
+select * from db4.t1;
+select * from db4.t2;
+select * from db4.t3;
+select * from db4.t4;
+select * from db4.t5;
+
+select * from db5.t1;
+
+create table db5.t2(a int);
+select * from db3.t2;
+
+# Verify what is instrumented
+select distinct OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA
+ from performance_schema.events_waits_history_long
+ where OBJECT_SCHEMA like "db%"
+ group by OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA
+ order by OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA;
+
+# Verify what is instrumented and timed
+select distinct OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA
+ from performance_schema.events_waits_history_long
+ where OBJECT_SCHEMA like "db%" and TIMER_END is not NULL
+ group by OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA
+ order by OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA;
+
+update performance_schema.setup_objects
+ set timed='YES' where OBJECT_SCHEMA = '%';
+
+create table db5.t3(a int);
+select * from db3.t3;
+
+truncate table performance_schema.setup_objects;
+
+select count(*) from performance_schema.setup_objects;
+
+drop database db1;
+drop database db2;
+drop database db3;
+drop database db4;
+drop database db5;
+
+# Restore the setup
+truncate table performance_schema.setup_objects;
+insert into performance_schema.setup_objects select * from test.setup_objects;
+drop table test.setup_objects;
+
+update performance_schema.setup_instruments set enabled='YES', timed='YES';
+
diff --git a/mysql-test/suite/perfschema/t/short_option_1-master.opt b/mysql-test/suite/perfschema/t/short_option_1-master.opt
index de5a297e9be..03c480fe90d 100644
--- a/mysql-test/suite/perfschema/t/short_option_1-master.opt
+++ b/mysql-test/suite/perfschema/t/short_option_1-master.opt
@@ -1 +1 @@
--a -Cutf8 --collation=utf8_bin -l -T12 -W3
+-a -Cutf8 --collation=utf8_bin -T12 -W3
diff --git a/mysql-test/suite/perfschema/t/short_option_1.test b/mysql-test/suite/perfschema/t/short_option_1.test
index 2b616844e58..3877e7b7277 100644
--- a/mysql-test/suite/perfschema/t/short_option_1.test
+++ b/mysql-test/suite/perfschema/t/short_option_1.test
@@ -14,7 +14,4 @@ show variables like 'character_set_system';
show variables like 'log';
show variables like 'general_log';
-show variables like 'new';
-
show variables like 'log_warnings';
-
diff --git a/mysql-test/suite/perfschema/t/socket_connect.test b/mysql-test/suite/perfschema/t/socket_connect.test
new file mode 100644
index 00000000000..94625d2ed06
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/socket_connect.test
@@ -0,0 +1,290 @@
+#
+# Check the handling of TCP/IP connections in the performance_schema socket
+# instance tables
+#
+#==============================================================================
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/wait_for_pfs_thread_count.inc
+
+# Set this to enable debugging output
+let $my_socket_debug=0;
+
+--echo #==============================================================================
+--echo # Establish the level of IPV6 support
+--echo #==============================================================================
+--source ../include/socket_ipv6.inc
+
+--echo #==============================================================================
+--echo # Get hostname, port number
+--echo #==============================================================================
+SELECT @@hostname INTO @MY_HOSTNAME;
+SELECT @@port INTO @MY_MASTER_PORT;
+
+if ($my_socket_debug)
+{
+ SELECT @MY_HOSTNAME AS 'Hostname';
+ SELECT @MY_MASTER_PORT AS 'Master Port';
+}
+#==============================================================================
+# Utility queries
+#==============================================================================
+let $count_client_connections=
+ SELECT COUNT(*) INTO @my_client_connections
+ FROM performance_schema.socket_instances
+ WHERE EVENT_NAME LIKE "%client_connection%";
+
+let $get_thread_id=
+ SELECT THREAD_ID INTO @my_thread_id
+ FROM performance_schema.threads
+ WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+let $get_object_instance_begin=
+ SELECT OBJECT_INSTANCE_BEGIN INTO @my_object_instance_begin
+ FROM performance_schema.socket_instances
+ WHERE THREAD_ID = @my_thread_id;
+
+let $get_port=
+ SELECT PORT INTO @my_port
+ FROM performance_schema.socket_instances
+ WHERE THREAD_ID = @my_thread_id;
+
+let $ip_localhost=
+ (IP LIKE '%127.0.0.1' OR IP LIKE '%::1');
+
+--echo #==============================================================================
+--echo # 1.0 Get the default connection object_instance_begin, thread id and verify
+--echo # the expected number of client connections.
+--echo #==============================================================================
+--echo
+--echo # 1.1 Confirm only one client connection
+--echo
+eval $count_client_connections;
+
+if (`SELECT @my_client_connections != 1`)
+{
+ --echo # There should be one client connection
+ SELECT * FROM performance_schema.socket_instances;
+ --echo # abort
+ exit;
+}
+
+--echo
+--echo # 1.2 Get the default THREAD_ID;
+--echo
+eval $get_thread_id;
+let $default_thread_id= `SELECT @my_thread_id`;
+
+--echo
+--echo # 1.3 Get the default OBJECT_INSTANCE_BEGIN
+--echo
+eval $get_object_instance_begin;
+let $default_object_instance_begin= `SELECT @my_object_instance_begin`;
+--disable_query_log
+SELECT @my_object_instance_begin INTO @default_object_instance_begin;
+--enable_query_log
+
+if ($my_socket_debug)
+{
+ --echo # Default object instance begin = $default_object_instance_begin
+ --echo # Default thread id = $default_thread_id
+}
+
+--echo #==============================================================================
+--echo # 2.0 ESTABLISH TCP/IP CONNECTION 1
+--echo # Connect with IP = localhost (127.0.0.1 or ::1)
+--echo #==============================================================================
+--disable_query_log
+--connect (con1,$my_localhost,root,,test,,$MASTER_MYPORT)
+--enable_query_log
+
+--echo
+--echo # 2.1 Get the connection thread id
+--echo
+eval $get_thread_id;
+
+--echo
+--echo # 2.2 Get the connection object instance begin
+--echo
+eval $get_object_instance_begin;
+
+--echo
+--echo # 2.3 Get the connection port
+--echo
+eval $get_port;
+
+--disable_query_log
+SELECT @my_thread_id INTO @con1_thread_id;
+SELECT @my_port INTO @con1_port;
+SELECT @my_object_instance_begin INTO @con1_object_id;
+let $con1_thread_id= `SELECT @con1_thread_id`;
+let $con1_port= `SELECT @con1_port`;
+let $con1_object_id= `SELECT @con1_object_id`;
+let $con1_name1= "127.0.0.1:$con1_port";
+let $con1_name2= "::1:$con1_port";
+--enable_query_log
+
+if ($my_socket_debug)
+{
+ --echo # Con1 thread id = $con1_thread_id
+ --echo # Con1 object_id = $con1_object_id
+ --echo # Con1 port = $con1_port
+ --echo # Con1 name1 = $con1_name1
+ --echo # Con1 name2 = $con1_name2
+}
+
+--echo
+--echo # 2.4 Verify that the connection is 127.0.0.1 or ::1
+--echo
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND $ip_localhost
+ AND PORT= @con1_port
+ AND OBJECT_INSTANCE_BEGIN= @con1_object_id;
+
+--echo
+--echo # 2.5 Verify that the same connection is in the summary instance table
+--echo
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN= @con1_object_id;
+
+--echo
+--echo # Switch to connection default
+--echo
+--connection default
+
+--echo #==============================================================================
+--echo # 3.0 ESTABLISH TCP/IP CONNECTION 2
+--echo # Connect with IP = localhost (127.0.0.1 or ::1)
+--echo #==============================================================================
+--disable_query_log
+--connect (con2,$my_localhost,root,,test,,$MASTER_MYPORT)
+--enable_query_log
+
+--echo
+--echo # 3.1 Get the connection thread id
+--echo
+eval $get_thread_id;
+
+--echo
+--echo # 3.2 Get the connection object instance begin
+--echo
+eval $get_object_instance_begin;
+
+--echo
+--echo # 3.3 Get the connection port
+--echo
+eval $get_port;
+
+--disable_query_log
+SELECT @my_thread_id INTO @con2_thread_id;
+SELECT @my_port INTO @con2_port;
+SELECT @my_object_instance_begin INTO @con2_object_id;
+let $con2_thread_id= `SELECT @con2_thread_id`;
+let $con2_port= `SELECT @con2_port`;
+let $con2_object_id= `SELECT @con2_object_id`;
+let $con2_name1= "127.0.0.1:$con2_port";
+let $con2_name2= "::1:$con2_port";
+--enable_query_log
+
+if ($my_socket_debug)
+{
+ --echo # con2 thread id = $con2_thread_id
+ --echo # con2 object_id = $con2_object_id
+ --echo # con2 port = $con2_port
+ --echo # con2 name1 = $con2_name1
+ --echo # con2 name2 = $con2_name2
+}
+
+--echo
+--echo # 3.4 Verify that the connection is 127.0.0.1 or ::1
+--echo
+
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND $ip_localhost
+ AND PORT= @con2_port
+ AND OBJECT_INSTANCE_BEGIN= @con2_object_id;
+
+--echo
+--echo # 3.5 Verify that the same connection is in the summary instance table
+--echo
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN= @con2_object_id;
+
+--echo
+--echo # 3.6 Verify that the connection is 127.0.0.1 or ::1
+--echo
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND $ip_localhost
+ AND PORT= @con2_port
+ AND OBJECT_INSTANCE_BEGIN= @con2_object_id;
+
+--echo #==============================================================================
+--echo # 4.0 Verify both connections exist in the instance tables
+--echo #==============================================================================
+--connection default
+
+--echo
+--echo # 4.1 Verify that there are two TCP/IP connections in the socket instance table
+--echo
+eval SELECT COUNT(*) = 2 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND $ip_localhost;
+
+--echo
+--echo # 4.2 Verify that there are two TCP/IP connections in the summary instance table
+--echo
+eval SELECT COUNT(*) = 2 AS 'Expect 1'
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
+
+--echo #==============================================================================
+--echo # 5.0 Drop the client connections
+--echo #==============================================================================
+
+--echo # 5.1 Disconnect con1
+--connection con1
+--disconnect con1
+--source include/wait_until_disconnected.inc
+
+--echo # 5.2 Disconnect con2
+--connection con2
+--disconnect con2
+--source include/wait_until_disconnected.inc
+--connection default
+
+--echo #==============================================================================
+--echo # 6.0 Verify sockets were removed from the instance tables
+--echo #==============================================================================
+
+--echo
+--echo # 6.1 Verify that there are no TCP/IP connections in the socket instance table
+--echo
+eval SELECT COUNT(*) = 0 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND $ip_localhost;
+
+--echo
+--echo # 6.2 Verify that there are no TCP/IP connections in the summary instance table
+--echo
+eval SELECT COUNT(*) = 0 AS 'Expect 1'
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
+
+exit;
diff --git a/mysql-test/suite/perfschema/t/socket_instances_func-master.opt b/mysql-test/suite/perfschema/t/socket_instances_func-master.opt
new file mode 100644
index 00000000000..ab6ca1731f5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/socket_instances_func-master.opt
@@ -0,0 +1 @@
+--skip-name-resolve
diff --git a/mysql-test/suite/perfschema/t/socket_instances_func.test b/mysql-test/suite/perfschema/t/socket_instances_func.test
new file mode 100644
index 00000000000..8955d978ca8
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/socket_instances_func.test
@@ -0,0 +1,447 @@
+#
+# Some functional checks for the content of performance_schema.socket_instances.
+#
+
+--source include/not_embedded.inc
+--source include/not_windows.inc
+--source include/have_perfschema.inc
+
+# Set this to enable debugging output
+let $my_socket_debug= 0;
+
+#
+# Set IP address defaults with respect to IPV6 support
+#
+
+# Determine if IPV6 supported
+let $check_ipv6_just_check= 1;
+--source include/check_ipv6.inc
+
+# Determine if IPV4 mapped to IPV6 supported
+let $check_ipv4_mapped_just_check= 1;
+--source include/check_ipv4_mapped.inc
+
+let $my_localhost= 127.0.0.1;
+
+if($check_ipv6_supported)
+{
+ let $my_localhost= ::1;
+}
+
+if($check_ipv4_mapped_supported)
+{
+ let $my_localhost= ::ffff:127.0.0.1;
+}
+
+if($my_socket_debug)
+{
+ --echo IPV6=$check_ipv6_supported, IPV4_MAPPED=$check_ipv4_mapped_supported, LOCALHOST=$my_localhost
+}
+
+#
+# Preserve the current state of SOCKET_INSTANCES
+#
+
+--echo # Take a snapshot of SOCKET_INSTANCES
+CREATE TEMPORARY TABLE my_socket_instances AS
+SELECT * FROM performance_schema.socket_instances;
+
+--echo # Get thread id of the default connection
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+let $con0_thread_id= `SELECT @thread_id`;
+
+#
+# ESTABLISH TCP/IP CONNECTION 1
+#
+# Start connection with IP = localhost (127.0.0.1 or ::1)
+
+--echo # Establish local TCP/IP connection (con1,localhost,root,,test,,)
+--disable_query_log ONCE
+--connect (con1,$my_localhost,root,,test,,$MASTER_MYPORT)
+
+if($my_socket_debug)
+{
+# --replace_result '::ffff:127.0.0.1' <LOCALHOST> '127.0.0.1' <LOCALHOST> '::1' <LOCALHOST> '::' <BINDADDR> '0.0.0.0' <BINDADDR>
+ SELECT * FROM performance_schema.socket_instances;
+}
+
+--echo # Store the thread id of connection 1 (tcp/ip)
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+--echo # Store the port of connection 1 (tcp/ip)
+eval SELECT PORT INTO @port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+let $con1_thread_id= `SELECT @thread_id`;
+let $con1_port= `SELECT @port`;
+
+--echo # Switch to connection default
+--connection default
+
+#
+# ESTABLISH TCP/IP CONNECTION 2
+#
+# Start a second connection with IP = localhost (127.0.0.1 or ::1)
+
+--echo # Establish second local TCP/IP connection (con1,localhost,root,,test,,)
+--disable_query_log ONCE
+--connect (con2,$my_localhost,root,,test,,$MASTER_MYPORT)
+
+if($my_socket_debug)
+{
+# --replace_result '::ffff:127.0.0.1' <LOCALHOST> '127.0.0.1' <LOCALHOST> '::1' <LOCALHOST> '::' <BINDADDR> '0.0.0.0' <BINDADDR>
+ SELECT * FROM performance_schema.socket_instances;
+}
+
+--echo # Store the thread_id of connection 2 (tcp/ip)
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+--echo # Store the port of connection 2 (tcp/ip)
+eval SELECT PORT INTO @port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+let $con2_thread_id= `SELECT @thread_id`;
+let $con2_port= `SELECT @port`;
+
+--echo # Switch to connection default
+--connection default
+
+#
+# ESTABLISH LOCAL UNIX DOMAIN CONNECTION
+#
+# Connect via mysql sock file
+
+--echo # Establish local unix domain connection (con3,localhost,root,,test,,)
+--connect(con3,localhost,root,,test,,)
+
+if($my_socket_debug)
+{
+# --replace_result '::ffff:127.0.0.1' <LOCALHOST> '127.0.0.1' <LOCALHOST> '::1' <LOCALHOST> '::' <BINDADDR> '0.0.0.0' <BINDADDR>
+ SELECT * FROM performance_schema.socket_instances;
+}
+
+--echo # Store the thread id of connection 3 (unix domain)
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+--echo # Store the port of connection 3 (unix domain)
+eval SELECT PORT INTO @port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+let $con3_port= `SELECT @port`;
+let $con3_thread_id= `SELECT @thread_id`;
+
+--echo # Switch to connection default
+--connection default
+
+#
+# VERIFY EVENT NAMES
+#
+
+--echo # EVENT_NAME is the "wait/io/socket/*" instrument identifier.
+
+SELECT COUNT(*) = 0 AS "Expect 1"
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME NOT LIKE 'wait/io/socket/%';
+
+#
+# VERIFY UNIQUE EVENT IDs
+#
+
+--echo # OBJECT_INSTANCE_BEGIN is an arbitrary identifier, guaranteed to be unique.
+
+SELECT COUNT(*) = COUNT(DISTINCT OBJECT_INSTANCE_BEGIN) AS "Expect 1"
+FROM performance_schema.socket_instances;
+
+#
+# VERIFY UNIQUE SOCKET ID
+#
+
+--echo # SOCKET_ID is the internal file handle assigned to the socket.
+
+SELECT COUNT(*) = COUNT(DISTINCT SOCKET_ID) AS "Expect 1"
+FROM performance_schema.socket_instances;
+
+#
+# VERIFY UNIQUE THREAD IDs
+#
+
+--echo # Characteristics per our thread
+--echo # There must be only one entry with our thread_id
+
+--disable_query_log ONCE
+eval SET @thread_id= $con0_thread_id;
+
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+#
+# VERIFY UNIQUE PORT NUMBERS FOR TCP/IP CLIENTS
+#
+
+--echo # TCP/IP connections should have a unique port number
+--disable_query_log ONCE
+eval SET @port= $con1_port;
+
+--echo # Connection 1 (tcp/ip)
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE PORT = @port;
+
+--disable_query_log ONCE
+eval SET @port= $con2_port;
+
+--echo # Connection 2 (tcp/ip)
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE PORT = @port;
+
+#
+# VERIFY CONNECTION DETAILS FOR THE DEFAULT CONNECTION
+#
+
+--echo # Check the content for the default connection (unix domain)
+# EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE
+# wait/io/socket/sql/client_connection 139799531958280 16 37 0 ACTIVE
+
+--disable_query_log ONCE
+eval SET @thread_id = $con0_thread_id;
+
+SELECT COUNT(*) = 1 as 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/client_connection'
+AND PORT = 0 AND THREAD_ID = @thread_id;
+
+#
+# VERIFY SERVER LISTENING SOCKET, TCP/IP
+#
+
+--echo # Characteristics of 'server_tcpip_socket' entry
+--echo # Server listening socket, TCP/IP
+--echo # There is only one entry with 'wait/io/socket/sql/server_tcpip_socket'.
+--echo # It shares the same thread id as 'wait/io/socket/sql/server_unix_socket'.
+
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+
+# Store the thread id of server_tcpip_socket
+--echo # Get the 'server_tcpip_socket' thread id
+
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+
+let $server_tcpip_thread_id= `SELECT @thread_id`;
+
+--echo # Check the content.
+--disable_query_log ONCE
+eval SET @port = $MASTER_MYPORT;
+
+eval SELECT THREAD_ID = @thread_id
+ AND (IP = '0.0.0.0' OR IP = '::')
+ AND PORT = @port
+ AND STATE = 'ACTIVE' AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+
+#
+# VERIFY SERVER LISTENING SOCKET, UNIX DOMAIN
+#
+
+--echo # Characteristics of 'server_unix_socket' entry
+--echo # Server listening socket, unix domain (socket file)
+--echo # There is only one entry with 'wait/io/socket/sql/server_unix_socket'.
+--echo # It shares the same thread id as 'wait/io/socket/sql/server_tcpip_socket'.
+
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_unix_socket';
+
+# Store the thread id of 'server_unix_socket'
+--echo # Get the 'server_unix_socket' thread id
+
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_unix_socket';
+
+let $server_unix_thread_id= `SELECT @thread_id`;
+
+--echo # Check the content.
+eval SELECT THREAD_ID = @thread_id
+ AND IP = ''
+ AND PORT = 0
+ AND STATE = 'ACTIVE' AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_unix_socket';
+
+#
+# VERIFY SERVER LISTENING SOCKET THREAD IDs
+#
+
+--echo # Server listening sockets (TCP and Unix) are handled on the same thread
+
+--disable_query_log ONCE
+eval SET @thread_id = $server_tcpip_thread_id;
+
+eval SELECT COUNT(*) = 2 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+--disable_query_log ONCE
+eval SET @thread_id = $server_unix_thread_id;
+
+eval SELECT COUNT(*) = 2 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+--echo #Compare server listener socket thread ids
+--disable_query_log ONCE
+eval SELECT ($server_tcpip_thread_id = $server_unix_thread_id) into @match_thread_id;
+
+select @match_thread_id;
+
+#
+# VERIFY TCP/IP CLIENT CONNECTION 1
+#
+
+# EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE
+# wait/io/socket/sql/client_connection 140707865187120 18 59 127.0.0.1 59298 IDLE or ACTIVE
+
+--echo # Check content for client connection 1 (tcpip)
+
+--disable_query_log
+eval SET @port = $con1_port;
+eval SET @thread_id = $con1_thread_id;
+eval SET @addr = '$my_localhost';
+--enable_query_log
+
+eval SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND (IP LIKE '%127.0.0.1' OR IP = '::1')
+ AND PORT = @port
+AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+--echo # Characteristics of entries with THREAD_ID of con1
+--echo # There is only one entry with this id.
+
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+#
+# VERIFY TCP/IP CLIENT CONNECTION 2
+#
+
+# EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE
+# wait/io/socket/sql/client_connection 140707865187120 18 59 127.0.0.1 59298 IDLE or ACTIVE
+
+--echo # Check content for client connection 2 (tcpip)
+
+--disable_query_log
+eval SET @port = $con2_port;
+eval SET @thread_id = $con2_thread_id;
+eval SET @addr = '$my_localhost';
+--enable_query_log
+
+eval SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND (IP LIKE '%127.0.0.1' OR IP = '::1')
+ AND PORT = @port
+AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+--echo # Characteristics of entries with THREAD_ID of con2
+--echo # There is only one entry with this id.
+
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+#
+# VERIFY LOCAL CONNECTION, UNIX DOMAIN
+#
+
+# EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE
+# wait/io/socket/sql/client_connection 139799531958280 16 37 0 IDLE or ACTIVE
+
+--echo # Check the content for client connection 3 (unix domain).
+
+--disable_query_log ONCE
+eval SET @thread_id = $con3_thread_id;
+
+eval SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND IP = ''
+ AND PORT = 0
+AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+--echo # Characteristics of entries with THREAD_ID of con3
+--echo # There is only one entry with this id.
+
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+#
+# LIST CLIENT CONNECTIONS
+#
+
+--echo # Show differences to socket_instances before con1, con2 and con3 connecting
+let $part=
+FROM performance_schema.socket_instances
+WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE)
+NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE
+ FROM my_socket_instances)
+ORDER BY THREAD_ID;
+--replace_result '::ffff:127.0.0.1' <LOCALHOST> '127.0.0.1' <LOCALHOST> '::1' <LOCALHOST> '::' <BINDADDR> '0.0.0.0' <BINDADDR>
+eval
+SELECT EVENT_NAME, IP
+$part;
+
+--connection default
+
+#
+# DROP CLIENT CONNECTIONS
+#
+
+--echo # Disconnect con1, con2 and con3
+--connection con1
+--disconnect con1
+--source include/wait_until_disconnected.inc
+--connection con2
+--disconnect con2
+--source include/wait_until_disconnected.inc
+--connection con3
+--disconnect con3
+--source include/wait_until_disconnected.inc
+--connection default
+
+#
+# VERIFY CONNECTIONS DROPPED
+#
+
+--echo # After waiting a bit we should have no differences to socket_instances
+--echo # before con1, con2, con3 connecting.
+let $wait_timeout= 10;
+let $wait_condition= SELECT COUNT(*) = 0 $part;
+--source include/wait_condition.inc
+#
+eval
+SELECT *
+$part;
+
diff --git a/mysql-test/suite/perfschema/t/socket_instances_func_win-master.opt b/mysql-test/suite/perfschema/t/socket_instances_func_win-master.opt
new file mode 100644
index 00000000000..ab6ca1731f5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/socket_instances_func_win-master.opt
@@ -0,0 +1 @@
+--skip-name-resolve
diff --git a/mysql-test/suite/perfschema/t/socket_instances_func_win.test b/mysql-test/suite/perfschema/t/socket_instances_func_win.test
new file mode 100644
index 00000000000..d2b7a9f371c
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/socket_instances_func_win.test
@@ -0,0 +1,339 @@
+#
+# Some functional checks for the content of performance_schema.socket_instances.
+#
+
+--source include/not_embedded.inc
+--source include/windows.inc
+--source include/have_perfschema.inc
+
+# Set this to enable debugging output
+let $my_socket_debug= 0;
+
+#
+# Set IP address defaults with respect to IPV6 support
+#
+
+# Determine if IPV6 supported
+let $check_ipv6_just_check= 1;
+--source include/check_ipv6.inc
+
+# Determine if IPV4 mapped to IPV6 supported
+let $check_ipv4_mapped_just_check= 1;
+--source include/check_ipv4_mapped.inc
+
+let $my_localhost= 127.0.0.1;
+
+if($check_ipv6_supported)
+{
+ let $my_localhost= ::1;
+}
+
+if($check_ipv4_mapped_supported)
+{
+ let $my_localhost= ::ffff:127.0.0.1;
+}
+
+if($my_socket_debug)
+{
+ --echo IPV6=$check_ipv6_supported, IPV4_MAPPED=$check_ipv4_mapped_supported, LOCALHOST=$my_localhost
+}
+
+#
+# Preserve the current state of SOCKET_INSTANCES
+#
+
+--echo # Take a snapshot of SOCKET_INSTANCES
+CREATE TEMPORARY TABLE my_socket_instances AS
+SELECT * FROM performance_schema.socket_instances;
+
+--echo # Get thread id of the default connection
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+let $con0_thread_id= `SELECT @thread_id`;
+
+#
+# ESTABLISH TCP/IP CONNECTION 1
+#
+# Start connection with IP = localhost (127.0.0.1 or ::1)
+
+--echo # Establish local TCP/IP connection (con1,localhost,root,,test,,)
+--disable_query_log
+--connect (con1,$my_localhost,root,,test,,$MASTER_MYPORT)
+--enable_query_log
+
+if($my_socket_debug)
+{
+# --replace_result '::ffff:127.0.0.1' <LOCALHOST> '127.0.0.1' <LOCALHOST> '::1' <LOCALHOST> '::' <BINDADDR> '0.0.0.0' <BINDADDR>
+ SELECT * FROM performance_schema.socket_instances;
+}
+
+--echo # Store the thread id of connection 1 (tcp/ip)
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+--echo # Store the port of connection 1 (tcp/ip)
+eval SELECT PORT INTO @port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+let $con1_thread_id= `SELECT @thread_id`;
+let $con1_port= `SELECT @port`;
+
+--echo # Switch to connection default
+--connection default
+
+#
+# ESTABLISH TCP/IP CONNECTION 2
+#
+# Start a second connection with IP = localhost (127.0.0.1 or ::1)
+
+--echo # Establish second local TCP/IP connection (con1,localhost,root,,test,,)
+--disable_query_log
+--connect (con2,$my_localhost,root,,test,,$MASTER_MYPORT)
+--enable_query_log
+
+if($my_socket_debug)
+{
+# --replace_result '::ffff:127.0.0.1' <LOCALHOST> '127.0.0.1' <LOCALHOST> '::1' <LOCALHOST> '::' <BINDADDR> '0.0.0.0' <BINDADDR>
+ SELECT * FROM performance_schema.socket_instances;
+}
+
+--echo # Store the thread_id of connection 2 (tcp/ip)
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.threads
+WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+--echo # Store the port of connection 2 (tcp/ip)
+eval SELECT PORT INTO @port
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+let $con2_thread_id= `SELECT @thread_id`;
+let $con2_port = `SELECT @port`;
+
+--echo # Switch to connection default
+--connection default
+
+#
+# VERIFY EVENT NAMES
+#
+
+--echo # EVENT_NAME is the "wait/io/socket/*" instrument identifier.
+
+SELECT COUNT(*) = 0 AS "Expect 1"
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME NOT LIKE 'wait/io/socket/%';
+
+#
+# VERIFY UNIQUE EVENT IDs
+#
+
+--echo # OBJECT_INSTANCE_BEGIN is an arbitrary identifier, guaranteed to be unique.
+
+SELECT COUNT(*) = COUNT(DISTINCT OBJECT_INSTANCE_BEGIN) AS "Expect 1"
+FROM performance_schema.socket_instances;
+
+#
+# VERIFY UNIQUE SOCKET ID
+#
+
+--echo # SOCKET_ID is the internal file handle assigned to the socket.
+
+SELECT COUNT(*) = COUNT(DISTINCT SOCKET_ID) AS "Expect 1"
+FROM performance_schema.socket_instances;
+
+#
+# VERIFY UNIQUE THREAD IDs
+#
+
+--echo # Characteristics per our thread
+--echo # There must be only one entry with our thread_id
+
+--disable_query_log
+eval SET @thread_id= $con0_thread_id;
+--enable_query_log
+
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+#
+# VERIFY UNIQUE PORT NUMBERS FOR TCP/IP CLIENTS
+#
+
+--echo # TCP/IP connections should have a unique port number
+--disable_query_log
+eval SET @port= $con1_port;
+--enable_query_log
+
+--echo # Connection 1 (tcp/ip)
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE PORT = @port;
+
+--disable_query_log
+eval SET @port= $con2_port;
+--enable_query_log
+
+--echo # Connection 2 (tcp/ip)
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE PORT = @port;
+
+#
+# VERIFY CONNECTION DETAILS FOR THE DEFAULT CONNECTION
+#
+
+--echo # Check the content for the default connection (tcpip)
+# EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE
+# wait/io/socket/sql/client_connection 26139912 16 907296 127.0.0.1 2631 ACTIVE
+
+--disable_query_log
+eval SET @thread_id = $con0_thread_id;
+--enable_query_log
+
+SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND (IP LIKE '%127.0.0.1' OR IP = '::1') AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+#
+# VERIFY SERVER LISTENING SOCKET, TCP/IP
+#
+
+--echo # Characteristics of 'server_tcpip_socket' entry
+--echo # Server listening socket, TCP/IP
+--echo # There is only one entry with 'wait/io/socket/sql/server_tcpip_socket'.
+--echo # It shares the same thread id as 'wait/io/socket/sql/server_unix_socket'.
+
+SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+
+# Store the thread id of server_tcpip_socket
+--echo # Get the 'server_tcpip_socket' thread id
+
+SELECT THREAD_ID INTO @thread_id
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+
+let $server_tcpip_thread_id= `SELECT @thread_id`;
+
+--echo # Check the content.
+--disable_query_log
+eval SET @port = $MASTER_MYPORT;
+--enable_query_log
+
+eval SELECT THREAD_ID = @thread_id
+ AND (IP = '0.0.0.0' OR IP = '::')
+ AND PORT = @port
+ AND STATE = 'ACTIVE' AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE EVENT_NAME = 'wait/io/socket/sql/server_tcpip_socket';
+
+#
+# VERIFY TCP/IP CLIENT CONNECTION 1
+#
+
+# EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE
+# wait/io/socket/sql/client_connection 140707865187120 18 59 127.0.0.1 59298 IDLE or ACTIVE
+
+--echo # Check content for client connection 1 (tcpip)
+
+--disable_query_log
+eval SET @port = $con1_port;
+eval SET @thread_id = $con1_thread_id;
+eval SET @addr = '$my_localhost';
+--enable_query_log
+
+eval SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND (IP LIKE '%127.0.0.1' OR IP = '::1')
+ AND PORT = @port
+AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+--echo # Characteristics of entries with THREAD_ID of con1
+--echo # There is only one entry with this id.
+
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+#
+# VERIFY TCP/IP CLIENT CONNECTION 2
+#
+
+# EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE
+# wait/io/socket/sql/client_connection 140707865187120 18 59 127.0.0.1 59298 IDLE or ACTIVE
+
+--echo # Check content for client connection 2 (tcpip)
+
+--disable_query_log
+eval SET @port = $con2_port;
+eval SET @thread_id = $con2_thread_id;
+eval SET @addr = '$my_localhost';
+--enable_query_log
+
+eval SELECT EVENT_NAME = 'wait/io/socket/sql/client_connection'
+ AND (IP LIKE '%127.0.0.1' OR IP = '::1')
+ AND PORT = @port
+AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+--echo # Characteristics of entries with THREAD_ID of con2
+--echo # There is only one entry with this id.
+
+eval SELECT COUNT(*) = 1 AS 'Expect 1'
+FROM performance_schema.socket_instances
+WHERE THREAD_ID = @thread_id;
+
+#
+# LIST CLIENT CONNECTIONS
+#
+
+--echo # Show differences to socket_instances before con1, con2 and con3 connecting
+let $part=
+FROM performance_schema.socket_instances
+WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE)
+NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE
+ FROM my_socket_instances)
+ORDER BY THREAD_ID;
+--replace_result '::ffff:127.0.0.1' <LOCALHOST> '127.0.0.1' <LOCALHOST> '::1' <LOCALHOST> '::' <BINDADDR> '0.0.0.0' <BINDADDR>
+eval
+SELECT EVENT_NAME, IP
+$part;
+
+--connection default
+
+#
+# DROP CLIENT CONNECTIONS
+#
+
+--echo # Disconnect con1 and con2
+--connection con1
+--disconnect con1
+--source include/wait_until_disconnected.inc
+--connection con2
+--disconnect con2
+--source include/wait_until_disconnected.inc
+--connection default
+
+#
+# VERIFY CONNECTIONS DROPPED
+#
+
+--echo # After waiting a bit we should have no differences to socket_instances
+--echo # before con1, con2 connecting.
+let $wait_timeout= 10;
+let $wait_condition= SELECT COUNT(*) = 0 $part;
+--source include/wait_condition.inc
+#
+eval
+SELECT *
+$part;
+
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
new file mode 100644
index 00000000000..1c317cedcf5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test
@@ -0,0 +1,333 @@
+#
+# Some functional checks for the content of the performance_schema table
+# socket_summary_by_event_name.
+#
+# Created: cpowers 2011-08-18
+#==============================================================================
+#
+# Performance schema table socket_summary_by_event_name holds statistics
+# aggreagated by event name. Table socket_summary_by_instances maintains statistics
+# per socket instance.
+#
+# This test verifies that the statistics in socket_summary_by_event_name
+# are consistent with those in socket_summary_by_instance.
+#
+#==============================================================================
+# Embedded server does not support the performance_schema.
+--source include/not_embedded.inc
+
+# Not much can happen without the performance schema
+--source include/have_perfschema.inc
+
+# Wait for any clients from previous tests to disconnect
+--source ../include/wait_for_pfs_thread_count.inc
+
+# The values in the performance_schema tables depend on how much communication
+# 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
+
+# Set this to enable debugging output
+let $my_socket_debug= 0;
+
+--echo #==============================================================================
+--echo # Establish the level of IPV6 support
+--echo #==============================================================================
+--source ../include/socket_ipv6.inc
+
+--echo #==============================================================================
+--echo # Get hostname, port number
+--echo #==============================================================================
+SELECT @@hostname INTO @MY_HOSTNAME;
+SELECT @@port INTO @MY_MASTER_PORT;
+
+if ($my_socket_debug)
+{
+ SELECT @MY_HOSTNAME AS 'Hostname';
+ SELECT @MY_MASTER_PORT AS 'Master Port';
+ --echo MASTER_MYPORT=$MASTER_MYPORT
+}
+#==============================================================================
+# Utility queries
+#==============================================================================
+let $count_client_connections=
+ SELECT COUNT(*) INTO @my_client_connections
+ FROM performance_schema.socket_instances
+ WHERE EVENT_NAME LIKE "%client_connection%";
+
+let $get_thread_id=
+ SELECT THREAD_ID INTO @my_thread_id
+ FROM performance_schema.threads
+ WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+let $get_object_instance_begin=
+ SELECT OBJECT_INSTANCE_BEGIN INTO @my_object_instance_begin
+ FROM performance_schema.socket_instances
+ WHERE THREAD_ID = @my_thread_id;
+
+let $get_port=
+ SELECT PORT INTO @my_port
+ FROM performance_schema.socket_instances
+ WHERE THREAD_ID = @my_thread_id;
+
+let $get_write_count=
+SELECT sum(SUM_NUMBER_OF_BYTES_WRITE) INTO @my_write_count
+ FROM performance_schema.socket_summary_by_instance;
+#==============================================================================
+# Testcase queries
+#==============================================================================
+let $insert_totals=
+ INSERT INTO mysqltest.my_socket_summary SELECT EVENT_NAME,
+ SUM(t1.COUNT_STAR), SUM(t1.SUM_TIMER_WAIT), SUM(t1.MIN_TIMER_WAIT), SUM(t1.AVG_TIMER_WAIT), SUM(t1.MAX_TIMER_WAIT),
+ SUM(t1.COUNT_READ), SUM(t1.SUM_TIMER_READ), SUM(t1.MIN_TIMER_READ), SUM(t1.AVG_TIMER_READ), SUM(t1.MAX_TIMER_READ), SUM(t1.SUM_NUMBER_OF_BYTES_READ),
+ SUM(t1.COUNT_WRITE), SUM(t1.SUM_TIMER_WRITE), SUM(t1.MIN_TIMER_WRITE), SUM(t1.AVG_TIMER_WRITE), SUM(t1.MAX_TIMER_WRITE), SUM(t1.SUM_NUMBER_OF_BYTES_WRITE),
+ SUM(t1.COUNT_MISC), SUM(t1.SUM_TIMER_MISC), SUM(t1.MIN_TIMER_MISC), SUM(t1.AVG_TIMER_MISC), SUM(t1.MAX_TIMER_MISC), NULL
+ FROM performance_schema.socket_summary_by_instance AS t1
+ WHERE EVENT_NAME LIKE '%client_connection%' GROUP BY EVENT_NAME;
+
+let $compare_tables_and_print=
+SELECT EVENT_NAME,
+ (SUM(t_inst.COUNT_STAR) = t_name.COUNT_STAR) AS CNT_STAR,
+ (SUM(t_inst.SUM_TIMER_WAIT) = t_name.SUM_TIMER_WAIT) AS SUM_WAIT,
+ (MAX(t_inst.MAX_TIMER_WAIT) = t_name.MAX_TIMER_WAIT) AS MAX_WAIT,
+# (MIN(t_inst.MIN_TIMER_WAIT) = t_name.MIN_TIMER_WAIT) AS MIN_WAIT,
+ (SUM(t_inst.COUNT_READ) = t_name.COUNT_READ) AS CNT_READ,
+ (SUM(t_inst.SUM_TIMER_READ) = t_name.SUM_TIMER_READ) AS SUM_READ,
+ (MAX(t_inst.MAX_TIMER_READ) = t_name.MAX_TIMER_READ) AS MAX_READ,
+# (MIN(t_inst.MIN_TIMER_READ) = t_name.MIN_TIMER_READ) AS MIN_READ,
+ (SUM(t_inst.SUM_NUMBER_OF_BYTES_READ) = t_name.SUM_NUMBER_OF_BYTES_READ) AS BYTES_READ,
+ (SUM(t_inst.COUNT_WRITE) = t_name.COUNT_WRITE) AS CNT_WRITE,
+ (SUM(t_inst.SUM_TIMER_WRITE) = t_name.SUM_TIMER_WRITE) AS SUM_WRITE,
+ (MAX(t_inst.MAX_TIMER_WRITE) = t_name.MAX_TIMER_WRITE) AS MAX_WRITE,
+# (MIN(t_inst.MIN_TIMER_WRITE) = t_name.MIN_TIMER_WRITE) AS MIN_WRITE,
+ (SUM(t_inst.SUM_NUMBER_OF_BYTES_WRITE) = t_name.SUM_NUMBER_OF_BYTES_WRITE) AS BYTES_WRITE,
+ (SUM(t_inst.COUNT_MISC) = t_name.COUNT_MISC) AS CNT_MISC,
+ (SUM(t_inst.SUM_TIMER_MISC) = t_name.SUM_TIMER_MISC) AS SUM_MISC
+FROM performance_schema.socket_summary_by_instance t_inst
+JOIN performance_schema.socket_summary_by_event_name t_name
+USING (EVENT_NAME)
+WHERE t_inst.event_name LIKE '%client%'
+ AND t_inst.object_instance_begin <> @default_object_instance_begin;
+
+let $compare_tables_and_verify=
+SELECT (
+ (SUM(t_inst.COUNT_STAR) = t_name.COUNT_STAR) AND
+ (SUM(t_inst.SUM_TIMER_WAIT) = t_name.SUM_TIMER_WAIT) AND
+ (MAX(t_inst.MAX_TIMER_WAIT) = t_name.MAX_TIMER_WAIT) AND
+# (MIN(t_inst.MIN_TIMER_WAIT) = t_name.MIN_TIMER_WAIT) AND
+ (SUM(t_inst.COUNT_READ) = t_name.COUNT_READ) AND
+ (SUM(t_inst.SUM_TIMER_READ) = t_name.SUM_TIMER_READ) AND
+ (MAX(t_inst.MAX_TIMER_READ) = t_name.MAX_TIMER_READ) AND
+# (MIN(t_inst.MIN_TIMER_READ) = t_name.MIN_TIMER_READ) AND
+ (SUM(t_inst.SUM_NUMBER_OF_BYTES_READ) = t_name.SUM_NUMBER_OF_BYTES_READ) AND
+ (SUM(t_inst.COUNT_WRITE) = t_name.COUNT_WRITE) AND
+ (SUM(t_inst.SUM_TIMER_WRITE) = t_name.SUM_TIMER_WRITE) AND
+ (MAX(t_inst.MAX_TIMER_WRITE) = t_name.MAX_TIMER_WRITE) AND
+# (MIN(t_inst.MIN_TIMER_WRITE) = t_name.MIN_TIMER_WRITE) AND
+ (SUM(t_inst.SUM_NUMBER_OF_BYTES_WRITE) = t_name.SUM_NUMBER_OF_BYTES_WRITE) AND
+ (SUM(t_inst.COUNT_MISC) = t_name.COUNT_MISC) AND
+ (SUM(t_inst.SUM_TIMER_MISC) = t_name.SUM_TIMER_MISC) ) = 1 INTO @tables_match
+FROM performance_schema.socket_summary_by_instance t_inst
+JOIN performance_schema.socket_summary_by_event_name t_name
+USING (EVENT_NAME)
+WHERE t_inst.event_name LIKE '%client%'
+ AND t_inst.object_instance_begin <> @default_object_instance_begin;
+
+--echo #==============================================================================
+--echo # 1.0 TEST INITIALIZATION
+--echo #==============================================================================
+--echo
+--echo # 1.1 Disable instrumentation of the default (this) connection
+--echo
+--connection default
+UPDATE performance_schema.threads
+ SET INSTRUMENTED='NO' WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+--echo
+--echo # 1.2 Get the default THREAD_ID;
+--echo
+eval $get_thread_id;
+let $default_thread_id= `SELECT @my_thread_id`;
+
+--echo
+--echo # 1.3 Get the default OBJECT_INSTANCE_BEGIN
+--echo
+eval $get_object_instance_begin;
+let $default_object_instance_begin= `SELECT @my_object_instance_begin`;
+
+--disable_query_log
+SELECT @my_object_instance_begin INTO @default_object_instance_begin;
+--enable_query_log
+
+if ($my_socket_debug)
+{
+ --echo # Default object instance begin = $default_object_instance_begin
+ --echo # Default thread id = $default_thread_id
+}
+
+--echo
+--echo # 1.4 Create a test database
+--echo
+CREATE SCHEMA mysqltest;
+
+--echo
+--echo # 1.5 Create a table to store summary values from socket_summary_by_instance
+--echo and socket_summary_by_event_name
+--echo
+CREATE TABLE mysqltest.my_socket_summary AS
+ SELECT * FROM performance_schema.socket_summary_by_instance
+ WHERE 1 = 0;
+
+--echo
+--echo # 1.6 Drop object_instance_begin from my_socket_summary
+--echo
+ALTER TABLE mysqltest.my_socket_summary
+ DROP COLUMN OBJECT_INSTANCE_BEGIN;
+
+--echo
+--echo # 1.7 Add an auto_inc column to my_socket_summary
+--echo
+ALTER TABLE mysqltest.my_socket_summary
+ ADD COLUMN (n INT AUTO_INCREMENT, PRIMARY KEY(n));
+
+--echo
+--echo # 1.8 Create test tables
+--echo
+CREATE TABLE mysqltest.t1 (n INT AUTO_INCREMENT, s1 VARCHAR(1024), PRIMARY KEY(n));
+CREATE TABLE mysqltest.t2 (n INT AUTO_INCREMENT, s1 VARCHAR(1024), PRIMARY KEY(n));
+
+--echo #==============================================================================
+--echo # 2.0 ESTABLISH CLIENT CONNECTIONS
+--echo #==============================================================================
+--echo
+--echo # 2.1 Connection 1 (tcp/ip, 127.0.0.1 or ::1)
+--echo
+--disable_query_log
+--connect (con1,$my_localhost,root,,,,$MASTER_MYPORT)
+--enable_query_log
+
+--echo
+--echo # 2.2 Connection 2 (localhost or unix domain socket)
+--echo
+--disable_query_log
+--connect (con2,localhost,root,,,,)
+--enable_query_log
+
+--echo #==============================================================================
+--echo # 3.0 RUN THE TESTS
+--echo #==============================================================================
+--echo
+--echo # 3.1 Clear performance schema tables
+--echo
+TRUNCATE performance_schema.socket_summary_by_instance;
+TRUNCATE performance_schema.socket_summary_by_event_name;
+
+--echo
+--echo # 3.2 Get the 'before' sum of bytes written from socket_summary_by_instance
+--echo for later comparison to the 'after' byte count as a simple confirmation
+--echo that the table was updated.
+--echo
+--connection default
+eval $get_write_count;
+let $my_count_before= `SELECT @my_write_count`;
+
+--echo
+--echo # 3.3 From connection 1, insert one a 1K row of data into t1
+--echo
+--connection con1
+USE mysqltest;
+INSERT INTO t1 (s1) VALUES (REPEAT('a', 1024));
+INSERT INTO t1 (s1) SELECT s1 FROM t1;
+
+--echo
+--echo # 3.4 From connection 2, insert one a 1K row of data into t2
+--echo
+--connection con2
+USE mysqltest;
+INSERT INTO t2 (s1) VALUES (REPEAT('a', 1024));
+INSERT INTO t2 (s1) SELECT s1 FROM t2;
+
+--echo
+--echo # 3.5 Get the 'after' sum of bytes written from socket_summary_by_instance
+--echo
+--connection default
+eval $get_write_count;
+let $my_count_after= `SELECT @my_write_count`;
+
+--echo
+--echo # 3.6 Verify that SUM_NUMBER_OF_BYTES_WRITE increased
+--echo
+
+if ($my_count_before >= $my_count_after)
+{
+ --echo
+ --echo # ERROR: Write count did not increaase
+ --echo # Before = $my_count_before
+ --echo # After = $my_count_after
+ --echo
+ SELECT * FROM performance_schema.socket_summary_by_instance ORDER BY EVENT_NAME;
+ --echo
+ --echo # Abort
+ exit;
+}
+
+--echo
+--echo # socket_summary_by_instance was updated
+--echo
+
+--echo #==============================================================================
+--echo # 4.0 VERIFY RESULTS
+--echo #==============================================================================
+--echo
+--echo # 4.1 Verify that the totals in socket_summary_by_event_name are
+--echo consistent with totals in socket_summary_by_instance
+--echo
+
+--disable_query_log
+eval $compare_tables_and_verify;
+
+if (`SELECT @tables_match = 0`)
+{
+ --echo
+ --echo # ERROR: Socket summary tables do not match
+ --echo # Column comparison results:
+ --echo
+ eval $compare_tables_and_print;
+ --enable_query_log
+ --echo
+ SELECT * FROM performance_schema.socket_summary_by_instance ORDER BY EVENT_NAME;
+ --echo
+ SELECT * FROM performance_schema.socket_summary_by_event_name ORDER BY EVENT_NAME;
+ --echo
+ --echo # Abort
+ exit;
+}
+--enable_query_log
+
+--echo #==============================================================================
+--echo # 5.0 Clean up
+--echo #==============================================================================
+
+--echo
+--echo # 5.1 Disconnect con1
+--echo
+--connection con1
+--disconnect con1
+--source include/wait_until_disconnected.inc
+
+--echo
+--echo # 5.2 Disconnect con2
+--echo
+--connection con2
+--disconnect con2
+--source include/wait_until_disconnected.inc
+
+--echo
+--echo # 5.3 Drop mysqltest
+--echo
+--connection default
+DROP DATABASE mysqltest;
+
+exit;
+
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
new file mode 100644
index 00000000000..cad6d5cf998
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
@@ -0,0 +1,1710 @@
+# Some functional checks for the content of the performance_schema table
+# socket_summary_by_instance.
+#
+# Created: mleich 2011-07-01
+#
+# Rough description of "What is when tested"
+# 1. Impact of successful connect
+# A new row with EVENT_NAME "client_connection" shows up
+# is tested in 0 and 4.5.
+# 2. Impact of disconnect
+# A row with EVENT_NAME "client_connection" disappears
+# is tested in 0. and 2.
+# 3. Disabling the instrumentation for some thread causes that the
+# counter for this thread become static is tested in 4.3.
+# Nearby the beginning of this test and somewhere in the middle.
+# 4. TRUNCATE table resets the counters is tested in 5.
+# 5. Consistency within a row like MIN_* <= AVG_* <= MAX_*
+# -> include/socket_summary_check.inc which is called at
+# various places
+# 6. Consistency of the instances mentioned in socket_summary_by_event
+# and socket_summary_by_instance is checked per call of
+# include/socket_summary_check.inc
+# 7. Check if changes in counters of instances caused by actions
+# are reasonable is tested for
+# - Connects+SQL statements in 4.1 and 4.2
+# - SQL statements in 4.4
+# - Connects in 4.5
+#
+
+# Embedded server does not supprt the performance_schema.
+--source include/not_embedded.inc
+--source include/not_windows.inc
+--source include/have_perfschema.inc
+
+# The values in the performance_schema tables depend on how much communication
+# 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
+
+
+#===================================
+# Set IP address defaults with respect to IPV6 support
+#
+# Set this to enable debugging output
+let $my_socket_debug= 0;
+#
+# Determine if IPV6 supported
+#
+let $check_ipv6_just_check= 1;
+--source include/check_ipv6.inc
+#
+# Determine if IPV4 mapped to IPV6 supported
+#
+let $check_ipv4_mapped_just_check= 1;
+--source include/check_ipv4_mapped.inc
+#
+# Set the localhost IP default to use when establishing connections
+let $my_localhost=127.0.0.1;
+if($check_ipv6_supported)
+{
+ let $my_localhost=::1;
+}
+if($check_ipv4_mapped_supported)
+{
+ let $my_localhost=::ffff:127.0.0.1;
+}
+#
+let $my_socket_debug= 0;
+if($my_socket_debug)
+{
+ --echo IPV6=$check_ipv6_supported, IPV4_MAPPED = $check_ipv4_mapped_supported, LOCALHOST = $my_localhost
+}
+#===================================
+
+--echo # The logging of commands and result sets is mostly disabled.
+--echo # There are some messages which help to observe the progress of the test.
+--echo # In case some check fails
+--echo # - a message about this will be printed
+--echo # - some SQL commands which show the unexpected state will be executed
+--echo # (logging enabled)
+--echo # - the test might abort
+--echo #
+
+--disable_query_log
+
+--echo # 0. Check, build or set prequisites
+#==========================================
+# Set $print_details to 1 in case you want that the exact diffs caused
+# by the execution of a statement get printed.
+# Disadvantage of printing details:
+# Even minor legimitate changes of the client - server communication can
+# cause that the test needs maintenance.
+# Advantage:
+# More thorough checks.
+# If any of the checks detects some suspicious/unexpected state than
+# $print_details will be automatically switched to 1.
+#
+let $print_details= 0;
+
+#
+# Number of attempts within the test checking the stability of counter changes.
+#
+let $loop_rounds= 10;
+
+# This test of PERFORMANCE_SCHEMA functionality is very vulnerable.
+# Ensure that we have in the moment exact one
+# - connection
+# - instance with EVENT_NAME LIKE '%client_connection'
+# - instance with EVENT_NAME LIKE '%server_tcpip_socket'
+# - instance with EVENT_NAME LIKE '%server_unix_socket'
+#=======================================================
+let $my_rules= COUNT(*) = 1;
+let $part=
+FROM performance_schema.threads
+WHERE NAME LIKE '%one_connection';
+let $wait_condition=
+SELECT $my_rules $part;
+let $wait_timeout= 5;
+--source include/wait_condition.inc
+--enable_query_log
+if(!$success)
+{
+ --echo # ERROR: There must be only one user connection
+ eval
+ SELECT * $part;
+ --echo # abort
+ exit;
+}
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection';
+let $wait_condition=
+SELECT $my_rules $part;
+let $wait_timeout= 5;
+--source include/wait_condition.inc
+if(!$success)
+{
+ --echo # ERROR: There must be only one instance with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ exit;
+}
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%server_unix_socket';
+let $wait_condition=
+SELECT $my_rules $part;
+let $wait_timeout= 5;
+--source include/wait_condition.inc
+if(!$success)
+{
+ --echo # ERROR: There must be only one instance with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ exit;
+}
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%server_tcpip_socket';
+let $wait_condition=
+SELECT $my_rules $part;
+let $wait_timeout= 5;
+--source include/wait_condition.inc
+if(!$success)
+{
+ --echo # ERROR: There must be only one instance with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ exit;
+}
+
+--disable_query_log
+
+#
+# Lower the resolution of the wait timer from the default 'CYCLE'
+# to 'NANOSECOND'.
+# Hint: The timer columns contains values in picoseconds independent
+# of the timer resolution.
+# The timer resolution has an impact on the precision of the value.
+# This should prevent the failures seen on some suspicious PB boxes where
+# - calculations exceeded the BIGINT UNSIGNED (data type of the counter columns)
+# value range.
+# - we have reached from whatever reason 20 digit values
+# The consequence for the current test is the following:
+# The common sense rule
+# In case COUNT_<A> increases than SUM_TIMER_<A> must also increase
+# is no more valid because some action might need less time than the
+# timer resolution.
+#
+let $wait_timer= `SELECT TIMER_NAME FROM performance_schema.setup_timers
+ WHERE NAME = 'wait'`;
+UPDATE performance_schema.setup_timers
+SET TIMER_NAME = 'NANOSECOND'
+WHERE NAME = 'wait';
+
+#
+# Additional SCHEMA used for
+# - detection of our "worker" session within the PROCESSLIST.
+# No other connection should use this schema as default schema.
+# - easy cleanup because auxiliary objects are stored there
+#
+CREATE SCHEMA mysqltest;
+CREATE SCHEMA mysqlsupertest;
+
+#
+# Clear summary tables of previous entries
+#
+TRUNCATE performance_schema.socket_summary_by_instance;
+TRUNCATE performance_schema.socket_summary_by_event_name;
+# Disable instrumenting of the current default session.
+# Required for check 1.1
+UPDATE performance_schema.threads
+SET INSTRUMENTED='NO' WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+#
+# Auxiliary tables for storing current values at certain points of time.
+# We store states of performance_schema.socket_summary_by_instance here
+# in order
+# - to have initial values from before some action
+# - to minimize the impact of statements used for the checks on results.
+# CREATE TEMPORARY TABLE my_socket_summary_by_instance AS
+# would be nice but some statements are not supported for temporary tables.
+#
+# DECIMAL(60,0) is used instead of BIGINT UNSIGNED. The goal is to prevent
+# errors during calculations
+# Example:
+# - A and B UNSIGNED BIGINT
+# - A < B
+# - A - B ---> Error
+# though the columns in all queries are orderd to avoid this too.
+#
+CREATE TABLE mysqltest.my_socket_summary_by_instance (
+ EVENT_NAME varchar(128) NOT NULL,
+ OBJECT_INSTANCE_BEGIN bigint(20) unsigned NOT NULL,
+ COUNT_STAR DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_WAIT DECIMAL(60,0) NOT NULL,
+ MIN_TIMER_WAIT DECIMAL(60,0) NOT NULL,
+ AVG_TIMER_WAIT DECIMAL(60,0) NOT NULL,
+ MAX_TIMER_WAIT DECIMAL(60,0) NOT NULL,
+ COUNT_READ DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_READ DECIMAL(60,0) NOT NULL,
+ MIN_TIMER_READ DECIMAL(60,0) NOT NULL,
+ AVG_TIMER_READ DECIMAL(60,0) NOT NULL,
+ MAX_TIMER_READ DECIMAL(60,0) NOT NULL,
+ SUM_NUMBER_OF_BYTES_READ DECIMAL(60,0) NOT NULL,
+ COUNT_WRITE DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_WRITE DECIMAL(60,0) NOT NULL,
+ MIN_TIMER_WRITE DECIMAL(60,0) NOT NULL,
+ AVG_TIMER_WRITE DECIMAL(60,0) NOT NULL,
+ MAX_TIMER_WRITE DECIMAL(60,0) NOT NULL,
+ SUM_NUMBER_OF_BYTES_WRITE DECIMAL(60,0) NOT NULL,
+ COUNT_MISC DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_MISC DECIMAL(60,0) NOT NULL,
+ MIN_TIMER_MISC DECIMAL(60,0) NOT NULL,
+ AVG_TIMER_MISC DECIMAL(60,0) NOT NULL,
+ MAX_TIMER_MISC DECIMAL(60,0) NOT NULL,
+ pk VARCHAR(20),
+ PRIMARY KEY(pk, EVENT_NAME, OBJECT_INSTANCE_BEGIN)
+) DEFAULT CHARSET=utf8;
+
+
+# The CAST(... AS DECIMAL(60,0)) prevents errors which might show up in case
+# we run with the original data type UNSIGNED BIGINT.
+CREATE TABLE mysqltest.socket_summary_by_instance_detail (
+ EVENT_NAME varchar(128) NOT NULL,
+ OBJECT_INSTANCE_BEGIN bigint(20) unsigned NOT NULL,
+ COUNT_READ DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_READ DECIMAL(60,0) NOT NULL,
+ SUM_NUMBER_OF_BYTES_READ DECIMAL(60,0) NOT NULL,
+ COUNT_WRITE DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_WRITE DECIMAL(60,0) NOT NULL,
+ SUM_NUMBER_OF_BYTES_WRITE DECIMAL(60,0) NOT NULL,
+ COUNT_MISC DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_MISC DECIMAL(60,0) NOT NULL,
+ statement VARCHAR(500),
+ run INTEGER
+) DEFAULT CHARSET=utf8;
+
+#
+# Auxiliary SQL functions used to shorten some commands.
+#
+CREATE FUNCTION mysqltest.min_of_triple
+ (f1 DECIMAL(60,0), f2 DECIMAL(60,0), f3 DECIMAL(60,0))
+ RETURNS DECIMAL(60,0)
+ RETURN IF(IF(f1 < f2,f1,f2) < f3,IF(f1 < f2,f1,f2), f3);
+CREATE FUNCTION mysqltest.max_of_triple
+ (f1 DECIMAL(60,0), f2 DECIMAL(60,0), f3 DECIMAL(60,0))
+ RETURNS DECIMAL(60,0)
+ RETURN IF(IF(f1 > f2,f1,f2) > f3,IF(f1 > f2,f1,f2), f3);
+
+#
+# Auxiliary table for experiments with SELECTs earning different result sets.
+#
+CREATE TABLE mysqltest.my_aux (col1 INTEGER, col2 VARCHAR(1024), PRIMARY KEY(col1));
+INSERT INTO mysqltest.my_aux SET col1 = 0, col2 = REPEAT('a',0);
+INSERT INTO mysqltest.my_aux SET col1 = 1, col2 = REPEAT('a',0);
+INSERT INTO mysqltest.my_aux SET col1 = 2, col2 = REPEAT('a',1);
+INSERT INTO mysqltest.my_aux SET col1 = 3, col2 = REPEAT('a',1024);
+
+#
+# Auxiliary mysqltest variables used to shorten commands and to ensure
+# that we run all time the right operation.
+#
+let $truncate=
+TRUNCATE TABLE mysqltest.my_socket_summary_by_instance;
+#
+let $insert_before=
+INSERT INTO mysqltest.my_socket_summary_by_instance
+SELECT *,'Before' FROM performance_schema.socket_summary_by_instance;
+#
+let $insert_after=
+INSERT INTO mysqltest.my_socket_summary_by_instance
+SELECT *,'After' FROM performance_schema.socket_summary_by_instance;
+#
+let $insert_pseudo_before=
+INSERT INTO mysqltest.my_socket_summary_by_instance
+(EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+COUNT_STAR, SUM_TIMER_WAIT, MIN_TIMER_WAIT, AVG_TIMER_WAIT, MAX_TIMER_WAIT,
+COUNT_READ, SUM_TIMER_READ, MIN_TIMER_READ, AVG_TIMER_READ, MAX_TIMER_READ,
+SUM_NUMBER_OF_BYTES_READ,
+COUNT_WRITE, SUM_TIMER_WRITE, MIN_TIMER_WRITE, AVG_TIMER_WRITE, MAX_TIMER_WRITE,
+SUM_NUMBER_OF_BYTES_WRITE,
+COUNT_MISC, SUM_TIMER_MISC, MIN_TIMER_MISC, AVG_TIMER_MISC, MAX_TIMER_MISC,
+pk)
+SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+0, 0, 0, 0, 0,
+0, 0, 0, 0, 0,
+0,
+0, 0, 0, 0, 0,
+0,
+0, 0, 0, 0, 0,
+'Pseudo_Before'
+FROM mysqltest.my_socket_summary_by_instance t1
+WHERE OBJECT_INSTANCE_BEGIN NOT IN
+ (SELECT OBJECT_INSTANCE_BEGIN
+ FROM mysqltest.my_socket_summary_by_instance t2
+ WHERE pk = 'Before');
+#
+let $insert_delta=
+INSERT INTO mysqltest.socket_summary_by_instance_detail
+ (EVENT_NAME,OBJECT_INSTANCE_BEGIN,
+ COUNT_READ, SUM_TIMER_READ, SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE,SUM_TIMER_WRITE,SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC, SUM_TIMER_MISC, statement,run)
+SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,
+ t1.COUNT_READ - t2.COUNT_READ,
+ t1.SUM_TIMER_READ - t2.SUM_TIMER_READ,
+ t1.SUM_NUMBER_OF_BYTES_READ - t2.SUM_NUMBER_OF_BYTES_READ,
+ t1.COUNT_WRITE - t2.COUNT_WRITE,
+ t1.SUM_TIMER_WRITE - t2.SUM_TIMER_WRITE,
+ t1.SUM_NUMBER_OF_BYTES_WRITE - t2.SUM_NUMBER_OF_BYTES_WRITE,
+ t1.COUNT_MISC - t2.COUNT_MISC,
+ t1.SUM_TIMER_MISC - t2.SUM_TIMER_MISC,
+ NULL,NULL
+FROM mysqltest.my_socket_summary_by_instance t1
+JOIN mysqltest.my_socket_summary_by_instance t2
+USING (EVENT_NAME,OBJECT_INSTANCE_BEGIN)
+WHERE t1.pk = 'After' AND t2.pk LIKE '%Before';
+#
+let $get_object_instance_begin=
+SELECT OBJECT_INSTANCE_BEGIN INTO @con1_object_instance_begin
+FROM performance_schema.socket_summary_by_instance AS t1
+WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN)
+ NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN
+ FROM mysqltest.my_socket_summary_by_instance AS t2
+ WHERE pk = 'Before');
+
+# Use this whenever you print data.
+let $column_list=
+RPAD(EVENT_NAME, 38, ' ') AS EVENT_NAME,
+LPAD(OBJECT_INSTANCE_BEGIN, 20, ' ') AS OBJECT_INSTANCE,
+LPAD(COUNT_READ, 7, ' ') AS CREAD,
+LPAD(SUM_TIMER_READ, 12, ' ') AS TREAD,
+LPAD(SUM_NUMBER_OF_BYTES_READ, 7, ' ') AS BREAD,
+LPAD(COUNT_WRITE, 7, ' ') AS CWRITE,
+LPAD(SUM_TIMER_WRITE, 12, ' ') AS TWRITE,
+LPAD(SUM_NUMBER_OF_BYTES_WRITE, 7, ' ') AS BWRITE,
+LPAD(COUNT_MISC, 7, ' ') AS CMISC,
+LPAD(SUM_TIMER_MISC, 13, ' ') AS TMISC,
+RPAD(STATEMENT, 50, ' ') AS STATEMENT,
+LPAD(RUN, 5, ' ') AS RUN;
+
+# Determine OBJECT_INSTANCE_BEGIN of the connection default
+# which acts as the observer
+eval $truncate;
+eval $insert_before;
+--disconnect default
+--connect (default,localhost,root,,,,)
+# --echo ########### Disconnect/Connect
+# --enable_query_log
+eval $insert_after;
+eval $get_object_instance_begin;
+SET @default_object_instance_begin = @con1_object_instance_begin;
+
+# Wait till the old default connection has disappeared
+let $wait_timeout= 5;
+let $wait_condition=
+SELECT COUNT(*) = 1
+FROM performance_schema.threads
+WHERE processlist_user = 'root';
+--source include/wait_condition.inc
+--enable_query_log
+if (!$success)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # Error: The disconnect of the old default connection
+ --echo # (user = 'root') failed. We expect to have only one connection
+ --echo # with user = 'root'. And this is our current connection.
+ SELECT * FROM performance_schema.threads
+ WHERE processlist_user = 'root';
+ --echo # abort
+ exit;
+}
+
+# Disable instrumenting of the current default session.
+# Required for check 1.2
+UPDATE performance_schema.threads
+SET INSTRUMENTED='NO' WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+--echo # 1. Basic checks
+--echo # 1.1 Check that the entry of the disconnected old default session really
+--echo # disappeared from performance_schema.socket_summary_by_instance.
+#===============================================================================
+# This failed at some point in history when the instrumenting for the
+# session to be disconnected was disabled.
+if(`SELECT COUNT(*) FROM performance_schema.socket_summary_by_instance
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE '%client_connection'`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # Error: The disconnected old default session did not disappear from
+ --echo # socket_summary_by_instance.
+ SELECT * FROM performance_schema.socket_summary_by_instance
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE '%client_connection';
+}
+
+TRUNCATE TABLE performance_schema.socket_summary_by_instance;
+
+--echo # 1.2 Check the base line
+#===============================
+eval $truncate;
+--source ../include/socket_summary_check.inc
+
+# --disable_query_log
+# --disable_query_log
+
+--echo # 2. Variations on Connect
+let $is_connect= 1;
+--echo # 2.1 Connect fails because the user is unknown
+--echo # length of user name = 4 character
+--echo # length of default db = 9 character
+#========================================================================
+let $connect_host= localhost;
+let $connect_db= mysqltest;
+let $connect_user= boot;
+--source ../include/socket_event.inc
+
+--echo # 2.2 Connect fails because the user is unknown
+--echo # length of user name = 14 character (10 more than in 2.1)
+--echo # length of default db = 9 character
+#========================================================================
+let $connect_host= localhost;
+let $connect_db= mysqltest;
+let $connect_user= boot0123456789;
+--source ../include/socket_event.inc
+
+--echo # 2.3 Connect should pass, host = localhost
+--echo # length of user name = 4 character
+--echo # length of default db = 9 character
+#========================================================================
+let $connect_host= localhost;
+let $connect_db= mysqltest;
+let $connect_user= root;
+--source ../include/socket_event.inc
+
+--echo # 2.4 Connect should pass, host = localhost
+--echo # length of user name = 4 character
+--echo # length of default db = 14 character (5 more than 2.3)
+#========================================================================
+let $connect_host= localhost;
+let $connect_db= mysqlsupertest;
+let $connect_user= root;
+--source ../include/socket_event.inc
+
+--echo # 2.5 Connect should pass, host = localhost
+--echo # length of user name = 10 character
+--echo # length of default db = 9 character
+#========================================================================
+GRANT ALL PRIVILEGES ON *.* TO 'root012345'@'localhost';
+let $connect_host= localhost;
+let $connect_db= mysqltest;
+let $connect_user= root012345;
+--source ../include/socket_event.inc
+DROP USER 'root012345'@'localhost';
+
+--echo # 2.6 Connect should pass, host = localhost
+--echo # length of user name = 14 character
+--echo # length of default db = 9 character
+#========================================================================
+GRANT ALL PRIVILEGES ON *.* to 'root0123456789'@'localhost';
+let $connect_host= localhost;
+let $connect_db= mysqltest;
+let $connect_user= root0123456789;
+--source ../include/socket_event.inc
+DROP USER 'root0123456789'@'localhost';
+
+--echo # 2.7 Connect should pass, host = my_localhost
+--echo # length of user name = 4 character
+--echo # length of default db = 9 character
+--echo # connection runs through server_tcpip_socket !
+#========================================================================
+let $connect_host= $my_localhost;
+let $connect_db= mysqltest;
+let $connect_user= root;
+--source ../include/socket_event.inc
+
+#========================================================================
+--connect (con1,localhost,root,,mysqltest,,)
+# Experiments showed some unexpected result in the counter difference
+# which got con1 for the next statement (see 3.1).
+# The measured diff was too high and was probably caused by some
+# too much delayed counter maintenance for the connect.
+# We run here just some SQL statement because counter maintenance
+# for SQL statements is more fast and reliable than far Connect.
+DO 1;
+--connection default
+--source ../include/wait_till_sleep.inc
+--disable_query_log
+
+--echo # 3 Variations on SELECT
+# Attention: Don't use
+# - any double quotes within the statements because sourced scripts
+# already "decorate" $variables with double quotes
+# - UNION because this leads to result set related byte write
+# counters which cannot good compared to select without union
+let $is_connect= 0;
+eval $get_object_instance_begin;
+--echo # 3.1 Check a SELECT ending with server sending an error message.
+--echo # Error message is short (unknown table).
+#========================================================================
+let $statement= SELECT col2 FROM does_not_exist;
+--source ../include/socket_event.inc
+
+--echo # 3.2 SELECT ending with server sending an error message.
+--echo # Now the statement is a bit longer but the error message
+--echo # length does again not depend on statement.
+#=======================================================================
+let $statement= SELECT col2 FROM does_not_exist WHERE col1 = 0;
+--source ../include/socket_event.inc
+
+--echo # 3.3 SELECT ending with server sending an error message.
+--echo # The statement has the same length like in 3.2 but the error
+--echo # message is now different and much longer.
+#=======================================================================
+let $statement= SELECT col2 FROM does_not_exist WHERE col1 A 0;
+--source ../include/socket_event.inc
+
+--echo # 3.4 SELECT ending with server sending an error message.
+--echo # Statement and error message are a bit longer than in 3.1
+--echo # because the table name is longer.
+#=======================================================================
+let $statement= SELECT col2 FROM does_not_exist0123;
+--source ../include/socket_event.inc
+
+--echo # 3.5 SELECT earning an empty result set.
+#=======================================================
+let $statement= SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1;
+--source ../include/socket_event.inc
+
+--echo # 3.6 SELECT earning an empty result set.
+--echo # Short column name is replaced by longer alias.
+#==========================================================
+let $statement= SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1;
+--source ../include/socket_event.inc
+
+--echo # 3.7 SELECT earning one row with an empty string.
+#================================================================
+let $statement= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+--source ../include/socket_event.inc
+
+--echo # 3.8 SELECT earning one row with one string one char long.
+#=========================================================================
+let $statement= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2;
+--source ../include/socket_event.inc
+
+--echo # 3.9 SELECT earning one row with one string 1024 char long.
+#==========================================================================
+let $statement= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3;
+--source ../include/socket_event.inc
+
+--echo # 3.10 SELECT earning two rows with an empty string
+#==========================================================================
+let $statement= SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2;
+--source ../include/socket_event.inc
+
+--echo # 3.11 Check that the preceding Connects/SQL command runs have not
+--echo # caused some unexpected state.
+#==========================================================================
+let $my_rules= COUNT(*) = 2;
+let $part=
+FROM performance_schema.threads
+WHERE NAME LIKE '%one_connection';
+if(`SELECT NOT ( $my_rules ) $part `)
+{
+ --echo # ERROR: There must be only two user connections
+ eval
+ SELECT * $part;
+ --echo # abort
+ exit;
+}
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection';
+if(`SELECT NOT ( $my_rules ) $part `)
+{
+ --echo # ERROR: There must be only two instances with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ exit;
+}
+let $my_rules= COUNT(*) = 1;
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%server_unix_socket';
+if(`SELECT NOT ( $my_rules ) $part `)
+{
+ --echo # ERROR: There must be only one instance with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ exit;
+}
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%server_tcpip_socket';
+if(`SELECT NOT ( $my_rules ) $part `)
+{
+ --echo # ERROR: There must be only one instance with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ exit;
+}
+
+--echo # 4. Check delta (value_after_action - value_before_action) details
+# 4.0 . Negative deltas cannot have happened because the counter columns within
+# socket_summary_by_instance_detail are defined as UNSIGNED BIGINT.
+# = The INSERT which computes the diff would have been failed.
+--echo # 4.1 Check that
+--echo # - no change in COUNT_* leads to no change in
+--echo # SUM_TIMER_* and no change in SUM_NUMBER_OF_BYTES_*
+--echo # - increased COUNT_READ leads to increased
+--echo # SUM_NUMBER_OF_BYTES_READ
+--echo # - increased COUNT_WRITE leads to increased
+--echo # SUM_NUMBER_OF_BYTES_WRITE
+--echo # Attention:
+--echo # The time required for some action might be below timer resolution.
+--echo # Therefore some increased COUNT_* does not need to lead to an
+--echo # increased SUM_TIMER_*.
+#==========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET SUM_TIMER_MISC = 13, COUNT_MISC = 0
+ WHERE statement LIKE '%WHERE col1 = 3'
+ AND EVENT_NAME LIKE '%client_connection'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+((COUNT_READ = 0 AND SUM_TIMER_READ = 0 AND SUM_NUMBER_OF_BYTES_READ = 0)
+ OR
+ (COUNT_READ > 0 AND SUM_NUMBER_OF_BYTES_READ > 0))
+AND
+((COUNT_WRITE = 0 AND SUM_TIMER_WRITE = 0 AND SUM_NUMBER_OF_BYTES_WRITE = 0)
+ OR
+ (COUNT_WRITE > 0 AND SUM_NUMBER_OF_BYTES_WRITE > 0))
+AND
+((COUNT_MISC = 0 AND SUM_TIMER_MISC = 0)
+ OR
+(COUNT_MISC > 0));
+if(`SELECT COUNT(*) FROM mysqltest.socket_summary_by_instance_detail
+ WHERE NOT ( $my_rules ) `)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE NOT ( $my_rules )
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE, STATEMENT, RUN;
+ let $print_details= 1;
+}
+
+--echo # 4.2 Results must be stable
+#==========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_WRITE = 13
+ WHERE statement LIKE '%WHERE col1 = 3'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE '%client_connection'
+ LIMIT 1;
+ --disable_info
+}
+
+# eval
+# SELECT
+# $column_list
+# FROM mysqltest.socket_summary_by_instance_detail
+# WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+# ORDER BY EVENT_NAME, statement,run;
+
+# In case we are able to wait all time till perfschema has finished the
+# maintenance of counters than the following must be valid.
+let $my_rules=
+COUNT(DISTINCT SUM_NUMBER_OF_BYTES_READ) = 1 AND
+COUNT(DISTINCT COUNT_WRITE) = 1 AND
+COUNT(DISTINCT SUM_NUMBER_OF_BYTES_WRITE) = 1;
+
+# In case we do not get the results somehow deterministic than we
+# we should go with the less strict check based on CV.
+#
+# Compute coefficient of variation (CV) to detect 'notable' variances in the
+# byte count and operation counts. The acceptable range for the CV is purely
+# subjective, however, the CV is a dimensionless quantity therefore valid
+# across platforms.
+# let $my_rules=
+# STD(COUNT_READ)/AVG(COUNT_READ) <= 0.2 AND
+# STD(SUM_NUMBER_OF_BYTES_READ)/AVG(SUM_NUMBER_OF_BYTES_READ) <= 0.2 AND
+# STD(COUNT_WRITE)/AVG(COUNT_WRITE) <= 0.2 AND
+# STD(SUM_NUMBER_OF_BYTES_WRITE)/AVG(SUM_NUMBER_OF_BYTES_WRITE) <= 0.2 AND
+# STD(COUNT_MISC)/AVG(COUNT_MISC) <= 0.4;
+
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+GROUP BY EVENT_NAME, statement
+HAVING NOT ($my_rules) ;
+if(`SELECT COUNT(statement) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for GROUP BY EVENT_NAME, statement
+ eval
+ SELECT $column_list
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND (EVENT_NAME, statement)
+ IN (SELECT EVENT_NAME, statement
+ $part)
+ ORDER BY EVENT_NAME, statement, run, OBJECT_INSTANCE_BEGIN;
+ let $print_details= 1;
+}
+
+--echo # 4.3 Counters must be 0 in client_connection for the default session
+--echo # Instrumenting is disabled since a long time and the counter were
+--echo # reset via TRUNCATE just after the disabling.
+#==========================================================================
+let $my_rules=
+COUNT_STAR = 0 AND SUM_TIMER_WAIT = 0
+AND
+COUNT_READ = 0 AND SUM_TIMER_READ = 0 AND SUM_NUMBER_OF_BYTES_READ = 0
+AND
+COUNT_WRITE = 0 AND SUM_TIMER_WRITE = 0 AND SUM_NUMBER_OF_BYTES_WRITE = 0
+AND
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+if(`SELECT COUNT(*) FROM performance_schema.socket_summary_by_instance
+ WHERE NOT ( $my_rules )
+ AND OBJECT_INSTANCE_BEGIN = @default_object_instance_begin`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ # Attention: We use here performance_schema.socket_summary_by_instance
+ # and not mysqltest.socket_summary_by_instance_detail.
+ # Therefore the convenient $column_list cannot be used.
+ eval
+ SELECT
+ COUNT_STAR, SUM_TIMER_WAIT,
+ COUNT_READ,SUM_TIMER_READ,SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE,SUM_TIMER_WRITE,SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC,SUM_TIMER_MISC
+ FROM performance_schema.socket_summary_by_instance
+ WHERE OBJECT_INSTANCE_BEGIN = @default_object_instance_begin;
+ let $print_details= 1;
+}
+
+#---------------------------------------------------------------------------
+
+--echo # 4.4 Check the differences caused by SQL statements
+--echo # 4.4.1 There must be no changes in counters of instances
+--echo # NOT LIKE '%client_connection' because everything gets charged
+--echo # into client_connection of the acting connection.
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_WRITE = 13
+ WHERE statement LIKE '%WHERE col1 = 3'
+ AND EVENT_NAME NOT LIKE '%client_connection'
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_READ = 0 AND SUM_TIMER_READ = 0 AND SUM_NUMBER_OF_BYTES_READ = 0
+AND
+COUNT_WRITE = 0 AND SUM_TIMER_WRITE = 0 AND SUM_NUMBER_OF_BYTES_WRITE = 0
+AND
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+ WHERE NOT ( $my_rules )
+ AND EVENT_NAME NOT LIKE '%client_connection'
+ AND statement NOT LIKE 'Connect%';
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN, statement, run;
+ let $print_details= 1;
+}
+
+--echo # 4.4.2 In case of SELECT and our scenarios even COUNT_READ and COUNT_MISC
+--echo # are stable.
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_READ = 13
+ WHERE statement LIKE '%WHERE col1 = 3'
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT(DISTINCT COUNT_READ) = 1 AND
+COUNT(DISTINCT COUNT_MISC) = 1;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement NOT LIKE '%Connect%'
+GROUP BY EVENT_NAME, statement
+HAVING NOT ($my_rules) ;
+if(`SELECT COUNT(statement) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for GROUP BY EVENT_NAME, statement
+ eval
+ SELECT $column_list
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND (EVENT_NAME, statement)
+ IN (SELECT EVENT_NAME, statement
+ $part)
+ ORDER BY EVENT_NAME, statement, run, OBJECT_INSTANCE_BEGIN;
+ let $print_details= 1;
+}
+
+--echo # 4.4.3 In our testing scenarios we get for the client_connection entry
+--echo # of the acting connection
+--echo # -> OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+--echo # COUNT_MISC = 0 AND SUM_TIMER_MISC = 0
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_MISC = 13
+ WHERE statement LIKE '%WHERE col1 = 3'
+ AND EVENT_NAME LIKE '%client_connection'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE NOT ( $my_rules )
+ AND EVENT_NAME LIKE '%client_connection'
+ AND statement NOT LIKE 'Connect%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN, statement, run;
+ let $print_details= 1;
+}
+
+# Initialize variables
+let $my_rules= my_rules_not_set;
+let $stmt1= stmt1_not_set;
+let $stmt2= stmt2_not_set;
+# $title_prefix is used for the generation of titles
+let $title_prefix= 4.4;
+# $check_num is used for the generation of titles and gets incremented after
+# every call of the current script.
+let $check_num= 4;
+# $column_list is used for the generation of error information and valid for
+# every sub test.
+let $diff_column_list=
+t2.COUNT_READ - t1.COUNT_READ AS D_COUNT_READ,
+t2.COUNT_READ AS S2_COUNT_READ,
+t1.COUNT_READ AS S1_COUNT_READ,
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ AS D_SUM_NUMBER_OF_BYTES_READ,
+t2.SUM_NUMBER_OF_BYTES_READ AS S2_SUM_NUMBER_OF_BYTES_READ,
+t1.SUM_NUMBER_OF_BYTES_READ AS S1_SUM_NUMBER_OF_BYTES_READ,
+t2.COUNT_WRITE - t1.COUNT_WRITE AS D_COUNT_WRITE,
+t2.COUNT_WRITE AS S2_COUNT_WRITE,
+t1.COUNT_WRITE AS S1_COUNT_WRITE,
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE AS D_SUM_NUMBER_OF_BYTES_WRITE,
+t2.SUM_NUMBER_OF_BYTES_WRITE AS S2_SUM_NUMBER_OF_BYTES_WRITE,
+t1.SUM_NUMBER_OF_BYTES_WRITE AS S1_SUM_NUMBER_OF_BYTES_WRITE,
+t2.COUNT_MISC - t1.COUNT_MISC AS D_COUNT_MISC,
+t2.COUNT_MISC AS S2_COUNT_MISC,
+t1.COUNT_MISC AS S1_COUNT_MISC;
+# $part is used for the generation of "check" statements + error information
+# and valid for every sub test.
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail t1
+JOIN mysqltest.socket_summary_by_instance_detail t2
+USING (EVENT_NAME, OBJECT_INSTANCE_BEGIN, run)
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND run = 1;
+
+--echo # Check the differences between changes caused by SQL statements
+--echo # These differences must correspond to parameters like
+--echo # - statement, table name or column name length
+--echo # - number of rows in result set, size of rows in result set etc.
+# --> Statement NOT LIKE '%Connect%'
+
+let stmt1= SELECT col2 FROM does_not_exist;
+let stmt2= SELECT col2 FROM does_not_exist WHERE col1 = 0;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 36 1 59 1 SELECT col2 FROM does_not_exist
+# 3 51 1 59 1 SELECT col2 FROM does_not_exist WHERE col1 = 0
+# The string of the statement gets charged into SUM_NUMBER_OF_BYTES_READ.
+# The server error message gets charged into SUM_NUMBER_OF_BYTES_WRITE.
+let $msg=
+# One statement is longer than the other.
+# Both statements fail with the same error message (table does not exist);
+#
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE = 0 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt1= SELECT col2 FROM does_not_exist WHERE col1 = 0;
+let $stmt2= SELECT col2 FROM does_not_exist WHERE col1 A 0;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 51 1 59 1 SELECT col2 FROM does_not_exist WHERE col1 = 0
+# 3 51 1 162 1 SELECT col2 FROM does_not_exist WHERE col1 A 0
+let $msg=
+# Both statements have the same length and fail.
+# The length of the error messages differs.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE > 0 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt1= SELECT col2 FROM does_not_exist;
+let $stmt2= SELECT col2 FROM does_not_exist0123;
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 36 1 59 1 SELECT col2 FROM does_not_exist
+# 3 40 1 63 1 SELECT col2 FROM does_not_exist0123
+let $msg=
+# Both statements fail (table does not exist).
+# The length of the statement and the length of the error messages differs.
+# Reason for both differences is the length of the table name.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+# Assuming that some new check should be added.
+# How to enforce that a lot info is printed so that it becomes easy to derive
+# the right value for $my_rules?
+#----------------------------------------------------------------------------
+# let $my_rules= 0;
+# This will cause that suite/perfschema/include/socket_check1.inc concludes that
+# the check via $my_rules failed and it will print debug information.
+# let $stmt1= SELECT col2 FROM does_not_exist WHERE col1 = 0;
+# let $stmt2= SELECT col2 FROM does_not_exist WHERE col1 A 0;
+# let $my_rules= 0;
+# --source ../include/socket_check1.inc
+
+let $stmt2= SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1;
+let $stmt1= SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 54 1 78 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1
+# 3 70 1 86 1 SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1
+let $msg=
+# Both statements get an empty result set.
+# The length of the statements and the length of the result sets differs.
+# Reason for both differences is the length of the some column name.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE = LENGTH('my_super_col') - LENGTH('col2') AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt2= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+let $stmt1= SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# t1 3 54 1 78 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1
+# t2 3 53 1 83 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+let $msg=
+# Both statements differ in the statement length.
+# One statement earns an empty result set.
+# The other statement earns one row containing an empty string.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t1.SUM_NUMBER_OF_BYTES_READ - t2.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt1') - LENGTH('$stmt2') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE > 0 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt2= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2;
+let $stmt1= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 53 1 83 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# 3 53 1 84 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2
+let $msg=
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns one row containing a string 1 byte long.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE = 1 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt2= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3;
+let $stmt1= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 53 1 83 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# 3 53 1 1109 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3
+let $msg=
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns one row containing a string 1024 byte long.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE >= 1024 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt2= SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2;
+let $stmt1= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# t1 3 53 1 83 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# t2 3 53 1 88 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2
+let $msg=
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns two rows containing an empty string.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE > 0 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+--echo # 4.5 Check the differences caused by Connects
+--echo # Attention: Succesful Connects run an additional "DO 1".
+--echo # 4.5.1 Connects do not charge anything into READ or WRITE counters
+--echo # of the instance with EVENT_NAME NOT LIKE ('%client_connection%').
+--echo # This mean all these counters must be 0.
+let $my_rules=
+COUNT_READ = 0 AND SUM_TIMER_READ = 0 AND SUM_NUMBER_OF_BYTES_READ = 0 AND
+COUNT_WRITE = 0 AND SUM_TIMER_WRITE = 0 AND SUM_NUMBER_OF_BYTES_WRITE = 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%')
+ AND EVENT_NAME NOT LIKE ('%client_connection%')
+ AND NOT ( $my_rules );
+if(`SELECT COUNT(*) $part `)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.2 Connects using for host the value 'localhost'
+--echo # 4.5.2.1 For the instance with EVENT_NAME LIKE '%server_tcpip_socket'
+--echo # COUNT_MISC = 0 AND SUM_TIMER_MISC = 0 must be valid
+--echo # because we run through server_unix_socket.
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_MISC = 13
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%localhost%')
+ AND EVENT_NAME LIKE ('%server_tcpip_socket%')
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%localhost%')
+ AND EVENT_NAME LIKE ('%server_tcpip_socket%')
+ AND NOT ( $my_rules );
+if(`SELECT COUNT(*) $part `)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.2.2 For the instance with EVENT_NAME LIKE '%server_unix_socket'
+--echo # COUNT_MISC > 0 must be valid.
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_MISC = 0
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%localhost%')
+ AND EVENT_NAME LIKE ('%server_unix_socket%')
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_MISC > 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%localhost%')
+ AND EVENT_NAME LIKE ('%server_unix_socket%')
+ AND NOT ( $my_rules );
+if(`SELECT COUNT(*) $part `)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.3 Connects using for host a value <> 'localhost'
+--echo # 4.5.3.1 For the instance with EVENT_NAME LIKE '%server_unix_socket'
+--echo # COUNT_MISC = 0 AND SUM_TIMER_MISC = 0 must be valid
+--echo # because we run through server_tcpip_socket.
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ eval
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_MISC = 13
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%server_unix_socket%')
+ AND statement LIKE ('%Connect%$my_localhost%')
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%$my_localhost%')
+ AND EVENT_NAME LIKE ('%server_unix_socket%')
+ AND NOT ( $my_rules );
+if(`SELECT COUNT(*) $part `)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.3.2 For the instance with EVENT_NAME LIKE '%server_tcpip_socket'
+--echo # COUNT_MISC > 0 must be valid.
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ eval
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_MISC = 0
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%$my_localhost%')
+ AND EVENT_NAME LIKE ('%server_tcpip_socket%')
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_MISC > 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%$my_localhost%')
+ AND EVENT_NAME LIKE ('%server_tcpip_socket%')
+ AND NOT ( $my_rules );
+if(`SELECT COUNT(*) $part `)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.4 Failing Connects do not cause any row with EVENT_NAME
+--echo # LIKE '%client_connection'
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ eval
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET statement = 'Connect boot '
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('Connect%root%')
+ AND EVENT_NAME LIKE ('%client_connection')
+ LIMIT 1;
+ --disable_info
+}
+
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('Connect%boot%')
+ AND EVENT_NAME LIKE ('%client_connection');
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect that there are no rows because
+ --echo # - failing connects do not cause a row with "client_connection"
+ --echo # - all failing connects contain a user name LIKE '%boot%'
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.5 Successful Connects cause a new instance with EVENT_NAME
+--echo # LIKE '%client_connection'
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ DELETE
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE EVENT_NAME LIKE ('%client_connection')
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('Connect%root%')
+ LIMIT 1;
+ --disable_info
+}
+
+# - connects which should be successful have statement LIKE ('Connect%root%').
+# - We try every type of Connect $loop_rounds times.
+# Therefore we should find $loop_rounds rows with
+# - EVENT_NAME LIKE ('%client_connection')
+# AND
+# - OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+# We do not want to count the entry of belonging to the default connection.
+# AND
+# - statement LIKE ('Connect%root%')
+# The connects which should be successful.
+#
+let $my_rules=
+COUNT(*) = $loop_rounds;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE EVENT_NAME LIKE ('%client_connection')
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('Connect%root%')
+GROUP BY statement
+HAVING NOT ( $my_rules );
+
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for GROUP BY statement
+ --echo #
+ eval
+ SELECT
+ $column_list
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE EVENT_NAME LIKE ('%client_connection')
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement IN
+ (SELECT statement
+ $part);
+ let $print_details= 1;
+}
+
+--echo # 4.6 Check the differences caused by Connects
+--echo # - INSTANCES with an EVENT_NAME like server_tcpip_socket or
+--echo # server_unix_socket are already checked
+--echo # - the stability of results is already checked
+--echo # So we con go with the results of the first run.
+
+# Typical content of mysqltest.socket_summary_by_instance_detail
+#
+# eval
+# SELECT $column_list
+# FROM mysqltest.socket_summary_by_instance_detail
+# WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+# AND EVENT_NAME LIKE ('%client_connection')
+# AND statement LIKE ('Connect%')
+# AND run = 1
+# ORDER BY event_name,statement, run;
+# CREAD TREAD BREAD CWRITE TWRITE BWRITE CMISC TMISC STATEMENT
+# 4 6149616 79 3 34008480 117 3 38914128 Connect (con*,::ffff:127.0.0.1,root,,mysqltest,,)
+# 4 7012368 84 3 10112256 117 2 43067376 Connect (con*,localhost,root,,mysqlsupertest,,)
+# 4 7172880 79 3 10247688 117 2 40128000 Connect (con*,localhost,root,,mysqltest,,)
+# 4 6706392 85 3 15509472 117 2 34851168 Connect (con*,localhost,root012345,,mysqltest,,)
+# 4 10543632 89 3 10578744 117 2 39460872 Connect (con*,localhost,root0123456789,,mysqltest,,)
+
+--echo # 4.6.1 The SUM_OF_BYTES_WRITE value is the same for all Connects.
+#========================================================================
+let $my_rules= COUNT(DISTINCT SUM_NUMBER_OF_BYTES_WRITE) = 1;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND statement LIKE ('Connect%')
+ AND run = 1;
+if(`SELECT NOT ( $my_rules) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for all Connects
+ --echo #
+ eval
+ SELECT
+ statement, SUM_NUMBER_OF_BYTES_WRITE
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.6.2 The SUM_OF_BYTES_WRITE value hast to be > 100.
+#============================================================
+let $my_rules= SUM_NUMBER_OF_BYTES_WRITE > 100;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND statement LIKE ('Connect%')
+ AND NOT ( $my_rules )
+ AND run = 1;
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for all Connects
+ --echo #
+ eval
+ SELECT
+ statement, SUM_NUMBER_OF_BYTES_WRITE
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.6.3 COUNT_READ, COUNT_WRITE and COUNT_MISC have to be to be > 0
+#=========================================================================
+let $my_rules=
+COUNT_READ > 0 AND COUNT_WRITE > 0 AND COUNT_MISC > 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND statement LIKE ('Connect%')
+ AND NOT ( $my_rules )
+ AND run = 1;
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for all Connects
+ --echo #
+ eval
+ SELECT
+ statement, COUNT_READ, COUNT_WRITE, COUNT_MISC
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.6.4 Checks based on comparison of results for connects
+let $part0=
+FROM mysqltest.socket_summary_by_instance_detail t1
+JOIN mysqltest.socket_summary_by_instance_detail t2
+USING (EVENT_NAME, run)
+WHERE EVENT_NAME LIKE ('%client_connection')
+ AND run = 1
+ AND t2.OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND t1.OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
+let $part1=
+SELECT RPAD(statement,55,' ') AS STATEMENT,
+ LENGTH(statement), SUM_NUMBER_OF_BYTES_READ
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND run = 1;
+
+
+--echo # 4.6.4 The user name length affects the SUM_OF_BYTES_READ value
+#======================================================================
+# CREAD TREAD BREAD CWRITE TWRITE BWRITE CMISC TMISC STATEMENT
+# 4 6706392 85 3 15509472 117 2 34851168 Connect (con*,localhost,root012345,,mysqltest,,)
+# 4 10543632 89 3 10578744 117 2 39460872 Connect (con*,localhost,root0123456789,,mysqltest,,)
+let $stmt2= Connect (con*,localhost,root0123456789,,mysqltest,,);
+let $stmt1= Connect (con*,localhost,root012345,,mysqltest,,);
+let $my_rules=
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1');
+if(`SELECT NOT ($my_rules)
+ $part0
+ AND t2.statement = '$stmt2'
+ AND t1.statement = '$stmt1'`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ $part1
+ AND statement IN('$stmt2','$stmt1');
+ let $print_details= 1;
+}
+
+--echo # 4.6.5 The database name length affects the SUM_OF_BYTES_READ value
+#==========================================================================
+# CREAD TREAD BREAD CWRITE TWRITE BWRITE CMISC TMISC STATEMENT
+# 4 7012368 84 3 10112256 117 2 43067376 Connect (con*,localhost,root,,mysqlsupertest,,)
+# 4 7172880 79 3 10247688 117 2 40128000 Connect (con*,localhost,root,,mysqltest,,)
+let $stmt2= Connect (con*,localhost,root,,mysqlsupertest,,);
+let $stmt1= Connect (con*,localhost,root,,mysqltest,,);
+let $my_rules=
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1');
+if(`SELECT NOT ($my_rules)
+ $part0
+ AND t2.statement = '$stmt2'
+ AND t1.statement = '$stmt1'`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ $part1
+ AND statement IN('$stmt2','$stmt1');
+ let $print_details= 1;
+}
+
+--echo # 5. Check the impact of TRUNCATE on socket_summary_by_instance.
+--echo # It must reset all counters.
+#=======================================================================
+# We do not need to check if the majority of counters is <> 0 because if
+# we ever hit such a bad state than a lot of the preceding checks would
+# have already failed and reported this.
+TRUNCATE TABLE performance_schema.socket_summary_by_instance;
+let $my_rules=
+COUNT_STAR = 0 AND SUM_TIMER_WAIT = 0
+AND
+COUNT_READ = 0 AND SUM_TIMER_READ = 0 AND SUM_NUMBER_OF_BYTES_READ = 0
+AND
+COUNT_WRITE = 0 AND SUM_TIMER_WRITE = 0 AND SUM_NUMBER_OF_BYTES_WRITE = 0
+AND
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+if(`SELECT COUNT(*) FROM performance_schema.socket_summary_by_instance
+ WHERE NOT ( $my_rules )
+ AND OBJECT_INSTANCE_BEGIN = @default_object_instance_begin`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ COUNT_STAR, SUM_TIMER_WAIT,
+ COUNT_READ,SUM_TIMER_READ,SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE,SUM_TIMER_WRITE,SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC,SUM_TIMER_MISC
+ FROM performance_schema.socket_summary_by_instance
+ WHERE OBJECT_INSTANCE_BEGIN = @default_object_instance_begin;
+}
+
+
+if($print_details)
+{
+ --enable_query_log
+ --enable_result_log
+ --horizontal_results
+ --echo # Dump detailed differences after - before statement execution
+ --echo # 1. The statement executing connection and hopefully noone else
+ SELECT @default_object_instance_begin;
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ COUNT_READ, SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE, SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC, statement
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ ORDER BY statement, run;
+ --echo # 2. The connection default
+ SELECT EVENT_NAME,
+ COUNT_READ, SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE, SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC, statement
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE OBJECT_INSTANCE_BEGIN = @default_object_instance_begin
+ ORDER BY statement,run;
+ --echo # 3. The "server_unix_socket"
+ # WHERE OBJECT_INSTANCE_BEGIN = @default_object_instance_begin
+ SELECT EVENT_NAME,
+ COUNT_READ, SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE, SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC, statement
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE EVENT_NAME LIKE '%server_unix_socket%'
+ ORDER BY statement,run;
+ --echo # 4. The "server_tcpip_socket"
+ SELECT EVENT_NAME,
+ COUNT_READ, SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE, SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC, statement
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE EVENT_NAME LIKE '%server_tcpip_socket%'
+ ORDER BY statement,run;
+ --echo # 5. mysqltest.my_socket_summary_by_instance
+ --vertical_results
+ SELECT * FROM mysqltest.my_socket_summary_by_instance;
+ --horizontal_results
+}
+
+--echo # 6. Cleanup
+#==================
+# Cleanup
+--disable_query_log
+eval
+UPDATE performance_schema.setup_timers
+SET TIMER_NAME = '$wait_timer'
+WHERE NAME = 'wait';
+DROP SCHEMA mysqltest;
+DROP SCHEMA mysqlsupertest;
+--connection con1
+--disconnect con1
+--source include/wait_until_disconnected.inc
+--connection default
+--enable_query_log
+
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
new file mode 100644
index 00000000000..c7ca254d5bb
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test
@@ -0,0 +1,1722 @@
+# Some functional checks for the content of the performance_schema table
+# socket_summary_by_instance.
+#
+# Created: mleich 2011-07-01
+#
+# Rough description of "What is when tested"
+# 1. Impact of successful connect
+# A new row with EVENT_NAME "client_connection" shows up
+# is tested in 0 and 4.5.
+# 2. Impact of disconnect
+# A row with EVENT_NAME "client_connection" disappears
+# is tested in 0. and 2.
+# 3. Disabling the instrumentation for some thread causes that the
+# counter for this thread become static is tested in 4.3.
+# Nearby the beginning of this test and somewhere in the middle.
+# 4. TRUNCATE table resets the counters is tested in 5.
+# 5. Consistency within a row like MIN_* <= AVG_* <= MAX_*
+# -> include/socket_summary_check.inc which is called at
+# various places
+# 6. Consistency of the instances mentioned in socket_summary_by_event
+# and socket_summary_by_instance is checked per call of
+# include/socket_summary_check.inc
+# 7. Check if changes in counters of instances caused by actions
+# are reasonable is tested for
+# - Connects+SQL statements in 4.1 and 4.2
+# - SQL statements in 4.4
+# - Connects in 4.5
+#
+
+# Embedded server does not support the performance_schema.
+--source include/not_embedded.inc
+
+# Windows platforms only
+--source include/windows.inc
+--source include/have_perfschema.inc
+
+# The values in the performance_schema tables depend on how much communication
+# 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
+
+
+#===================================
+# Set IP address defaults with respect to IPV6 support
+#
+# Set this to enable debugging output
+let $my_socket_debug= 0;
+#
+# Determine if IPV6 supported
+#
+let $check_ipv6_just_check= 1;
+--source include/check_ipv6.inc
+#
+# Determine if IPV4 mapped to IPV6 supported
+#
+let $check_ipv4_mapped_just_check= 1;
+--source include/check_ipv4_mapped.inc
+#
+# Set the localhost IP default to use when establishing connections
+let $my_localhost=127.0.0.1;
+if($check_ipv6_supported)
+{
+ let $my_localhost=::1;
+}
+if($check_ipv4_mapped_supported)
+{
+ let $my_localhost=::ffff:127.0.0.1;
+}
+#
+let $my_socket_debug= 0;
+if($my_socket_debug)
+{
+ --echo IPV6=$check_ipv6_supported, IPV4_MAPPED = $check_ipv4_mapped_supported, LOCALHOST = $my_localhost
+}
+#===================================
+
+--echo # The logging of commands and result sets is mostly disabled.
+--echo # There are some messages which help to observe the progress of the test.
+--echo # In case some check fails
+--echo # - a message about this will be printed
+--echo # - some SQL commands which show the unexpected state will be executed
+--echo # (logging enabled)
+--echo # - the test might abort
+--echo #
+
+--disable_query_log
+
+--echo # 0. Check, build or set prequisites
+#==========================================
+# Set $print_details to 1 in case you want that the exact diffs caused
+# by the execution of a statement get printed.
+# Disadvantage of printing details:
+# Even minor legimitate changes of the client - server communication can
+# cause that the test needs maintenance.
+# Advantage:
+# More thorough checks.
+# If any of the checks detects some suspicious/unexpected state than
+# $print_details will be automatically switched to 1.
+#
+let $print_details= 0;
+
+#
+# Number of attempts within the test checking the stability of counter changes.
+#
+let $loop_rounds= 10;
+
+# This test of PERFORMANCE_SCHEMA functionality is very vulnerable.
+# Ensure that we have in the moment exact one
+# - connection
+# - instance with EVENT_NAME LIKE '%client_connection'
+# - instance with EVENT_NAME LIKE '%server_tcpip_socket'
+# - instance with EVENT_NAME LIKE '%server_unix_socket'
+#=======================================================
+let $my_rules= COUNT(*) = 1;
+let $part=
+FROM performance_schema.threads
+WHERE NAME LIKE '%one_connection';
+let $wait_condition=
+SELECT $my_rules $part;
+let $wait_timeout= 5;
+--source include/wait_condition.inc
+if(!$success)
+{
+ --echo # ERROR: There must be only one user connection
+ eval
+ SELECT * $part;
+ --echo # abort
+ die;
+}
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection';
+let $wait_condition=
+SELECT $my_rules $part;
+let $wait_timeout= 5;
+--source include/wait_condition.inc
+if(!$success)
+{
+ --echo # ERROR: There must be only one instance with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ die;
+}
+# DISABLED FOR WINDOWS
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%server_unix_socket';
+let $wait_condition=
+SELECT $my_rules $part;
+let $wait_timeout= 5;
+#--source include/wait_condition.inc
+#if(!$success)
+#{
+# --echo # ERROR: There must be only one instance with this EVENT_NAME.
+# eval
+# SELECT * $part;
+# --echo # abort
+# die;
+#}
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%server_tcpip_socket';
+let $wait_condition=
+SELECT $my_rules $part;
+let $wait_timeout= 5;
+--source include/wait_condition.inc
+if(!$success)
+{
+ --echo # ERROR: There must be only one instance with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ die;
+}
+
+--disable_query_log
+
+#
+# Lower the resolution of the wait timer from the default 'CYCLE'
+# to 'NANOSECOND'.
+# Hint: The timer columns contains values in picoseconds independent
+# of the timer resolution.
+# The timer resolution has an impact on the precision of the value.
+# This should prevent the failures seen on some suspicious PB boxes where
+# - calculations exceeded the BIGINT UNSIGNED (data type of the counter columns)
+# value range.
+# - we have reached from whatever reason 20 digit values
+# The consequence for the current test is the following:
+# The common sense rule
+# In case COUNT_<A> increases than SUM_TIMER_<A> must also increase
+# is no more valid because some action might need less time than the
+# timer resolution.
+#
+let $wait_timer= `SELECT TIMER_NAME FROM performance_schema.setup_timers
+ WHERE NAME = 'wait'`;
+UPDATE performance_schema.setup_timers
+SET TIMER_NAME = 'NANOSECOND'
+WHERE NAME = 'wait';
+
+#
+# Additional SCHEMA used for
+# - detection of our "worker" session within the PROCESSLIST.
+# No other connection should use this schema as default schema.
+# - easy cleanup because auxiliary objects are stored there
+#
+CREATE SCHEMA mysqltest;
+CREATE SCHEMA mysqlsupertest;
+
+#
+# Clear summary tables of previous entries
+#
+TRUNCATE performance_schema.socket_summary_by_instance;
+TRUNCATE performance_schema.socket_summary_by_event_name;
+# Disable instrumenting of the current default session.
+# Required for check 1.1
+UPDATE performance_schema.threads
+SET INSTRUMENTED='NO' WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+#
+# Auxiliary tables for storing current values at certain points of time.
+# We store states of performance_schema.socket_summary_by_instance here
+# in order
+# - to have initial values from before some action
+# - to minimize the impact of statements used for the checks on results.
+# CREATE TEMPORARY TABLE my_socket_summary_by_instance AS
+# would be nice but some statements are not supported for temporary tables.
+#
+# DECIMAL(60,0) is used instead of BIGINT UNSIGNED. The goal is to prevent
+# errors during calculations
+# Example:
+# - A and B UNSIGNED BIGINT
+# - A < B
+# - A - B ---> Error
+# though the columns in all queries are orderd to avoid this too.
+#
+CREATE TABLE mysqltest.my_socket_summary_by_instance (
+ EVENT_NAME varchar(128) NOT NULL,
+ OBJECT_INSTANCE_BEGIN bigint(20) unsigned NOT NULL,
+ COUNT_STAR DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_WAIT DECIMAL(60,0) NOT NULL,
+ MIN_TIMER_WAIT DECIMAL(60,0) NOT NULL,
+ AVG_TIMER_WAIT DECIMAL(60,0) NOT NULL,
+ MAX_TIMER_WAIT DECIMAL(60,0) NOT NULL,
+ COUNT_READ DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_READ DECIMAL(60,0) NOT NULL,
+ MIN_TIMER_READ DECIMAL(60,0) NOT NULL,
+ AVG_TIMER_READ DECIMAL(60,0) NOT NULL,
+ MAX_TIMER_READ DECIMAL(60,0) NOT NULL,
+ SUM_NUMBER_OF_BYTES_READ DECIMAL(60,0) NOT NULL,
+ COUNT_WRITE DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_WRITE DECIMAL(60,0) NOT NULL,
+ MIN_TIMER_WRITE DECIMAL(60,0) NOT NULL,
+ AVG_TIMER_WRITE DECIMAL(60,0) NOT NULL,
+ MAX_TIMER_WRITE DECIMAL(60,0) NOT NULL,
+ SUM_NUMBER_OF_BYTES_WRITE DECIMAL(60,0) NOT NULL,
+ COUNT_MISC DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_MISC DECIMAL(60,0) NOT NULL,
+ MIN_TIMER_MISC DECIMAL(60,0) NOT NULL,
+ AVG_TIMER_MISC DECIMAL(60,0) NOT NULL,
+ MAX_TIMER_MISC DECIMAL(60,0) NOT NULL,
+ pk VARCHAR(20),
+ PRIMARY KEY(pk, EVENT_NAME, OBJECT_INSTANCE_BEGIN)
+) DEFAULT CHARSET=utf8;
+
+
+# The CAST(... AS DECIMAL(60,0)) prevents errors which might show up in case
+# we run with the original data type UNSIGNED BIGINT.
+CREATE TABLE mysqltest.socket_summary_by_instance_detail (
+ EVENT_NAME varchar(128) NOT NULL,
+ OBJECT_INSTANCE_BEGIN bigint(20) unsigned NOT NULL,
+ COUNT_READ DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_READ DECIMAL(60,0) NOT NULL,
+ SUM_NUMBER_OF_BYTES_READ DECIMAL(60,0) NOT NULL,
+ COUNT_WRITE DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_WRITE DECIMAL(60,0) NOT NULL,
+ SUM_NUMBER_OF_BYTES_WRITE DECIMAL(60,0) NOT NULL,
+ COUNT_MISC DECIMAL(60,0) NOT NULL,
+ SUM_TIMER_MISC DECIMAL(60,0) NOT NULL,
+ statement VARCHAR(500),
+ run INTEGER
+) DEFAULT CHARSET=utf8;
+
+#
+# Auxiliary SQL functions used to shorten some commands.
+#
+CREATE FUNCTION mysqltest.min_of_triple
+ (f1 DECIMAL(60,0), f2 DECIMAL(60,0), f3 DECIMAL(60,0))
+ RETURNS DECIMAL(60,0)
+ RETURN IF(IF(f1 < f2,f1,f2) < f3,IF(f1 < f2,f1,f2), f3);
+CREATE FUNCTION mysqltest.max_of_triple
+ (f1 DECIMAL(60,0), f2 DECIMAL(60,0), f3 DECIMAL(60,0))
+ RETURNS DECIMAL(60,0)
+ RETURN IF(IF(f1 > f2,f1,f2) > f3,IF(f1 > f2,f1,f2), f3);
+
+#
+# Auxiliary table for experiments with SELECTs earning different result sets.
+#
+CREATE TABLE mysqltest.my_aux (col1 INTEGER, col2 VARCHAR(1024), PRIMARY KEY(col1));
+INSERT INTO mysqltest.my_aux SET col1 = 0, col2 = REPEAT('a',0);
+INSERT INTO mysqltest.my_aux SET col1 = 1, col2 = REPEAT('a',0);
+INSERT INTO mysqltest.my_aux SET col1 = 2, col2 = REPEAT('a',1);
+INSERT INTO mysqltest.my_aux SET col1 = 3, col2 = REPEAT('a',1024);
+
+#
+# Auxiliary mysqltest variables used to shorten commands and to ensure
+# that we run all time the right operation.
+#
+let $truncate=
+TRUNCATE TABLE mysqltest.my_socket_summary_by_instance;
+#
+let $insert_before=
+INSERT INTO mysqltest.my_socket_summary_by_instance
+SELECT *,'Before' FROM performance_schema.socket_summary_by_instance;
+#
+let $insert_after=
+INSERT INTO mysqltest.my_socket_summary_by_instance
+SELECT *,'After' FROM performance_schema.socket_summary_by_instance;
+#
+let $insert_pseudo_before=
+INSERT INTO mysqltest.my_socket_summary_by_instance
+(EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+COUNT_STAR, SUM_TIMER_WAIT, MIN_TIMER_WAIT, AVG_TIMER_WAIT, MAX_TIMER_WAIT,
+COUNT_READ, SUM_TIMER_READ, MIN_TIMER_READ, AVG_TIMER_READ, MAX_TIMER_READ,
+SUM_NUMBER_OF_BYTES_READ,
+COUNT_WRITE, SUM_TIMER_WRITE, MIN_TIMER_WRITE, AVG_TIMER_WRITE, MAX_TIMER_WRITE,
+SUM_NUMBER_OF_BYTES_WRITE,
+COUNT_MISC, SUM_TIMER_MISC, MIN_TIMER_MISC, AVG_TIMER_MISC, MAX_TIMER_MISC,
+pk)
+SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+0, 0, 0, 0, 0,
+0, 0, 0, 0, 0,
+0,
+0, 0, 0, 0, 0,
+0,
+0, 0, 0, 0, 0,
+'Pseudo_Before'
+FROM mysqltest.my_socket_summary_by_instance t1
+WHERE OBJECT_INSTANCE_BEGIN NOT IN
+ (SELECT OBJECT_INSTANCE_BEGIN
+ FROM mysqltest.my_socket_summary_by_instance t2
+ WHERE pk = 'Before');
+#
+let $insert_delta=
+INSERT INTO mysqltest.socket_summary_by_instance_detail
+ (EVENT_NAME,OBJECT_INSTANCE_BEGIN,
+ COUNT_READ, SUM_TIMER_READ, SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE,SUM_TIMER_WRITE,SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC, SUM_TIMER_MISC, statement,run)
+SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,
+ t1.COUNT_READ - t2.COUNT_READ,
+ t1.SUM_TIMER_READ - t2.SUM_TIMER_READ,
+ t1.SUM_NUMBER_OF_BYTES_READ - t2.SUM_NUMBER_OF_BYTES_READ,
+ t1.COUNT_WRITE - t2.COUNT_WRITE,
+ t1.SUM_TIMER_WRITE - t2.SUM_TIMER_WRITE,
+ t1.SUM_NUMBER_OF_BYTES_WRITE - t2.SUM_NUMBER_OF_BYTES_WRITE,
+ t1.COUNT_MISC - t2.COUNT_MISC,
+ t1.SUM_TIMER_MISC - t2.SUM_TIMER_MISC,
+ NULL,NULL
+FROM mysqltest.my_socket_summary_by_instance t1
+JOIN mysqltest.my_socket_summary_by_instance t2
+USING (EVENT_NAME,OBJECT_INSTANCE_BEGIN)
+WHERE t1.pk = 'After' AND t2.pk LIKE '%Before';
+#
+let $get_object_instance_begin=
+SELECT OBJECT_INSTANCE_BEGIN INTO @con1_object_instance_begin
+FROM performance_schema.socket_summary_by_instance AS t1
+WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN)
+ NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN
+ FROM mysqltest.my_socket_summary_by_instance AS t2
+ WHERE pk = 'Before');
+
+# Use this whenever you print data.
+let $column_list=
+RPAD(EVENT_NAME, 38, ' ') AS EVENT_NAME,
+LPAD(OBJECT_INSTANCE_BEGIN, 20, ' ') AS OBJECT_INSTANCE,
+LPAD(COUNT_READ, 7, ' ') AS CREAD,
+LPAD(SUM_TIMER_READ, 12, ' ') AS TREAD,
+LPAD(SUM_NUMBER_OF_BYTES_READ, 7, ' ') AS BREAD,
+LPAD(COUNT_WRITE, 7, ' ') AS CWRITE,
+LPAD(SUM_TIMER_WRITE, 12, ' ') AS TWRITE,
+LPAD(SUM_NUMBER_OF_BYTES_WRITE, 7, ' ') AS BWRITE,
+LPAD(COUNT_MISC, 7, ' ') AS CMISC,
+LPAD(SUM_TIMER_MISC, 13, ' ') AS TMISC,
+RPAD(STATEMENT, 50, ' ') AS STATEMENT,
+LPAD(RUN, 5, ' ') AS RUN;
+
+# Determine OBJECT_INSTANCE_BEGIN of the connection default
+# which acts as the observer
+eval $truncate;
+eval $insert_before;
+--disconnect default
+--connect (default,localhost,root,,,,)
+# --echo ########### Disconnect/Connect
+# --enable_query_log
+eval $insert_after;
+eval $get_object_instance_begin;
+SET @default_object_instance_begin = @con1_object_instance_begin;
+
+# Wait till the old default connection has disappeared
+let $wait_timeout= 5;
+let $wait_condition=
+SELECT COUNT(*) = 1
+FROM performance_schema.threads
+WHERE processlist_user = 'root';
+--source include/wait_condition.inc
+--enable_query_log
+if (!$success)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # Error: The disconnect of the old default connection
+ --echo # (user = 'root') failed. We expect to have only one connection
+ --echo # with user = 'root'. And this is our current connection.
+ SELECT * FROM performance_schema.threads
+ WHERE processlist_user = 'root';
+ --echo # abort
+ die;
+}
+
+# Disable instrumenting of the current default session.
+# Required for check 1.2
+UPDATE performance_schema.threads
+SET INSTRUMENTED='NO' WHERE PROCESSLIST_ID = CONNECTION_ID();
+
+--echo # 1. Basic checks
+--echo # 1.1 Check that the entry of the disconnected old default session really
+--echo # disappeared from performance_schema.socket_summary_by_instance.
+#===============================================================================
+# This failed at some point in history when the instrumenting for the
+# session to be disconnected was disabled.
+if(`SELECT COUNT(*) FROM performance_schema.socket_summary_by_instance
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE '%client_connection'`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # Error: The disconnected old default session did not disappear from
+ --echo # socket_summary_by_instance.
+ SELECT * FROM performance_schema.socket_summary_by_instance
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE '%client_connection';
+}
+
+TRUNCATE TABLE performance_schema.socket_summary_by_instance;
+
+--echo # 1.2 Check the base line
+#===============================
+eval $truncate;
+--source ../include/socket_summary_check.inc
+
+# --disable_query_log
+# --disable_query_log
+
+--echo # 2. Variations on Connect
+let $is_connect= 1;
+--echo # 2.1 Connect fails because the user is unknown
+--echo # length of user name = 4 character
+--echo # length of default db = 9 character
+#========================================================================
+let $connect_host= localhost;
+let $connect_db= mysqltest;
+let $connect_user= boot;
+--source ../include/socket_event.inc
+
+--echo # 2.2 Connect fails because the user is unknown
+--echo # length of user name = 14 character (10 more than in 2.1)
+--echo # length of default db = 9 character
+#========================================================================
+let $connect_host= localhost;
+let $connect_db= mysqltest;
+let $connect_user= boot0123456789;
+--source ../include/socket_event.inc
+
+--echo # 2.3 Connect should pass, host = localhost
+--echo # length of user name = 4 character
+--echo # length of default db = 9 character
+#========================================================================
+let $connect_host= localhost;
+let $connect_db= mysqltest;
+let $connect_user= root;
+--source ../include/socket_event.inc
+
+--echo # 2.4 Connect should pass, host = localhost
+--echo # length of user name = 4 character
+--echo # length of default db = 14 character (5 more than 2.3)
+#========================================================================
+let $connect_host= localhost;
+let $connect_db= mysqlsupertest;
+let $connect_user= root;
+--source ../include/socket_event.inc
+
+--echo # 2.5 Connect should pass, host = localhost
+--echo # length of user name = 10 character
+--echo # length of default db = 9 character
+#========================================================================
+GRANT ALL PRIVILEGES ON *.* TO 'root012345'@'localhost';
+let $connect_host= localhost;
+let $connect_db= mysqltest;
+let $connect_user= root012345;
+--source ../include/socket_event.inc
+DROP USER 'root012345'@'localhost';
+
+--echo # 2.6 Connect should pass, host = localhost
+--echo # length of user name = 14 character
+--echo # length of default db = 9 character
+#========================================================================
+GRANT ALL PRIVILEGES ON *.* to 'root0123456789'@'localhost';
+let $connect_host= localhost;
+let $connect_db= mysqltest;
+let $connect_user= root0123456789;
+--source ../include/socket_event.inc
+DROP USER 'root0123456789'@'localhost';
+
+--echo # 2.7 Connect should pass, host = my_localhost
+--echo # length of user name = 4 character
+--echo # length of default db = 9 character
+--echo # connection runs through server_tcpip_socket !
+#========================================================================
+let $connect_host= $my_localhost;
+let $connect_db= mysqltest;
+let $connect_user= root;
+--source ../include/socket_event.inc
+
+#========================================================================
+--connect (con1,localhost,root,,mysqltest,,)
+# Experiments showed some unexpected result in the counter difference
+# which got con1 for the next statement (see 3.1).
+# The measured diff was too high and was probably caused by some
+# too much delayed counter maintenance for the connect.
+# We run here just some SQL statement because counter maintenance
+# for SQL statements is more fast and reliable than far Connect.
+DO 1;
+--connection default
+--source ../include/wait_till_sleep.inc
+--disable_query_log
+
+--echo # 3 Variations on SELECT
+# Attention: Don't use
+# - any double quotes within the statements because sourced scripts
+# already "decorate" $variables with double quotes
+# - UNION because this leads to result set related byte write
+# counters which cannot good compared to select without union
+let $is_connect= 0;
+eval $get_object_instance_begin;
+--echo # 3.1 Check a SELECT ending with server sending an error message.
+--echo # Error message is short (unknown table).
+#========================================================================
+let $statement= SELECT col2 FROM does_not_exist;
+--source ../include/socket_event.inc
+
+--echo # 3.2 SELECT ending with server sending an error message.
+--echo # Now the statement is a bit longer but the error message
+--echo # length does again not depend on statement.
+#=======================================================================
+let $statement= SELECT col2 FROM does_not_exist WHERE col1 = 0;
+--source ../include/socket_event.inc
+
+--echo # 3.3 SELECT ending with server sending an error message.
+--echo # The statement has the same length like in 3.2 but the error
+--echo # message is now different and much longer.
+#=======================================================================
+let $statement= SELECT col2 FROM does_not_exist WHERE col1 A 0;
+--source ../include/socket_event.inc
+
+--echo # 3.4 SELECT ending with server sending an error message.
+--echo # Statement and error message are a bit longer than in 3.1
+--echo # because the table name is longer.
+#=======================================================================
+let $statement= SELECT col2 FROM does_not_exist0123;
+--source ../include/socket_event.inc
+
+--echo # 3.5 SELECT earning an empty result set.
+#=======================================================
+let $statement= SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1;
+--source ../include/socket_event.inc
+
+--echo # 3.6 SELECT earning an empty result set.
+--echo # Short column name is replaced by longer alias.
+#==========================================================
+let $statement= SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1;
+--source ../include/socket_event.inc
+
+--echo # 3.7 SELECT earning one row with an empty string.
+#================================================================
+let $statement= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+--source ../include/socket_event.inc
+
+--echo # 3.8 SELECT earning one row with one string one char long.
+#=========================================================================
+let $statement= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2;
+--source ../include/socket_event.inc
+
+--echo # 3.9 SELECT earning one row with one string 1024 char long.
+#==========================================================================
+let $statement= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3;
+--source ../include/socket_event.inc
+
+--echo # 3.10 SELECT earning two rows with an empty string
+#==========================================================================
+let $statement= SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2;
+--source ../include/socket_event.inc
+
+--echo # 3.11 Check that the preceding Connects/SQL command runs have not
+--echo # caused some unexpected state.
+#==========================================================================
+let $my_rules= COUNT(*) = 2;
+let $part=
+FROM performance_schema.threads
+WHERE NAME LIKE '%one_connection';
+if(`SELECT NOT ( $my_rules ) $part `)
+{
+ --echo # ERROR: There must be only two user connections
+ eval
+ SELECT * $part;
+ --echo # abort
+ die;
+}
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%client_connection';
+if(`SELECT NOT ( $my_rules ) $part `)
+{
+ --echo # ERROR: There must be only two instances with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ die;
+}
+let $my_rules= COUNT(*) = 1;
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%server_unix_socket';
+#DISABLED FOR WINDOWS
+#if(`SELECT NOT ( $my_rules ) $part `)
+if (0)
+{
+ --echo # ERROR: There must be only one instance with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ die;
+}
+let $part=
+FROM performance_schema.socket_summary_by_instance
+WHERE EVENT_NAME LIKE '%server_tcpip_socket';
+if(`SELECT NOT ( $my_rules ) $part `)
+{
+ --echo # ERROR: There must be only one instance with this EVENT_NAME.
+ eval
+ SELECT * $part;
+ --echo # abort
+ die;
+}
+
+--echo # 4. Check delta (value_after_action - value_before_action) details
+# 4.0 . Negative deltas cannot have happened because the counter columns within
+# socket_summary_by_instance_detail are defined as UNSIGNED BIGINT.
+# = The INSERT which computes the diff would have been failed.
+--echo # 4.1 Check that
+--echo # - no change in COUNT_* leads to no change in
+--echo # SUM_TIMER_* and no change in SUM_NUMBER_OF_BYTES_*
+--echo # - increased COUNT_READ leads to increased
+--echo # SUM_NUMBER_OF_BYTES_READ
+--echo # - increased COUNT_WRITE leads to increased
+--echo # SUM_NUMBER_OF_BYTES_WRITE
+--echo # Attention:
+--echo # The time required for some action might be below timer resolution.
+--echo # Therefore some increased COUNT_* does not need to lead to an
+--echo # increased SUM_TIMER_*.
+#==========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET SUM_TIMER_MISC = 13, COUNT_MISC = 0
+ WHERE statement LIKE '%WHERE col1 = 3'
+ AND EVENT_NAME LIKE '%client_connection'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+((COUNT_READ = 0 AND SUM_TIMER_READ = 0 AND SUM_NUMBER_OF_BYTES_READ = 0)
+ OR
+ (COUNT_READ > 0 AND SUM_NUMBER_OF_BYTES_READ > 0))
+AND
+((COUNT_WRITE = 0 AND SUM_TIMER_WRITE = 0 AND SUM_NUMBER_OF_BYTES_WRITE = 0)
+ OR
+ (COUNT_WRITE > 0 AND SUM_NUMBER_OF_BYTES_WRITE > 0))
+AND
+((COUNT_MISC = 0 AND SUM_TIMER_MISC = 0)
+ OR
+(COUNT_MISC > 0));
+if(`SELECT COUNT(*) FROM mysqltest.socket_summary_by_instance_detail
+ WHERE NOT ( $my_rules ) `)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE NOT ( $my_rules )
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE, STATEMENT, RUN;
+ let $print_details= 1;
+}
+
+--echo # 4.2 Results must be stable
+#==========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_WRITE = 13
+ WHERE statement LIKE '%WHERE col1 = 3'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE '%client_connection'
+ LIMIT 1;
+ --disable_info
+}
+
+# eval
+# SELECT
+# $column_list
+# FROM mysqltest.socket_summary_by_instance_detail
+# WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+# ORDER BY EVENT_NAME, statement,run;
+
+# In case we are able to wait all time till perfschema has finished the
+# maintenance of counters than the following must be valid.
+let $my_rules=
+COUNT(DISTINCT SUM_NUMBER_OF_BYTES_READ) = 1 AND
+COUNT(DISTINCT COUNT_WRITE) = 1 AND
+COUNT(DISTINCT SUM_NUMBER_OF_BYTES_WRITE) = 1;
+
+# In case we do not get the results somehow deterministic than we
+# we should go with the less strict check based on CV.
+#
+# Compute coefficient of variation (CV) to detect 'notable' variances in the
+# byte count and operation counts. The acceptable range for the CV is purely
+# subjective, however, the CV is a dimensionless quantity therefore valid
+# across platforms.
+# let $my_rules=
+# STD(COUNT_READ)/AVG(COUNT_READ) <= 0.2 AND
+# STD(SUM_NUMBER_OF_BYTES_READ)/AVG(SUM_NUMBER_OF_BYTES_READ) <= 0.2 AND
+# STD(COUNT_WRITE)/AVG(COUNT_WRITE) <= 0.2 AND
+# STD(SUM_NUMBER_OF_BYTES_WRITE)/AVG(SUM_NUMBER_OF_BYTES_WRITE) <= 0.2 AND
+# STD(COUNT_MISC)/AVG(COUNT_MISC) <= 0.4;
+
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+GROUP BY EVENT_NAME, statement
+HAVING NOT ($my_rules) ;
+if(`SELECT COUNT(statement) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for GROUP BY EVENT_NAME, statement
+ eval
+ SELECT $column_list
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND (EVENT_NAME, statement)
+ IN (SELECT EVENT_NAME, statement
+ $part)
+ ORDER BY EVENT_NAME, statement, run, OBJECT_INSTANCE_BEGIN;
+ let $print_details= 1;
+}
+
+--echo # 4.3 Counters must be 0 in client_connection for the default session
+--echo # Instrumenting is disabled since a long time and the counter were
+--echo # reset via TRUNCATE just after the disabling.
+#==========================================================================
+let $my_rules=
+COUNT_STAR = 0 AND SUM_TIMER_WAIT = 0
+AND
+COUNT_READ = 0 AND SUM_TIMER_READ = 0 AND SUM_NUMBER_OF_BYTES_READ = 0
+AND
+COUNT_WRITE = 0 AND SUM_TIMER_WRITE = 0 AND SUM_NUMBER_OF_BYTES_WRITE = 0
+AND
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+if(`SELECT COUNT(*) FROM performance_schema.socket_summary_by_instance
+ WHERE NOT ( $my_rules )
+ AND OBJECT_INSTANCE_BEGIN = @default_object_instance_begin`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ # Attention: We use here performance_schema.socket_summary_by_instance
+ # and not mysqltest.socket_summary_by_instance_detail.
+ # Therefore the convenient $column_list cannot be used.
+ eval
+ SELECT
+ COUNT_STAR, SUM_TIMER_WAIT,
+ COUNT_READ,SUM_TIMER_READ,SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE,SUM_TIMER_WRITE,SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC,SUM_TIMER_MISC
+ FROM performance_schema.socket_summary_by_instance
+ WHERE OBJECT_INSTANCE_BEGIN = @default_object_instance_begin;
+ let $print_details= 1;
+}
+
+#---------------------------------------------------------------------------
+
+--echo # 4.4 Check the differences caused by SQL statements
+--echo # 4.4.1 There must be no changes in counters of instances
+--echo # NOT LIKE '%client_connection' because everything gets charged
+--echo # into client_connection of the acting connection.
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_WRITE = 13
+ WHERE statement LIKE '%WHERE col1 = 3'
+ AND EVENT_NAME NOT LIKE '%client_connection'
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_READ = 0 AND SUM_TIMER_READ = 0 AND SUM_NUMBER_OF_BYTES_READ = 0
+AND
+COUNT_WRITE = 0 AND SUM_TIMER_WRITE = 0 AND SUM_NUMBER_OF_BYTES_WRITE = 0
+AND
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+ WHERE NOT ( $my_rules )
+ AND EVENT_NAME NOT LIKE '%client_connection'
+ AND statement NOT LIKE 'Connect%';
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN, statement, run;
+ let $print_details= 1;
+}
+
+--echo # 4.4.2 In case of SELECT and our scenarios even COUNT_READ and COUNT_MISC
+--echo # are stable.
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_READ = 13
+ WHERE statement LIKE '%WHERE col1 = 3'
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT(DISTINCT COUNT_READ) = 1 AND
+COUNT(DISTINCT COUNT_MISC) = 1;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement NOT LIKE '%Connect%'
+GROUP BY EVENT_NAME, statement
+HAVING NOT ($my_rules) ;
+if(`SELECT COUNT(statement) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for GROUP BY EVENT_NAME, statement
+ eval
+ SELECT $column_list
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND (EVENT_NAME, statement)
+ IN (SELECT EVENT_NAME, statement
+ $part)
+ ORDER BY EVENT_NAME, statement, run, OBJECT_INSTANCE_BEGIN;
+ let $print_details= 1;
+}
+
+--echo # 4.4.3 In our testing scenarios we get for the client_connection entry
+--echo # of the acting connection
+--echo # -> OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+--echo # COUNT_MISC = 0 AND SUM_TIMER_MISC = 0
+--echo # SKIPPED FOR WINDOWS
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_MISC = 13
+ WHERE statement LIKE '%WHERE col1 = 3'
+ AND EVENT_NAME LIKE '%client_connection'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE NOT ( $my_rules )
+ AND EVENT_NAME LIKE '%client_connection'
+ AND statement NOT LIKE 'Connect%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
+#if(`SELECT COUNT(*) $part`)
+if (0)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part
+ ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN, statement, run;
+ let $print_details= 1;
+}
+
+# Initialize variables
+let $my_rules= my_rules_not_set;
+let $stmt1= stmt1_not_set;
+let $stmt2= stmt2_not_set;
+# $title_prefix is used for the generation of titles
+let $title_prefix= 4.4;
+# $check_num is used for the generation of titles and gets incremented after
+# every call of the current script.
+let $check_num= 4;
+# $column_list is used for the generation of error information and valid for
+# every sub test.
+let $diff_column_list=
+t2.COUNT_READ - t1.COUNT_READ AS D_COUNT_READ,
+t2.COUNT_READ AS S2_COUNT_READ,
+t1.COUNT_READ AS S1_COUNT_READ,
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ AS D_SUM_NUMBER_OF_BYTES_READ,
+t2.SUM_NUMBER_OF_BYTES_READ AS S2_SUM_NUMBER_OF_BYTES_READ,
+t1.SUM_NUMBER_OF_BYTES_READ AS S1_SUM_NUMBER_OF_BYTES_READ,
+t2.COUNT_WRITE - t1.COUNT_WRITE AS D_COUNT_WRITE,
+t2.COUNT_WRITE AS S2_COUNT_WRITE,
+t1.COUNT_WRITE AS S1_COUNT_WRITE,
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE AS D_SUM_NUMBER_OF_BYTES_WRITE,
+t2.SUM_NUMBER_OF_BYTES_WRITE AS S2_SUM_NUMBER_OF_BYTES_WRITE,
+t1.SUM_NUMBER_OF_BYTES_WRITE AS S1_SUM_NUMBER_OF_BYTES_WRITE,
+t2.COUNT_MISC - t1.COUNT_MISC AS D_COUNT_MISC,
+t2.COUNT_MISC AS S2_COUNT_MISC,
+t1.COUNT_MISC AS S1_COUNT_MISC;
+# $part is used for the generation of "check" statements + error information
+# and valid for every sub test.
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail t1
+JOIN mysqltest.socket_summary_by_instance_detail t2
+USING (EVENT_NAME, OBJECT_INSTANCE_BEGIN, run)
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND run = 1;
+
+--echo # Check the differences between changes caused by SQL statements
+--echo # These differences must correspond to parameters like
+--echo # - statement, table name or column name length
+--echo # - number of rows in result set, size of rows in result set etc.
+# --> Statement NOT LIKE '%Connect%'
+
+let stmt1= SELECT col2 FROM does_not_exist;
+let stmt2= SELECT col2 FROM does_not_exist WHERE col1 = 0;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 36 1 59 1 SELECT col2 FROM does_not_exist
+# 3 51 1 59 1 SELECT col2 FROM does_not_exist WHERE col1 = 0
+# The string of the statement gets charged into SUM_NUMBER_OF_BYTES_READ.
+# The server error message gets charged into SUM_NUMBER_OF_BYTES_WRITE.
+let $msg=
+# One statement is longer than the other.
+# Both statements fail with the same error message (table does not exist);
+#
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE = 0 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt1= SELECT col2 FROM does_not_exist WHERE col1 = 0;
+let $stmt2= SELECT col2 FROM does_not_exist WHERE col1 A 0;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 51 1 59 1 SELECT col2 FROM does_not_exist WHERE col1 = 0
+# 3 51 1 162 1 SELECT col2 FROM does_not_exist WHERE col1 A 0
+let $msg=
+# Both statements have the same length and fail.
+# The length of the error messages differs.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE > 0 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt1= SELECT col2 FROM does_not_exist;
+let $stmt2= SELECT col2 FROM does_not_exist0123;
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 36 1 59 1 SELECT col2 FROM does_not_exist
+# 3 40 1 63 1 SELECT col2 FROM does_not_exist0123
+let $msg=
+# Both statements fail (table does not exist).
+# The length of the statement and the length of the error messages differs.
+# Reason for both differences is the length of the table name.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+# Assuming that some new check should be added.
+# How to enforce that a lot info is printed so that it becomes easy to derive
+# the right value for $my_rules?
+#----------------------------------------------------------------------------
+# let $my_rules= 0;
+# This will cause that suite/perfschema/include/socket_check1.inc concludes that
+# the check via $my_rules failed and it will print debug information.
+# let $stmt1= SELECT col2 FROM does_not_exist WHERE col1 = 0;
+# let $stmt2= SELECT col2 FROM does_not_exist WHERE col1 A 0;
+# let $my_rules= 0;
+# --source ../include/socket_check1.inc
+
+let $stmt2= SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1;
+let $stmt1= SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 54 1 78 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1
+# 3 70 1 86 1 SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1
+let $msg=
+# Both statements get an empty result set.
+# The length of the statements and the length of the result sets differs.
+# Reason for both differences is the length of the some column name.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE = LENGTH('my_super_col') - LENGTH('col2') AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt2= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+let $stmt1= SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# t1 3 54 1 78 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1
+# t2 3 53 1 83 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+let $msg=
+# Both statements differ in the statement length.
+# One statement earns an empty result set.
+# The other statement earns one row containing an empty string.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t1.SUM_NUMBER_OF_BYTES_READ - t2.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt1') - LENGTH('$stmt2') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE > 0 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt2= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2;
+let $stmt1= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 53 1 83 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# 3 53 1 84 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2
+let $msg=
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns one row containing a string 1 byte long.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE = 1 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt2= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3;
+let $stmt1= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# 3 53 1 83 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# 3 53 1 1109 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3
+let $msg=
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns one row containing a string 1024 byte long.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE >= 1024 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+let $stmt2= SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2;
+let $stmt1= SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
+#
+# CNT_READ BYTES_READ CNT_WRITE BYTES_WRITE CNT_MISC statement
+# t1 3 53 1 83 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1
+# t2 3 53 1 88 1 SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2
+let $msg=
+# Both statements have the same length.
+# One statement earns an one row containing an empty string.
+# The other statement earns two rows containing an empty string.;
+let $my_rules=
+t2.COUNT_READ - t1.COUNT_READ = 0 AND
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
+t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
+t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE > 0 AND
+t2.COUNT_MISC - t1.COUNT_MISC = 0;
+--source ../include/socket_check1.inc
+
+--echo # 4.5 Check the differences caused by Connects
+--echo # Attention: Succesful Connects run an additional "DO 1".
+--echo # 4.5.1 Connects do not charge anything into READ or WRITE counters
+--echo # of the instance with EVENT_NAME NOT LIKE ('%client_connection%').
+--echo # This mean all these counters must be 0.
+let $my_rules=
+COUNT_READ = 0 AND SUM_TIMER_READ = 0 AND SUM_NUMBER_OF_BYTES_READ = 0 AND
+COUNT_WRITE = 0 AND SUM_TIMER_WRITE = 0 AND SUM_NUMBER_OF_BYTES_WRITE = 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%')
+ AND EVENT_NAME NOT LIKE ('%client_connection%')
+ AND NOT ( $my_rules );
+if(`SELECT COUNT(*) $part `)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.2 Connects using for host the value 'localhost'
+--echo # 4.5.2.1 For the instance with EVENT_NAME LIKE '%server_tcpip_socket'
+--echo # COUNT_MISC = 0 AND SUM_TIMER_MISC = 0 must be valid
+--echo # because we run through server_unix_socket.
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_MISC = 13
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%localhost%')
+ AND EVENT_NAME LIKE ('%server_tcpip_socket%')
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%localhost%')
+ AND EVENT_NAME LIKE ('%server_tcpip_socket%')
+ AND NOT ( $my_rules );
+#if(`SELECT COUNT(*) $part `)
+# DISABLED FOR WINDOWS
+if (0)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.2.2 For the instance with EVENT_NAME LIKE '%server_unix_socket'
+--echo # COUNT_MISC > 0 must be valid.
+--echo # SKIPPED FOR WINDOWS
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_MISC = 0
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%localhost%')
+ AND EVENT_NAME LIKE ('%server_unix_socket%')
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_MISC > 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%localhost%')
+ AND EVENT_NAME LIKE ('%server_unix_socket%')
+ AND NOT ( $my_rules );
+#if(`SELECT COUNT(*) $part `)
+if (0)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.3 Connects using for host a value <> 'localhost'
+--echo # 4.5.3.1 For the instance with EVENT_NAME LIKE '%server_unix_socket'
+--echo # COUNT_MISC = 0 AND SUM_TIMER_MISC = 0 must be valid
+--echo # because we run through server_tcpip_socket.
+--echo # SKIPPED FOR WINDOWS
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ eval
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_MISC = 13
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%server_unix_socket%')
+ AND statement LIKE ('%Connect%$my_localhost%')
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%$my_localhost%')
+ AND EVENT_NAME LIKE ('%server_unix_socket%')
+ AND NOT ( $my_rules );
+#if(`SELECT COUNT(*) $part `)
+if (0)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.3.2 For the instance with EVENT_NAME LIKE '%server_tcpip_socket'
+--echo # COUNT_MISC > 0 must be valid.
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ eval
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET COUNT_MISC = 0
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%$my_localhost%')
+ AND EVENT_NAME LIKE ('%server_tcpip_socket%')
+ LIMIT 1;
+ --disable_info
+}
+
+let $my_rules=
+COUNT_MISC > 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('%Connect%$my_localhost%')
+ AND EVENT_NAME LIKE ('%server_tcpip_socket%')
+ AND NOT ( $my_rules );
+if(`SELECT COUNT(*) $part `)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.4 Failing Connects do not cause any row with EVENT_NAME
+--echo # LIKE '%client_connection'
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ eval
+ UPDATE mysqltest.socket_summary_by_instance_detail
+ SET statement = 'Connect boot '
+ WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('Connect%root%')
+ AND EVENT_NAME LIKE ('%client_connection')
+ LIMIT 1;
+ --disable_info
+}
+
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('Connect%boot%')
+ AND EVENT_NAME LIKE ('%client_connection');
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect that there are no rows because
+ --echo # - failing connects do not cause a row with "client_connection"
+ --echo # - all failing connects contain a user name LIKE '%boot%'
+ eval
+ SELECT
+ $column_list
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.5.5 Successful Connects cause a new instance with EVENT_NAME
+--echo # LIKE '%client_connection'
+#===========================================================================
+# Enable the following lines for debugging the check.
+# Attention: socket_summary_by_instance_detail is after that rotten.
+if(0)
+{
+ --enable_info
+ DELETE
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE EVENT_NAME LIKE ('%client_connection')
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('Connect%root%')
+ LIMIT 1;
+ --disable_info
+}
+
+# - connects which should be successful have statement LIKE ('Connect%root%').
+# - We try every type of Connect $loop_rounds times.
+# Therefore we should find $loop_rounds rows with
+# - EVENT_NAME LIKE ('%client_connection')
+# AND
+# - OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+# We do not want to count the entry of belonging to the default connection.
+# AND
+# - statement LIKE ('Connect%root%')
+# The connects which should be successful.
+#
+let $my_rules=
+COUNT(*) = $loop_rounds;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE EVENT_NAME LIKE ('%client_connection')
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement LIKE ('Connect%root%')
+GROUP BY statement
+HAVING NOT ( $my_rules );
+
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for GROUP BY statement
+ --echo #
+ eval
+ SELECT
+ $column_list
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE EVENT_NAME LIKE ('%client_connection')
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND statement IN
+ (SELECT statement
+ $part);
+ let $print_details= 1;
+}
+
+--echo # 4.6 Check the differences caused by Connects
+--echo # - INSTANCES with an EVENT_NAME like server_tcpip_socket or
+--echo # server_unix_socket are already checked
+--echo # - the stability of results is already checked
+--echo # So we con go with the results of the first run.
+
+# Typical content of mysqltest.socket_summary_by_instance_detail
+#
+# eval
+# SELECT $column_list
+# FROM mysqltest.socket_summary_by_instance_detail
+# WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+# AND EVENT_NAME LIKE ('%client_connection')
+# AND statement LIKE ('Connect%')
+# AND run = 1
+# ORDER BY event_name,statement, run;
+# CREAD TREAD BREAD CWRITE TWRITE BWRITE CMISC TMISC STATEMENT
+# 4 6149616 79 3 34008480 117 3 38914128 Connect (con*,::ffff:127.0.0.1,root,,mysqltest,,)
+# 4 7012368 84 3 10112256 117 2 43067376 Connect (con*,localhost,root,,mysqlsupertest,,)
+# 4 7172880 79 3 10247688 117 2 40128000 Connect (con*,localhost,root,,mysqltest,,)
+# 4 6706392 85 3 15509472 117 2 34851168 Connect (con*,localhost,root012345,,mysqltest,,)
+# 4 10543632 89 3 10578744 117 2 39460872 Connect (con*,localhost,root0123456789,,mysqltest,,)
+
+--echo # 4.6.1 The SUM_OF_BYTES_WRITE value is the same for all Connects.
+#========================================================================
+let $my_rules= COUNT(DISTINCT SUM_NUMBER_OF_BYTES_WRITE) = 1;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND statement LIKE ('Connect%')
+ AND run = 1;
+if(`SELECT NOT ( $my_rules) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for all Connects
+ --echo #
+ eval
+ SELECT
+ statement, SUM_NUMBER_OF_BYTES_WRITE
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.6.2 The SUM_OF_BYTES_WRITE value hast to be > 100.
+#============================================================
+let $my_rules= SUM_NUMBER_OF_BYTES_WRITE > 100;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND statement LIKE ('Connect%')
+ AND NOT ( $my_rules )
+ AND run = 1;
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for all Connects
+ --echo #
+ eval
+ SELECT
+ statement, SUM_NUMBER_OF_BYTES_WRITE
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.6.3 COUNT_READ, COUNT_WRITE and COUNT_MISC have to be to be > 0
+#=========================================================================
+let $my_rules=
+COUNT_READ > 0 AND COUNT_WRITE > 0 AND COUNT_MISC > 0;
+let $part=
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND statement LIKE ('Connect%')
+ AND NOT ( $my_rules )
+ AND run = 1;
+if(`SELECT COUNT(*) $part`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo # for all Connects
+ --echo #
+ eval
+ SELECT
+ statement, COUNT_READ, COUNT_WRITE, COUNT_MISC
+ $part;
+ let $print_details= 1;
+}
+
+--echo # 4.6.4 Checks based on comparison of results for connects
+let $part0=
+FROM mysqltest.socket_summary_by_instance_detail t1
+JOIN mysqltest.socket_summary_by_instance_detail t2
+USING (EVENT_NAME, run)
+WHERE EVENT_NAME LIKE ('%client_connection')
+ AND run = 1
+ AND t2.OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND t1.OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
+let $part1=
+SELECT RPAD(statement,55,' ') AS STATEMENT,
+ LENGTH(statement), SUM_NUMBER_OF_BYTES_READ
+FROM mysqltest.socket_summary_by_instance_detail
+WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ AND EVENT_NAME LIKE ('%client_connection')
+ AND run = 1;
+
+
+--echo # 4.6.4 The user name length affects the SUM_OF_BYTES_READ value
+#======================================================================
+# CREAD TREAD BREAD CWRITE TWRITE BWRITE CMISC TMISC STATEMENT
+# 4 6706392 85 3 15509472 117 2 34851168 Connect (con*,localhost,root012345,,mysqltest,,)
+# 4 10543632 89 3 10578744 117 2 39460872 Connect (con*,localhost,root0123456789,,mysqltest,,)
+let $stmt2= Connect (con*,localhost,root0123456789,,mysqltest,,);
+let $stmt1= Connect (con*,localhost,root012345,,mysqltest,,);
+let $my_rules=
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1');
+if(`SELECT NOT ($my_rules)
+ $part0
+ AND t2.statement = '$stmt2'
+ AND t1.statement = '$stmt1'`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ $part1
+ AND statement IN('$stmt2','$stmt1');
+ let $print_details= 1;
+}
+
+--echo # 4.6.5 The database name length affects the SUM_OF_BYTES_READ value
+#==========================================================================
+# CREAD TREAD BREAD CWRITE TWRITE BWRITE CMISC TMISC STATEMENT
+# 4 7012368 84 3 10112256 117 2 43067376 Connect (con*,localhost,root,,mysqlsupertest,,)
+# 4 7172880 79 3 10247688 117 2 40128000 Connect (con*,localhost,root,,mysqltest,,)
+let $stmt2= Connect (con*,localhost,root,,mysqlsupertest,,);
+let $stmt1= Connect (con*,localhost,root,,mysqltest,,);
+let $my_rules=
+t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1');
+if(`SELECT NOT ($my_rules)
+ $part0
+ AND t2.statement = '$stmt2'
+ AND t1.statement = '$stmt1'`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ $part1
+ AND statement IN('$stmt2','$stmt1');
+ let $print_details= 1;
+}
+
+--echo # 5. Check the impact of TRUNCATE on socket_summary_by_instance.
+--echo # It must reset all counters.
+#=======================================================================
+# We do not need to check if the majority of counters is <> 0 because if
+# we ever hit such a bad state than a lot of the preceding checks would
+# have already failed and reported this.
+TRUNCATE TABLE performance_schema.socket_summary_by_instance;
+let $my_rules=
+COUNT_STAR = 0 AND SUM_TIMER_WAIT = 0
+AND
+COUNT_READ = 0 AND SUM_TIMER_READ = 0 AND SUM_NUMBER_OF_BYTES_READ = 0
+AND
+COUNT_WRITE = 0 AND SUM_TIMER_WRITE = 0 AND SUM_NUMBER_OF_BYTES_WRITE = 0
+AND
+COUNT_MISC = 0 AND SUM_TIMER_MISC = 0;
+if(`SELECT COUNT(*) FROM performance_schema.socket_summary_by_instance
+ WHERE NOT ( $my_rules )
+ AND OBJECT_INSTANCE_BEGIN = @default_object_instance_begin`)
+{
+ --enable_query_log
+ --enable_result_log
+ --echo # The statistics looks suspicious.
+ --echo # We expect
+ --echo # $my_rules
+ --echo #
+ eval
+ SELECT
+ COUNT_STAR, SUM_TIMER_WAIT,
+ COUNT_READ,SUM_TIMER_READ,SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE,SUM_TIMER_WRITE,SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC,SUM_TIMER_MISC
+ FROM performance_schema.socket_summary_by_instance
+ WHERE OBJECT_INSTANCE_BEGIN = @default_object_instance_begin;
+}
+
+
+if($print_details)
+{
+ --enable_query_log
+ --enable_result_log
+ --horizontal_results
+ --echo # Dump detailed differences after - before statement execution
+ --echo # 1. The statement executing connection and hopefully noone else
+ SELECT @default_object_instance_begin;
+ SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
+ COUNT_READ, SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE, SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC, statement
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE EVENT_NAME LIKE '%client_connection%'
+ AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
+ ORDER BY statement, run;
+ --echo # 2. The connection default
+ SELECT EVENT_NAME,
+ COUNT_READ, SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE, SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC, statement
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE OBJECT_INSTANCE_BEGIN = @default_object_instance_begin
+ ORDER BY statement,run;
+ --echo # 3. The "server_unix_socket"
+ # WHERE OBJECT_INSTANCE_BEGIN = @default_object_instance_begin
+ SELECT EVENT_NAME,
+ COUNT_READ, SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE, SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC, statement
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE EVENT_NAME LIKE '%server_unix_socket%'
+ ORDER BY statement,run;
+ --echo # 4. The "server_tcpip_socket"
+ SELECT EVENT_NAME,
+ COUNT_READ, SUM_NUMBER_OF_BYTES_READ,
+ COUNT_WRITE, SUM_NUMBER_OF_BYTES_WRITE,
+ COUNT_MISC, statement
+ FROM mysqltest.socket_summary_by_instance_detail
+ WHERE EVENT_NAME LIKE '%server_tcpip_socket%'
+ ORDER BY statement,run;
+ --echo # 5. mysqltest.my_socket_summary_by_instance
+ --vertical_results
+ SELECT * FROM mysqltest.my_socket_summary_by_instance;
+ --horizontal_results
+}
+
+--echo # 6. Cleanup
+#==================
+# Cleanup
+--disable_query_log
+eval
+UPDATE performance_schema.setup_timers
+SET TIMER_NAME = '$wait_timer'
+WHERE NAME = 'wait';
+DROP SCHEMA mysqltest;
+DROP SCHEMA mysqlsupertest;
+--connection con1
+--disconnect con1
+--source include/wait_until_disconnected.inc
+--connection default
+--enable_query_log
+
diff --git a/mysql-test/suite/perfschema/t/stage_mdl_function.test b/mysql-test/suite/perfschema/t/stage_mdl_function.test
new file mode 100644
index 00000000000..3cd0c62fc08
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/stage_mdl_function.test
@@ -0,0 +1,63 @@
+# Tests for the performance schema
+#
+
+--source ../include/stage_setup.inc
+
+connect (con1, localhost, user1, , );
+
+--disable_warnings
+drop function if exists test.f1;
+--enable_warnings
+
+create function test.f1() returns int
+ return 1;
+
+begin;
+select test.f1();
+
+connect (con2, localhost, user2, , );
+
+# Will wait on con1, "Waiting for stored function metadata lock"
+--send
+drop function test.f1;
+
+--connection default
+
+# user1: Wait for the statement to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user1'
+ and PROCESSLIST_COMMAND = 'Sleep';
+--source include/wait_condition.inc
+
+# user2: Wait for the drop function to block
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user2'
+ and PROCESSLIST_STATE = 'Waiting for stored function metadata lock';
+--source include/wait_condition.inc
+
+call dump_one_thread('user1');
+call dump_one_thread('user2');
+
+--connection con1
+select f1();
+commit;
+
+--disconnect con1
+
+--connection con2
+--reap
+
+--disconnect con2
+
+--connection default
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+--source ../include/stage_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/stage_mdl_global.test b/mysql-test/suite/perfschema/t/stage_mdl_global.test
new file mode 100644
index 00000000000..8863d2da903
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/stage_mdl_global.test
@@ -0,0 +1,54 @@
+# Tests for the performance schema
+#
+
+--source ../include/stage_setup.inc
+
+connect (con1, localhost, user1, , );
+
+flush tables with read lock;
+
+connect (con2, localhost, user2, , );
+
+# Will wait on con1, "Waiting for global read lock"
+--send
+insert into test.t1 values (1), (2), (3);
+
+--connection default
+
+# user1: Wait for the statement to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user1'
+ and PROCESSLIST_COMMAND = 'Sleep';
+--source include/wait_condition.inc
+
+# user2: Wait for the insert to block
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user2'
+ and PROCESSLIST_STATE = 'Waiting for global read lock';
+--source include/wait_condition.inc
+
+call dump_one_thread('user1');
+call dump_one_thread('user2');
+
+--connection con1
+unlock tables;
+
+--disconnect con1
+
+--connection con2
+--reap
+
+--disconnect con2
+
+--connection default
+
+# Wait for the disconnects to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+--source ../include/stage_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/stage_mdl_procedure.test b/mysql-test/suite/perfschema/t/stage_mdl_procedure.test
new file mode 100644
index 00000000000..7d9dc6d80eb
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/stage_mdl_procedure.test
@@ -0,0 +1,79 @@
+# Tests for the performance schema
+#
+
+--source ../include/stage_setup.inc
+
+connect (con1, localhost, user1, , );
+
+--disable_warnings
+drop function if exists test.f1;
+drop procedure if exists test.p1;
+--enable_warnings
+
+delimiter $$;
+
+create function test.f1() returns int
+begin
+ call test.p1();
+ return 1;
+end
+$$
+
+delimiter ;$$
+
+create procedure test.p1()
+begin end;
+
+begin;
+# The procedure is in a sub statement,
+# so that the current transaction keeps a reference to it.
+select test.f1();
+
+connect (con2, localhost, user2, , );
+
+# Will wait on con1, "Waiting for stored procedure metadata lock"
+--send
+drop procedure test.p1;
+
+--connection default
+
+# user1: Wait for the statement to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user1'
+ and PROCESSLIST_COMMAND = 'Sleep';
+--source include/wait_condition.inc
+
+# user2: Wait for the drop procedure to block
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user2'
+ and PROCESSLIST_STATE = 'Waiting for stored procedure metadata lock';
+--source include/wait_condition.inc
+
+call dump_one_thread('user1');
+call dump_one_thread('user2');
+
+--connection con1
+select test.f1();
+commit;
+
+--disconnect con1
+
+--connection con2
+--reap
+
+--disconnect con2
+
+--connection default
+
+# Wait for the disconnect to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+drop function test.f1;
+
+--source ../include/stage_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/stage_mdl_table.test b/mysql-test/suite/perfschema/t/stage_mdl_table.test
new file mode 100644
index 00000000000..b522f51a68e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/stage_mdl_table.test
@@ -0,0 +1,59 @@
+# Tests for the performance schema
+#
+
+--source ../include/stage_setup.inc
+
+connect (con1, localhost, user1, , );
+
+begin;
+insert into test.t1 values (1), (2), (3);
+commit;
+
+begin;
+select * from test.t1 for update;
+
+connect (con2, localhost, user2, , );
+
+# Will wait on con1, "Waiting for table metadata lock"
+--send
+alter table test.t1 add column (b int);
+
+--connection default
+
+# user1: Wait for the statement to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user1'
+ and PROCESSLIST_COMMAND = 'Sleep';
+--source include/wait_condition.inc
+
+# user2: Wait for the alter to block
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user2'
+ and PROCESSLIST_STATE = 'Waiting for table metadata lock';
+--source include/wait_condition.inc
+
+call dump_one_thread('user1');
+call dump_one_thread('user2');
+
+--connection con1
+commit;
+
+--disconnect con1
+
+--connection con2
+--reap
+
+--disconnect con2
+
+--connection default
+
+# Wait for the disconnects to complete
+let $wait_condition=
+ select count(*) = 0 from performance_schema.threads
+ where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
+--source include/wait_condition.inc
+
+--source ../include/stage_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/start_server_disable_idle-master.opt b/mysql-test/suite/perfschema/t/start_server_disable_idle-master.opt
new file mode 100644
index 00000000000..3f1ee203961
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_disable_idle-master.opt
@@ -0,0 +1 @@
+--loose-performance-schema-instrument='idle=OFF'
diff --git a/mysql-test/suite/perfschema/t/start_server_disable_idle.test b/mysql-test/suite/perfschema/t/start_server_disable_idle.test
new file mode 100644
index 00000000000..6cf8d4a522c
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_disable_idle.test
@@ -0,0 +1,28 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no enabled idle instruments
+select * from performance_schema.setup_instruments
+ where name like "idle" and enabled='YES';
+
+# Expect no idle statistics collected
+
+select * from performance_schema.events_waits_summary_global_by_event_name
+ where event_name like "idle" and count_star > 0;
+
+select * from performance_schema.events_waits_summary_by_thread_by_event_name
+ where event_name like "idle" and count_star > 0;
+
+select * from performance_schema.events_waits_summary_by_user_by_event_name
+ where event_name like "idle" and count_star > 0;
+
+select * from performance_schema.events_waits_summary_by_host_by_event_name
+ where event_name like "idle" and count_star > 0;
+
+select * from performance_schema.events_waits_summary_by_account_by_event_name
+ where event_name like "idle" and count_star > 0;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_disable_stages-master.opt b/mysql-test/suite/perfschema/t/start_server_disable_stages-master.opt
new file mode 100644
index 00000000000..fb8292c1f81
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_disable_stages-master.opt
@@ -0,0 +1 @@
+--loose-performance-schema-instrument='stage/%=OFF'
diff --git a/mysql-test/suite/perfschema/t/start_server_disable_stages.test b/mysql-test/suite/perfschema/t/start_server_disable_stages.test
new file mode 100644
index 00000000000..83ee6838910
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_disable_stages.test
@@ -0,0 +1,28 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no enabled stages instruments
+select * from performance_schema.setup_instruments
+ where name like "stage/%" and enabled='YES';
+
+# Expect no stage statistics collected
+
+select * from performance_schema.events_stages_summary_global_by_event_name
+ where count_star > 0;
+
+select * from performance_schema.events_stages_summary_by_thread_by_event_name
+ where count_star > 0;
+
+select * from performance_schema.events_stages_summary_by_user_by_event_name
+ where count_star > 0;
+
+select * from performance_schema.events_stages_summary_by_host_by_event_name
+ where count_star > 0;
+
+select * from performance_schema.events_stages_summary_by_account_by_event_name
+ where count_star > 0;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_disable_statements-master.opt b/mysql-test/suite/perfschema/t/start_server_disable_statements-master.opt
new file mode 100644
index 00000000000..51d222d1fbe
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_disable_statements-master.opt
@@ -0,0 +1 @@
+--loose-performance-schema-instrument='statement/%=OFF'
diff --git a/mysql-test/suite/perfschema/t/start_server_disable_statements.test b/mysql-test/suite/perfschema/t/start_server_disable_statements.test
new file mode 100644
index 00000000000..a337fb2ad85
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_disable_statements.test
@@ -0,0 +1,28 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no enabled statements instruments
+select * from performance_schema.setup_instruments
+ where name like "statement/%" and enabled='YES';
+
+# Expect no statement statistics collected
+
+select * from performance_schema.events_statements_summary_global_by_event_name
+ where count_star > 0;
+
+select * from performance_schema.events_statements_summary_by_thread_by_event_name
+ where count_star > 0;
+
+select * from performance_schema.events_statements_summary_by_user_by_event_name
+ where count_star > 0;
+
+select * from performance_schema.events_statements_summary_by_host_by_event_name
+ where count_star > 0;
+
+select * from performance_schema.events_statements_summary_by_account_by_event_name
+ where count_star > 0;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_disable_waits-master.opt b/mysql-test/suite/perfschema/t/start_server_disable_waits-master.opt
new file mode 100644
index 00000000000..c3a8876c8ee
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_disable_waits-master.opt
@@ -0,0 +1 @@
+--loose-performance-schema-instrument='wait/%=OFF'
diff --git a/mysql-test/suite/perfschema/t/start_server_disable_waits.test b/mysql-test/suite/perfschema/t/start_server_disable_waits.test
new file mode 100644
index 00000000000..5da7f533875
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_disable_waits.test
@@ -0,0 +1,28 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no enabled waits instruments
+select * from performance_schema.setup_instruments
+ where name like "wait/%" and enabled='YES';
+
+# Expect no wait statistics collected
+
+select * from performance_schema.events_waits_summary_global_by_event_name
+ where event_name like "wait/%" and count_star > 0;
+
+select * from performance_schema.events_waits_summary_by_thread_by_event_name
+ where event_name like "wait/%" and count_star > 0;
+
+select * from performance_schema.events_waits_summary_by_user_by_event_name
+ where event_name like "wait/%" and count_star > 0;
+
+select * from performance_schema.events_waits_summary_by_host_by_event_name
+ where event_name like "wait/%" and count_star > 0;
+
+select * from performance_schema.events_waits_summary_by_account_by_event_name
+ where event_name like "wait/%" and count_star > 0;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_innodb-master.opt b/mysql-test/suite/perfschema/t/start_server_innodb-master.opt
new file mode 100644
index 00000000000..542720c44d7
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_innodb-master.opt
@@ -0,0 +1 @@
+--loose-enable-performance-schema
diff --git a/mysql-test/suite/perfschema/t/start_server_innodb.test b/mysql-test/suite/perfschema/t/start_server_innodb.test
new file mode 100644
index 00000000000..68a164a0bc1
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_innodb.test
@@ -0,0 +1,11 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/have_innodb.inc
+
+--source ../include/start_server_common.inc
+
+# Expecting nothing lost with default parameters
+
+show status like "performance_schema%";
diff --git a/mysql-test/suite/perfschema/t/start_server_no_account-master.opt b/mysql-test/suite/perfschema/t/start_server_no_account-master.opt
new file mode 100644
index 00000000000..cfe98cec802
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_account-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_accounts_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_account.test b/mysql-test/suite/perfschema/t/start_server_no_account.test
new file mode 100644
index 00000000000..b9b0c858dfb
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_account.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no records
+show variables like "performance_schema_accounts_size";
+
+select count(*) from performance_schema.accounts;
+
+# We lost all the data
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_ACCOUNTS_LOST';
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_cond_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_cond_class-master.opt
index 714888a6de1..6b15f14cbf0 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_cond_class-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_no_cond_class-master.opt
@@ -1 +1,2 @@
---loose-enable-performance-schema --loose-performance_schema_max_cond_classes=0
+--loose-enable-performance-schema
+--loose-performance_schema_max_cond_classes=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_cond_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_cond_inst-master.opt
index 4b33152f89a..12a79eb08e7 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_cond_inst-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_no_cond_inst-master.opt
@@ -1 +1,2 @@
---loose-enable-performance-schema --loose-performance_schema_max_cond_instances=0
+--loose-enable-performance-schema
+--loose-performance_schema_max_cond_instances=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_digests-master.opt b/mysql-test/suite/perfschema/t/start_server_no_digests-master.opt
new file mode 100644
index 00000000000..397fdefc31a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_digests-master.opt
@@ -0,0 +1 @@
+--loose-performance-schema-digests-size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_digests.test b/mysql-test/suite/perfschema/t/start_server_no_digests.test
new file mode 100644
index 00000000000..b0ff0ab6f21
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_digests.test
@@ -0,0 +1,32 @@
+# ----------------------------------------------------
+# Tests for the performance schema statement Digests.
+# ----------------------------------------------------
+
+# Test case to show behavior of statements digest when
+# statement-digest-size is 0
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+# Initial Setup for Digest
+--source ../include/digest_setup.inc
+
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+
+# Executing queries
+--source ../include/digest_execution.inc
+
+--echo ####################################
+--echo # QUERYING PS STATEMENT DIGEST
+--echo ####################################
+SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+ SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
+
+
+# Expect no digest
+SHOW VARIABLES LIKE "performance_schema_digests_size";
+SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest;
+
+# Cleanup for Digest
+--source ../include/digest_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_file_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_file_class-master.opt
index f4b6d1ec893..657de947526 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_file_class-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_no_file_class-master.opt
@@ -1 +1,2 @@
---loose-enable-performance-schema --loose-performance_schema_max_file_classes=0
+--loose-enable-performance-schema
+--loose-performance_schema_max_file_classes=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_file_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_file_inst-master.opt
index 7f0d246f97a..e0a0c6a0e46 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_file_inst-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_no_file_inst-master.opt
@@ -1 +1,2 @@
---loose-enable-performance-schema --loose-performance_schema_max_file_instances=0
+--loose-enable-performance-schema
+--loose-performance_schema_max_file_instances=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_host-master.opt b/mysql-test/suite/perfschema/t/start_server_no_host-master.opt
new file mode 100644
index 00000000000..1cf7956d257
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_host-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_hosts_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_host.test b/mysql-test/suite/perfschema/t/start_server_no_host.test
new file mode 100644
index 00000000000..e0d3d4b1f0f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_host.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no records
+show variables like "performance_schema_hosts_size";
+
+select count(*) from performance_schema.hosts;
+
+# We lost all the data
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_HOSTS_LOST';
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_mutex_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_mutex_class-master.opt
index 173851434eb..27d055d3f89 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_mutex_class-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_no_mutex_class-master.opt
@@ -1 +1,2 @@
---loose-enable-performance-schema --loose-performance_schema_max_mutex_classes=0
+--loose-enable-performance-schema
+--loose-performance_schema_max_mutex_classes=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_mutex_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_mutex_inst-master.opt
index 5bdd7d39b4a..b8ed7ea744b 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_mutex_inst-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_no_mutex_inst-master.opt
@@ -1 +1,2 @@
---loose-enable-performance-schema --loose-performance_schema_max_mutex_instances=0
+--loose-enable-performance-schema
+--loose-performance_schema_max_mutex_instances=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_rwlock_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_rwlock_class-master.opt
index f0d15c86ddc..1c136591c6d 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_rwlock_class-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_no_rwlock_class-master.opt
@@ -1 +1,2 @@
---loose-enable-performance-schema --loose-performance_schema_max_rwlock_classes=0
+--loose-enable-performance-schema
+--loose-performance_schema_max_rwlock_classes=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst-master.opt
index fc1f5f89902..e9495b03f76 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst-master.opt
@@ -1 +1,2 @@
---loose-enable-performance-schema --loose-performance_schema_max_rwlock_instances=0
+--loose-enable-performance-schema
+--loose-performance_schema_max_rwlock_instances=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_setup_actors-master.opt b/mysql-test/suite/perfschema/t/start_server_no_setup_actors-master.opt
new file mode 100644
index 00000000000..624ef23b60b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_setup_actors-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_setup_actors_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_setup_actors.test b/mysql-test/suite/perfschema/t/start_server_no_setup_actors.test
new file mode 100644
index 00000000000..d1433053df8
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_setup_actors.test
@@ -0,0 +1,13 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no setup_actors
+show variables like "performance_schema_setup_actors_size";
+
+# Expect no setup_actors
+select count(*) from performance_schema.setup_actors;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_setup_objects-master.opt b/mysql-test/suite/perfschema/t/start_server_no_setup_objects-master.opt
new file mode 100644
index 00000000000..76f060669f4
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_setup_objects-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_setup_objects_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_setup_objects.test b/mysql-test/suite/perfschema/t/start_server_no_setup_objects.test
new file mode 100644
index 00000000000..d46805e5b25
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_setup_objects.test
@@ -0,0 +1,13 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no setup_objects
+show variables like "performance_schema_setup_objects_size";
+
+# Expect no setup_objects
+select count(*) from performance_schema.setup_objects;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_socket_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_socket_class-master.opt
new file mode 100644
index 00000000000..372cfe821cf
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_socket_class-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_max_socket_classes=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_socket_class.test b/mysql-test/suite/perfschema/t/start_server_no_socket_class.test
new file mode 100644
index 00000000000..ec1a2495413
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_socket_class.test
@@ -0,0 +1,23 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no classes
+show variables like "performance_schema_max_socket_classes";
+
+select count(*) from performance_schema.setup_instruments
+ where name like "wait/io/socket/%";
+
+# We lost all the classes
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_SOCKET_CLASSES_LOST';
+
+# Expect no instances
+select count(*) from performance_schema.socket_instances;
+
+# Expect no instances lost
+show status like "performance_schema_socket_instances_lost";
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_socket_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_socket_inst-master.opt
new file mode 100644
index 00000000000..f269db53f44
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_socket_inst-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_max_socket_instances=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_socket_inst.test b/mysql-test/suite/perfschema/t/start_server_no_socket_inst.test
new file mode 100644
index 00000000000..752a1666550
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_socket_inst.test
@@ -0,0 +1,26 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect classes
+show variables like "performance_schema_max_socket_classes";
+
+select count(*) > 0 from performance_schema.setup_instruments
+ where name like "wait/io/socket/%";
+
+# Expect no class lost
+show status like "performance_schema_socket_classes_lost";
+
+# Expect no instances
+show variables like "performance_schema_max_socket_instances";
+
+select count(*) from performance_schema.socket_instances;
+
+# Expect instances lost
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_SOCKET_INSTANCES_LOST';
+
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_stage_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_stage_class-master.opt
new file mode 100644
index 00000000000..31cf7bdf78a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_stage_class-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_max_stage_classes=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_stage_class.test b/mysql-test/suite/perfschema/t/start_server_no_stage_class.test
new file mode 100644
index 00000000000..23d22ac5431
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_stage_class.test
@@ -0,0 +1,26 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no classes
+show variables like "performance_schema_max_stage_classes";
+
+select count(*) from performance_schema.setup_instruments
+ where name like "stage/%";
+
+# We lost all the classes
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_STAGE_CLASSES_LOST';
+
+# Expect no stages
+select count(*) from performance_schema.events_stages_current;
+select count(*) from performance_schema.events_stages_history;
+select count(*) from performance_schema.events_stages_history_long;
+
+# Expect no stages classes
+select count(*) from performance_schema.events_stages_summary_by_thread_by_event_name;
+select count(*) from performance_schema.events_stages_summary_global_by_event_name;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_stages_history-master.opt b/mysql-test/suite/perfschema/t/start_server_no_stages_history-master.opt
new file mode 100644
index 00000000000..c3b7cfd64ac
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_stages_history-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_events_stages_history_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_stages_history.test b/mysql-test/suite/perfschema/t/start_server_no_stages_history.test
new file mode 100644
index 00000000000..1f5df187646
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_stages_history.test
@@ -0,0 +1,14 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no history
+show variables like "performance_schema_events_stages_history_size";
+select count(*) from performance_schema.events_stages_history;
+
+# Valid operation, edge case
+truncate table performance_schema.events_stages_history;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_stages_history_long-master.opt b/mysql-test/suite/perfschema/t/start_server_no_stages_history_long-master.opt
new file mode 100644
index 00000000000..731c1469c1a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_stages_history_long-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_events_stages_history_long_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_stages_history_long.test b/mysql-test/suite/perfschema/t/start_server_no_stages_history_long.test
new file mode 100644
index 00000000000..84c227790c9
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_stages_history_long.test
@@ -0,0 +1,14 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no history long
+show variables like "performance_schema_events_stages_history_long_size";
+select count(*) from performance_schema.events_stages_history_long;
+
+# Valid operation, edge case
+truncate table performance_schema.events_stages_history_long;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_statement_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_statement_class-master.opt
new file mode 100644
index 00000000000..6cf6fbdc0ba
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_statement_class-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_max_statement_classes=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_statement_class.test b/mysql-test/suite/perfschema/t/start_server_no_statement_class.test
new file mode 100644
index 00000000000..71deb85680a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_statement_class.test
@@ -0,0 +1,26 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no classes
+show variables like "performance_schema_max_statement_classes";
+
+select count(*) from performance_schema.setup_instruments
+ where name like "statement/%";
+
+# We lost all the classes
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_STATEMENT_CLASSES_LOST';
+
+# Expect no statements
+select count(*) from performance_schema.events_statements_current;
+select count(*) from performance_schema.events_statements_history;
+select count(*) from performance_schema.events_statements_history_long;
+
+# Expect no statements classes
+select count(*) from performance_schema.events_statements_summary_by_thread_by_event_name;
+select count(*) from performance_schema.events_statements_summary_global_by_event_name;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_statements_history-master.opt b/mysql-test/suite/perfschema/t/start_server_no_statements_history-master.opt
new file mode 100644
index 00000000000..3389a3c434b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_statements_history-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_events_statements_history_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_statements_history.test b/mysql-test/suite/perfschema/t/start_server_no_statements_history.test
new file mode 100644
index 00000000000..625e0bb3cd3
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_statements_history.test
@@ -0,0 +1,14 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no history
+show variables like "performance_schema_events_statements_history_size";
+select count(*) from performance_schema.events_statements_history;
+
+# Valid operation, edge case
+truncate table performance_schema.events_statements_history;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_statements_history_long-master.opt b/mysql-test/suite/perfschema/t/start_server_no_statements_history_long-master.opt
new file mode 100644
index 00000000000..b7728d6e6b4
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_statements_history_long-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_events_statements_history_long_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_statements_history_long.test b/mysql-test/suite/perfschema/t/start_server_no_statements_history_long.test
new file mode 100644
index 00000000000..a8d551cbed0
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_statements_history_long.test
@@ -0,0 +1,14 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no history long
+show variables like "performance_schema_events_statements_history_long_size";
+select count(*) from performance_schema.events_statements_history_long;
+
+# Valid operation, edge case
+truncate table performance_schema.events_statements_history_long;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_table_hdl-master.opt b/mysql-test/suite/perfschema/t/start_server_no_table_hdl-master.opt
new file mode 100644
index 00000000000..c6b6db94939
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_table_hdl-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_max_table_handles=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_table_hdl.test b/mysql-test/suite/perfschema/t/start_server_no_table_hdl.test
new file mode 100644
index 00000000000..80553f11866
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_table_hdl.test
@@ -0,0 +1,30 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect instances
+show variables like "performance_schema_max_table_instances";
+
+# Expect no handles
+show variables like "performance_schema_max_table_handles";
+
+# Create an instrumented table
+--disable_warnings
+drop table if exists test.instrument_me;
+--enable_warnings
+
+create table test.instrument_me(a int);
+insert into test.instrument_me values (1), (2), (3);
+select * from test.instrument_me;
+drop table test.instrument_me;
+
+# Expect no instances lost
+show variables like "performance_schema_max_table_instances";
+
+# We lost all the handles
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_TABLE_HANDLES_LOST';
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_table_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_table_inst-master.opt
new file mode 100644
index 00000000000..50abd1264f5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_table_inst-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_max_table_instances=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_table_inst.test b/mysql-test/suite/perfschema/t/start_server_no_table_inst.test
new file mode 100644
index 00000000000..bd6ad54325e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_table_inst.test
@@ -0,0 +1,30 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no instances
+show variables like "performance_schema_max_table_instances";
+
+# Expect handles
+show variables like "performance_schema_max_table_handles";
+
+# Create an instrumented table
+--disable_warnings
+drop table if exists test.instrument_me;
+--enable_warnings
+
+create table test.instrument_me(a int);
+insert into test.instrument_me values (1), (2), (3);
+select * from test.instrument_me;
+drop table test.instrument_me;
+
+# We lost all the instances
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_TABLE_INSTANCES_LOST';
+
+# Expect no handle lost
+show status like "performance_schema_table_handles_lost";
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_thread_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_thread_class-master.opt
index 91286cef859..f3facc9516c 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_thread_class-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_no_thread_class-master.opt
@@ -1 +1,2 @@
---loose-enable-performance-schema --loose-performance_schema_max_thread_classes=0
+--loose-enable-performance-schema
+--loose-performance_schema_max_thread_classes=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_thread_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_thread_inst-master.opt
index 6e9d13c2b4c..ba1e47500fc 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_thread_inst-master.opt
+++ b/mysql-test/suite/perfschema/t/start_server_no_thread_inst-master.opt
@@ -1 +1,2 @@
---loose-enable-performance-schema --loose-performance_schema_max_thread_instances=0
+--loose-enable-performance-schema
+--loose-performance_schema_max_thread_instances=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_user-master.opt b/mysql-test/suite/perfschema/t/start_server_no_user-master.opt
new file mode 100644
index 00000000000..50571a72bea
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_user-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_users_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_user.test b/mysql-test/suite/perfschema/t/start_server_no_user.test
new file mode 100644
index 00000000000..549b90a5851
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_user.test
@@ -0,0 +1,16 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no records
+show variables like "performance_schema_users_size";
+
+select count(*) from performance_schema.users;
+
+# We lost all the data
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_USERS_LOST';
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_waits_history-master.opt b/mysql-test/suite/perfschema/t/start_server_no_waits_history-master.opt
new file mode 100644
index 00000000000..334f805e2d5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_waits_history-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_events_waits_history_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_waits_history.test b/mysql-test/suite/perfschema/t/start_server_no_waits_history.test
new file mode 100644
index 00000000000..2ee7dba2526
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_waits_history.test
@@ -0,0 +1,14 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no history
+show variables like "performance_schema_events_waits_history_size";
+select count(*) from performance_schema.events_waits_history;
+
+# Valid operation, edge case
+truncate table performance_schema.events_waits_history;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_no_waits_history_long-master.opt b/mysql-test/suite/perfschema/t/start_server_no_waits_history_long-master.opt
new file mode 100644
index 00000000000..ca6699f8111
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_waits_history_long-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_events_waits_history_long_size=0
diff --git a/mysql-test/suite/perfschema/t/start_server_no_waits_history_long.test b/mysql-test/suite/perfschema/t/start_server_no_waits_history_long.test
new file mode 100644
index 00000000000..e393304a94d
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_no_waits_history_long.test
@@ -0,0 +1,14 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no history long
+show variables like "performance_schema_events_waits_history_long_size";
+select count(*) from performance_schema.events_waits_history_long;
+
+# Valid operation, edge case
+truncate table performance_schema.events_waits_history_long;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_nothing-master.opt b/mysql-test/suite/perfschema/t/start_server_nothing-master.opt
new file mode 100644
index 00000000000..0203918849b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_nothing-master.opt
@@ -0,0 +1,37 @@
+--loose-enable-performance-schema
+
+--loose-performance_schema_events_waits_history_long_size=0
+--loose-performance_schema_events_waits_history_size=0
+
+--loose-performance_schema_max_mutex_classes=0
+--loose-performance_schema_max_rwlock_classes=0
+--loose-performance_schema_max_cond_classes=0
+--loose-performance_schema_max_file_classes=0
+--loose-performance_schema_max_thread_classes=0
+--loose-performance_schema_max_socket_classes=0
+
+--loose-performance_schema_max_mutex_instances=0
+--loose-performance_schema_max_rwlock_instances=0
+--loose-performance_schema_max_cond_instances=0
+--loose-performance_schema_max_file_instances=0
+--loose-performance_schema_max_thread_instances=0
+--loose-performance_schema_max_socket_instances=0
+
+--loose-performance_schema_max_table_instances=0
+--loose-performance_schema_max_file_handles=0
+--loose-performance_schema_max_table_handles=0
+
+--loose-performance_schema_setup_actors_size=0
+--loose-performance_schema_setup_objects_size=0
+--loose-performance_schema_accounts_size=0
+--loose-performance_schema_hosts_size=0
+--loose-performance_schema_users_size=0
+
+--loose-performance_schema_max_stage_classes=0
+--loose-performance_schema_events_stages_history_long_size=0
+--loose-performance_schema_events_stages_history_size=0
+
+--loose-performance_schema_max_statement_classes=0
+--loose-performance_schema_events_statements_history_long_size=0
+--loose-performance_schema_events_statements_history_size=0
+
diff --git a/mysql-test/suite/perfschema/t/start_server_nothing.test b/mysql-test/suite/perfschema/t/start_server_nothing.test
new file mode 100644
index 00000000000..61f70dcfdb5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/start_server_nothing.test
@@ -0,0 +1,58 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+show variables like "performance_schema%";
+
+# Not empty
+select * from performance_schema.setup_instruments;
+select TIMER_NAME from performance_schema.performance_timers;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_timers;
+
+# All empty
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.hosts;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_objects;
+select * from performance_schema.threads;
+select * from performance_schema.users;
+
diff --git a/mysql-test/suite/perfschema/t/start_server_off.test b/mysql-test/suite/perfschema/t/start_server_off.test
index 4b24b2263cb..a46c2898865 100644
--- a/mysql-test/suite/perfschema/t/start_server_off.test
+++ b/mysql-test/suite/perfschema/t/start_server_off.test
@@ -8,3 +8,14 @@
# Expecting all off / zero
show status like "performance_schema%";
+# Expect all consumers disabled
+
+select * from performance_schema.setup_consumers;
+
+# Expect no instruments
+
+select * from performance_schema.setup_instruments;
+
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
diff --git a/mysql-test/suite/perfschema/t/statement_digest.test b/mysql-test/suite/perfschema/t/statement_digest.test
new file mode 100644
index 00000000000..24c43cdbac4
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/statement_digest.test
@@ -0,0 +1,23 @@
+# -----------------------------------------------------------------------
+# Tests for the performance schema statement Digests.
+# -----------------------------------------------------------------------
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+# Initial Setup for Digest
+--source ../include/digest_setup.inc
+
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+
+# Executing queries
+--source ../include/digest_execution.inc
+
+--echo ####################################
+--echo # QUERYING PS STATEMENT DIGEST
+--echo ####################################
+SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
+ SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
+
+# Cleanup for Digest
+--source ../include/digest_cleanup.inc
diff --git a/mysql-test/suite/perfschema/t/statement_digest_consumers-master.opt b/mysql-test/suite/perfschema/t/statement_digest_consumers-master.opt
new file mode 100644
index 00000000000..a13a5a2ca4a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/statement_digest_consumers-master.opt
@@ -0,0 +1,2 @@
+--loose-performance_schema_consumer_statements_digest=1
+--loose-performance_schema_consumer_events_statements_current=0
diff --git a/mysql-test/suite/perfschema/t/statement_digest_consumers.test b/mysql-test/suite/perfschema/t/statement_digest_consumers.test
new file mode 100644
index 00000000000..e7721d770ea
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/statement_digest_consumers.test
@@ -0,0 +1,35 @@
+# ----------------------------------------------------
+# Tests for the performance schema statement Digests.
+# ----------------------------------------------------
+
+# Test case to show behavior of statements digest in combination of different
+# consumers enabled/disabled
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+# Initial Setup for Digest
+--source ../include/digest_setup.inc
+
+# -----------------------------------------
+# Consumer State |
+# -----------------------------------------
+# statements_digest Disabled |
+# events_statement_current Enabled |
+# -----------------------------------------
+
+SELECT * FROM performance_schema.setup_consumers;
+
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+
+# Executing queries
+--source ../include/digest_execution.inc
+
+--echo ####################################
+--echo # QUERYING PS STATEMENT DIGEST
+--echo ####################################
+SELECT digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
+SELECT digest, digest_text FROM performance_schema.events_statements_current;
+
+# Cleanup for Digest
+--source ../include/digest_cleanup.inc
diff --git a/mysql-test/suite/perfschema/t/statement_digest_consumers2-master.opt b/mysql-test/suite/perfschema/t/statement_digest_consumers2-master.opt
new file mode 100644
index 00000000000..60ce703cad9
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/statement_digest_consumers2-master.opt
@@ -0,0 +1,2 @@
+--loose-performance_schema_consumer_statements_digest=0
+--loose-performance_schema_consumer_events_statements_current=1
diff --git a/mysql-test/suite/perfschema/t/statement_digest_consumers2.test b/mysql-test/suite/perfschema/t/statement_digest_consumers2.test
new file mode 100644
index 00000000000..72bf5241ee8
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/statement_digest_consumers2.test
@@ -0,0 +1,37 @@
+# ----------------------------------------------------
+# Tests for the performance schema statement Digests.
+# ----------------------------------------------------
+
+# Test case to show behavior of statements digest in combination of different
+# consumers enabled/disabled
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+# Initial Setup for Digest
+--source ../include/digest_setup.inc
+
+# -----------------------------------------
+# Consumer State |
+# -----------------------------------------
+# statements_digest Enabled |
+# events_statement_current Disabled |
+# global_implementation Disabled ? |
+# thread_implementation Disabled ? |
+# -----------------------------------------
+
+SELECT * FROM performance_schema.setup_consumers;
+
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+
+# Executing queries
+--source ../include/digest_execution.inc
+
+--echo ####################################
+--echo # QUERYING PS STATEMENT DIGEST
+--echo ####################################
+SELECT digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
+SELECT digest, digest_text FROM performance_schema.events_statements_current;
+
+# Cleanup for Digest
+--source ../include/digest_cleanup.inc
diff --git a/mysql-test/suite/perfschema/t/statement_digest_long_query-master.opt b/mysql-test/suite/perfschema/t/statement_digest_long_query-master.opt
new file mode 100644
index 00000000000..3f9d7900961
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/statement_digest_long_query-master.opt
@@ -0,0 +1 @@
+--thread_stack=655360
diff --git a/mysql-test/suite/perfschema/t/statement_digest_long_query.test b/mysql-test/suite/perfschema/t/statement_digest_long_query.test
new file mode 100644
index 00000000000..fdc9496c4f1
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/statement_digest_long_query.test
@@ -0,0 +1,23 @@
+# -----------------------------------------------------------------------
+# 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_summary_by_digest;
+
+# -----------------------------------------------------------------------
+# Test to show how the digest behaves with long queries, when the token
+# stream is truncated (digest text should end with "...")
+# NOTE: For this test case to run, we need to start mysql server
+# with bigger stack using "--thread_stack=#" option.
+# -----------------------------------------------------------------------
+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+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+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+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 digest, digest_text, count_star FROM events_statements_summary_by_digest;
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_global_2u_2t.test b/mysql-test/suite/perfschema/t/table_aggregate_global_2u_2t.test
new file mode 100644
index 00000000000..240be494428
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_global_2u_2t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_global_2u_3t.test b/mysql-test/suite/perfschema/t/table_aggregate_global_2u_3t.test
new file mode 100644
index 00000000000..cfee45056bd
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_global_2u_3t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_global_4u_2t.test b/mysql-test/suite/perfschema/t/table_aggregate_global_4u_2t.test
new file mode 100644
index 00000000000..a523ee6cce9
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_global_4u_2t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 4users by default
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_global_4u_3t.test b/mysql-test/suite/perfschema/t/table_aggregate_global_4u_3t.test
new file mode 100644
index 00000000000..01cae774f5d
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_global_4u_3t.test
@@ -0,0 +1,17 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 4users by default
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_hist_2u_2t.test b/mysql-test/suite/perfschema/t/table_aggregate_hist_2u_2t.test
new file mode 100644
index 00000000000..518ca74f549
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_hist_2u_2t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# hist by default
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_hist_2u_3t.test b/mysql-test/suite/perfschema/t/table_aggregate_hist_2u_3t.test
new file mode 100644
index 00000000000..6ebaf2f441d
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_hist_2u_3t.test
@@ -0,0 +1,17 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# hist by default
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_hist_4u_2t.test b/mysql-test/suite/perfschema/t/table_aggregate_hist_4u_2t.test
new file mode 100644
index 00000000000..ac8f6f83f4b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_hist_4u_2t.test
@@ -0,0 +1,17 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# hist by default
+
+# 4users by default
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_hist_4u_3t.test b/mysql-test/suite/perfschema/t/table_aggregate_hist_4u_3t.test
new file mode 100644
index 00000000000..4201db1a3aa
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_hist_4u_3t.test
@@ -0,0 +1,15 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# hist by default
+
+# 4users by default
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_off.test b/mysql-test/suite/perfschema/t/table_aggregate_off.test
new file mode 100644
index 00000000000..a56d6a9b905
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_off.test
@@ -0,0 +1,13 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# off
+update performance_schema.setup_consumers
+ set enabled='NO' where name='global_instrumentation';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_thread_2u_2t.test b/mysql-test/suite/perfschema/t/table_aggregate_thread_2u_2t.test
new file mode 100644
index 00000000000..ff1bd616d61
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_thread_2u_2t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_thread_2u_3t.test b/mysql-test/suite/perfschema/t/table_aggregate_thread_2u_3t.test
new file mode 100644
index 00000000000..6f33fd63070
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_thread_2u_3t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_thread_4u_2t.test b/mysql-test/suite/perfschema/t/table_aggregate_thread_4u_2t.test
new file mode 100644
index 00000000000..e01edbc64e9
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_thread_4u_2t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 4users by default
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_aggregate_thread_4u_3t.test b/mysql-test/suite/perfschema/t/table_aggregate_thread_4u_3t.test
new file mode 100644
index 00000000000..1e67fbdde45
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_aggregate_thread_4u_3t.test
@@ -0,0 +1,17 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io and table lock by default
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 4users by default
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_global_2u_2t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_global_2u_2t.test
new file mode 100644
index 00000000000..025bb8af67b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_global_2u_2t.test
@@ -0,0 +1,23 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_global_2u_3t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_global_2u_3t.test
new file mode 100644
index 00000000000..da566c99b21
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_global_2u_3t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_global_4u_2t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_global_4u_2t.test
new file mode 100644
index 00000000000..9d03b1b192f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_global_4u_2t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 4users by default
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_global_4u_3t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_global_4u_3t.test
new file mode 100644
index 00000000000..90a5994018b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_global_4u_3t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 4users by default
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_hist_2u_2t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_hist_2u_2t.test
new file mode 100644
index 00000000000..7c01bd0196c
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_hist_2u_2t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# hist by default
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_hist_2u_3t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_hist_2u_3t.test
new file mode 100644
index 00000000000..b817059c9c2
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_hist_2u_3t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# hist by default
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_hist_4u_2t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_hist_4u_2t.test
new file mode 100644
index 00000000000..6b6c3906e33
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_hist_4u_2t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# hist by default
+
+# 4users by default
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_hist_4u_3t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_hist_4u_3t.test
new file mode 100644
index 00000000000..ff4c74f87be
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_hist_4u_3t.test
@@ -0,0 +1,17 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# hist by default
+
+# 4users by default
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_thread_2u_2t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_thread_2u_2t.test
new file mode 100644
index 00000000000..6e70be45fab
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_thread_2u_2t.test
@@ -0,0 +1,23 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_thread_2u_3t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_thread_2u_3t.test
new file mode 100644
index 00000000000..3dca2916079
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_thread_2u_3t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_thread_4u_2t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_thread_4u_2t.test
new file mode 100644
index 00000000000..e14ccf38fb3
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_thread_4u_2t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 4users by default
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_io_aggregate_thread_4u_3t.test b/mysql-test/suite/perfschema/t/table_io_aggregate_thread_4u_3t.test
new file mode 100644
index 00000000000..eaf55d6afff
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_io_aggregate_thread_4u_3t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table io
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/lock/table/sql/handler';
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 4users by default
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_global_2u_2t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_global_2u_2t.test
new file mode 100644
index 00000000000..c64838b206b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_global_2u_2t.test
@@ -0,0 +1,23 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_global_2u_3t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_global_2u_3t.test
new file mode 100644
index 00000000000..7a0676c6006
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_global_2u_3t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_global_4u_2t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_global_4u_2t.test
new file mode 100644
index 00000000000..fb9f896eeca
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_global_4u_2t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 4users by default
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_global_4u_3t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_global_4u_3t.test
new file mode 100644
index 00000000000..eb9b7b4faa8
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_global_4u_3t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# global
+update performance_schema.setup_consumers
+ set enabled='NO' where name='thread_instrumentation';
+
+# 4users by default
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_2u_2t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_2u_2t.test
new file mode 100644
index 00000000000..5d1f36228e8
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_2u_2t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# hist by default
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_2u_3t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_2u_3t.test
new file mode 100644
index 00000000000..b1e4043f12f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_2u_3t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# hist by default
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_4u_2t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_4u_2t.test
new file mode 100644
index 00000000000..53992612fc2
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_4u_2t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# hist by default
+
+# 4users by default
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_4u_3t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_4u_3t.test
new file mode 100644
index 00000000000..05306d74d8b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_hist_4u_3t.test
@@ -0,0 +1,17 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# hist by default
+
+# 4users by default
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_2u_2t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_2u_2t.test
new file mode 100644
index 00000000000..4376b49eb3c
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_2u_2t.test
@@ -0,0 +1,23 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_2u_3t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_2u_3t.test
new file mode 100644
index 00000000000..d1412b148da
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_2u_3t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 2users
+delete from performance_schema.setup_actors
+ where user in ('user2', 'user4');
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_4u_2t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_4u_2t.test
new file mode 100644
index 00000000000..46ab5ce3b01
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_4u_2t.test
@@ -0,0 +1,21 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 4users by default
+
+# 2tables
+delete from performance_schema.setup_objects
+ where object_name='t2';
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_4u_3t.test b/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_4u_3t.test
new file mode 100644
index 00000000000..9ee66735961
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_lock_aggregate_thread_4u_3t.test
@@ -0,0 +1,19 @@
+# Tests for the performance schema
+
+--source ../include/table_aggregate_setup.inc
+
+# table lock
+update performance_schema.setup_instruments
+ set enabled='NO' where name='wait/io/table/sql/handler';
+
+# thread
+update performance_schema.setup_consumers
+ set enabled='NO' where name like 'event%';
+
+# 4users by default
+
+# 3tables by default
+
+--source ../include/table_aggregate_load.inc
+--source ../include/table_aggregate_cleanup.inc
+
diff --git a/mysql-test/suite/perfschema/t/table_schema.test b/mysql-test/suite/perfschema/t/table_schema.test
new file mode 100644
index 00000000000..f903419bd78
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/table_schema.test
@@ -0,0 +1,57 @@
+# Test to detect changest to the PERFORMANCE_SCHEMA table schemas
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+# Use the INFORMATION_SCHEMA to examine the tables in the PERFORMANCE_SCHEMA
+# and detect any tables that have changed.
+
+select * from information_schema.columns where table_schema="performance_schema"
+ order by table_name, ordinal_position;
+
+# Bug#11766504 "59631: BIGINT UNSIGNED BYTE RELATED COLUMNS IN PERFORMANCE_SCHEMA"
+
+# Goal: Confirm that all byte related columns are BIGINT signed. This test will
+# not have to be changed to accommodate new or deleted columns.
+
+# Count the number of NUMBER_OF_BYTES columns.
+
+select count(*) from information_schema.columns
+ where table_schema="performance_schema" and data_type = "bigint"
+ and column_name like "%number_of_bytes" into @count_byte_columns;
+
+# Confirm that at least one column was found.
+
+select @count_byte_columns > 0;
+
+# Confirm that all NUMBER_OF_BYTES columns are BIGINT signed.
+
+select count(*) from information_schema.columns
+ where table_schema="performance_schema" and data_type="bigint"
+ and column_name like "%number_of_bytes"
+ and column_type not like "%unsigned" into @count_byte_signed;
+
+select (@count_byte_columns - @count_byte_signed) = 0;
+
+# Similar test for OBJECT_INSTANCE_BEGIN values, which are typically derived
+# from a memory address and must therefore be unsigned.
+#
+# Count the number of OBJECT_INSTANCE_BEGIN columns.
+
+select count(*) from information_schema.columns
+ where table_schema="performance_schema" and data_type = "bigint"
+ and column_name like "%object_instance_begin" into @count_object_columns;
+
+# Confirm that at least one column was found.
+
+select @count_object_columns > 0;
+
+# Confirm that all OBJECT_INSTANCE_BEGIN columns are BIGINT unsigned.
+
+select count(*) from information_schema.columns
+ where table_schema="performance_schema" and data_type="bigint"
+ and column_name like "%object_instance_begin"
+ and column_type like "%unsigned" into @count_object_unsigned;
+
+select (@count_object_columns - @count_object_unsigned) = 0;
+
diff --git a/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test b/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
index e06a8fae892..09e3d3aaa2c 100644
--- a/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
+++ b/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
@@ -12,12 +12,8 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
-# The message prints 'mysql.setup_instruments'
-# instead of 'performance_schema.setup_instruments',
-# due to Bug#46792
-
call mtr.add_suppression(
-"Column count of mysql.setup_instruments is wrong. "
+"Column count of performance_schema.setup_instruments is wrong. "
"Expected 4, found 3. The table is probably corrupted");
--error ER_WRONG_NATIVE_TABLE_STRUCTURE
diff --git a/mysql-test/suite/perfschema/t/temp_table_io.test b/mysql-test/suite/perfschema/t/temp_table_io.test
new file mode 100644
index 00000000000..7a4d69997ab
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/temp_table_io.test
@@ -0,0 +1,28 @@
+# Tests for PERFORMANCE_SCHEMA table io
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/table_io_setup_helper.inc
+
+let $engine_type= MyISAM;
+let $table_item= test.no_index_tab;
+--disable_warnings
+eval drop temporary table if exists $table_item;
+--enable_warnings
+
+# Start recording events
+update performance_schema.setup_consumers set enabled = 'YES';
+insert into marker set a = 1;
+eval create temporary table $table_item
+( a varchar(255) not null, b int not null) engine = $engine_type;
+insert into marker set a = 1;
+eval show create table $table_item;
+--source ../include/table_io_basic_dml.inc
+eval drop temporary table $table_item;
+
+# Stop recording events + pull result
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/suite/perfschema/t/thread_cache-master.opt b/mysql-test/suite/perfschema/t/thread_cache-master.opt
new file mode 100644
index 00000000000..52d8d233ea2
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/thread_cache-master.opt
@@ -0,0 +1 @@
+--loose-performance_schema_max_thread_class=200
diff --git a/mysql-test/suite/perfschema/t/thread_cache.test b/mysql-test/suite/perfschema/t/thread_cache.test
index cef0c2553f5..4ebadfde9fb 100644
--- a/mysql-test/suite/perfschema/t/thread_cache.test
+++ b/mysql-test/suite/perfschema/t/thread_cache.test
@@ -3,6 +3,12 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
+#
+# Important note:
+# this test is extremely sensitive to how threads are running inside the server,
+# so it has it's own -master.opt file, to enforce it runs alone in mysqld
+#
+
# Setup
flush status;
@@ -43,6 +49,10 @@ select @thread_id_increment;
--connection default
+# Debug
+# select * from performance_schema.threads
+# where name like "thread/sql/one_connection";
+
# Wait for the disconnect con2 to complete
let $wait_condition=
select count(*) = 2 from performance_schema.threads
@@ -61,6 +71,10 @@ let $con3_THREAD_ID=`select thread_id from performance_schema.threads
--connection default
+# Debug
+# select * from performance_schema.threads
+# where name like "thread/sql/one_connection";
+
# Wait for the disconnect con1 and con3 to complete
let $wait_condition=
select count(*) = 1 from performance_schema.threads
@@ -107,6 +121,10 @@ select @thread_id_increment;
--connection default
+# Debug
+# select * from performance_schema.threads
+# where name like "thread/sql/one_connection";
+
# Wait for the disconnect con2 to complete
let $wait_condition=
select count(*) = 2 from performance_schema.threads
@@ -125,6 +143,10 @@ let $con3_THREAD_ID=`select thread_id from performance_schema.threads
--connection default
+# Debug
+# select * from performance_schema.threads
+# where name like "thread/sql/one_connection";
+
# Wait for the disconnect con1 and con3 to complete
let $wait_condition=
select count(*) = 1 from performance_schema.threads
diff --git a/mysql-test/suite/perfschema/t/threads_innodb.test b/mysql-test/suite/perfschema/t/threads_innodb.test
new file mode 100644
index 00000000000..66bceab724a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/threads_innodb.test
@@ -0,0 +1,20 @@
+
+# Tests for special content of performance_schema.threads
+#
+# Show InnoDB related content in performance_schema.threads
+
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/have_perfschema.inc
+
+# There are several InnoDB io_handler_threads servicing for read IO, write IO etc.
+# The number of these threads is at least for some types configurable.
+# We suppress here duplicates rows with the goal to avoid that the test fails
+# in case some defaults are changed.
+SELECT name, type, processlist_user, processlist_host, processlist_db,
+ processlist_command, processlist_time, processlist_state, processlist_info,
+ parent_thread_id, role, instrumented
+FROM performance_schema.threads
+WHERE name LIKE 'thread/innodb/%'
+GROUP BY name;
+
diff --git a/mysql-test/suite/perfschema/t/threads_insert_delayed.test b/mysql-test/suite/perfschema/t/threads_insert_delayed.test
new file mode 100644
index 00000000000..a9f3edc6cfe
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/threads_insert_delayed.test
@@ -0,0 +1,40 @@
+
+# Tests for special content of performance_schema.threads
+#
+# The feature INSERT DELAYED (supported by MyISAM,MEMORY,ARCHIVE,BLACKHOLE)
+# causes that a "delayed_insert" thread shows up as soon as the first
+# INSERT DELAYED was issued.
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TEMPORARY TABLE IF EXISTS t2;
+--enable_warnings
+CREATE TABLE t1 (f1 BIGINT) ENGINE = MyISAM;
+CREATE TEMPORARY TABLE t2 AS
+SELECT thread_id FROM performance_schema.threads WHERE 1 = 2;
+
+# Reveal that the delayed_insert thread does not exist.
+# Note(mleich): This expectation is probably not all time true.
+SELECT COUNT(*) = 0 AS expect_1 FROM performance_schema.threads
+WHERE name = 'thread/sql/delayed_insert';
+
+INSERT INTO t2 SELECT thread_id
+FROM performance_schema.threads;
+
+let $wait_condition= SELECT COUNT(*) = 1 AS expect_0 FROM performance_schema.threads
+WHERE name = 'thread/sql/delayed_insert';
+INSERT DELAYED INTO t1 SET f1 = SLEEP(3);
+--source include/wait_condition.inc
+
+# Expect to get
+# thread/sql/delayed_insert FOREGROUND YES root localhost
+SELECT name, type, instrumented, processlist_user, processlist_host
+FROM performance_schema.threads
+WHERE thread_id NOT IN (SELECT thread_id FROM t2);
+
+DROP TABLE t1;
+DROP TEMPORARY TABLE t2;
+
diff --git a/mysql-test/suite/perfschema/t/threads_mysql-master.opt b/mysql-test/suite/perfschema/t/threads_mysql-master.opt
new file mode 100644
index 00000000000..f93413a61e5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/threads_mysql-master.opt
@@ -0,0 +1 @@
+--event-scheduler
diff --git a/mysql-test/suite/perfschema/t/threads_mysql.test b/mysql-test/suite/perfschema/t/threads_mysql.test
new file mode 100644
index 00000000000..8576c8767d6
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/threads_mysql.test
@@ -0,0 +1,128 @@
+
+# Tests for special content of performance_schema.threads
+#
+# Show MySQL server related content in performance_schema.threads
+
+--source include/not_windows.inc
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+# Ensure that the event scheduler (started via threads_mysql-master.opt)
+# is really running.
+--source include/running_event_scheduler.inc
+
+SET GLOBAL event_scheduler = OFF;
+--source include/no_running_event_scheduler.inc
+
+# threads are removed from:
+# - information_schema.processlist
+# - performance_schema.threads
+# at different times, so we may have to wait a little more
+# for the event_scheduler to shutdown
+#
+let $wait_timeout= 1;
+let $wait_condition=
+ SELECT COUNT(*) = 0 FROM performance_schema.threads
+ WHERE name like 'thread/sql/event%';
+--source include/wait_condition.inc
+
+--vertical_results
+
+# Show all "system" threads except the event scheduler
+# ---------------------------------------------------
+# 0. The values within the columns "thread_id" and "processlist_id" depend
+# on server history. Therefore they are unstable and need to be omitted.
+# 1. The columns "time" and "state" are omitted because it is thinkable that
+# they contain slightly unstable though correct values.
+# 2. The unification of the column "parent_thread_id" is in the moment most
+# probably not required because I observed all time that the parent is
+# "thread/sql/main" with the thread_id = 1.
+# But there might be more kinds of parents with most probably unstable
+# "thread_id" values in future.
+# 3. In case the test is started with the option "--ps-protocol" we will
+# find a correcet row for our current thread but the content will differ.
+# Therefore we have to disable this protocol for the next statement.
+--disable_ps_protocol
+SELECT name, type, processlist_user, processlist_host, processlist_db,
+ processlist_command, processlist_info,
+ IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
+ AS unified_parent_thread_id,
+ role, instrumented
+FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%'
+ORDER BY name;
+--enable_ps_protocol
+
+CREATE TEMPORARY TABLE t1 AS
+SELECT thread_id FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%';
+
+
+SET GLOBAL event_scheduler = ON;
+--source include/running_event_scheduler.inc
+
+# Show entries belonging to the just started event scheduler
+SELECT name, type, processlist_user, processlist_host, processlist_db,
+ processlist_command, processlist_info,
+ IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
+ AS unified_parent_thread_id,
+ role, instrumented
+FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%'
+ AND thread_id NOT IN (SELECT thread_id FROM t1)
+ORDER BY name;
+
+TRUNCATE t1;
+INSERT INTO t1
+SELECT thread_id FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%';
+SELECT COUNT(*) INTO @aux FROM t1;
+
+# Attention:
+# Just waiting for some new thread showing up is not sufficient because
+# because the successing SELECT showing the thread might catch this thread
+# in a very early and short phase.
+# process_info si quite often
+# CREATE PROCEDURE `t_ps_event`() SQL SECURITY INVOKER SELECT SLEEP(3)
+#
+let $wait_condition=
+SELECT COUNT(*) = 1 FROM information_schema.processlist
+WHERE info = 'SELECT SLEEP(3)';
+
+--disable_warnings
+DROP EVENT IF EXISTS t_ps_event;
+--enable_warnings
+CREATE EVENT t_ps_event
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
+DO SELECT SLEEP(3);
+
+# Wait till one more thread comes up.
+# This must be the event worker thread.
+let $wait_timeout= 20;
+--source include/wait_condition.inc
+
+# Show entries belonging to the just started event worker
+SELECT name, type, processlist_user, processlist_host, processlist_db,
+ processlist_command, processlist_info,
+ IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
+ AS unified_parent_thread_id,
+ role, instrumented
+FROM performance_schema.threads
+WHERE name LIKE 'thread/sql%'
+ AND thread_id NOT IN (SELECT thread_id FROM t1)
+ORDER BY name;
+
+# Show parent - child relations between "system" threads
+# ------------------------------------------------------
+--horizontal_results
+SELECT t2.name AS parent_thread_name, t1.name AS child_thread_name
+FROM performance_schema.threads t1 INNER JOIN performance_schema.threads t2
+ON t1.parent_thread_id = t2.thread_id
+WHERE t1.name LIKE 'thread/sql%'
+ AND t1.parent_thread_id IS NOT NULL
+ORDER BY parent_thread_name, child_thread_name;
+
+# Cleanup
+# Wait till the event worker disappeared
+--source include/no_running_events.inc
+
diff --git a/mysql-test/suite/perfschema/t/trigger_table_io.test b/mysql-test/suite/perfschema/t/trigger_table_io.test
new file mode 100644
index 00000000000..090d64e330e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/trigger_table_io.test
@@ -0,0 +1,74 @@
+# Tests for PERFORMANCE_SCHEMA table io
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/table_io_setup_helper.inc
+
+let $engine_type= MyISAM;
+
+--disable_warnings
+drop table if exists test.t1;
+drop table if exists test.t2;
+--enable_warnings
+
+eval create table test.t1 (a int, v int) engine = $engine_type;
+eval create table test.t2 (b int, v int) engine = $engine_type;
+
+create trigger t1_bi before insert on t1
+for each row insert into test.t2 set b = new.a, v = 0;
+
+create trigger t1_ai after insert on t1
+for each row update test.t2 set v = 1 where b = new.a;
+
+create trigger t1_bu before update on t1
+for each row update test.t2 set v = 3 where b = old.a;
+
+create trigger t1_au after update on t1
+for each row update test.t2 set v = 4 where b = new.a;
+
+create trigger t1_bd before delete on t1
+for each row delete from test.t2 where b = old.a;
+
+create trigger t1_ad after delete on t1
+for each row insert into test.t2 set b = old.a, v = 99;
+
+# Start recording events
+update performance_schema.setup_consumers set enabled = 'YES';
+
+# Code to test
+
+insert into marker set a = 1;
+insert into t1 set a = 1, v = 10;
+insert into marker set a = 1;
+insert into t1 set a = 2, v = 20;
+insert into marker set a = 1;
+select * from t1;
+insert into marker set a = 1;
+select * from t2;
+insert into marker set a = 1;
+update t1 set v = v + 100;
+insert into marker set a = 1;
+select * from t1;
+insert into marker set a = 1;
+select * from t2;
+insert into marker set a = 1;
+delete from t1 where a = 1;
+insert into marker set a = 1;
+select * from t1;
+insert into marker set a = 1;
+select * from t2;
+insert into marker set a = 1;
+delete from t1 where a = 2;
+insert into marker set a = 1;
+select * from t1;
+insert into marker set a = 1;
+select * from t2;
+
+# Stop recording events + pull results
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+drop table test.t1;
+drop table test.t2;
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/suite/perfschema/t/view_table_io.test b/mysql-test/suite/perfschema/t/view_table_io.test
new file mode 100644
index 00000000000..703f5414ba4
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/view_table_io.test
@@ -0,0 +1,39 @@
+# Tests for PERFORMANCE_SCHEMA table io
+# Reveal that in case of DML on an updatable view the
+# base table used within the view shows up whereas
+# the view itself never shows up.
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/table_io_setup_helper.inc
+
+let $engine_type= MyISAM;
+let $table_item= test.v1;
+
+--disable_warnings
+eval drop view if exists $table_item;
+drop table if exists test.no_index_tab;
+--enable_warnings
+
+
+# Start recording events
+update performance_schema.setup_consumers set enabled='YES';
+insert into marker set a = 1;
+eval create table test.no_index_tab
+( a varchar(255) not null, b int not null) engine = $engine_type;
+insert into marker set a = 1;
+# Make sure the proper engine is used
+show create table test.no_index_tab;
+insert into marker set a = 1;
+eval create view $table_item as select * from test.no_index_tab;
+--source ../include/table_io_basic_dml.inc
+eval drop view $table_item;
+insert into marker set a = 1;
+drop table test.no_index_tab;
+
+# Stop recording events + pull result
+--source ../include/table_io_result_helper.inc
+
+# Cleanup
+--source ../include/table_io_cleanup_helper.inc
+
diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test
index 341ec0591e7..eb4da99588c 100644
--- a/mysql-test/t/ssl.test
+++ b/mysql-test/t/ssl.test
@@ -13,6 +13,10 @@ connect (ssl_con,localhost,root,,,,,SSL);
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
+# Check ssl expiration
+SHOW STATUS LIKE 'Ssl_server_not_before';
+SHOW STATUS LIKE 'Ssl_server_not_after';
+
# Source select test case
-- source include/common-tests.inc
diff --git a/mysql-test/t/ssl_crl-master.opt b/mysql-test/t/ssl_crl-master.opt
new file mode 100644
index 00000000000..8500f8cd6e7
--- /dev/null
+++ b/mysql-test/t/ssl_crl-master.opt
@@ -0,0 +1,4 @@
+--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+--ssl-key=$MYSQL_TEST_DIR/std_data/crl-server-key.pem
+--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-server-cert.pem
+--ssl-crl=$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl
diff --git a/mysql-test/t/ssl_crl.test b/mysql-test/t/ssl_crl.test
new file mode 100644
index 00000000000..b12317b0381
--- /dev/null
+++ b/mysql-test/t/ssl_crl.test
@@ -0,0 +1,23 @@
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+-- source include/have_ssl_communication.inc
+-- source include/have_openssl.inc
+
+let $crllen=`select length(trim(coalesce(@@ssl_crl, ''))) + length(trim(coalesce(@@ssl_crlpath, '')))`;
+if (!$crllen)
+{
+ skip Needs OpenSSL;
+}
+
+--echo # test --crl for the client : should connect
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pem test --ssl-crl=$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl -e "SHOW VARIABLES like '%ssl%';"
+
+--echo # test --crlpath for the client : should connect
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pem --ssl-crlpath=$MYSQL_TEST_DIR/std_data/crldir test -e "SHOW VARIABLES like '%ssl%';"
+
+--echo # try logging in with a certificate in the server's --ssl-crl : should fail
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test -e "SHOW VARIABLES like '%ssl%';"
diff --git a/mysql-test/t/ssl_crl_clients-master.opt b/mysql-test/t/ssl_crl_clients-master.opt
new file mode 100644
index 00000000000..fa885a61a0c
--- /dev/null
+++ b/mysql-test/t/ssl_crl_clients-master.opt
@@ -0,0 +1,4 @@
+--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+--ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem
+--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem
+--ssl-crl=$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl
diff --git a/mysql-test/t/ssl_crl_clients.test b/mysql-test/t/ssl_crl_clients.test
new file mode 100644
index 00000000000..56f43b2425e
--- /dev/null
+++ b/mysql-test/t/ssl_crl_clients.test
@@ -0,0 +1,48 @@
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+-- source include/have_ssl_communication.inc
+-- source include/have_openssl.inc
+
+let $crllen=`select length(trim(coalesce(@@ssl_crl, ''))) + length(trim(coalesce(@@ssl_crlpath, '')))`;
+if (!$crllen)
+{
+ skip Needs OpenSSL;
+}
+
+--echo # Test clients with and without CRL lists
+
+let $ssl_base = --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-server-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-server-cert.pem;
+let $ssl_crl = $ssl_base --ssl-crl=$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl;
+let $ssl_crlpath = $ssl_base --ssl-crlpath=$MYSQL_TEST_DIR/std_data/crldir;
+
+
+--echo ############ Test mysql ##############
+
+--echo # Test mysql connecting to a server with a certificate revoked by -crl
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1
+--exec $MYSQL $ssl_crl test -e "SHOW VARIABLES like '%ssl%';"
+
+--echo # Test mysql connecting to a server with a certificate revoked by -crlpath
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1
+--exec $MYSQL $ssl_crlpath test -e "SHOW VARIABLES like '%ssl%';"
+
+
+--echo ############ Test mysqladmin ##############
+let $admin_prefix = --no-defaults;
+let $admin_suffix = --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping;
+
+--echo # Test mysqladmin connecting to a server with a certificate revoked by -crl
+--disable_result_log
+--replace_regex /.*mysqladmin.*: connect/mysqladmin: connect/
+--error 1
+--exec $MYSQLADMIN $admin_prefix $ssl_crl $admin_suffix 2>&1
+--enable_result_log
+
+--disable_result_log
+--echo # Test mysqladmin connecting to a server with a certificate revoked by -crlpath
+--replace_regex /.*mysqladmin.*: connect/mysqladmin: connect/
+--error 1
+--exec $MYSQLADMIN $admin_prefix $ssl_crlpath $admin_suffix 2>&1
+--enable_result_log
diff --git a/mysql-test/t/ssl_crl_clients_valid-master.opt b/mysql-test/t/ssl_crl_clients_valid-master.opt
new file mode 100644
index 00000000000..258df564eba
--- /dev/null
+++ b/mysql-test/t/ssl_crl_clients_valid-master.opt
@@ -0,0 +1,4 @@
+--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+--ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem
+--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pem
+--ssl-crl=$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl
diff --git a/mysql-test/t/ssl_crl_clients_valid.test b/mysql-test/t/ssl_crl_clients_valid.test
new file mode 100644
index 00000000000..ff120693d85
--- /dev/null
+++ b/mysql-test/t/ssl_crl_clients_valid.test
@@ -0,0 +1,30 @@
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+-- source include/have_ssl_communication.inc
+-- source include/have_openssl.inc
+
+let $crllen=`select length(trim(coalesce(@@ssl_crl, ''))) + length(trim(coalesce(@@ssl_crlpath, '')))`;
+if (!$crllen)
+{
+ skip Needs OpenSSL;
+}
+
+--echo # Test clients with and without CRL lists
+
+let $ssl_base = --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-server-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-server-cert.pem;
+let $ssl_crl = $ssl_base --ssl-crl=$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl;
+let $ssl_crlpath = $ssl_base --ssl-crlpath=$MYSQL_TEST_DIR/std_data/crldir;
+
+
+--echo ############ Test mysql ##############
+
+--echo # Test mysql connecting to a server with an empty crl
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL $ssl_crl test -e "SHOW VARIABLES like '%ssl%';" 2>&1
+
+--echo ############ Test mysqladmin ##############
+let $admin_prefix = --no-defaults;
+let $admin_suffix = --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping;
+
+--echo # Test mysqladmin connecting to a server with an empty crl
+--exec $MYSQLADMIN $admin_prefix $ssl_crl $admin_suffix 2>&1
diff --git a/mysql-test/t/ssl_crl_clrpath-master.opt b/mysql-test/t/ssl_crl_clrpath-master.opt
new file mode 100644
index 00000000000..b1f486a322b
--- /dev/null
+++ b/mysql-test/t/ssl_crl_clrpath-master.opt
@@ -0,0 +1,4 @@
+--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+--ssl-key=$MYSQL_TEST_DIR/std_data/crl-server-key.pem
+--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-server-cert.pem
+--ssl-crlpath=$MYSQL_TEST_DIR/std_data/crldir
diff --git a/mysql-test/t/ssl_crl_clrpath.test b/mysql-test/t/ssl_crl_clrpath.test
new file mode 100644
index 00000000000..2f1af145574
--- /dev/null
+++ b/mysql-test/t/ssl_crl_clrpath.test
@@ -0,0 +1,23 @@
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+-- source include/have_ssl_communication.inc
+-- source include/have_openssl.inc
+
+let $crllen=`select length(trim(coalesce(@@ssl_crl, ''))) + length(trim(coalesce(@@ssl_crlpath, '')))`;
+if (!$crllen)
+{
+ skip Needs OpenSSL;
+}
+
+--echo # test --crl for the client : should connect
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pem test --ssl-crl=$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl -e "SHOW VARIABLES like '%ssl%';"
+
+--echo # test --crlpath for the client : should connect
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pem --ssl-crlpath=$MYSQL_TEST_DIR/std_data/crldir test -e "SHOW VARIABLES like '%ssl%';"
+
+--echo # try logging in with a certificate in the server's --ssl-crlpath : should fail
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test -e "SHOW VARIABLES like '%ssl%';"
diff --git a/mysys/charset.c b/mysys/charset.c
index cc1d0a0111e..a561291ba37 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -349,6 +349,17 @@ static int add_collation(struct charset_info_st *cs)
return MY_XML_OK;
}
+/**
+ Report character set initialization errors and warnings.
+ Be silent by default: no warnings on the client side.
+*/
+static void
+default_reporter(enum loglevel level __attribute__ ((unused)),
+ const char *format __attribute__ ((unused)),
+ ...)
+{
+}
+my_error_reporter my_charset_error_reporter= default_reporter;
#define MY_MAX_ALLOWED_BUF 1024*1024
#define MY_CHARSET_INDEX "Index.xml"
diff --git a/mysys/psi_noop.c b/mysys/psi_noop.c
index 6d26f5a2178..78629ca16d7 100644
--- a/mysys/psi_noop.c
+++ b/mysys/psi_noop.c
@@ -743,4 +743,3 @@ void set_psi_server(PSI *psi)
}
C_MODE_END
-
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index cc697092e6e..50f26fc8038 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -662,3 +662,6 @@ DROP TABLE tmp_proxies_priv;
# changes was correct
flush privileges;
+
+ALTER TABLE slave_master_info ADD Ssl_crl TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Revocation List (CRL)';
+ALTER TABLE slave_master_info ADD Ssl_crlpath TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path used for Certificate Revocation List (CRL) files';
diff --git a/sql-common/client.c b/sql-common/client.c
index 337e5b7458c..05688a33730 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -143,6 +143,37 @@ CHARSET_INFO *default_client_charset_info = &my_charset_latin1;
unsigned int mysql_server_last_errno;
char mysql_server_last_error[MYSQL_ERRMSG_SIZE];
+/**
+ Convert the connect timeout option to a timeout value for VIO
+ functions (vio_socket_connect() and vio_io_wait()).
+
+ @param mysql Connection handle (client side).
+
+ @return The timeout value in milliseconds, or -1 if no timeout.
+*/
+
+static int get_vio_connect_timeout(MYSQL *mysql)
+{
+ int timeout_ms;
+ uint timeout_sec;
+
+ /*
+ A timeout of 0 means no timeout. Also, the connect_timeout
+ option value is in seconds, while VIO timeouts are measured
+ in milliseconds. Hence, check for a possible overflow. In
+ case of overflow, set to no timeout.
+ */
+ timeout_sec= mysql->options.connect_timeout;
+
+ if (!timeout_sec || (timeout_sec > INT_MAX/1000))
+ timeout_ms= -1;
+ else
+ timeout_ms= (int) (timeout_sec * 1000);
+
+ return timeout_ms;
+}
+
+
/****************************************************************************
A modified version of connect(). my_connect() allows you to specify
a timeout value, in seconds, that we should wait until we
@@ -1139,6 +1170,7 @@ static const char *default_options[]=
"ssl-cipher", "max-allowed-packet", "protocol", "shared-memory-base-name",
"multi-results", "multi-statements", "multi-queries", "secure-auth",
"report-data-truncation", "plugin-dir", "default-auth",
+ "bind-address", "ssl-crl", "ssl-crlpath",
NullS
};
enum option_id {
@@ -1150,6 +1182,7 @@ enum option_id {
OPT_ssl_cipher, OPT_max_allowed_packet, OPT_protocol, OPT_shared_memory_base_name,
OPT_multi_results, OPT_multi_statements, OPT_multi_queries, OPT_secure_auth,
OPT_report_data_truncation, OPT_plugin_dir, OPT_default_auth,
+ OPT_bind_address, OPT_ssl_crl, OPT_ssl_crlpath,
OPT_keep_this_one_last
};
@@ -1187,12 +1220,28 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
(OPTS)->extension= (struct st_mysql_options_extention *) \
my_malloc(sizeof(struct st_mysql_options_extention), \
MYF(MY_WME | MY_ZEROFILL)); \
- (OPTS)->extension->X= VAL;
+ (OPTS)->extension->X= (VAL);
+
+#define EXTENSION_SET_STRING_MAYBE_NULL(OPTS, X, STR) \
+ if ((OPTS)->extension) \
+ my_free((OPTS)->extension->X); \
+ EXTENSION_SET(OPTS, X, (STR) ? my_strdup((STR), MYF(MY_WME)) : NullS);
#define EXTENSION_SET_STRING(OPTS, X, STR) \
if ((OPTS)->extension) \
my_free((OPTS)->extension->X); \
- EXTENSION_SET(OPTS, X, my_strdup((STR), MYF(MY_WME)));
+ EXTENSION_SET(OPTS, X, my_strdup((STR), MYF(MY_WME)))
+
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
+#define SET_SSL_OPTION(OPTS, opt_var, arg) \
+ my_free((OPTS)->opt_var); \
+ (OPTS)->opt_var= arg ? my_strdup(arg, MYF(MY_WME)) : NULL;
+#define EXTENSION_SET_SSL_STRING(OPTS, X, STR) \
+ EXTENSION_SET_STRING_MAYBE_NULL((OPTS), X, (STR));
+#else
+#define SET_SSL_OPTION(OPTS, opt_var,arg) do { } while(0)
+#define EXTENSION_SET_SSL_STRING(OPTS, X, STR) do { } while(0)
+#endif /* defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) */
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group)
@@ -1296,35 +1345,27 @@ void mysql_read_default_options(struct st_mysql_options *options,
case OPT_return_found_rows:
options->client_flag|=CLIENT_FOUND_ROWS;
break;
-#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
case OPT_ssl_key:
- my_free(options->ssl_key);
- options->ssl_key = my_strdup(opt_arg, MYF(MY_WME));
+ SET_SSL_OPTION(options, ssl_key, opt_arg);
break;
case OPT_ssl_cert:
- my_free(options->ssl_cert);
- options->ssl_cert = my_strdup(opt_arg, MYF(MY_WME));
+ SET_SSL_OPTION(options, ssl_cert, opt_arg);
break;
case OPT_ssl_ca:
- my_free(options->ssl_ca);
- options->ssl_ca = my_strdup(opt_arg, MYF(MY_WME));
+ SET_SSL_OPTION(options, ssl_ca, opt_arg);
break;
case OPT_ssl_capath:
- my_free(options->ssl_capath);
- options->ssl_capath = my_strdup(opt_arg, MYF(MY_WME));
+ SET_SSL_OPTION(options, ssl_capath, opt_arg);
break;
case OPT_ssl_cipher:
- my_free(options->ssl_cipher);
- options->ssl_cipher= my_strdup(opt_arg, MYF(MY_WME));
+ SET_SSL_OPTION(options, ssl_cipher, opt_arg);
+ break;
+ case OPT_ssl_crl:
+ EXTENSION_SET_SSL_STRING(options, ssl_crl, opt_arg);
+ break;
+ case OPT_ssl_crlpath:
+ EXTENSION_SET_SSL_STRING(options, ssl_crlpath, opt_arg);
break;
-#else
- case OPT_ssl_key:
- case OPT_ssl_cert:
- case OPT_ssl_ca:
- case OPT_ssl_capath:
- case OPT_ssl_cipher:
- break;
-#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */
case OPT_character_sets_dir:
my_free(options->charset_dir);
options->charset_dir = my_strdup(opt_arg, MYF(MY_WME));
@@ -1761,12 +1802,11 @@ mysql_init(MYSQL *mysql)
/*
- Fill in SSL part of MYSQL structure and set 'use_ssl' flag.
+ Fill in SSL part of MYSQL structure.
NB! Errors are not reported until you do mysql_real_connect.
+ use_ssl is set in send_client_reply_packet if any ssl option is set.
*/
-#define strdup_if_not_null(A) (A) == 0 ? 0 : my_strdup((A),MYF(MY_WME))
-
my_bool STDCALL
mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
const char *key __attribute__((unused)),
@@ -1775,20 +1815,17 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
const char *capath __attribute__((unused)),
const char *cipher __attribute__((unused)))
{
+ my_bool result= 0;
DBUG_ENTER("mysql_ssl_set");
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
- my_free(mysql->options.ssl_key);
- my_free(mysql->options.ssl_cert);
- my_free(mysql->options.ssl_ca);
- my_free(mysql->options.ssl_capath);
- my_free(mysql->options.ssl_cipher);
- mysql->options.ssl_key= strdup_if_not_null(key);
- mysql->options.ssl_cert= strdup_if_not_null(cert);
- mysql->options.ssl_ca= strdup_if_not_null(ca);
- mysql->options.ssl_capath= strdup_if_not_null(capath);
- mysql->options.ssl_cipher= strdup_if_not_null(cipher);
+ result= (mysql_options(mysql, MYSQL_OPT_SSL_KEY, key) |
+ mysql_options(mysql, MYSQL_OPT_SSL_CERT, cert) |
+ mysql_options(mysql, MYSQL_OPT_SSL_CA, ca) |
+ mysql_options(mysql, MYSQL_OPT_SSL_CAPATH, capath) |
+ mysql_options(mysql, MYSQL_OPT_SSL_CIPHER, cipher) ?
+ 1 : 0);
#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */
- DBUG_RETURN(0);
+ DBUG_RETURN(result);
}
@@ -1810,6 +1847,11 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
my_free(mysql->options.ssl_ca);
my_free(mysql->options.ssl_capath);
my_free(mysql->options.ssl_cipher);
+ if (mysql->options.extension)
+ {
+ my_free(mysql->options.extension->ssl_crl);
+ my_free(mysql->options.extension->ssl_crlpath);
+ }
if (ssl_fd)
SSL_CTX_free(ssl_fd->ssl_context);
my_free(mysql->connector_fd);
@@ -1818,6 +1860,11 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
mysql->options.ssl_ca = 0;
mysql->options.ssl_capath = 0;
mysql->options.ssl_cipher= 0;
+ if (mysql->options.extension)
+ {
+ mysql->options.extension->ssl_crl = 0;
+ mysql->options.extension->ssl_crlpath = 0;
+ }
mysql->options.use_ssl = FALSE;
mysql->connector_fd = 0;
DBUG_VOID_RETURN;
@@ -2461,7 +2508,10 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (mysql->options.ssl_key || mysql->options.ssl_cert ||
mysql->options.ssl_ca || mysql->options.ssl_capath ||
- mysql->options.ssl_cipher)
+ mysql->options.ssl_cipher ||
+ (mysql->options.extension &&
+ (mysql->options.extension->ssl_crl ||
+ mysql->options.extension->ssl_crlpath)))
mysql->options.use_ssl= 1;
if (mysql->options.use_ssl)
mysql->client_flag|= CLIENT_SSL;
@@ -2522,7 +2572,11 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
options->ssl_ca,
options->ssl_capath,
options->ssl_cipher,
- &ssl_init_error)))
+ &ssl_init_error,
+ options->extension ?
+ options->extension->ssl_crl : NULL,
+ options->extension ?
+ options->extension->ssl_crlpath : NULL)))
{
set_mysql_extended_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate,
ER(CR_SSL_CONNECTION_ERROR), sslGetErrString(ssl_init_error));
@@ -2726,21 +2780,21 @@ void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info)
switch (vio->type) {
case VIO_TYPE_TCPIP:
info->protocol= MYSQL_VIO_TCP;
- info->socket= vio->sd;
+ info->socket= vio_fd(vio);
return;
case VIO_TYPE_SOCKET:
info->protocol= MYSQL_VIO_SOCKET;
- info->socket= vio->sd;
+ info->socket= vio_fd(vio);
return;
case VIO_TYPE_SSL:
{
struct sockaddr addr;
SOCKET_SIZE_TYPE addrlen= sizeof(addr);
- if (getsockname(vio->sd, &addr, &addrlen))
+ if (getsockname(vio_fd(vio), &addr, &addrlen))
return;
info->protocol= addr.sa_family == AF_UNIX ?
MYSQL_VIO_SOCKET : MYSQL_VIO_TCP;
- info->socket= vio->sd;
+ info->socket= vio_fd(vio);
return;
}
#ifdef _WIN32
@@ -3304,7 +3358,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
/* Get version info */
mysql->protocol_version= PROTOCOL_VERSION; /* Assume this */
if (mysql->options.connect_timeout &&
- vio_poll_read(net->vio, mysql->options.connect_timeout))
+ (vio_io_wait(net->vio, VIO_IO_EVENT_READ,
+ get_vio_connect_timeout(mysql)) < 1))
{
set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
ER(CR_SERVER_LOST_EXTENDED),
@@ -3920,7 +3975,6 @@ mysql_send_query(MYSQL* mysql, const char* query, ulong length)
DBUG_RETURN(simple_command(mysql, COM_QUERY, (uchar*) query, length, 1));
}
-
int STDCALL
mysql_real_query(MYSQL *mysql, const char *query, ulong length)
{
@@ -4171,6 +4225,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
mysql->options.methods_to_use= option;
break;
case MYSQL_SET_CLIENT_IP:
+ my_free(mysql->options.client_ip);
mysql->options.client_ip= my_strdup(arg, MYF(MY_WME));
break;
case MYSQL_SECURE_AUTH:
@@ -4189,10 +4244,10 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
mysql->options.client_flag&= ~CLIENT_SSL_VERIFY_SERVER_CERT;
break;
case MYSQL_PLUGIN_DIR:
- EXTENSION_SET_STRING(&mysql->options, plugin_dir, arg);
+ EXTENSION_SET_STRING_MAYBE_NULL(&mysql->options, plugin_dir, arg);
break;
case MYSQL_DEFAULT_AUTH:
- EXTENSION_SET_STRING(&mysql->options, default_auth, arg);
+ EXTENSION_SET_STRING_MAYBE_NULL(&mysql->options, default_auth, arg);
break;
case MYSQL_PROGRESS_CALLBACK:
if (!mysql->options.extension)
@@ -4236,6 +4291,27 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
if (mysql->net.vio)
mysql->net.vio->async_context= ctxt;
break;
+ case MYSQL_OPT_SSL_KEY:
+ SET_SSL_OPTION(&mysql->options,ssl_key, arg);
+ break;
+ case MYSQL_OPT_SSL_CERT:
+ SET_SSL_OPTION(&mysql->options, ssl_cert, arg);
+ break;
+ case MYSQL_OPT_SSL_CA:
+ SET_SSL_OPTION(&mysql->options,ssl_ca, arg);
+ break;
+ case MYSQL_OPT_SSL_CAPATH:
+ SET_SSL_OPTION(&mysql->options,ssl_capath, arg);
+ break;
+ case MYSQL_OPT_SSL_CIPHER:
+ SET_SSL_OPTION(&mysql->options,ssl_cipher, arg);
+ break;
+ case MYSQL_OPT_SSL_CRL:
+ EXTENSION_SET_SSL_STRING(&mysql->options, ssl_crl, arg);
+ break;
+ case MYSQL_OPT_SSL_CRLPATH:
+ EXTENSION_SET_SSL_STRING(&mysql->options, ssl_crlpath, arg);
+ break;
default:
DBUG_RETURN(1);
}
@@ -4450,6 +4526,6 @@ my_socket STDCALL
mysql_get_socket(const MYSQL *mysql)
{
if (mysql->net.vio)
- return mysql->net.vio->sd;
+ return vio_fd(mysql->net.vio);
return INVALID_SOCKET;
}
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 805f7b34e04..6c53930f23d 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -76,7 +76,7 @@ SET (SQL_SOURCE
sql_profile.cc event_parse_data.cc sql_alter.cc
sql_signal.cc rpl_handler.cc mdl.cc sql_admin.cc
transaction.cc sys_vars.cc sql_truncate.cc datadict.cc
- sql_reload.cc
+ sql_reload.cc sql_cmd.h
# added in MariaDB:
sql_lifo_buffer.h sql_join_cache.h sql_join_cache.cc
diff --git a/sql/lex.h b/sql/lex.h
index 9f4369630a0..9bd1a9b93aa 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -340,6 +340,8 @@ static SYMBOL symbols[] = {
{ "MASTER_SSL_CAPATH",SYM(MASTER_SSL_CAPATH_SYM)},
{ "MASTER_SSL_CERT", SYM(MASTER_SSL_CERT_SYM)},
{ "MASTER_SSL_CIPHER",SYM(MASTER_SSL_CIPHER_SYM)},
+ { "MASTER_SSL_CRL", SYM(MASTER_SSL_CRL_SYM)},
+ { "MASTER_SSL_CRLPATH",SYM(MASTER_SSL_CRLPATH_SYM)},
{ "MASTER_SSL_KEY", SYM(MASTER_SSL_KEY_SYM)},
{ "MASTER_SSL_VERIFY_SERVER_CERT", SYM(MASTER_SSL_VERIFY_SERVER_CERT_SYM)},
{ "MASTER_USER", SYM(MASTER_USER_SYM)},
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index ef0de79820d..f88b4047c17 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -78,6 +78,10 @@
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
#include "../storage/perfschema/pfs_server.h"
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
+#include <mysql/psi/mysql_idle.h>
+#include <mysql/psi/mysql_socket.h>
+#include <mysql/psi/mysql_statement.h>
+#include "mysql_com_server.h"
#include "keycaches.h"
#include "../storage/myisam/ha_myisam.h"
@@ -734,8 +738,8 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_master_info_data_lock, key_master_info_run_lock,
key_master_info_sleep_lock,
key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock,
- key_relay_log_info_log_space_lock, key_relay_log_info_run_lock,
key_relay_log_info_sleep_lock,
+ key_relay_log_info_log_space_lock, key_relay_log_info_run_lock,
key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data,
key_LOCK_error_messages, key_LOG_INFO_lock, key_LOCK_thread_count,
key_PARTITION_LOCK_auto_inc;
@@ -917,6 +921,10 @@ static PSI_thread_info all_server_threads[]=
{ &key_thread_signal_hand, "signal_handler", PSI_FLAG_GLOBAL}
};
+#ifdef HAVE_MMAP
+PSI_file_key key_file_map;
+#endif /* HAVE_MMAP */
+
PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
key_file_dbopt, key_file_des_key_file, key_file_ERRMSG, key_select_to_file,
key_file_fileparser, key_file_frm, key_file_global_ddl_log, key_file_load,
@@ -927,67 +935,89 @@ PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
PSI_file_key key_file_query_log, key_file_slow_log;
PSI_file_key key_file_relaylog, key_file_relaylog_index;
-static PSI_file_info all_server_files[]=
-{
- { &key_file_binlog, "binlog", 0},
- { &key_file_binlog_index, "binlog_index", 0},
- { &key_file_relaylog, "relaylog", 0},
- { &key_file_relaylog_index, "relaylog_index", 0},
- { &key_file_casetest, "casetest", 0},
- { &key_file_dbopt, "dbopt", 0},
- { &key_file_des_key_file, "des_key_file", 0},
- { &key_file_ERRMSG, "ERRMSG", 0},
- { &key_select_to_file, "select_to_file", 0},
- { &key_file_fileparser, "file_parser", 0},
- { &key_file_frm, "FRM", 0},
- { &key_file_global_ddl_log, "global_ddl_log", 0},
- { &key_file_load, "load", 0},
- { &key_file_loadfile, "LOAD_FILE", 0},
- { &key_file_log_event_data, "log_event_data", 0},
- { &key_file_log_event_info, "log_event_info", 0},
- { &key_file_master_info, "master_info", 0},
- { &key_file_misc, "misc", 0},
- { &key_file_partition, "partition", 0},
- { &key_file_pid, "pid", 0},
- { &key_file_query_log, "query_log", 0},
- { &key_file_relay_log_info, "relay_log_info", 0},
- { &key_file_send_file, "send_file", 0},
- { &key_file_slow_log, "slow_log", 0},
- { &key_file_tclog, "tclog", 0},
- { &key_file_trg, "trigger_name", 0},
- { &key_file_trn, "trigger", 0},
- { &key_file_init, "init", 0}
-};
+#endif /* HAVE_PSI_INTERFACE */
-/**
- Initialise all the performance schema instrumentation points
- used by the server.
-*/
-void init_server_psi_keys(void)
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+PSI_statement_info stmt_info_new_packet;
+#endif
+
+#ifndef EMBEDDED_LIBRARY
+void net_before_header_psi(struct st_net *net, void *user_data, size_t /* unused: count */)
{
- const char* category= "sql";
- int count;
+ THD *thd;
+ thd= static_cast<THD*> (user_data);
+ DBUG_ASSERT(thd != NULL);
- if (PSI_server == NULL)
- return;
+ if (thd->m_server_idle)
+ {
+ /*
+ The server is IDLE, waiting for the next command.
+ Technically, it is a wait on a socket, which may take a long time,
+ because the call is blocking.
+ Disable the socket instrumentation, to avoid recording a SOCKET event.
+ Instead, start explicitly an IDLE event.
+ */
+ MYSQL_SOCKET_SET_STATE(net->vio->mysql_socket, PSI_SOCKET_STATE_IDLE);
+ MYSQL_START_IDLE_WAIT(thd->m_idle_psi, &thd->m_idle_state);
+ }
+}
- count= array_elements(all_server_mutexes);
- PSI_server->register_mutex(category, all_server_mutexes, count);
+void net_after_header_psi(struct st_net *net, void *user_data, size_t /* unused: count */, my_bool rc)
+{
+ THD *thd;
+ thd= static_cast<THD*> (user_data);
+ DBUG_ASSERT(thd != NULL);
- count= array_elements(all_server_rwlocks);
- PSI_server->register_rwlock(category, all_server_rwlocks, count);
+ if (thd->m_server_idle)
+ {
+ /*
+ The server just got data for a network packet header,
+ from the network layer.
+ The IDLE event is now complete, since we now have a message to process.
+ We need to:
+ - start a new STATEMENT event
+ - start a new STAGE event, within this statement,
+ - start recording SOCKET WAITS events, within this stage.
+ The proper order is critical to get events numbered correctly,
+ and nested in the proper parent.
+ */
+ MYSQL_END_IDLE_WAIT(thd->m_idle_psi);
- count= array_elements(all_server_conds);
- PSI_server->register_cond(category, all_server_conds, count);
+ if (! rc)
+ {
+ thd->m_statement_psi= MYSQL_START_STATEMENT(&thd->m_statement_state,
+ stmt_info_new_packet.m_key,
+ thd->db, thd->db_length);
- count= array_elements(all_server_threads);
- PSI_server->register_thread(category, all_server_threads, count);
+ THD_STAGE_INFO(thd, stage_init);
+ }
- count= array_elements(all_server_files);
- PSI_server->register_file(category, all_server_files, count);
+ /*
+ TODO: consider recording a SOCKET event for the bytes just read,
+ by also passing count here.
+ */
+ MYSQL_SOCKET_SET_STATE(net->vio->mysql_socket, PSI_SOCKET_STATE_ACTIVE);
+ }
}
-#endif /* HAVE_PSI_INTERFACE */
+void init_net_server_extension(THD *thd)
+{
+#ifdef HAVE_PSI_INTERFACE
+ /* Start with a clean state for connection events. */
+ thd->m_idle_psi= NULL;
+ thd->m_statement_psi= NULL;
+ thd->m_server_idle= false;
+ /* Hook up the NET_SERVER callback in the net layer. */
+ thd->m_net_server_extension.m_user_data= thd;
+ thd->m_net_server_extension.m_before_header= net_before_header_psi;
+ thd->m_net_server_extension.m_after_header= net_after_header_psi;
+ /* Activate this private extension for the mysqld server. */
+ thd->net.extension= & thd->m_net_server_extension;
+#else
+ thd->net.extension= NULL;
+#endif
+}
+#endif /* EMBEDDED_LIBRARY */
/*
Since buffered_option_error_reporter is only used currently
@@ -1152,7 +1182,7 @@ C_MODE_END
#endif /* !EMBEDDED_LIBRARY */
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
-static my_socket unix_sock, base_ip_sock, extra_ip_sock;
+static MYSQL_SOCKET unix_sock, base_ip_sock, extra_ip_sock;
struct my_rnd_struct sql_rand; ///< used by sql_class.cc:THD::THD()
#ifndef EMBEDDED_LIBRARY
@@ -1216,7 +1246,9 @@ HANDLE smem_event_connect_request= 0;
my_bool opt_use_ssl = 0;
char *opt_ssl_ca= NULL, *opt_ssl_capath= NULL, *opt_ssl_cert= NULL,
- *opt_ssl_cipher= NULL, *opt_ssl_key= NULL;
+ *opt_ssl_cipher= NULL, *opt_ssl_key= NULL, *opt_ssl_crl= NULL,
+ *opt_ssl_crlpath= NULL;
+
static scheduler_functions thread_scheduler_struct, extra_thread_scheduler_struct;
scheduler_functions *thread_scheduler= &thread_scheduler_struct,
@@ -1343,17 +1375,17 @@ static void close_connections(void)
DBUG_PRINT("quit",("Closing sockets"));
if (!opt_disable_networking )
{
- if (base_ip_sock != INVALID_SOCKET)
+ if (mysql_socket_getfd(base_ip_sock) != INVALID_SOCKET)
{
(void) mysql_socket_shutdown(base_ip_sock, SHUT_RDWR);
- (void) closesocket(base_ip_sock);
- base_ip_sock= INVALID_SOCKET;
+ (void) mysql_socket_close(base_ip_sock);
+ base_ip_sock= MYSQL_INVALID_SOCKET;
}
- if (extra_ip_sock != INVALID_SOCKET)
+ if (mysql_socket_getfd(extra_ip_sock) != INVALID_SOCKET)
{
(void) mysql_socket_shutdown(extra_ip_sock, SHUT_RDWR);
- (void) closesocket(extra_ip_sock);
- extra_ip_sock= INVALID_SOCKET;
+ (void) mysql_socket_close(extra_ip_sock);
+ extra_ip_sock= MYSQL_INVALID_SOCKET;
}
}
#ifdef _WIN32
@@ -1381,12 +1413,12 @@ static void close_connections(void)
}
#endif
#ifdef HAVE_SYS_UN_H
- if (unix_sock != INVALID_SOCKET)
+ if (mysql_socket_getfd(unix_sock) != INVALID_SOCKET)
{
(void) mysql_socket_shutdown(unix_sock, SHUT_RDWR);
- (void) closesocket(unix_sock);
+ (void) mysql_socket_close(unix_sock);
(void) unlink(mysqld_unix_port);
- unix_sock= INVALID_SOCKET;
+ unix_sock= MYSQL_INVALID_SOCKET;
}
#endif
end_thr_alarm(0); // Abort old alarms.
@@ -1491,22 +1523,14 @@ static void close_connections(void)
#ifdef HAVE_CLOSE_SERVER_SOCK
-static void close_socket(my_socket sock, const char *info)
+static void close_socket(MYSQL_SOCKET sock, const char *info)
{
DBUG_ENTER("close_socket");
- if (sock != INVALID_SOCKET)
+ if (mysql_socket_getfd(sock) != INVALID_SOCKET)
{
DBUG_PRINT("info", ("calling shutdown on %s socket", info));
(void) mysql_socket_shutdown(sock, SHUT_RDWR);
-#if defined(__NETWARE__)
- /*
- The following code is disabled for normal systems as it causes MySQL
- to hang on AIX 4.3 during shutdown
- */
- DBUG_PRINT("info", ("calling closesocket on %s socket", info));
- (void) closesocket(tmp_sock);
-#endif
}
DBUG_VOID_RETURN;
}
@@ -1522,9 +1546,9 @@ static void close_server_sock()
close_socket(extra_ip_sock, "TCP/IP");
close_socket(unix_sock, "unix/IP");
- if (unix_sock != INVALID_SOCKET)
+ if (mysql_socket_getfd(unix_sock) != INVALID_SOCKET)
(void) unlink(mysqld_unix_port);
- base_ip_sock= extra_ip_sock= unix_sock= INVALID_SOCKET;
+ base_ip_sock= extra_ip_sock= unix_sock= MYSQL_INVALID_SOCKET;
DBUG_VOID_RETURN;
#endif
@@ -1745,7 +1769,9 @@ static void mysqld_exit(int exit_code)
clean_up_mutexes();
clean_up_error_log_mutex();
my_end((opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0));
- shutdown_performance_schema(); // we do it as late as possible
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
+ shutdown_performance_schema();
+#endif
exit(exit_code); /* purecov: inspected */
}
@@ -2110,14 +2136,14 @@ static void set_root(const char *path)
Activate usage of a tcp port
*/
-static my_socket activate_tcp_port(uint port)
+static MYSQL_SOCKET activate_tcp_port(uint port)
{
struct addrinfo *ai, *a;
struct addrinfo hints;
int error;
int arg;
char port_buf[NI_MAXSERV];
- my_socket ip_sock= INVALID_SOCKET;
+ MYSQL_SOCKET ip_sock= MYSQL_INVALID_SOCKET;
DBUG_ENTER("activate_tcp_port");
DBUG_PRINT("general",("IP Socket is %d",port));
@@ -2137,25 +2163,29 @@ static my_socket activate_tcp_port(uint port)
for (a= ai; a != NULL; a= a->ai_next)
{
- ip_sock= socket(a->ai_family, a->ai_socktype, a->ai_protocol);
- if (ip_sock != INVALID_SOCKET)
+ ip_sock= mysql_socket_socket(key_socket_tcpip, a->ai_family,
+ a->ai_socktype, a->ai_protocol);
+ if (mysql_socket_getfd(ip_sock) != INVALID_SOCKET)
break;
}
- if (ip_sock == INVALID_SOCKET)
+ if (mysql_socket_getfd(ip_sock) == INVALID_SOCKET)
{
DBUG_PRINT("error",("Got error: %d from socket()",socket_errno));
sql_perror(ER_DEFAULT(ER_IPSOCK_ERROR)); /* purecov: tested */
unireg_abort(1); /* purecov: tested */
}
+ mysql_socket_set_thread_owner(ip_sock);
+
#ifndef __WIN__
/*
We should not use SO_REUSEADDR on windows as this would enable a
user to open two mysqld servers with the same TCP/IP port.
*/
arg= 1;
- (void) setsockopt(ip_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,sizeof(arg));
+ (void) mysql_socket_setsockopt(ip_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,
+ sizeof(arg));
#endif /* __WIN__ */
#ifdef IPV6_V6ONLY
@@ -2171,8 +2201,8 @@ static my_socket activate_tcp_port(uint port)
if (a->ai_family == AF_INET6)
{
arg= 0;
- (void) setsockopt(ip_sock, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&arg,
- sizeof(arg));
+ (void) mysql_socket_setsockopt(ip_sock, IPPROTO_IPV6, IPV6_V6ONLY,
+ (char*)&arg, sizeof(arg));
}
#endif
/*
@@ -2187,7 +2217,7 @@ static my_socket activate_tcp_port(uint port)
uint waited, retry, this_wait;
for (waited= 0, retry= 1; ; retry++, waited+= this_wait)
{
- if (((ret= bind(ip_sock, a->ai_addr, a->ai_addrlen)) >= 0 ) ||
+ if (((ret= mysql_socket_bind(ip_sock, a->ai_addr, a->ai_addrlen)) >= 0 ) ||
(socket_errno != SOCKET_EADDRINUSE) ||
(waited >= mysqld_port_timeout))
break;
@@ -2206,7 +2236,7 @@ static my_socket activate_tcp_port(uint port)
"port: %u ?", port);
unireg_abort(1);
}
- if (listen(ip_sock,(int) back_log) < 0)
+ if (mysql_socket_listen(ip_sock,(int) back_log) < 0)
{
sql_perror("Can't start server: listen() on TCP/IP port");
sql_print_error("listen() on TCP/IP failed with error %d",
@@ -2307,7 +2337,8 @@ static void network_init(void)
(uint) sizeof(UNIXaddr.sun_path) - 1, mysqld_unix_port);
unireg_abort(1);
}
- if ((unix_sock= socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
+ unix_sock= mysql_socket_socket(key_socket_unix, AF_UNIX, SOCK_STREAM, 0);
+ if (mysql_socket_getfd(unix_sock) < 0)
{
sql_perror("Can't start server : UNIX Socket "); /* purecov: inspected */
unireg_abort(1); /* purecov: inspected */
@@ -2317,11 +2348,12 @@ static void network_init(void)
strmov(UNIXaddr.sun_path, mysqld_unix_port);
(void) unlink(mysqld_unix_port);
arg= 1;
- (void) setsockopt(unix_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,
- sizeof(arg));
+ (void) mysql_socket_setsockopt(unix_sock,SOL_SOCKET,SO_REUSEADDR,
+ (char*)&arg, sizeof(arg));
umask(0);
- if (bind(unix_sock, reinterpret_cast<struct sockaddr *>(&UNIXaddr),
- sizeof(UNIXaddr)) < 0)
+ if (mysql_socket_bind(unix_sock,
+ reinterpret_cast<struct sockaddr *>(&UNIXaddr),
+ sizeof(UNIXaddr)) < 0)
{
sql_perror("Can't start server : Bind on unix socket"); /* purecov: tested */
sql_print_error("Do you already have another mysqld server running on socket: %s ?",mysqld_unix_port);
@@ -2331,7 +2363,7 @@ static void network_init(void)
#if defined(S_IFSOCK) && defined(SECURE_SOCKETS)
(void) chmod(mysqld_unix_port,S_IFSOCK); /* Fix solaris 2.6 bug */
#endif
- if (listen(unix_sock,(int) back_log) < 0)
+ if (mysql_socket_listen(unix_sock,(int) back_log) < 0)
sql_print_warning("listen() on Unix socket failed with error %d",
socket_errno);
}
@@ -2485,13 +2517,12 @@ static bool cache_thread()
DBUG_PRINT("info", ("Adding thread to cache"));
cached_thread_count++;
-#ifdef HAVE_PSI_INTERFACE
+#ifdef HAVE_PSI_THREAD_INTERFACE
/*
Delete the instrumentation for the job that just completed,
before parking this pthread in the cache (blocked on COND_thread_cache).
*/
- if (likely(PSI_server != NULL))
- PSI_server->delete_current_thread();
+ PSI_CALL(delete_current_thread)();
#endif
while (!abort_loop && ! wake_thread && ! kill_cached_threads)
@@ -2507,18 +2538,14 @@ static bool cache_thread()
thd->thread_stack= (char*) &thd; // For store_globals
(void) thd->store_globals();
-#ifdef HAVE_PSI_INTERFACE
+#ifdef HAVE_PSI_THREAD_INTERFACE
/*
Create new instrumentation for the new THD job,
and attach it to this running pthread.
*/
- if (likely(PSI_server != NULL))
- {
- PSI_thread *psi= PSI_server->new_thread(key_thread_one_connection,
- thd, thd->thread_id);
- if (likely(psi != NULL))
- PSI_server->set_thread(psi);
- }
+ PSI_thread *psi= PSI_CALL(new_thread)(key_thread_one_connection,
+ thd, thd->thread_id);
+ PSI_CALL(set_thread)(psi);
#endif
/*
@@ -3033,10 +3060,9 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
if (!abort_loop)
{
abort_loop=1; // mark abort for threads
-#ifdef HAVE_PSI_INTERFACE
+#ifdef HAVE_PSI_THREAD_INTERFACE
/* Delete the instrumentation for the signal thread */
- if (likely(PSI_server != NULL))
- PSI_server->delete_current_thread();
+ PSI_CALL(delete_current_thread)();
#endif
#ifdef USE_ONE_SIGNAL_HAND
pthread_t tmp;
@@ -3393,6 +3419,68 @@ SHOW_VAR com_status_vars[]= {
{NullS, NullS, SHOW_LONG}
};
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+PSI_statement_info sql_statement_info[(uint) SQLCOM_END + 1];
+PSI_statement_info com_statement_info[(uint) COM_END + 1];
+
+/**
+ Initialize the command names array.
+ Since we do not want to maintain a separate array,
+ this is populated from data mined in com_status_vars,
+ which already has one name for each command.
+*/
+void init_sql_statement_info()
+{
+ char *first_com= (char*) offsetof(STATUS_VAR, com_stat[0]);
+ char *last_com= (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_END]);
+ int record_size= (char*) offsetof(STATUS_VAR, com_stat[1])
+ - (char*) offsetof(STATUS_VAR, com_stat[0]);
+ char *ptr;
+ uint i;
+ uint com_index;
+
+ static const char* dummy= "";
+ for (i= 0; i < ((uint) SQLCOM_END + 1); i++)
+ {
+ sql_statement_info[i].m_name= dummy;
+ sql_statement_info[i].m_flags= 0;
+ }
+
+ SHOW_VAR *var= &com_status_vars[0];
+ while (var->name != NULL)
+ {
+ ptr= var->value;
+ if ((first_com <= ptr) && (ptr <= last_com))
+ {
+ com_index= ((int)(ptr - first_com))/record_size;
+ DBUG_ASSERT(com_index < (uint) SQLCOM_END);
+ sql_statement_info[com_index].m_name= var->name;
+ }
+ var++;
+ }
+
+ DBUG_ASSERT(strcmp(sql_statement_info[(uint) SQLCOM_SELECT].m_name, "select") == 0);
+ DBUG_ASSERT(strcmp(sql_statement_info[(uint) SQLCOM_SIGNAL].m_name, "signal") == 0);
+
+ sql_statement_info[(uint) SQLCOM_END].m_name= "error";
+}
+
+void init_com_statement_info()
+{
+ uint index;
+
+ for (index= 0; index < (uint) COM_END + 1; index++)
+ {
+ com_statement_info[index].m_name= command_name[index].str;
+ com_statement_info[index].m_flags= 0;
+ }
+
+ /* "statement/com/query" can mutate into "statement/sql/..." */
+ com_statement_info[(uint) COM_QUERY].m_flags= PSI_FLAG_MUTABLE;
+}
+#endif
+
+
static int init_common_variables()
{
umask(((~my_umask) & 0666));
@@ -3446,8 +3534,9 @@ static int init_common_variables()
#ifdef HAVE_PSI_INTERFACE
/*
Complete the mysql_bin_log initialization.
- Instrumentation keys are known only after the performance schema initialization,
- and can not be set in the MYSQL_BIN_LOG constructor (called before main()).
+ Instrumentation keys are known only after the performance schema
+ initialization, and can not be set in the MYSQL_BIN_LOG
+ constructor (called before main()).
*/
mysql_bin_log.set_psi_keys(key_BINLOG_LOCK_index,
key_BINLOG_update_cond,
@@ -3732,6 +3821,10 @@ static int init_common_variables()
default_collation= get_charset_by_name(default_collation_name, MYF(0));
if (!default_collation)
{
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
+ buffered_logs.print();
+ buffered_logs.cleanup();
+#endif
sql_print_error(ER_DEFAULT(ER_UNKNOWN_COLLATION), default_collation_name);
return 1;
}
@@ -4013,7 +4106,8 @@ static void init_ssl()
/* having ssl_acceptor_fd != 0 signals the use of SSL */
ssl_acceptor_fd= new_VioSSLAcceptorFd(opt_ssl_key, opt_ssl_cert,
opt_ssl_ca, opt_ssl_capath,
- opt_ssl_cipher, &error);
+ opt_ssl_cipher, &error,
+ opt_ssl_crl, opt_ssl_crlpath);
DBUG_PRINT("info",("ssl_acceptor_fd: 0x%lx", (long) ssl_acceptor_fd));
if (!ssl_acceptor_fd)
{
@@ -4656,9 +4750,16 @@ int mysqld_main(int argc, char **argv)
*/
buffered_logs.init();
my_getopt_error_reporter= buffered_option_error_reporter;
+ my_charset_error_reporter= buffered_option_error_reporter;
+
+ /*
+ Initialize the array of performance schema instrument configurations.
+ */
+ init_pfs_instrument_array();
ho_error= handle_options(&remaining_argc, &remaining_argv,
- (my_option*)(all_early_options.buffer), NULL);
+ (my_option*)(all_early_options.buffer),
+ mysqld_get_one_option);
delete_dynamic(&all_early_options);
if (ho_error == 0)
{
@@ -4694,27 +4795,29 @@ int mysqld_main(int argc, char **argv)
if available.
*/
if (PSI_hook)
- PSI_server= (PSI*) PSI_hook->get_interface(PSI_CURRENT_VERSION);
-
- if (PSI_server)
{
- /*
- Now that we have parsed the command line arguments, and have initialized
- the performance schema itself, the next step is to register all the
- server instruments.
- */
- init_server_psi_keys();
- /* Instrument the main thread */
- PSI_thread *psi= PSI_server->new_thread(key_thread_main, NULL, 0);
- if (psi)
- PSI_server->set_thread(psi);
+ PSI *psi_server= (PSI*) PSI_hook->get_interface(PSI_CURRENT_VERSION);
+ if (likely(psi_server != NULL))
+ {
+ set_psi_server(psi_server);
- /*
- Now that some instrumentation is in place,
- recreate objects which were initialised early,
- so that they are instrumented as well.
- */
- my_thread_global_reinit();
+ /*
+ Now that we have parsed the command line arguments, and have
+ initialized the performance schema itself, the next step is to
+ register all the server instruments.
+ */
+ init_server_psi_keys();
+ /* Instrument the main thread */
+ PSI_thread *psi= PSI_CALL(new_thread)(key_thread_main, NULL, 0);
+ PSI_CALL(set_thread)(psi);
+
+ /*
+ Now that some instrumentation is in place,
+ recreate objects which were initialised early,
+ so that they are instrumented as well.
+ */
+ my_thread_global_reinit();
+ }
}
#endif /* HAVE_PSI_INTERFACE */
@@ -4858,7 +4961,7 @@ int mysqld_main(int argc, char **argv)
if (!opt_bootstrap)
mysql_file_delete(key_file_pid, pidfile_name, MYF(MY_WME)); // Not needed anymore
- if (unix_sock != INVALID_SOCKET)
+ if (mysql_socket_getfd(unix_sock) != INVALID_SOCKET)
unlink(mysqld_unix_port);
exit(1);
}
@@ -4939,8 +5042,8 @@ int mysqld_main(int argc, char **argv)
start_handle_manager();
sql_print_information(ER_DEFAULT(ER_STARTUP),my_progname,server_version,
- ((unix_sock == INVALID_SOCKET) ? (char*) ""
- : mysqld_unix_port),
+ ((mysql_socket_getfd(unix_sock) == INVALID_SOCKET) ?
+ (char*) "" : mysqld_unix_port),
mysqld_port,
MYSQL_COMPILATION_COMMENT);
#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY)
@@ -4978,13 +5081,12 @@ int mysqld_main(int argc, char **argv)
#endif
#endif /* __WIN__ */
-#ifdef HAVE_PSI_INTERFACE
+#ifdef HAVE_PSI_THREAD_INTERFACE
/*
Disable the main thread instrumentation,
to avoid recording events during the shutdown.
*/
- if (PSI_server)
- PSI_server->delete_current_thread();
+ PSI_CALL(delete_current_thread)();
#endif
/* Wait until cleanup is done */
@@ -5438,8 +5540,9 @@ static void create_new_thread(THD *thd)
inline void kill_broken_server()
{
/* hack to get around signals ignored in syscalls for problem OS's */
- if (unix_sock == INVALID_SOCKET ||
- (!opt_disable_networking && base_ip_sock == INVALID_SOCKET))
+ if (mysql_socket_getfd(unix_sock) == INVALID_SOCKET ||
+ (!opt_disable_networking &&
+ mysql_socket_getfd(base_ip_sock) == INVALID_SOCKET))
{
select_thread_in_use = 0;
/* The following call will never return */
@@ -5458,7 +5561,8 @@ inline void kill_broken_server()
void handle_connections_sockets()
{
- my_socket UNINIT_VAR(sock), UNINIT_VAR(new_sock);
+ MYSQL_SOCKET sock= mysql_socket_invalid();
+ MYSQL_SOCKET new_sock= mysql_socket_invalid();
uint error_count=0;
THD *thd;
struct sockaddr_storage cAddr;
@@ -5467,36 +5571,40 @@ void handle_connections_sockets()
int extra_ip_flags __attribute__((unused))=0;
int flags=0,retval;
st_vio *vio_tmp;
+ bool is_unix_sock;
#ifdef HAVE_POLL
int socket_count= 0;
struct pollfd fds[3]; // for ip_sock, unix_sock and extra_ip_sock
+ MYSQL_SOCKET pfs_fds[3]; // for performance schema
#define setup_fds(X) \
- fds[socket_count].fd= X; \
+ pfs_fds[socket_count]= (X); \
+ fds[socket_count].fd= mysql_socket_getfd(X); \
fds[socket_count].events= POLLIN; \
socket_count++
#else
fd_set readFDs,clientFDs;
uint max_used_connection= (uint)
- max(max(base_ip_sock, unix_sock), extra_ip_sock) + 1;
-#define setup_fds(X) FD_SET(X,&clientFDs)
+ max(max(mysql_socket_getfd(base_ip_sock), mysql_socket_getfd(unix_sock)),
+ mysqld_socket_getfd(extra_ip_sock)) + 1;
+#define setup_fds(X) FD_SET(mysql_socket_getfd(X),&clientFDs)
FD_ZERO(&clientFDs);
#endif
DBUG_ENTER("handle_connections_sockets");
- if (base_ip_sock != INVALID_SOCKET)
+ if (mysql_socket_getfd(base_ip_sock) != INVALID_SOCKET)
{
setup_fds(base_ip_sock);
- ip_flags = fcntl(base_ip_sock, F_GETFL, 0);
+ ip_flags = fcntl(mysql_socket_getfd(base_ip_sock), F_GETFL, 0);
}
- if (extra_ip_sock != INVALID_SOCKET)
+ if (mysql_socket_getfd(extra_ip_sock) != INVALID_SOCKET)
{
setup_fds(extra_ip_sock);
- extra_ip_flags = fcntl(extra_ip_sock, F_GETFL, 0);
+ extra_ip_flags = fcntl(mysql_socket_getfd(extra_ip_sock), F_GETFL, 0);
}
#ifdef HAVE_SYS_UN_H
setup_fds(unix_sock);
- socket_flags=fcntl(unix_sock, F_GETFL, 0);
+ socket_flags=fcntl(mysql_socket_getfd(unix_sock), F_GETFL, 0);
#endif
DBUG_PRINT("general",("Waiting for connections."));
@@ -5534,8 +5642,8 @@ void handle_connections_sockets()
{
if (fds[i].revents & POLLIN)
{
- sock= fds[i].fd;
- flags= fcntl(sock, F_GETFL, 0);
+ sock= pfs_fds[i];
+ flags= fcntl(mysql_socket_getfd(sock), F_GETFL, 0);
break;
}
}
@@ -5562,18 +5670,19 @@ void handle_connections_sockets()
if (!(test_flags & TEST_BLOCKING))
{
#if defined(O_NONBLOCK)
- fcntl(sock, F_SETFL, flags | O_NONBLOCK);
+ fcntl(mysql_socket_getfd(sock), F_SETFL, flags | O_NONBLOCK);
#elif defined(O_NDELAY)
- fcntl(sock, F_SETFL, flags | O_NDELAY);
+ fcntl(mysql_socket_getfd(sock), F_SETFL, flags | O_NDELAY);
#endif
}
#endif /* NO_FCNTL_NONBLOCK */
for (uint retry=0; retry < MAX_ACCEPT_RETRY; retry++)
{
size_socket length= sizeof(struct sockaddr_storage);
- new_sock= accept(sock, (struct sockaddr *)(&cAddr),
- &length);
- if (new_sock != INVALID_SOCKET ||
+ new_sock= mysql_socket_accept(key_socket_client_connection, sock,
+ (struct sockaddr *)(&cAddr),
+ &length);
+ if (mysql_socket_getfd(new_sock) != INVALID_SOCKET ||
(socket_errno != SOCKET_EINTR && socket_errno != SOCKET_EAGAIN))
break;
MAYBE_BROKEN_SYSCALL;
@@ -5581,15 +5690,18 @@ void handle_connections_sockets()
if (!(test_flags & TEST_BLOCKING))
{
if (retry == MAX_ACCEPT_RETRY - 1)
- fcntl(sock, F_SETFL, flags); // Try without O_NONBLOCK
+ {
+ // Try without O_NONBLOCK
+ fcntl(mysql_socket_getfd(sock), F_SETFL, flags);
+ }
}
#endif
}
#if !defined(NO_FCNTL_NONBLOCK)
if (!(test_flags & TEST_BLOCKING))
- fcntl(sock, F_SETFL, flags);
+ fcntl(mysql_socket_getfd(sock), F_SETFL, flags);
#endif
- if (new_sock == INVALID_SOCKET)
+ if (mysql_socket_getfd(new_sock) == INVALID_SOCKET)
{
if ((error_count++ & 255) == 0) // This can happen often
sql_perror("Error in accept");
@@ -5605,7 +5717,8 @@ void handle_connections_sockets()
{
struct request_info req;
signal(SIGCHLD, SIG_DFL);
- request_init(&req, RQ_DAEMON, libwrapName, RQ_FILE, new_sock, NULL);
+ request_init(&req, RQ_DAEMON, libwrapName, RQ_FILE,
+ mysql_socket_getfd(new_sock), NULL);
my_fromhost(&req);
if (!my_hosts_access(&req))
{
@@ -5627,7 +5740,7 @@ void handle_connections_sockets()
((void (*)(int))req.sink)(req.fd);
(void) mysql_socket_shutdown(new_sock, SHUT_RDWR);
- (void) closesocket(new_sock);
+ (void) mysql_socket_close(new_sock);
continue;
}
}
@@ -5638,12 +5751,13 @@ void handle_connections_sockets()
size_socket dummyLen;
struct sockaddr_storage dummy;
dummyLen = sizeof(dummy);
- if ( getsockname(new_sock,(struct sockaddr *)&dummy,
- (SOCKET_SIZE_TYPE *)&dummyLen) < 0 )
+ if (getsockname(mysql_socket_getfd(new_sock),
+ (struct sockaddr *)&dummy,
+ (SOCKET_SIZE_TYPE *)&dummyLen) < 0 )
{
sql_perror("Error on new connection socket");
(void) mysql_socket_shutdown(new_sock, SHUT_RDWR);
- (void) closesocket(new_sock);
+ (void) mysql_socket_close(new_sock);
continue;
}
}
@@ -5655,14 +5769,17 @@ void handle_connections_sockets()
if (!(thd= new THD))
{
(void) mysql_socket_shutdown(new_sock, SHUT_RDWR);
- (void) closesocket(new_sock);
+ (void) mysql_socket_close(new_sock);
continue;
}
- if (!(vio_tmp=vio_new(new_sock,
- sock == unix_sock ? VIO_TYPE_SOCKET :
- VIO_TYPE_TCPIP,
- sock == unix_sock ? VIO_LOCALHOST: 0)) ||
- my_net_init(&thd->net,vio_tmp))
+ is_unix_sock= (mysql_socket_getfd(sock) ==
+ mysql_socket_getfd(unix_sock));
+
+ if (!(vio_tmp=
+ mysql_socket_vio_new(new_sock,
+ is_unix_sock ? VIO_TYPE_SOCKET : VIO_TYPE_TCPIP,
+ is_unix_sock ? VIO_LOCALHOST: 0)) ||
+ my_net_init(&thd->net, vio_tmp))
{
/*
Only delete the temporary vio if we didn't already attach it to the
@@ -5674,15 +5791,15 @@ void handle_connections_sockets()
else
{
(void) mysql_socket_shutdown(new_sock, SHUT_RDWR);
- (void) closesocket(new_sock);
+ (void) mysql_socket_close(new_sock);
}
delete thd;
continue;
}
- if (sock == unix_sock)
+ if (is_unix_sock)
thd->security_ctx->host=(char*) my_localhost;
- if (sock == extra_ip_sock)
+ if (mysql_socket_getfd(sock) == mysql_socket_getfd(extra_ip_sock))
{
thd->extra_port= 1;
thd->scheduler= extra_thread_scheduler;
@@ -6231,9 +6348,6 @@ struct my_option my_long_options[]=
"Set the language used for the month names and the days of the week.",
&lc_time_names_name, &lc_time_names_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- {"log", 'l', "Log connections and queries to file (deprecated option, use "
- "--general-log/--general-log-file instead).", &opt_logname, &opt_logname,
- 0, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-basename", OPT_LOG_BASENAME,
"Basename for all log files and the .pid file. This sets all log file "
"names at once (in 'datadir') and is normally the only option you need "
@@ -6410,7 +6524,7 @@ struct my_option my_long_options[]=
#endif
#ifdef HAVE_OPENSSL
{"ssl", 0,
- "Enable SSL for connection (automatically enabled with other flags).",
+ "Enable SSL for connection (automatically enabled if an ssl option is used).",
&opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0,
0, 0, 0},
#endif
@@ -6869,6 +6983,110 @@ static int show_ssl_get_cipher_list(THD *thd, SHOW_VAR *var, char *buff)
return 0;
}
+
+#ifdef HAVE_YASSL
+
+static char *
+my_asn1_time_to_string(ASN1_TIME *time, char *buf, size_t len)
+{
+ return yaSSL_ASN1_TIME_to_string(time, buf, len);
+}
+
+#else /* openssl */
+
+static char *
+my_asn1_time_to_string(ASN1_TIME *time, char *buf, size_t len)
+{
+ int n_read;
+ char *res= NULL;
+ BIO *bio= BIO_new(BIO_s_mem());
+
+ if (bio == NULL)
+ return NULL;
+
+ if (!ASN1_TIME_print(bio, time))
+ goto end;
+
+ n_read= BIO_read(bio, buf, (int) (len - 1));
+
+ if (n_read > 0)
+ {
+ buf[n_read]= 0;
+ res= buf;
+ }
+
+end:
+ BIO_free(bio);
+ return res;
+}
+
+#endif
+
+
+/**
+ Handler function for the 'ssl_get_server_not_before' variable
+
+ @param thd the mysql thread structure
+ @param var the data for the variable
+ @param[out] buf the string to put the value of the variable into
+
+ @return status
+ @retval 0 success
+*/
+
+static int
+show_ssl_get_server_not_before(THD *thd, SHOW_VAR *var, char *buff)
+{
+ var->type= SHOW_CHAR;
+ if(thd->vio_ok() && thd->net.vio->ssl_arg)
+ {
+ SSL *ssl= (SSL*) thd->net.vio->ssl_arg;
+ X509 *cert= SSL_get_certificate(ssl);
+ ASN1_TIME *not_before= X509_get_notBefore(cert);
+
+ var->value= my_asn1_time_to_string(not_before, buff,
+ SHOW_VAR_FUNC_BUFF_SIZE);
+ if (!var->value)
+ return 1;
+ var->value= buff;
+ }
+ else
+ var->value= empty_c_string;
+ return 0;
+}
+
+
+/**
+ Handler function for the 'ssl_get_server_not_after' variable
+
+ @param thd the mysql thread structure
+ @param var the data for the variable
+ @param[out] buf the string to put the value of the variable into
+
+ @return status
+ @retval 0 success
+*/
+
+static int
+show_ssl_get_server_not_after(THD *thd, SHOW_VAR *var, char *buff)
+{
+ var->type= SHOW_CHAR;
+ if(thd->vio_ok() && thd->net.vio->ssl_arg)
+ {
+ SSL *ssl= (SSL*) thd->net.vio->ssl_arg;
+ X509 *cert= SSL_get_certificate(ssl);
+ ASN1_TIME *not_after= X509_get_notAfter(cert);
+
+ var->value= my_asn1_time_to_string(not_after, buff,
+ SHOW_VAR_FUNC_BUFF_SIZE);
+ if (!var->value)
+ return 1;
+ }
+ else
+ var->value= empty_c_string;
+ return 0;
+}
+
#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */
static int show_default_keycache(THD *thd, SHOW_VAR *var, char *buff)
@@ -7049,6 +7267,10 @@ SHOW_VAR status_vars[]= {
{"Ssl_verify_depth", (char*) &show_ssl_get_verify_depth, SHOW_FUNC},
{"Ssl_verify_mode", (char*) &show_ssl_get_verify_mode, SHOW_FUNC},
{"Ssl_version", (char*) &show_ssl_get_version, SHOW_FUNC},
+ {"Ssl_server_not_before", (char*) &show_ssl_get_server_not_before,
+ SHOW_FUNC},
+ {"Ssl_server_not_after", (char*) &show_ssl_get_server_not_after,
+ SHOW_FUNC},
#endif
#endif /* HAVE_OPENSSL */
{"Syncs", (char*) &my_sync_count, SHOW_LONG_NOFLUSH},
@@ -7267,7 +7489,7 @@ static int mysql_init_variables(void)
character_set_filesystem= &my_charset_bin;
opt_specialflag= SPECIAL_ENGLISH;
- unix_sock= base_ip_sock= extra_ip_sock= INVALID_SOCKET;
+ unix_sock= base_ip_sock= extra_ip_sock= MYSQL_INVALID_SOCKET;
mysql_home_ptr= mysql_home;
pidfile_name_ptr= pidfile_name;
log_error_file_ptr= log_error_file;
@@ -7714,6 +7936,74 @@ mysqld_get_one_option(int optid,
case OPT_MAX_LONG_DATA_SIZE:
max_long_data_size_used= true;
break;
+ case OPT_PFS_INSTRUMENT:
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
+ /* Parse instrument name and value from argument string */
+ char* name = argument,*p, *val;
+
+ /* Assignment required */
+ if (!(p= strchr(argument, '=')))
+ {
+ my_getopt_error_reporter(WARNING_LEVEL,
+ "Missing value for performance_schema_instrument "
+ "'%s'", argument);
+ return 0;
+ }
+
+ /* Option value */
+ val= p + 1;
+ if (!*val)
+ {
+ my_getopt_error_reporter(WARNING_LEVEL,
+ "Missing value for performance_schema_instrument "
+ "'%s'", argument);
+ return 0;
+ }
+
+ /* Trim leading spaces from instrument name */
+ while (*name && my_isspace(mysqld_charset, *name))
+ name++;
+
+ /* Trim trailing spaces and slashes from instrument name */
+ while (p > argument && (my_isspace(mysqld_charset, p[-1]) || p[-1] == '/'))
+ p--;
+ *p= 0;
+
+ if (!*name)
+ {
+ my_getopt_error_reporter(WARNING_LEVEL,
+ "Invalid instrument name for "
+ "performance_schema_instrument '%s'", argument);
+ return 0;
+ }
+
+ /* Trim leading spaces from option value */
+ while (*val && my_isspace(mysqld_charset, *val))
+ val++;
+
+ /* Trim trailing spaces from option value */
+ if ((p= my_strchr(mysqld_charset, val, val+strlen(val), ' ')) != NULL)
+ *p= 0;
+
+ if (!*val)
+ {
+ my_getopt_error_reporter(WARNING_LEVEL,
+ "Invalid value for performance_schema_instrument "
+ "'%s'", argument);
+ return 0;
+ }
+
+ /* Add instrument name and value to array of configuration options */
+ if (add_pfs_instr_to_array(name, val))
+ {
+ my_getopt_error_reporter(WARNING_LEVEL,
+ "Invalid value for performance_schema_instrument "
+ "'%s'", argument);
+ return 0;
+ }
+
+#endif
+ break;
}
return 0;
}
@@ -8299,23 +8589,305 @@ void refresh_status(THD *thd)
mysql_mutex_unlock(&LOCK_thread_count);
}
+PSI_stage_info stage_after_create= { 0, "After create", 0};
+PSI_stage_info stage_allocating_local_table= { 0, "allocating local table", 0};
+PSI_stage_info stage_changing_master= { 0, "Changing master", 0};
+PSI_stage_info stage_checking_master_version= { 0, "Checking master version", 0};
+PSI_stage_info stage_checking_permissions= { 0, "checking permissions", 0};
+PSI_stage_info stage_checking_privileges_on_cached_query= { 0, "checking privileges on cached query", 0};
+PSI_stage_info stage_checking_query_cache_for_query= { 0, "checking query cache for query", 0};
+PSI_stage_info stage_cleaning_up= { 0, "cleaning up", 0};
+PSI_stage_info stage_closing_tables= { 0, "closing tables", 0};
+PSI_stage_info stage_connecting_to_master= { 0, "Connecting to master", 0};
+PSI_stage_info stage_converting_heap_to_myisam= { 0, "converting HEAP to MyISAM", 0};
+PSI_stage_info stage_copying_to_group_table= { 0, "Copying to group table", 0};
+PSI_stage_info stage_copying_to_tmp_table= { 0, "Copying to tmp table", 0};
+PSI_stage_info stage_copy_to_tmp_table= { 0, "copy to tmp table", 0};
+PSI_stage_info stage_creating_delayed_handler= { 0, "Creating delayed handler", 0};
+PSI_stage_info stage_creating_sort_index= { 0, "Creating sort index", 0};
+PSI_stage_info stage_creating_table= { 0, "creating table", 0};
+PSI_stage_info stage_creating_tmp_table= { 0, "Creating tmp table", 0};
+PSI_stage_info stage_deleting_from_main_table= { 0, "deleting from main table", 0};
+PSI_stage_info stage_deleting_from_reference_tables= { 0, "deleting from reference tables", 0};
+PSI_stage_info stage_discard_or_import_tablespace= { 0, "discard_or_import_tablespace", 0};
+PSI_stage_info stage_end= { 0, "end", 0};
+PSI_stage_info stage_executing= { 0, "executing", 0};
+PSI_stage_info stage_execution_of_init_command= { 0, "Execution of init_command", 0};
+PSI_stage_info stage_explaining= { 0, "explaining", 0};
+PSI_stage_info stage_finished_reading_one_binlog_switching_to_next_binlog= { 0, "Finished reading one binlog; switching to next binlog", 0};
+PSI_stage_info stage_flushing_relay_log_and_master_info_repository= { 0, "Flushing relay log and master info repository.", 0};
+PSI_stage_info stage_flushing_relay_log_info_file= { 0, "Flushing relay-log info file.", 0};
+PSI_stage_info stage_freeing_items= { 0, "freeing items", 0};
+PSI_stage_info stage_fulltext_initialization= { 0, "FULLTEXT initialization", 0};
+PSI_stage_info stage_got_handler_lock= { 0, "got handler lock", 0};
+PSI_stage_info stage_got_old_table= { 0, "got old table", 0};
+PSI_stage_info stage_init= { 0, "init", 0};
+PSI_stage_info stage_insert= { 0, "insert", 0};
+PSI_stage_info stage_invalidating_query_cache_entries_table= { 0, "invalidating query cache entries (table)", 0};
+PSI_stage_info stage_invalidating_query_cache_entries_table_list= { 0, "invalidating query cache entries (table list)", 0};
+PSI_stage_info stage_killing_slave= { 0, "Killing slave", 0};
+PSI_stage_info stage_logging_slow_query= { 0, "logging slow query", 0};
+PSI_stage_info stage_making_temp_file_append_before_load_data= { 0, "Making temporary file (append) before replaying LOAD DATA INFILE.", 0};
+PSI_stage_info stage_making_temp_file_create_before_load_data= { 0, "Making temporary file (create) before replaying LOAD DATA INFILE.", 0};
+PSI_stage_info stage_manage_keys= { 0, "manage keys", 0};
+PSI_stage_info stage_master_has_sent_all_binlog_to_slave= { 0, "Master has sent all binlog to slave; waiting for binlog to be updated", 0};
+PSI_stage_info stage_opening_tables= { 0, "Opening tables", 0};
+PSI_stage_info stage_optimizing= { 0, "optimizing", 0};
+PSI_stage_info stage_preparing= { 0, "preparing", 0};
+PSI_stage_info stage_purging_old_relay_logs= { 0, "Purging old relay logs", 0};
+PSI_stage_info stage_query_end= { 0, "query end", 0};
+PSI_stage_info stage_queueing_master_event_to_the_relay_log= { 0, "Queueing master event to the relay log", 0};
+PSI_stage_info stage_reading_event_from_the_relay_log= { 0, "Reading event from the relay log", 0};
+PSI_stage_info stage_registering_slave_on_master= { 0, "Registering slave on master", 0};
+PSI_stage_info stage_removing_duplicates= { 0, "Removing duplicates", 0};
+PSI_stage_info stage_removing_tmp_table= { 0, "removing tmp table", 0};
+PSI_stage_info stage_rename= { 0, "rename", 0};
+PSI_stage_info stage_rename_result_table= { 0, "rename result table", 0};
+PSI_stage_info stage_requesting_binlog_dump= { 0, "Requesting binlog dump", 0};
+PSI_stage_info stage_reschedule= { 0, "reschedule", 0};
+PSI_stage_info stage_searching_rows_for_update= { 0, "Searching rows for update", 0};
+PSI_stage_info stage_sending_binlog_event_to_slave= { 0, "Sending binlog event to slave", 0};
+PSI_stage_info stage_sending_cached_result_to_client= { 0, "sending cached result to client", 0};
+PSI_stage_info stage_sending_data= { 0, "Sending data", 0};
+PSI_stage_info stage_setup= { 0, "setup", 0};
+PSI_stage_info stage_slave_has_read_all_relay_log= { 0, "Slave has read all relay log; waiting for the slave I/O thread to update it", 0};
+PSI_stage_info stage_sorting_for_group= { 0, "Sorting for group", 0};
+PSI_stage_info stage_sorting_for_order= { 0, "Sorting for order", 0};
+PSI_stage_info stage_sorting_result= { 0, "Sorting result", 0};
+PSI_stage_info stage_statistics= { 0, "statistics", 0};
+PSI_stage_info stage_sql_thd_waiting_until_delay= { 0, "Waiting until MASTER_DELAY seconds after master executed event", 0 };
+PSI_stage_info stage_storing_result_in_query_cache= { 0, "storing result in query cache", 0};
+PSI_stage_info stage_storing_row_into_queue= { 0, "storing row into queue", 0};
+PSI_stage_info stage_system_lock= { 0, "System lock", 0};
+PSI_stage_info stage_update= { 0, "update", 0};
+PSI_stage_info stage_updating= { 0, "updating", 0};
+PSI_stage_info stage_updating_main_table= { 0, "updating main table", 0};
+PSI_stage_info stage_updating_reference_tables= { 0, "updating reference tables", 0};
+PSI_stage_info stage_upgrading_lock= { 0, "upgrading lock", 0};
+PSI_stage_info stage_user_lock= { 0, "User lock", 0};
+PSI_stage_info stage_user_sleep= { 0, "User sleep", 0};
+PSI_stage_info stage_verifying_table= { 0, "verifying table", 0};
+PSI_stage_info stage_waiting_for_delay_list= { 0, "waiting for delay_list", 0};
+PSI_stage_info stage_waiting_for_gtid_to_be_written_to_binary_log= { 0, "waiting for GTID to be written to binary log", 0};
+PSI_stage_info stage_waiting_for_handler_insert= { 0, "waiting for handler insert", 0};
+PSI_stage_info stage_waiting_for_handler_lock= { 0, "waiting for handler lock", 0};
+PSI_stage_info stage_waiting_for_handler_open= { 0, "waiting for handler open", 0};
+PSI_stage_info stage_waiting_for_insert= { 0, "Waiting for INSERT", 0};
+PSI_stage_info stage_waiting_for_master_to_send_event= { 0, "Waiting for master to send event", 0};
+PSI_stage_info stage_waiting_for_master_update= { 0, "Waiting for master update", 0};
+PSI_stage_info stage_waiting_for_relay_log_space= { 0, "Waiting for the slave SQL thread to free enough relay log space", 0};
+PSI_stage_info stage_waiting_for_slave_mutex_on_exit= { 0, "Waiting for slave mutex on exit", 0};
+PSI_stage_info stage_waiting_for_slave_thread_to_start= { 0, "Waiting for slave thread to start", 0};
+PSI_stage_info stage_waiting_for_table_flush= { 0, "Waiting for table flush", 0};
+PSI_stage_info stage_waiting_for_query_cache_lock= { 0, "Waiting for query cache lock", 0};
+PSI_stage_info stage_waiting_for_the_next_event_in_relay_log= { 0, "Waiting for the next event in relay log", 0};
+PSI_stage_info stage_waiting_for_the_slave_thread_to_advance_position= { 0, "Waiting for the slave SQL thread to advance position", 0};
+PSI_stage_info stage_waiting_to_finalize_termination= { 0, "Waiting to finalize termination", 0};
+PSI_stage_info stage_waiting_to_get_readlock= { 0, "Waiting to get readlock", 0};
+PSI_stage_info stage_slave_waiting_workers_to_exit= { 0, "Waiting for workers to exit", 0};
+PSI_stage_info stage_slave_waiting_worker_to_release_partition= { 0, "Waiting for Slave Worker to release partition", 0};
+PSI_stage_info stage_slave_waiting_worker_to_free_events= { 0, "Waiting for Slave Workers to free pending events", 0};
+PSI_stage_info stage_slave_waiting_worker_queue= { 0, "Waiting for Slave Worker queue", 0};
+PSI_stage_info stage_slave_waiting_event_from_coordinator= { 0, "Waiting for an event from Coordinator", 0};
-/*****************************************************************************
- Instantiate variables for missing storage engines
- This section should go away soon
-*****************************************************************************/
+#ifdef HAVE_PSI_INTERFACE
-/*****************************************************************************
- Instantiate templates
-*****************************************************************************/
+static PSI_file_info all_server_files[]=
+{
+#ifdef HAVE_MMAP
+ { &key_file_map, "map", 0},
+#endif /* HAVE_MMAP */
+ { &key_file_binlog, "binlog", 0},
+ { &key_file_binlog_index, "binlog_index", 0},
+ { &key_file_relaylog, "relaylog", 0},
+ { &key_file_relaylog_index, "relaylog_index", 0},
+ { &key_file_casetest, "casetest", 0},
+ { &key_file_dbopt, "dbopt", 0},
+ { &key_file_des_key_file, "des_key_file", 0},
+ { &key_file_ERRMSG, "ERRMSG", 0},
+ { &key_select_to_file, "select_to_file", 0},
+ { &key_file_fileparser, "file_parser", 0},
+ { &key_file_frm, "FRM", 0},
+ { &key_file_global_ddl_log, "global_ddl_log", 0},
+ { &key_file_load, "load", 0},
+ { &key_file_loadfile, "LOAD_FILE", 0},
+ { &key_file_log_event_data, "log_event_data", 0},
+ { &key_file_log_event_info, "log_event_info", 0},
+ { &key_file_master_info, "master_info", 0},
+ { &key_file_misc, "misc", 0},
+ { &key_file_partition, "partition", 0},
+ { &key_file_pid, "pid", 0},
+ { &key_file_query_log, "query_log", 0},
+ { &key_file_relay_log_info, "relay_log_info", 0},
+ { &key_file_send_file, "send_file", 0},
+ { &key_file_slow_log, "slow_log", 0},
+ { &key_file_tclog, "tclog", 0},
+ { &key_file_trg, "trigger_name", 0},
+ { &key_file_trn, "trigger", 0},
+ { &key_file_init, "init", 0}
+};
+
+PSI_stage_info *all_server_stages[]=
+{
+ & stage_after_create,
+ & stage_allocating_local_table,
+ & stage_changing_master,
+ & stage_checking_master_version,
+ & stage_checking_permissions,
+ & stage_checking_privileges_on_cached_query,
+ & stage_checking_query_cache_for_query,
+ & stage_cleaning_up,
+ & stage_closing_tables,
+ & stage_connecting_to_master,
+ & stage_converting_heap_to_myisam,
+ & stage_copying_to_group_table,
+ & stage_copying_to_tmp_table,
+ & stage_copy_to_tmp_table,
+ & stage_creating_delayed_handler,
+ & stage_creating_sort_index,
+ & stage_creating_table,
+ & stage_creating_tmp_table,
+ & stage_deleting_from_main_table,
+ & stage_deleting_from_reference_tables,
+ & stage_discard_or_import_tablespace,
+ & stage_end,
+ & stage_executing,
+ & stage_execution_of_init_command,
+ & stage_explaining,
+ & stage_finished_reading_one_binlog_switching_to_next_binlog,
+ & stage_flushing_relay_log_and_master_info_repository,
+ & stage_flushing_relay_log_info_file,
+ & stage_freeing_items,
+ & stage_fulltext_initialization,
+ & stage_got_handler_lock,
+ & stage_got_old_table,
+ & stage_init,
+ & stage_insert,
+ & stage_invalidating_query_cache_entries_table,
+ & stage_invalidating_query_cache_entries_table_list,
+ & stage_killing_slave,
+ & stage_logging_slow_query,
+ & stage_making_temp_file_append_before_load_data,
+ & stage_making_temp_file_create_before_load_data,
+ & stage_manage_keys,
+ & stage_master_has_sent_all_binlog_to_slave,
+ & stage_opening_tables,
+ & stage_optimizing,
+ & stage_preparing,
+ & stage_purging_old_relay_logs,
+ & stage_query_end,
+ & stage_queueing_master_event_to_the_relay_log,
+ & stage_reading_event_from_the_relay_log,
+ & stage_registering_slave_on_master,
+ & stage_removing_duplicates,
+ & stage_removing_tmp_table,
+ & stage_rename,
+ & stage_rename_result_table,
+ & stage_requesting_binlog_dump,
+ & stage_reschedule,
+ & stage_searching_rows_for_update,
+ & stage_sending_binlog_event_to_slave,
+ & stage_sending_cached_result_to_client,
+ & stage_sending_data,
+ & stage_setup,
+ & stage_slave_has_read_all_relay_log,
+ & stage_sorting_for_group,
+ & stage_sorting_for_order,
+ & stage_sorting_result,
+ & stage_sql_thd_waiting_until_delay,
+ & stage_statistics,
+ & stage_storing_result_in_query_cache,
+ & stage_storing_row_into_queue,
+ & stage_system_lock,
+ & stage_update,
+ & stage_updating,
+ & stage_updating_main_table,
+ & stage_updating_reference_tables,
+ & stage_upgrading_lock,
+ & stage_user_lock,
+ & stage_user_sleep,
+ & stage_verifying_table,
+ & stage_waiting_for_delay_list,
+ & stage_waiting_for_handler_insert,
+ & stage_waiting_for_handler_lock,
+ & stage_waiting_for_handler_open,
+ & stage_waiting_for_insert,
+ & stage_waiting_for_master_to_send_event,
+ & stage_waiting_for_master_update,
+ & stage_waiting_for_slave_mutex_on_exit,
+ & stage_waiting_for_slave_thread_to_start,
+ & stage_waiting_for_table_flush,
+ & stage_waiting_for_query_cache_lock,
+ & stage_waiting_for_the_next_event_in_relay_log,
+ & stage_waiting_for_the_slave_thread_to_advance_position,
+ & stage_waiting_to_finalize_termination,
+ & stage_waiting_to_get_readlock
+};
+
+PSI_socket_key key_socket_tcpip, key_socket_unix, key_socket_client_connection;
+
+static PSI_socket_info all_server_sockets[]=
+{
+ { &key_socket_tcpip, "server_tcpip_socket", PSI_FLAG_GLOBAL},
+ { &key_socket_unix, "server_unix_socket", PSI_FLAG_GLOBAL},
+ { &key_socket_client_connection, "client_connection", 0}
+};
+
+/**
+ Initialise all the performance schema instrumentation points
+ used by the server.
+*/
+void init_server_psi_keys(void)
+{
+ const char* category= "sql";
+ int count;
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-/* Used templates */
-template class I_List<THD>;
-template class I_List_iterator<THD>;
-template class I_List<i_string>;
-template class I_List<i_string_pair>;
-template class I_List<Statement>;
-template class I_List_iterator<Statement>;
+ count= array_elements(all_server_mutexes);
+ mysql_mutex_register(category, all_server_mutexes, count);
+
+ count= array_elements(all_server_rwlocks);
+ mysql_rwlock_register(category, all_server_rwlocks, count);
+
+ count= array_elements(all_server_conds);
+ mysql_cond_register(category, all_server_conds, count);
+
+ count= array_elements(all_server_threads);
+ mysql_thread_register(category, all_server_threads, count);
+
+ count= array_elements(all_server_files);
+ mysql_file_register(category, all_server_files, count);
+
+ count= array_elements(all_server_stages);
+ mysql_stage_register(category, all_server_stages, count);
+
+ count= array_elements(all_server_sockets);
+ mysql_socket_register(category, all_server_sockets, count);
+
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ init_sql_statement_info();
+ count= array_elements(sql_statement_info);
+ mysql_statement_register(category, sql_statement_info, count);
+
+ category= "com";
+ init_com_statement_info();
+ count= array_elements(com_statement_info);
+ mysql_statement_register(category, com_statement_info, count);
+
+ /*
+ When a new packet is received,
+ it is instrumented as "statement/com/".
+ Based on the packet type found, it later mutates to the
+ proper narrow type, for example
+ "statement/com/query" or "statement/com/ping".
+ In cases of "statement/com/query", SQL queries are given to
+ the parser, which mutates the statement type to an even more
+ narrow classification, for example "statement/sql/select".
+ */
+ stmt_info_new_packet.m_key= 0;
+ stmt_info_new_packet.m_name= "";
+ stmt_info_new_packet.m_flags= PSI_FLAG_MUTABLE;
+ mysql_statement_register(category, & stmt_info_new_packet, 1);
#endif
+}
+#endif /* HAVE_PSI_INTERFACE */
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 6b073eac59b..e2beb59908b 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -23,6 +23,7 @@
#include "my_atomic.h" /* my_atomic_rwlock_t */
#include "mysql/psi/mysql_file.h" /* MYSQL_FILE */
#include "sql_list.h" /* I_List */
+#include "sql_cmd.h"
class THD;
struct handlerton;
@@ -285,10 +286,133 @@ extern PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
key_file_trg, key_file_trn, key_file_init;
extern PSI_file_key key_file_query_log, key_file_slow_log;
extern PSI_file_key key_file_relaylog, key_file_relaylog_index;
+extern PSI_socket_key key_socket_tcpip, key_socket_unix,
+ key_socket_client_connection;
void init_server_psi_keys();
#endif /* HAVE_PSI_INTERFACE */
+/*
+ MAINTAINER: Please keep this list in order, to limit merge collisions.
+ Hint: grep PSI_stage_info | sort -u
+*/
+extern PSI_stage_info stage_after_create;
+extern PSI_stage_info stage_allocating_local_table;
+extern PSI_stage_info stage_changing_master;
+extern PSI_stage_info stage_checking_master_version;
+extern PSI_stage_info stage_checking_permissions;
+extern PSI_stage_info stage_checking_privileges_on_cached_query;
+extern PSI_stage_info stage_checking_query_cache_for_query;
+extern PSI_stage_info stage_cleaning_up;
+extern PSI_stage_info stage_closing_tables;
+extern PSI_stage_info stage_connecting_to_master;
+extern PSI_stage_info stage_converting_heap_to_myisam;
+extern PSI_stage_info stage_copying_to_group_table;
+extern PSI_stage_info stage_copying_to_tmp_table;
+extern PSI_stage_info stage_copy_to_tmp_table;
+extern PSI_stage_info stage_creating_delayed_handler;
+extern PSI_stage_info stage_creating_sort_index;
+extern PSI_stage_info stage_creating_table;
+extern PSI_stage_info stage_creating_tmp_table;
+extern PSI_stage_info stage_deleting_from_main_table;
+extern PSI_stage_info stage_deleting_from_reference_tables;
+extern PSI_stage_info stage_discard_or_import_tablespace;
+extern PSI_stage_info stage_end;
+extern PSI_stage_info stage_executing;
+extern PSI_stage_info stage_execution_of_init_command;
+extern PSI_stage_info stage_explaining;
+extern PSI_stage_info stage_finished_reading_one_binlog_switching_to_next_binlog;
+extern PSI_stage_info stage_flushing_relay_log_and_master_info_repository;
+extern PSI_stage_info stage_flushing_relay_log_info_file;
+extern PSI_stage_info stage_freeing_items;
+extern PSI_stage_info stage_fulltext_initialization;
+extern PSI_stage_info stage_got_handler_lock;
+extern PSI_stage_info stage_got_old_table;
+extern PSI_stage_info stage_init;
+extern PSI_stage_info stage_insert;
+extern PSI_stage_info stage_invalidating_query_cache_entries_table;
+extern PSI_stage_info stage_invalidating_query_cache_entries_table_list;
+extern PSI_stage_info stage_killing_slave;
+extern PSI_stage_info stage_logging_slow_query;
+extern PSI_stage_info stage_making_temp_file_append_before_load_data;
+extern PSI_stage_info stage_making_temp_file_create_before_load_data;
+extern PSI_stage_info stage_manage_keys;
+extern PSI_stage_info stage_master_has_sent_all_binlog_to_slave;
+extern PSI_stage_info stage_opening_tables;
+extern PSI_stage_info stage_optimizing;
+extern PSI_stage_info stage_preparing;
+extern PSI_stage_info stage_purging_old_relay_logs;
+extern PSI_stage_info stage_query_end;
+extern PSI_stage_info stage_queueing_master_event_to_the_relay_log;
+extern PSI_stage_info stage_reading_event_from_the_relay_log;
+extern PSI_stage_info stage_registering_slave_on_master;
+extern PSI_stage_info stage_removing_duplicates;
+extern PSI_stage_info stage_removing_tmp_table;
+extern PSI_stage_info stage_rename;
+extern PSI_stage_info stage_rename_result_table;
+extern PSI_stage_info stage_requesting_binlog_dump;
+extern PSI_stage_info stage_reschedule;
+extern PSI_stage_info stage_searching_rows_for_update;
+extern PSI_stage_info stage_sending_binlog_event_to_slave;
+extern PSI_stage_info stage_sending_cached_result_to_client;
+extern PSI_stage_info stage_sending_data;
+extern PSI_stage_info stage_setup;
+extern PSI_stage_info stage_slave_has_read_all_relay_log;
+extern PSI_stage_info stage_sorting_for_group;
+extern PSI_stage_info stage_sorting_for_order;
+extern PSI_stage_info stage_sorting_result;
+extern PSI_stage_info stage_sql_thd_waiting_until_delay;
+extern PSI_stage_info stage_statistics;
+extern PSI_stage_info stage_storing_result_in_query_cache;
+extern PSI_stage_info stage_storing_row_into_queue;
+extern PSI_stage_info stage_system_lock;
+extern PSI_stage_info stage_update;
+extern PSI_stage_info stage_updating;
+extern PSI_stage_info stage_updating_main_table;
+extern PSI_stage_info stage_updating_reference_tables;
+extern PSI_stage_info stage_upgrading_lock;
+extern PSI_stage_info stage_user_lock;
+extern PSI_stage_info stage_user_sleep;
+extern PSI_stage_info stage_verifying_table;
+extern PSI_stage_info stage_waiting_for_delay_list;
+extern PSI_stage_info stage_waiting_for_gtid_to_be_written_to_binary_log;
+extern PSI_stage_info stage_waiting_for_handler_insert;
+extern PSI_stage_info stage_waiting_for_handler_lock;
+extern PSI_stage_info stage_waiting_for_handler_open;
+extern PSI_stage_info stage_waiting_for_insert;
+extern PSI_stage_info stage_waiting_for_master_to_send_event;
+extern PSI_stage_info stage_waiting_for_master_update;
+extern PSI_stage_info stage_waiting_for_relay_log_space;
+extern PSI_stage_info stage_waiting_for_slave_mutex_on_exit;
+extern PSI_stage_info stage_waiting_for_slave_thread_to_start;
+extern PSI_stage_info stage_waiting_for_query_cache_lock;
+extern PSI_stage_info stage_waiting_for_table_flush;
+extern PSI_stage_info stage_waiting_for_the_next_event_in_relay_log;
+extern PSI_stage_info stage_waiting_for_the_slave_thread_to_advance_position;
+extern PSI_stage_info stage_waiting_to_finalize_termination;
+extern PSI_stage_info stage_waiting_to_get_readlock;
+extern PSI_stage_info stage_slave_waiting_worker_to_release_partition;
+extern PSI_stage_info stage_slave_waiting_worker_to_free_events;
+extern PSI_stage_info stage_slave_waiting_worker_queue;
+extern PSI_stage_info stage_slave_waiting_event_from_coordinator;
+extern PSI_stage_info stage_slave_waiting_workers_to_exit;
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+/**
+ Statement instrumentation keys (sql).
+ The last entry, at [SQLCOM_END], is for parsing errors.
+*/
+extern PSI_statement_info sql_statement_info[(uint) SQLCOM_END + 1];
+
+/**
+ Statement instrumentation keys (com).
+ The last entry, at [COM_END], is for packet errors.
+*/
+extern PSI_statement_info com_statement_info[(uint) COM_END + 1];
+
+void init_sql_statement_info();
+void init_com_statement_info();
+#endif /* HAVE_PSI_STATEMENT_INTERFACE */
+
#ifndef __WIN__
extern pthread_t signal_thread;
#endif
@@ -349,7 +473,7 @@ extern int32 thread_running;
extern my_atomic_rwlock_t thread_running_lock;
extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher,
- *opt_ssl_key;
+ *opt_ssl_key, *opt_ssl_crl, *opt_ssl_crlpath;
extern MYSQL_PLUGIN_IMPORT pthread_key(THD*, THR_THD);
@@ -407,7 +531,10 @@ enum options_mysqld
OPT_WANT_CORE,
OPT_ENGINE_CONDITION_PUSHDOWN,
OPT_LOG_ERROR,
- OPT_MAX_LONG_DATA_SIZE
+ OPT_MAX_LONG_DATA_SIZE,
+ OPT_SSL_CRL,
+ OPT_SSL_CRLPATH,
+ OPT_PFS_INSTRUMENT
};
#endif
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index 3c5a99121fa..c1a4347d508 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -39,6 +39,7 @@ Master_info::Master_info(bool is_slave_recovery)
host[0] = 0; user[0] = 0; password[0] = 0;
ssl_ca[0]= 0; ssl_capath[0]= 0; ssl_cert[0]= 0;
ssl_cipher[0]= 0; ssl_key[0]= 0;
+ ssl_crl[0]= 0; ssl_crlpath[0]= 0;
my_init_dynamic_array(&ignore_server_ids, sizeof(::server_id), 16, 16);
bzero((char*) &file, sizeof(file));
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index a885576ef1c..462d0cfe1ed 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -72,6 +72,7 @@ class Master_info : public Slave_reporting_capability
bool ssl; // enables use of SSL connection if true
char ssl_ca[FN_REFLEN], ssl_capath[FN_REFLEN], ssl_cert[FN_REFLEN];
char ssl_cipher[FN_REFLEN], ssl_key[FN_REFLEN];
+ char ssl_crl[FN_REFLEN], ssl_crlpath[FN_REFLEN];
bool ssl_verify_server_cert;
my_off_t master_log_pos;
diff --git a/sql/set_var.h b/sql/set_var.h
index 6edfd6adb39..1d07a1b73e9 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -60,7 +60,8 @@ public:
sys_var *next;
LEX_CSTRING name;
enum flag_enum { GLOBAL, SESSION, ONLY_SESSION, SCOPE_MASK=1023,
- READONLY=1024, ALLOCATED=2048, PARSE_EARLY=4096 };
+ READONLY=1024, ALLOCATED=2048, INVISIBLE= 4096,
+ PARSE_EARLY=8192 };
/**
Enumeration type to indicate for a system variable whether
it will be written to the binlog or not.
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 67a9312b6e6..3a3cf4520e1 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -426,7 +426,7 @@ void thd_set_mysys_var(THD *thd, st_my_thread_var *mysys_var)
*/
my_socket thd_get_fd(THD *thd)
{
- return thd->net.vio->sd;
+ return mysql_socket_getfd(thd->net.vio->mysql_socket);
}
/**
@@ -491,27 +491,74 @@ int thd_tablespace_op(const THD *thd)
return test(thd->tablespace_op);
}
-
extern "C"
-const char *set_thd_proc_info(THD *thd, const char *info,
+const char *set_thd_proc_info(THD *thd_arg, const char *info,
const char *calling_function,
const char *calling_file,
const unsigned int calling_line)
{
- if (!thd)
+ PSI_stage_info old_stage;
+ PSI_stage_info new_stage;
+
+ old_stage.m_key= 0;
+ old_stage.m_name= info;
+
+ set_thd_stage_info(thd_arg, & old_stage, & new_stage,
+ calling_function, calling_file, calling_line);
+
+ return new_stage.m_name;
+}
+
+extern "C"
+void set_thd_stage_info(void *opaque_thd,
+ const PSI_stage_info *new_stage,
+ PSI_stage_info *old_stage,
+ const char *calling_func,
+ const char *calling_file,
+ const unsigned int calling_line)
+{
+ THD *thd= (THD*) opaque_thd;
+ if (thd == NULL)
thd= current_thd;
- const char *old_info= thd->proc_info;
- DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line, info));
+ thd->enter_stage(new_stage, old_stage, calling_func, calling_file,
+ calling_line);
+}
+
+void THD::enter_stage(const PSI_stage_info *new_stage,
+ PSI_stage_info *old_stage,
+ const char *calling_func,
+ const char *calling_file,
+ const unsigned int calling_line)
+{
+ DBUG_PRINT("THD::enter_stage", ("%s:%d", calling_file, calling_line));
+
+ if (old_stage != NULL)
+ {
+ old_stage->m_key= m_current_stage_key;
+ old_stage->m_name= proc_info;
+ }
+
+ if (new_stage != NULL)
+ {
+ const char *msg= new_stage->m_name;
#if defined(ENABLED_PROFILING)
- thd->profiling.status_change(info,
- calling_function, calling_file, calling_line);
+ profiling.status_change(msg, calling_func, calling_file, calling_line);
#endif
- thd->proc_info= info;
- return old_info;
+
+ m_current_stage_key= new_stage->m_key;
+ proc_info= msg;
+
+#ifdef HAVE_PSI_THREAD_INTERFACE
+ PSI_CALL(set_thread_state)(msg);
+ MYSQL_SET_STAGE(m_current_stage_key, calling_file, calling_line);
+#endif
+ }
+ return;
}
+
extern "C"
const char* thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond,
mysql_mutex_t *mutex, const char *msg)
@@ -746,6 +793,9 @@ THD::THD()
accessed_rows_and_keys(0),
warning_info(&main_warning_info),
stmt_da(&main_da),
+ m_statement_psi(NULL),
+ m_idle_psi(NULL),
+ m_server_idle(false),
global_disable_checkpoint(0),
is_fatal_error(0),
transaction_rollback_request(0),
@@ -4186,6 +4236,141 @@ void THD::set_statement(Statement *stmt)
mysql_mutex_unlock(&LOCK_thd_data);
}
+void THD::set_sent_row_count(ha_rows count)
+{
+ sent_row_count= count;
+ MYSQL_SET_STATEMENT_ROWS_SENT(m_statement_psi, sent_row_count);
+}
+
+void THD::set_examined_row_count(ha_rows count)
+{
+ examined_row_count= count;
+ MYSQL_SET_STATEMENT_ROWS_EXAMINED(m_statement_psi, examined_row_count);
+}
+
+void THD::inc_sent_row_count(ha_rows count)
+{
+ sent_row_count+= count;
+ MYSQL_SET_STATEMENT_ROWS_SENT(m_statement_psi, sent_row_count);
+}
+
+void THD::inc_examined_row_count(ha_rows count)
+{
+ examined_row_count+= count;
+ MYSQL_SET_STATEMENT_ROWS_EXAMINED(m_statement_psi, examined_row_count);
+}
+
+void THD::inc_status_created_tmp_disk_tables()
+{
+ status_var_increment(status_var.created_tmp_disk_tables);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_created_tmp_disk_tables)(m_statement_psi, 1);
+#endif
+}
+
+void THD::inc_status_created_tmp_tables()
+{
+ status_var_increment(status_var.created_tmp_tables);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_created_tmp_tables)(m_statement_psi, 1);
+#endif
+}
+
+void THD::inc_status_select_full_join()
+{
+ status_var_increment(status_var.select_full_join_count);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_select_full_join)(m_statement_psi, 1);
+#endif
+}
+
+void THD::inc_status_select_full_range_join()
+{
+ status_var_increment(status_var.select_full_range_join_count);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_select_full_range_join)(m_statement_psi, 1);
+#endif
+}
+
+void THD::inc_status_select_range()
+{
+ status_var_increment(status_var.select_range_count);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_select_range)(m_statement_psi, 1);
+#endif
+}
+
+void THD::inc_status_select_range_check()
+{
+ status_var_increment(status_var.select_range_check_count);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_select_range_check)(m_statement_psi, 1);
+#endif
+}
+
+void THD::inc_status_select_scan()
+{
+ status_var_increment(status_var.select_scan_count);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_select_scan)(m_statement_psi, 1);
+#endif
+}
+
+void THD::inc_status_sort_merge_passes()
+{
+ status_var_increment(status_var.filesort_merge_passes);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_sort_merge_passes)(m_statement_psi, 1);
+#endif
+}
+
+void THD::inc_status_sort_range()
+{
+ status_var_increment(status_var.filesort_range_count);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_sort_range)(m_statement_psi, 1);
+#endif
+}
+
+void THD::inc_status_sort_rows(ha_rows count)
+{
+ statistic_add(status_var.filesort_rows, count, &LOCK_status);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_sort_rows)(m_statement_psi, count);
+#endif
+}
+
+void THD::inc_status_sort_scan()
+{
+ status_var_increment(status_var.filesort_scan_count);
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(inc_statement_sort_scan)(m_statement_psi, 1);
+#endif
+}
+
+void THD::set_status_no_index_used()
+{
+ server_status|= SERVER_QUERY_NO_INDEX_USED;
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(set_statement_no_index_used)(m_statement_psi);
+#endif
+}
+
+void THD::set_status_no_good_index_used()
+{
+ server_status|= SERVER_QUERY_NO_GOOD_INDEX_USED;
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ PSI_CALL(set_statement_no_good_index_used)(m_statement_psi);
+#endif
+}
+
+void THD::set_command(enum enum_server_command command_arg)
+{
+ command= command_arg;
+#ifdef HAVE_PSI_THREAD_INTERFACE
+ PSI_CALL(set_thread_command)(command);
+#endif
+}
/** Assign a new value to thd->query. */
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 9a4a3dece67..b21f60a7a78 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -43,7 +43,11 @@
#include "violite.h" /* vio_is_connected */
#include "thr_lock.h" /* thr_lock_type, THR_LOCK_DATA,
THR_LOCK_INFO */
+#include <mysql/psi/mysql_stage.h>
+#include <mysql/psi/mysql_statement.h>
+#include <mysql/psi/mysql_idle.h>
#include <mysql/psi/mysql_table.h>
+#include <mysql_com_server.h>
class Reprepare_observer;
class Relay_log_info;
@@ -1588,6 +1592,8 @@ public:
Query_cache_tls query_cache_tls;
#endif
NET net; // client connection descriptor
+ /** Aditional network instrumentation for the server only. */
+ NET_SERVER m_net_server_extension;
scheduler_functions *scheduler; // Scheduler for this connection
Protocol *protocol; // Current protocol
Protocol_text protocol_text; // Normal protocol
@@ -1653,6 +1659,19 @@ public:
*/
const char *proc_info;
+private:
+ unsigned int m_current_stage_key;
+
+public:
+ void enter_stage(const PSI_stage_info *stage,
+ PSI_stage_info *old_stage,
+ const char *calling_func,
+ const char *calling_file,
+ const unsigned int calling_line);
+
+ const char *get_proc_info() const
+ { return proc_info; }
+
/*
Used in error messages to tell user in what part of MySQL we found an
error. E. g. when where= "having clause", if fix_fields() fails, user
@@ -2115,6 +2134,27 @@ public:
changed or written.
*/
ulonglong accessed_rows_and_keys;
+
+ void set_sent_row_count(ha_rows count);
+ void set_examined_row_count(ha_rows count);
+
+ void inc_sent_row_count(ha_rows count);
+ void inc_examined_row_count(ha_rows count);
+
+ void inc_status_created_tmp_disk_tables();
+ void inc_status_created_tmp_files();
+ void inc_status_created_tmp_tables();
+ void inc_status_select_full_join();
+ void inc_status_select_full_range_join();
+ void inc_status_select_range();
+ void inc_status_select_range_check();
+ void inc_status_select_scan();
+ void inc_status_sort_merge_passes();
+ void inc_status_sort_range();
+ void inc_status_sort_rows(ha_rows count);
+ void inc_status_sort_scan();
+ void set_status_no_index_used();
+ void set_status_no_good_index_used();
/**
Check if the number of rows accessed by a statement exceeded
LIMIT ROWS EXAMINED. If so, signal the query engine to stop execution.
@@ -2133,6 +2173,21 @@ public:
PROFILING profiling;
#endif
+ /** Current statement instrumentation. */
+ PSI_statement_locker *m_statement_psi;
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+ /** Current statement instrumentation state. */
+ PSI_statement_locker_state m_statement_state;
+#endif /* HAVE_PSI_STATEMENT_INTERFACE */
+ /** Idle instrumentation. */
+ PSI_idle_locker *m_idle_psi;
+#ifdef HAVE_PSI_IDLE_INTERFACE
+ /** Idle instrumentation state. */
+ PSI_idle_locker_state m_idle_state;
+#endif /* HAVE_PSI_IDLE_INTERFACE */
+ /** True if the server code is IDLE for this connection. */
+ bool m_server_idle;
+
/*
Id of current query. Statement can be reused to execute several queries
query_id is global in context of the whole MySQL server.
@@ -2482,7 +2537,12 @@ public:
my_hrtime_t hrtime= { hrtime_from_time(t) + sec_part };
set_time(hrtime);
}
- void set_time_after_lock() { utime_after_lock= microsecond_interval_timer(); }
+ void set_time_after_lock()
+ {
+ utime_after_lock= microsecond_interval_timer();
+ MYSQL_SET_STATEMENT_LOCK_TIME(m_statement_psi,
+ (utime_after_lock - start_utime));
+ }
ulonglong current_utime() { return microsecond_interval_timer(); }
/**
@@ -2650,6 +2710,11 @@ public:
To raise this flag, use my_error().
*/
inline bool is_error() const { return stmt_da->is_error(); }
+
+ /// Returns Diagnostics-area for the current statement.
+ Diagnostics_area *get_stmt_da()
+ { return stmt_da; }
+
inline CHARSET_INFO *charset() { return variables.character_set_client; }
void update_charset();
@@ -2973,6 +3038,9 @@ private:
public:
/** Overloaded to guard query/query_length fields */
virtual void set_statement(Statement *stmt);
+ void set_command(enum enum_server_command command);
+ inline enum enum_server_command get_command() const
+ { return command; }
/**
Assign a new value to thd->query and thd->query_id and mysys_var.
@@ -4368,6 +4436,17 @@ inline int handler::ha_update_tmp_row(const uchar *old_data, uchar *new_data)
extern pthread_attr_t *get_connection_attrib(void);
+extern "C"
+void set_thd_stage_info(void *thd,
+ const PSI_stage_info *new_stage,
+ PSI_stage_info *old_stage,
+ const char *calling_func,
+ const char *calling_file,
+ const unsigned int calling_line);
+
+#define THD_STAGE_INFO(thd, stage) \
+ (thd)->enter_stage(& stage, NULL, __func__, __FILE__, __LINE__)
+
#endif /* MYSQL_SERVER */
#endif /* SQL_CLASS_INCLUDED */
diff --git a/sql/sql_cmd.h b/sql/sql_cmd.h
new file mode 100644
index 00000000000..29b478bfb52
--- /dev/null
+++ b/sql/sql_cmd.h
@@ -0,0 +1,161 @@
+/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/**
+ @file Representation of an SQL command.
+*/
+
+#ifndef SQL_CMD_INCLUDED
+#define SQL_CMD_INCLUDED
+
+/*
+ When a command is added here, be sure it's also added in mysqld.cc
+ in "struct show_var_st status_vars[]= {" ...
+
+ If the command returns a result set or is not allowed in stored
+ functions or triggers, please also make sure that
+ sp_get_flags_for_command (sp_head.cc) returns proper flags for the
+ added SQLCOM_.
+*/
+
+enum enum_sql_command {
+ SQLCOM_SELECT, SQLCOM_CREATE_TABLE, SQLCOM_CREATE_INDEX, SQLCOM_ALTER_TABLE,
+ SQLCOM_UPDATE, SQLCOM_INSERT, SQLCOM_INSERT_SELECT,
+ SQLCOM_DELETE, SQLCOM_TRUNCATE, SQLCOM_DROP_TABLE, SQLCOM_DROP_INDEX,
+
+ SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
+ SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_STATUS,
+ SQLCOM_SHOW_ENGINE_LOGS, SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_MUTEX,
+ SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
+ SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
+ SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS,
+ SQLCOM_SHOW_TRIGGERS,
+
+ SQLCOM_LOAD,SQLCOM_SET_OPTION,SQLCOM_LOCK_TABLES,SQLCOM_UNLOCK_TABLES,
+ SQLCOM_GRANT,
+ SQLCOM_CHANGE_DB, SQLCOM_CREATE_DB, SQLCOM_DROP_DB, SQLCOM_ALTER_DB,
+ SQLCOM_REPAIR, SQLCOM_REPLACE, SQLCOM_REPLACE_SELECT,
+ SQLCOM_CREATE_FUNCTION, SQLCOM_DROP_FUNCTION,
+ SQLCOM_REVOKE,SQLCOM_OPTIMIZE, SQLCOM_CHECK,
+ SQLCOM_ASSIGN_TO_KEYCACHE, SQLCOM_PRELOAD_KEYS,
+ SQLCOM_FLUSH, SQLCOM_KILL, SQLCOM_ANALYZE,
+ SQLCOM_ROLLBACK, SQLCOM_ROLLBACK_TO_SAVEPOINT,
+ SQLCOM_COMMIT, SQLCOM_SAVEPOINT, SQLCOM_RELEASE_SAVEPOINT,
+ SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP,
+ SQLCOM_BEGIN, SQLCOM_CHANGE_MASTER,
+ SQLCOM_RENAME_TABLE,
+ SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_PURGE_BEFORE, SQLCOM_SHOW_BINLOGS,
+ SQLCOM_SHOW_OPEN_TABLES,
+ SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ,
+ SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
+ SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_DO,
+ SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
+ SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES,
+ SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER,
+ SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM,
+ SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL,
+ SQLCOM_DROP_PROCEDURE, SQLCOM_ALTER_PROCEDURE,SQLCOM_ALTER_FUNCTION,
+ SQLCOM_SHOW_CREATE_PROC, SQLCOM_SHOW_CREATE_FUNC,
+ SQLCOM_SHOW_STATUS_PROC, SQLCOM_SHOW_STATUS_FUNC,
+ SQLCOM_PREPARE, SQLCOM_EXECUTE, SQLCOM_DEALLOCATE_PREPARE,
+ SQLCOM_CREATE_VIEW, SQLCOM_DROP_VIEW,
+ SQLCOM_CREATE_TRIGGER, SQLCOM_DROP_TRIGGER,
+ SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE,
+ SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER,
+ SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE,
+ SQLCOM_ALTER_TABLESPACE,
+ SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN,
+ SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT,
+ SQLCOM_SHOW_PLUGINS,
+ SQLCOM_SHOW_CONTRIBUTORS,
+ SQLCOM_CREATE_SERVER, SQLCOM_DROP_SERVER, SQLCOM_ALTER_SERVER,
+ SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT, SQLCOM_DROP_EVENT,
+ SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS,
+ SQLCOM_SHOW_CREATE_TRIGGER,
+ SQLCOM_ALTER_DB_UPGRADE,
+ SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES,
+ SQLCOM_SIGNAL, SQLCOM_RESIGNAL,
+ SQLCOM_SHOW_RELAYLOG_EVENTS,
+ SQLCOM_SHOW_USER_STATS, SQLCOM_SHOW_TABLE_STATS, SQLCOM_SHOW_INDEX_STATS,
+ SQLCOM_SHOW_CLIENT_STATS,
+
+ /*
+ When a command is added here, be sure it's also added in mysqld.cc
+ in "struct show_var_st status_vars[]= {" ...
+ */
+ /* This should be the last !!! */
+ SQLCOM_END
+};
+
+/**
+ @class Sql_cmd - Representation of an SQL command.
+
+ This class is an interface between the parser and the runtime.
+ The parser builds the appropriate derived classes of Sql_cmd
+ to represent a SQL statement in the parsed tree.
+ The execute() method in the derived classes of Sql_cmd contain the runtime
+ implementation.
+ Note that this interface is used for SQL statements recently implemented,
+ the code for older statements tend to load the LEX structure with more
+ attributes instead.
+ Implement new statements by sub-classing Sql_cmd, as this improves
+ code modularity (see the 'big switch' in dispatch_command()), and decreases
+ the total size of the LEX structure (therefore saving memory in stored
+ programs).
+ The recommended name of a derived class of Sql_cmd is Sql_cmd_<derived>.
+
+ Notice that the Sql_cmd class should not be confused with the
+ Statement class. Statement is a class that is used to manage an SQL
+ command or a set of SQL commands. When the SQL statement text is
+ analyzed, the parser will create one or more Sql_cmd objects to
+ represent the actual SQL commands.
+*/
+class Sql_cmd : public Sql_alloc
+{
+private:
+ Sql_cmd(const Sql_cmd &); // No copy constructor wanted
+ void operator=(Sql_cmd &); // No assignment operator wanted
+
+public:
+ /**
+ @brief Return the command code for this statement
+ */
+ virtual enum_sql_command sql_command_code() const = 0;
+
+ /**
+ Execute this SQL statement.
+ @param thd the current thread.
+ @retval false on success.
+ @retval true on error
+ */
+ virtual bool execute(THD *thd) = 0;
+
+protected:
+ Sql_cmd()
+ {}
+
+ virtual ~Sql_cmd()
+ {
+ /*
+ Sql_cmd objects are allocated in thd->mem_root.
+ In MySQL, the C++ destructor is never called, the underlying MEM_ROOT is
+ simply destroyed instead.
+ Do not rely on the destructor for any cleanup.
+ */
+ DBUG_ASSERT(FALSE);
+ }
+};
+
+#endif // SQL_CMD_INCLUDED
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index c50cded7470..fd348e0b75f 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -97,6 +97,7 @@ public:
int mysql_open_cursor(THD *thd, select_result *result,
Server_side_cursor **pcursor)
{
+ PSI_statement_locker *parent_locker;
select_result *save_result;
Select_materialize *result_materialize;
LEX *lex= thd->lex;
@@ -115,7 +116,10 @@ int mysql_open_cursor(THD *thd, select_result *result,
&thd->security_ctx->priv_user[0],
(char *) thd->security_ctx->host_or_ip,
2);
+ parent_locker= thd->m_statement_psi;
+ thd->m_statement_psi= NULL;
rc= mysql_execute_command(thd);
+ thd->m_statement_psi= parent_locker;
MYSQL_QUERY_EXEC_DONE(rc);
lex->result= save_result;
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index cf0a8674316..5f18d9861a9 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -970,6 +970,7 @@ int MYSQLlex(void *arg, void *yythd)
lip->lookahead_token= -1;
*yylval= *(lip->lookahead_yylval);
lip->lookahead_yylval= NULL;
+ lip->m_digest_psi= MYSQL_ADD_TOKEN(lip->m_digest_psi, token, yylval);
return token;
}
@@ -987,8 +988,12 @@ int MYSQLlex(void *arg, void *yythd)
token= lex_one_token(arg, yythd);
switch(token) {
case CUBE_SYM:
+ lip->m_digest_psi= MYSQL_ADD_TOKEN(lip->m_digest_psi, WITH_CUBE_SYM,
+ yylval);
return WITH_CUBE_SYM;
case ROLLUP_SYM:
+ lip->m_digest_psi= MYSQL_ADD_TOKEN(lip->m_digest_psi, WITH_ROLLUP_SYM,
+ yylval);
return WITH_ROLLUP_SYM;
default:
/*
@@ -997,6 +1002,7 @@ int MYSQLlex(void *arg, void *yythd)
lip->lookahead_yylval= lip->yylval;
lip->yylval= NULL;
lip->lookahead_token= token;
+ lip->m_digest_psi= MYSQL_ADD_TOKEN(lip->m_digest_psi, WITH, yylval);
return WITH;
}
break;
@@ -1004,6 +1010,7 @@ int MYSQLlex(void *arg, void *yythd)
break;
}
+ lip->m_digest_psi= MYSQL_ADD_TOKEN(lip->m_digest_psi, token, yylval);
return token;
}
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 2f3214646de..3dd978e93b3 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -25,6 +25,7 @@
#include "item.h" /* From item_subselect.h: subselect_union_engine */
#include "thr_lock.h" /* thr_lock_type, TL_UNLOCK */
#include "mem_root_array.h"
+#include "sql_cmd.h"
/* YACC and LEX Definitions */
@@ -123,85 +124,6 @@ struct sys_var_with_base
#endif
#endif
-/*
- When a command is added here, be sure it's also added in mysqld.cc
- in "struct show_var_st status_vars[]= {" ...
-
- If the command returns a result set or is not allowed in stored
- functions or triggers, please also make sure that
- sp_get_flags_for_command (sp_head.cc) returns proper flags for the
- added SQLCOM_.
-*/
-
-enum enum_sql_command {
- SQLCOM_SELECT, SQLCOM_CREATE_TABLE, SQLCOM_CREATE_INDEX, SQLCOM_ALTER_TABLE,
- SQLCOM_UPDATE, SQLCOM_INSERT, SQLCOM_INSERT_SELECT,
- SQLCOM_DELETE, SQLCOM_TRUNCATE, SQLCOM_DROP_TABLE, SQLCOM_DROP_INDEX,
-
- SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
- SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_STATUS,
- SQLCOM_SHOW_ENGINE_LOGS, SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_MUTEX,
- SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
- SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
- SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS,
- SQLCOM_SHOW_TRIGGERS,
-
- SQLCOM_LOAD,SQLCOM_SET_OPTION,SQLCOM_LOCK_TABLES,SQLCOM_UNLOCK_TABLES,
- SQLCOM_GRANT,
- SQLCOM_CHANGE_DB, SQLCOM_CREATE_DB, SQLCOM_DROP_DB, SQLCOM_ALTER_DB,
- SQLCOM_REPAIR, SQLCOM_REPLACE, SQLCOM_REPLACE_SELECT,
- SQLCOM_CREATE_FUNCTION, SQLCOM_DROP_FUNCTION,
- SQLCOM_REVOKE,SQLCOM_OPTIMIZE, SQLCOM_CHECK,
- SQLCOM_ASSIGN_TO_KEYCACHE, SQLCOM_PRELOAD_KEYS,
- SQLCOM_FLUSH, SQLCOM_KILL, SQLCOM_ANALYZE,
- SQLCOM_ROLLBACK, SQLCOM_ROLLBACK_TO_SAVEPOINT,
- SQLCOM_COMMIT, SQLCOM_SAVEPOINT, SQLCOM_RELEASE_SAVEPOINT,
- SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP,
- SQLCOM_BEGIN, SQLCOM_CHANGE_MASTER,
- SQLCOM_RENAME_TABLE,
- SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_PURGE_BEFORE, SQLCOM_SHOW_BINLOGS,
- SQLCOM_SHOW_OPEN_TABLES,
- SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ,
- SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
- SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_DO,
- SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
- SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES,
- SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER,
- SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM,
- SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL,
- SQLCOM_DROP_PROCEDURE, SQLCOM_ALTER_PROCEDURE,SQLCOM_ALTER_FUNCTION,
- SQLCOM_SHOW_CREATE_PROC, SQLCOM_SHOW_CREATE_FUNC,
- SQLCOM_SHOW_STATUS_PROC, SQLCOM_SHOW_STATUS_FUNC,
- SQLCOM_PREPARE, SQLCOM_EXECUTE, SQLCOM_DEALLOCATE_PREPARE,
- SQLCOM_CREATE_VIEW, SQLCOM_DROP_VIEW,
- SQLCOM_CREATE_TRIGGER, SQLCOM_DROP_TRIGGER,
- SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE,
- SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER,
- SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE,
- SQLCOM_ALTER_TABLESPACE,
- SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN,
- SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT,
- SQLCOM_SHOW_PLUGINS,
- SQLCOM_SHOW_CONTRIBUTORS,
- SQLCOM_CREATE_SERVER, SQLCOM_DROP_SERVER, SQLCOM_ALTER_SERVER,
- SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT, SQLCOM_DROP_EVENT,
- SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS,
- SQLCOM_SHOW_CREATE_TRIGGER,
- SQLCOM_ALTER_DB_UPGRADE,
- SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES,
- SQLCOM_SIGNAL, SQLCOM_RESIGNAL,
- SQLCOM_SHOW_RELAYLOG_EVENTS,
- SQLCOM_SHOW_USER_STATS, SQLCOM_SHOW_TABLE_STATS, SQLCOM_SHOW_INDEX_STATS,
- SQLCOM_SHOW_CLIENT_STATS,
-
- /*
- When a command is added here, be sure it's also added in mysqld.cc
- in "struct show_var_st status_vars[]= {" ...
- */
- /* This should be the last !!! */
- SQLCOM_END
-};
-
// describe/explain types
#define DESCRIBE_NORMAL 1
#define DESCRIBE_EXTENDED 2
@@ -285,6 +207,7 @@ struct LEX_MASTER_INFO
DYNAMIC_ARRAY repl_ignore_server_ids;
char *host, *user, *password, *log_file_name;
char *ssl_key, *ssl_cert, *ssl_ca, *ssl_capath, *ssl_cipher;
+ char *ssl_crl, *ssl_crlpath;
char *relay_log_name;
ulonglong pos;
ulong relay_log_pos;
@@ -2270,6 +2193,11 @@ public:
NOTE: this member must be used within MYSQLlex() function only.
*/
CHARSET_INFO *m_underscore_cs;
+
+ /**
+ Current statement digest instrumentation.
+ */
+ PSI_digest_locker* m_digest_psi;
};
/**
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 19a8ba2b533..48ae2f066db 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -865,18 +865,32 @@ bool do_command(THD *thd)
*/
DEBUG_SYNC(thd, "before_do_command_net_read");
- if ((packet_length= my_net_read(net)) == packet_error)
+ thd->m_server_idle= TRUE;
+ packet_length= my_net_read(net);
+ thd->m_server_idle= FALSE;
+
+ if ((packet_length == packet_error))
{
DBUG_PRINT("info",("Got error %d reading command from socket %s",
net->error,
vio_description(net->vio)));
+ /* Instrument this broken statement as "statement/com/error" */
+ thd->m_statement_psi= MYSQL_REFINE_STATEMENT(thd->m_statement_psi,
+ com_statement_info[COM_END].
+ m_key);
+
+
/* Check if we can continue without closing the connection */
/* The error must be set. */
DBUG_ASSERT(thd->is_error());
thd->protocol->end_statement();
+ /* Mark the statement completed. */
+ MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
+ thd->m_statement_psi= NULL;
+
if (net->error != 3)
{
return_value= TRUE; // We have to close it.
@@ -922,6 +936,8 @@ bool do_command(THD *thd)
return_value= dispatch_command(command, thd, packet+1, (uint) (packet_length-1));
out:
+ /* The statement instrumentation must be closed in all cases. */
+ DBUG_ASSERT(thd->m_statement_psi == NULL);
DBUG_RETURN(return_value);
}
#endif /* EMBEDDED_LIBRARY */
@@ -1034,7 +1050,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
{ DBUG_PRINT("crash_dispatch_command_before", ("now"));
DBUG_ABORT(); });
- thd->command=command;
+ /* Performance Schema Interface instrumentation, begin */
+ thd->m_statement_psi= MYSQL_REFINE_STATEMENT(thd->m_statement_psi,
+ com_statement_info[command].
+ m_key);
+ thd->set_command(command);
+
/*
Commands which always take a long time are logged into
the slow log only if opt_log_slow_admin_statements is set.
@@ -1176,6 +1197,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#if defined(ENABLED_PROFILING)
thd->profiling.set_query_source(thd->query(), thd->query_length());
#endif
+ MYSQL_SET_STATEMENT_TEXT(thd->m_statement_psi, thd->query(),
+ thd->query_length());
+
Parser_state parser_state;
if (parser_state.init(thd, thd->query(), thd->query_length()))
break;
@@ -1209,6 +1233,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
length--;
}
+ /* PSI end */
+ MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
+ thd->m_statement_psi= NULL;
+
+ /* DTRACE end */
if (MYSQL_QUERY_DONE_ENABLED())
{
MYSQL_QUERY_DONE(thd->is_error());
@@ -1220,11 +1249,21 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->profiling.set_query_source(beginning_of_next_stmt, length);
#endif
+ /* DTRACE begin */
MYSQL_QUERY_START(beginning_of_next_stmt, thd->thread_id,
(char *) (thd->db ? thd->db : ""),
&thd->security_ctx->priv_user[0],
(char *) thd->security_ctx->host_or_ip);
+ /* PSI begin */
+ thd->m_statement_psi=
+ MYSQL_START_STATEMENT(&thd->m_statement_state,
+ com_statement_info[command]. m_key,
+ thd->db, thd->db_length);
+ THD_STAGE_INFO(thd, stage_init);
+ MYSQL_SET_STATEMENT_TEXT(thd->m_statement_psi, beginning_of_next_stmt,
+ length);
+
thd->set_query_and_id(beginning_of_next_stmt, length,
thd->charset(), next_query_id());
/*
@@ -1571,7 +1610,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd_proc_info(thd, "cleaning up");
thd->reset_query();
- thd->command=COM_SLEEP;
+ thd->set_command(COM_SLEEP);
+
+ /* Performance Schema Interface instrumentation, end */
+ MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
+ thd->m_statement_psi= NULL;
+
dec_thread_running();
thd_proc_info(thd, 0);
thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory
@@ -5836,6 +5880,10 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
if (!err)
{
+ thd->m_statement_psi=
+ MYSQL_REFINE_STATEMENT(thd->m_statement_psi,
+ sql_statement_info[thd->lex->sql_command].
+ m_key);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (mqh_used && thd->user_connect &&
check_mqh(thd, lex->sql_command))
@@ -5884,6 +5932,10 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
}
else
{
+ /* Instrument this broken statement as "statement/sql/error" */
+ thd->m_statement_psi=
+ MYSQL_REFINE_STATEMENT(thd->m_statement_psi,
+ sql_statement_info[SQLCOM_END].m_key);
DBUG_ASSERT(thd->is_error());
DBUG_PRINT("info",("Command aborted. Fatal_error: %d",
thd->is_fatal_error));
@@ -5901,6 +5953,9 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
{
/* Update statistics for getting the query from the cache */
thd->lex->sql_command= SQLCOM_SELECT;
+ thd->m_statement_psi=
+ MYSQL_REFINE_STATEMENT(thd->m_statement_psi,
+ sql_statement_info[SQLCOM_SELECT].m_key);
}
DBUG_VOID_RETURN;
}
@@ -7741,6 +7796,12 @@ bool parse_sql(THD *thd,
thd->m_parser_state= parser_state;
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
+ /* Start Digest */
+ thd->m_parser_state->m_lip.m_digest_psi=
+ MYSQL_DIGEST_START(thd->m_statement_psi);
+#endif
+
/* Parse the query. */
bool mysql_parse_status= MYSQLparse(thd) != 0;
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index ed437c498e6..b579474ee4d 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -3072,6 +3072,7 @@ Execute_sql_statement(LEX_STRING sql_text)
bool
Execute_sql_statement::execute_server_code(THD *thd)
{
+ PSI_statement_locker *parent_locker;
bool error;
if (alloc_query(thd, m_sql_text.str, m_sql_text.length))
@@ -3091,7 +3092,10 @@ Execute_sql_statement::execute_server_code(THD *thd)
thd->lex->set_trg_event_type_for_tables();
+ parent_locker= thd->m_statement_psi;
+ thd->m_statement_psi= NULL;
error= mysql_execute_command(thd);
+ thd->m_statement_psi= parent_locker;
/* report error issued during command execution */
if (error == 0 && thd->spcont == NULL)
@@ -3877,13 +3881,17 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
if (query_cache_send_result_to_client(thd, thd->query(),
thd->query_length()) <= 0)
{
+ PSI_statement_locker *parent_locker;
MYSQL_QUERY_EXEC_START(thd->query(),
thd->thread_id,
(char *) (thd->db ? thd->db : ""),
&thd->security_ctx->priv_user[0],
(char *) thd->security_ctx->host_or_ip,
1);
+ parent_locker= thd->m_statement_psi;
+ thd->m_statement_psi= NULL;
error= mysql_execute_command(thd);
+ thd->m_statement_psi= parent_locker;
MYSQL_QUERY_EXEC_DONE(error);
}
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 4e3629080be..e2263e21e8f 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1103,6 +1103,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token MASTER_SSL_CA_SYM
%token MASTER_SSL_CERT_SYM
%token MASTER_SSL_CIPHER_SYM
+%token MASTER_SSL_CRL_SYM
+%token MASTER_SSL_CRLPATH_SYM
%token MASTER_SSL_KEY_SYM
%token MASTER_SSL_SYM
%token MASTER_SSL_VERIFY_SERVER_CERT_SYM
@@ -1967,6 +1969,14 @@ master_def:
Lex->mi.ssl_verify_server_cert= $3 ?
LEX_MASTER_INFO::LEX_MI_ENABLE : LEX_MASTER_INFO::LEX_MI_DISABLE;
}
+ | MASTER_SSL_CRL_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.ssl_crl= $3.str;
+ }
+ | MASTER_SSL_CRLPATH_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.ssl_crlpath= $3.str;
+ }
| MASTER_HEARTBEAT_PERIOD_SYM EQ NUM_literal
{
@@ -13098,6 +13108,8 @@ keyword_sp:
| MASTER_SSL_CAPATH_SYM {}
| MASTER_SSL_CERT_SYM {}
| MASTER_SSL_CIPHER_SYM {}
+ | MASTER_SSL_CRL_SYM {}
+ | MASTER_SSL_CRLPATH_SYM {}
| MASTER_SSL_KEY_SYM {}
| MAX_CONNECTIONS_PER_HOUR {}
| MAX_QUERIES_PER_HOUR {}
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 97fbe76f149..ac84d820ca6 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -14,7 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-/*
+/**
+ @file
+ Definitions of all server's session or global variables.
+
How to add new variables:
1. copy one of the existing variables, and edit the declaration.
@@ -69,6 +72,85 @@ static Sys_var_mybool Sys_pfs_enabled(
PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_enabled),
CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+static Sys_var_charptr Sys_pfs_instrument(
+ "performance_schema_instrument",
+ "Default startup value for a performance schema instrument.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_pfs_instrument),
+ CMD_LINE(OPT_ARG, OPT_PFS_INSTRUMENT),
+ IN_FS_CHARSET, DEFAULT(""));
+
+static Sys_var_mybool Sys_pfs_consumer_events_stages_current(
+ "performance_schema_consumer_events_stages_current",
+ "Default startup value for the events_stages_current consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_stages_current_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_pfs_consumer_events_stages_history(
+ "performance_schema_consumer_events_stages_history",
+ "Default startup value for the events_stages_history consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_stages_history_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_pfs_consumer_events_stages_history_long(
+ "performance_schema_consumer_events_stages_history_long",
+ "Default startup value for the events_stages_history_long consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_stages_history_long_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_pfs_consumer_events_statements_current(
+ "performance_schema_consumer_events_statements_current",
+ "Default startup value for the events_statements_current consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_statements_current_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+
+static Sys_var_mybool Sys_pfs_consumer_events_statements_history(
+ "performance_schema_consumer_events_statements_history",
+ "Default startup value for the events_statements_history consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_statements_history_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_pfs_consumer_events_statements_history_long(
+ "performance_schema_consumer_events_statements_history_long",
+ "Default startup value for the events_statements_history_long consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_statements_history_long_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_pfs_consumer_events_waits_current(
+ "performance_schema_consumer_events_waits_current",
+ "Default startup value for the events_waits_current consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_waits_current_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_pfs_consumer_events_waits_history(
+ "performance_schema_consumer_events_waits_history",
+ "Default startup value for the events_waits_history consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_waits_history_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_pfs_consumer_events_waits_history_long(
+ "performance_schema_consumer_events_waits_history_long",
+ "Default startup value for the events_waits_history_long consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_waits_history_long_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_pfs_consumer_global_instrumentation(
+ "performance_schema_consumer_global_instrumentation",
+ "Default startup value for the global_instrumentation consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_global_instrumentation_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+
+static Sys_var_mybool Sys_pfs_consumer_thread_instrumentation(
+ "performance_schema_consumer_thread_instrumentation",
+ "Default startup value for the thread_instrumentation consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_thread_instrumentation_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+
+static Sys_var_mybool Sys_pfs_consumer_statement_digest(
+ "performance_schema_consumer_statements_digest",
+ "Default startup value for the statements_digest consumer.",
+ PARSED_EARLY READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_statement_digest_enabled),
+ CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+
static Sys_var_ulong Sys_pfs_events_waits_history_long_size(
"performance_schema_events_waits_history_long_size",
"Number of rows in EVENTS_WAITS_HISTORY_LONG.",
@@ -119,6 +201,22 @@ static Sys_var_ulong Sys_pfs_max_file_instances(
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024),
DEFAULT(PFS_MAX_FILE), BLOCK_SIZE(1));
+static Sys_var_ulong Sys_pfs_max_sockets(
+ "performance_schema_max_socket_instances",
+ "Maximum number of opened instrumented sockets.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_socket_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024),
+ DEFAULT(PFS_MAX_SOCKETS),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_max_socket_classes(
+ "performance_schema_max_socket_classes",
+ "Maximum number of socket instruments.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_socket_class_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 256),
+ DEFAULT(PFS_MAX_SOCKET_CLASS),
+ BLOCK_SIZE(1));
+
static Sys_var_ulong Sys_pfs_max_mutex_classes(
"performance_schema_max_mutex_classes",
"Maximum number of mutex instruments.",
@@ -175,6 +273,111 @@ static Sys_var_ulong Sys_pfs_max_thread_instances(
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024),
DEFAULT(PFS_MAX_THREAD), BLOCK_SIZE(1));
+static Sys_var_ulong Sys_pfs_setup_actors_size(
+ "performance_schema_setup_actors_size",
+ "Maximum number of rows in SETUP_ACTORS.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_setup_actor_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024),
+ DEFAULT(PFS_MAX_SETUP_ACTOR),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_setup_objects_size(
+ "performance_schema_setup_objects_size",
+ "Maximum number of rows in SETUP_OBJECTS.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_setup_object_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024),
+ DEFAULT(PFS_MAX_SETUP_OBJECT),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_accounts_size(
+ "performance_schema_accounts_size",
+ "Maximum number of instrumented user@host accounts.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_account_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024),
+ DEFAULT(PFS_MAX_ACCOUNT),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_hosts_size(
+ "performance_schema_hosts_size",
+ "Maximum number of instrumented hosts.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_host_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024),
+ DEFAULT(PFS_MAX_HOST),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_users_size(
+ "performance_schema_users_size",
+ "Maximum number of instrumented users.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_user_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024),
+ DEFAULT(PFS_MAX_USER),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_max_stage_classes(
+ "performance_schema_max_stage_classes",
+ "Maximum number of stage instruments.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_stage_class_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 256),
+ DEFAULT(PFS_MAX_STAGE_CLASS),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_events_stages_history_long_size(
+ "performance_schema_events_stages_history_long_size",
+ "Number of rows in EVENTS_STAGES_HISTORY_LONG.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_events_stages_history_long_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024),
+ DEFAULT(PFS_STAGES_HISTORY_LONG_SIZE),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_events_stages_history_size(
+ "performance_schema_events_stages_history_size",
+ "Number of rows per thread in EVENTS_STAGES_HISTORY.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_events_stages_history_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024),
+ DEFAULT(PFS_STAGES_HISTORY_SIZE),
+ BLOCK_SIZE(1));
+
+/**
+ Variable performance_schema_max_statement_classes.
+ The default number of statement classes is the sum of:
+ - COM_END for all regular "statement/com/...",
+ - 1 for "statement/com/new_packet", for unknown enum_server_command
+ - 1 for "statement/com/Error", for invalid enum_server_command
+ - SQLCOM_END for all regular "statement/sql/...",
+ - 1 for "statement/sql/error", for invalid enum_sql_command.
+*/
+static Sys_var_ulong Sys_pfs_max_statement_classes(
+ "performance_schema_max_statement_classes",
+ "Maximum number of statement instruments.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_statement_class_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 256),
+ DEFAULT((ulong) SQLCOM_END + (ulong) COM_END + 3),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_events_statements_history_long_size(
+ "performance_schema_events_statements_history_long_size",
+ "Number of rows in EVENTS_STATEMENTS_HISTORY_LONG.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_events_statements_history_long_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024),
+ DEFAULT(PFS_STATEMENTS_HISTORY_LONG_SIZE),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_events_statements_history_size(
+ "performance_schema_events_statements_history_size",
+ "Number of rows per thread in EVENTS_STATEMENTS_HISTORY.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_events_statements_history_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024),
+ DEFAULT(PFS_STATEMENTS_HISTORY_SIZE),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_pfs_digest_size(
+ "performance_schema_digests_size",
+ "Size of the statement digest.",
+ PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_digest_sizing),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 200),
+ DEFAULT(PFS_DIGEST_SIZE),
+ BLOCK_SIZE(1));
+
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
static Sys_var_ulong Sys_auto_increment_increment(
@@ -2225,6 +2428,19 @@ static Sys_var_charptr Sys_ssl_key(
READ_ONLY GLOBAL_VAR(opt_ssl_key), SSL_OPT(OPT_SSL_KEY),
IN_FS_CHARSET, DEFAULT(0));
+static Sys_var_charptr Sys_ssl_crl(
+ "ssl_crl",
+ "CRL file in PEM format (check OpenSSL docs, implies --ssl)",
+ READ_ONLY GLOBAL_VAR(opt_ssl_crl), SSL_OPT(OPT_SSL_CRL),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_charptr Sys_ssl_crlpath(
+ "ssl_crlpath",
+ "CRL directory (check OpenSSL docs, implies --ssl)",
+ READ_ONLY GLOBAL_VAR(opt_ssl_crlpath), SSL_OPT(OPT_SSL_CRLPATH),
+ IN_FS_CHARSET, DEFAULT(0));
+
+
// why ENUM and not BOOL ?
static const char *updatable_views_with_limit_names[]= {"NO", "YES", 0};
static Sys_var_enum Sys_updatable_views_with_limit(
diff --git a/sql/sys_vars.h b/sql/sys_vars.h
index b594ff35571..ff7ac46d96f 100644
--- a/sql/sys_vars.h
+++ b/sql/sys_vars.h
@@ -51,9 +51,11 @@
#define ON_CHECK(X) X
#define ON_UPDATE(X) X
#define READ_ONLY sys_var::READONLY+
+#define NOT_VISIBLE sys_var::INVISIBLE+
// this means that Sys_var_charptr initial value was malloc()ed
#define PREALLOCATED sys_var::ALLOCATED+
#define PARSED_EARLY sys_var::PARSE_EARLY+
+
/*
Sys_var_bit meaning is reversed, like in
@@foreign_key_checks <-> OPTION_NO_FOREIGN_KEY_CHECKS
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc
index f5ea771883d..60c3ad69c65 100644
--- a/sql/threadpool_unix.cc
+++ b/sql/threadpool_unix.cc
@@ -1361,7 +1361,7 @@ static int change_group(connection_t *c,
thread_group_t *new_group)
{
int ret= 0;
- int fd = c->thd->net.vio->sd;
+ int fd= mysql_socket_getfd(c->thd->net.vio->mysql_socket);
DBUG_ASSERT(c->thread_group == old_group);
@@ -1389,7 +1389,7 @@ static int change_group(connection_t *c,
static int start_io(connection_t *connection)
{
- int fd = connection->thd->net.vio->sd;
+ int fd = mysql_socket_getfd(connection->thd->net.vio->mysql_socket);
/*
Usually, connection will stay in the same group for the entire
diff --git a/storage/perfschema/gen_pfs_lex_token b/storage/perfschema/gen_pfs_lex_token
index 0b4116982bb..48816282a67 100755
--- a/storage/perfschema/gen_pfs_lex_token
+++ b/storage/perfschema/gen_pfs_lex_token
Binary files differ
diff --git a/storage/perfschema/pfs_lex_token.h b/storage/perfschema/pfs_lex_token.h
index 6074570f56f..43e8f647f9a 100644
--- a/storage/perfschema/pfs_lex_token.h
+++ b/storage/perfschema/pfs_lex_token.h
@@ -567,340 +567,342 @@ lex_token_string lex_token_array[]=
/* 548 */ { "MASTER_SSL_CA", 13},
/* 549 */ { "MASTER_SSL_CERT", 15},
/* 550 */ { "MASTER_SSL_CIPHER", 17},
-/* 551 */ { "MASTER_SSL_KEY", 14},
-/* 552 */ { "MASTER_SSL", 10},
-/* 553 */ { "MASTER_SSL_VERIFY_SERVER_CERT", 29},
-/* 554 */ { "MASTER", 6},
-/* 555 */ { "MASTER_USER", 11},
-/* 556 */ { "MASTER_HEARTBEAT_PERIOD", 23},
-/* 557 */ { "MATCH", 5},
-/* 558 */ { "MAX_CONNECTIONS_PER_HOUR", 24},
-/* 559 */ { "MAX_QUERIES_PER_HOUR", 20},
-/* 560 */ { "MAX_ROWS", 8},
-/* 561 */ { "MAX_SIZE", 8},
-/* 562 */ { "MAX", 3},
-/* 563 */ { "MAX_UPDATES_PER_HOUR", 20},
-/* 564 */ { "MAX_USER_CONNECTIONS", 20},
-/* 565 */ { "MAXVALUE", 8},
-/* 566 */ { "MEDIUMBLOB", 10},
-/* 567 */ { "MIDDLEINT", 9},
-/* 568 */ { "MEDIUMTEXT", 10},
-/* 569 */ { "MEDIUM", 6},
-/* 570 */ { "MEMORY", 6},
-/* 571 */ { "MERGE", 5},
-/* 572 */ { "MESSAGE_TEXT", 12},
-/* 573 */ { "MICROSECOND", 11},
-/* 574 */ { "MIGRATE", 7},
-/* 575 */ { "MINUTE_MICROSECOND", 18},
-/* 576 */ { "MINUTE_SECOND", 13},
-/* 577 */ { "SQL_TSI_MINUTE", 14},
-/* 578 */ { "MIN_ROWS", 8},
-/* 579 */ { "MIN", 3},
-/* 580 */ { "MODE", 4},
-/* 581 */ { "MODIFIES", 8},
-/* 582 */ { "MODIFY", 6},
-/* 583 */ { "MOD", 3},
-/* 584 */ { "SQL_TSI_MONTH", 13},
-/* 585 */ { "MULTILINESTRING", 15},
-/* 586 */ { "MULTIPOINT", 10},
-/* 587 */ { "MULTIPOLYGON", 12},
-/* 588 */ { "MUTEX", 5},
-/* 589 */ { "MYSQL_ERRNO", 11},
-/* 590 */ { "NAMES", 5},
-/* 591 */ { "NAME", 4},
-/* 592 */ { "NATIONAL", 8},
-/* 593 */ { "NATURAL", 7},
-/* 594 */ { "(nchar)", 7},
-/* 595 */ { "NCHAR", 5},
-/* 596 */ { "NDBCLUSTER", 10},
-/* 597 */ { "!=", 2},
-/* 598 */ { "~", 1},
-/* 599 */ { "NEW", 3},
-/* 600 */ { "NEXT", 4},
-/* 601 */ { "NODEGROUP", 9},
-/* 602 */ { "NONE", 4},
-/* 603 */ { "!", 1},
-/* 604 */ { "NOT", 3},
-/* 605 */ { "NOW", 3},
-/* 606 */ { "NO", 2},
-/* 607 */ { "NO_WAIT", 7},
-/* 608 */ { "NO_WRITE_TO_BINLOG", 18},
-/* 609 */ { "NULL", 4},
-/* 610 */ { "(num)", 5},
-/* 611 */ { "NUMERIC", 7},
-/* 612 */ { "NVARCHAR", 8},
-/* 613 */ { "OFFSET", 6},
-/* 614 */ { "OLD_PASSWORD", 12},
-/* 615 */ { "ON", 2},
-/* 616 */ { "ONE_SHOT", 8},
-/* 617 */ { "ONE", 3},
-/* 618 */ { "ONLINE", 6},
-/* 619 */ { "OPEN", 4},
-/* 620 */ { "OPTIMIZE", 8},
-/* 621 */ { "OPTIONS", 7},
-/* 622 */ { "OPTION", 6},
-/* 623 */ { "OPTIONALLY", 10},
-/* 624 */ { "|", 1},
-/* 625 */ { "ORDER", 5},
-/* 626 */ { "||", 2},
-/* 627 */ { "OR", 2},
-/* 628 */ { "OUTER", 5},
-/* 629 */ { "OUTFILE", 7},
-/* 630 */ { "OUT", 3},
-/* 631 */ { "OWNER", 5},
-/* 632 */ { "PACK_KEYS", 9},
-/* 633 */ { "PAGE", 4},
-/* 634 */ { "PAGE_CHECKSUM", 13},
-/* 635 */ { "?", 1},
-/* 636 */ { "PARSER", 6},
-/* 637 */ { "PARSE_VCOL_EXPR", 15},
-/* 638 */ { "PARTIAL", 7},
-/* 639 */ { "PARTITIONING", 12},
-/* 640 */ { "PARTITIONS", 10},
-/* 641 */ { "PARTITION", 9},
-/* 642 */ { "PASSWORD", 8},
-/* 643 */ { "PERSISTENT", 10},
-/* 644 */ { "PHASE", 5},
-/* 645 */ { "PLUGINS", 7},
-/* 646 */ { "PLUGIN", 6},
-/* 647 */ { "POINT", 5},
-/* 648 */ { "POLYGON", 7},
-/* 649 */ { "PORT", 4},
-/* 650 */ { "POSITION", 8},
-/* 651 */ { "PRECISION", 9},
-/* 652 */ { "PREPARE", 7},
-/* 653 */ { "PRESERVE", 8},
-/* 654 */ { "PREV", 4},
-/* 655 */ { "PRIMARY", 7},
-/* 656 */ { "PRIVILEGES", 10},
-/* 657 */ { "PROCEDURE", 9},
-/* 658 */ { "PROCESS", 7},
-/* 659 */ { "PROCESSLIST", 11},
-/* 660 */ { "PROFILE", 7},
-/* 661 */ { "PROFILES", 8},
-/* 662 */ { "PROXY", 5},
-/* 663 */ { "PURGE", 5},
-/* 664 */ { "SQL_TSI_QUARTER", 15},
-/* 665 */ { "QUERY", 5},
-/* 666 */ { "QUICK", 5},
-/* 667 */ { "RANGE", 5},
-/* 668 */ { "READS", 5},
-/* 669 */ { "READ_ONLY", 9},
-/* 670 */ { "READ", 4},
-/* 671 */ { "READ_WRITE", 10},
-/* 672 */ { "REAL", 4},
-/* 673 */ { "REBUILD", 7},
-/* 674 */ { "RECOVER", 7},
-/* 675 */ { "REDOFILE", 8},
-/* 676 */ { "REDO_BUFFER_SIZE", 16},
-/* 677 */ { "REDUNDANT", 9},
-/* 678 */ { "REFERENCES", 10},
-/* 679 */ { "RLIKE", 5},
-/* 680 */ { "RELAY", 5},
-/* 681 */ { "RELAYLOG", 8},
-/* 682 */ { "RELAY_LOG_FILE", 14},
-/* 683 */ { "RELAY_LOG_POS", 13},
-/* 684 */ { "RELAY_THREAD", 12},
-/* 685 */ { "RELEASE", 7},
-/* 686 */ { "RELOAD", 6},
-/* 687 */ { "REMOVE", 6},
-/* 688 */ { "RENAME", 6},
-/* 689 */ { "REORGANIZE", 10},
-/* 690 */ { "REPAIR", 6},
-/* 691 */ { "REPEATABLE", 10},
-/* 692 */ { "REPEAT", 6},
-/* 693 */ { "REPLACE", 7},
-/* 694 */ { "REPLICATION", 11},
-/* 695 */ { "REQUIRE", 7},
-/* 696 */ { "RESET", 5},
-/* 697 */ { "RESIGNAL", 8},
-/* 698 */ { "USER_RESOURCES", 14},
-/* 699 */ { "RESTORE", 7},
-/* 700 */ { "RESTRICT", 8},
-/* 701 */ { "RESUME", 6},
-/* 702 */ { "RETURNS", 7},
-/* 703 */ { "RETURN", 6},
-/* 704 */ { "REVOKE", 6},
-/* 705 */ { "RIGHT", 5},
-/* 706 */ { "ROLLBACK", 8},
-/* 707 */ { "ROLLUP", 6},
-/* 708 */ { "ROUTINE", 7},
-/* 709 */ { "ROWS", 4},
-/* 710 */ { "ROW_FORMAT", 10},
-/* 711 */ { "ROW", 3},
-/* 712 */ { "RTREE", 5},
-/* 713 */ { "SAVEPOINT", 9},
-/* 714 */ { "SCHEDULE", 8},
-/* 715 */ { "SCHEMA_NAME", 11},
-/* 716 */ { "SECOND_MICROSECOND", 18},
-/* 717 */ { "SQL_TSI_SECOND", 14},
-/* 718 */ { "SECURITY", 8},
-/* 719 */ { "SELECT", 6},
-/* 720 */ { "SENSITIVE", 9},
-/* 721 */ { "SEPARATOR", 9},
-/* 722 */ { "SERIALIZABLE", 12},
-/* 723 */ { "SERIAL", 6},
-/* 724 */ { "SESSION", 7},
-/* 725 */ { "SERVER", 6},
-/* 726 */ { "SERVER_OPTIONS", 14},
-/* 727 */ { "SET", 3},
-/* 728 */ { ":=", 2},
-/* 729 */ { "SHARE", 5},
-/* 730 */ { "<<", 2},
-/* 731 */ { ">>", 2},
-/* 732 */ { "SHOW", 4},
-/* 733 */ { "SHUTDOWN", 8},
-/* 734 */ { "SIGNAL", 6},
-/* 735 */ { "SIGNED", 6},
-/* 736 */ { "SIMPLE", 6},
-/* 737 */ { "SLAVE", 5},
-/* 738 */ { "SLOW", 4},
-/* 739 */ { "SMALLINT", 8},
-/* 740 */ { "SNAPSHOT", 8},
-/* 741 */ { "SOCKET", 6},
-/* 742 */ { "SOFT", 4},
-/* 743 */ { "SONAME", 6},
-/* 744 */ { "SOUNDS", 6},
-/* 745 */ { "SOURCE", 6},
-/* 746 */ { "SPATIAL", 7},
-/* 747 */ { "SPECIFIC", 8},
-/* 748 */ { "SQLEXCEPTION", 12},
-/* 749 */ { "SQLSTATE", 8},
-/* 750 */ { "SQLWARNING", 10},
-/* 751 */ { "SQL_BIG_RESULT", 14},
-/* 752 */ { "SQL_BUFFER_RESULT", 17},
-/* 753 */ { "SQL_CACHE", 9},
-/* 754 */ { "SQL_CALC_FOUND_ROWS", 19},
-/* 755 */ { "SQL_NO_CACHE", 12},
-/* 756 */ { "SQL_SMALL_RESULT", 16},
-/* 757 */ { "SQL", 3},
-/* 758 */ { "SQL_THREAD", 10},
-/* 759 */ { "SSL", 3},
-/* 760 */ { "STARTING", 8},
-/* 761 */ { "STARTS", 6},
-/* 762 */ { "START", 5},
-/* 763 */ { "STATUS", 6},
-/* 764 */ { "STDDEV_SAMP", 11},
-/* 765 */ { "STDDEV_POP", 10},
-/* 766 */ { "STOP", 4},
-/* 767 */ { "STORAGE", 7},
-/* 768 */ { "STRAIGHT_JOIN", 13},
-/* 769 */ { "STRING", 6},
-/* 770 */ { "SUBCLASS_ORIGIN", 15},
-/* 771 */ { "SUBDATE", 7},
-/* 772 */ { "SUBJECT", 7},
-/* 773 */ { "SUBPARTITIONS", 13},
-/* 774 */ { "SUBPARTITION", 12},
-/* 775 */ { "SUBSTRING", 9},
-/* 776 */ { "SUM", 3},
-/* 777 */ { "SUPER", 5},
-/* 778 */ { "SUSPEND", 7},
-/* 779 */ { "SWAPS", 5},
-/* 780 */ { "SWITCHES", 8},
-/* 781 */ { "SYSDATE", 7},
-/* 782 */ { "TABLES", 6},
-/* 783 */ { "TABLESPACE", 10},
-/* 784 */ { "TABLE_REF_PRIORITY", 18},
-/* 785 */ { "TABLE_STATISTICS", 16},
-/* 786 */ { "TABLE", 5},
-/* 787 */ { "TABLE_CHECKSUM", 14},
-/* 788 */ { "TABLE_NAME", 10},
-/* 789 */ { "TEMPORARY", 9},
-/* 790 */ { "TEMPTABLE", 9},
-/* 791 */ { "TERMINATED", 10},
-/* 792 */ { "(text)", 6},
-/* 793 */ { "TEXT", 4},
-/* 794 */ { "THAN", 4},
-/* 795 */ { "THEN", 4},
-/* 796 */ { "TIMESTAMP", 9},
-/* 797 */ { "TIMESTAMPADD", 12},
-/* 798 */ { "TIMESTAMPDIFF", 13},
-/* 799 */ { "TIME", 4},
-/* 800 */ { "TINYBLOB", 8},
-/* 801 */ { "TINYINT", 7},
-/* 802 */ { "TINYTEXT", 8},
-/* 803 */ { "TO", 2},
-/* 804 */ { "TRAILING", 8},
-/* 805 */ { "TRANSACTION", 11},
-/* 806 */ { "TRANSACTIONAL", 13},
-/* 807 */ { "TRIGGERS", 8},
-/* 808 */ { "TRIGGER", 7},
-/* 809 */ { "TRIM", 4},
-/* 810 */ { "TRUE", 4},
-/* 811 */ { "TRUNCATE", 8},
-/* 812 */ { "TYPES", 5},
-/* 813 */ { "TYPE", 4},
-/* 814 */ { "UDF_RETURNS", 11},
-/* 815 */ { "(ulonglong)", 11},
-/* 816 */ { "UNCOMMITTED", 11},
-/* 817 */ { "UNDEFINED", 9},
-/* 818 */ { "(_charset)", 10},
-/* 819 */ { "UNDOFILE", 8},
-/* 820 */ { "UNDO_BUFFER_SIZE", 16},
-/* 821 */ { "UNDO", 4},
-/* 822 */ { "UNICODE", 7},
-/* 823 */ { "UNINSTALL", 9},
-/* 824 */ { "UNION", 5},
-/* 825 */ { "UNIQUE", 6},
-/* 826 */ { "UNKNOWN", 7},
-/* 827 */ { "UNLOCK", 6},
-/* 828 */ { "UNSIGNED", 8},
-/* 829 */ { "UNTIL", 5},
-/* 830 */ { "UPDATE", 6},
-/* 831 */ { "UPGRADE", 7},
-/* 832 */ { "USAGE", 5},
-/* 833 */ { "SYSTEM_USER", 11},
-/* 834 */ { "USER_STATISTICS", 15},
-/* 835 */ { "USE_FRM", 7},
-/* 836 */ { "USE", 3},
-/* 837 */ { "USING", 5},
-/* 838 */ { "UTC_DATE", 8},
-/* 839 */ { "UTC_TIMESTAMP", 13},
-/* 840 */ { "UTC_TIME", 8},
-/* 841 */ { "VALUES", 6},
-/* 842 */ { "VALUE", 5},
-/* 843 */ { "VARBINARY", 9},
-/* 844 */ { "VARCHARACTER", 12},
-/* 845 */ { "VARIABLES", 9},
-/* 846 */ { "VAR_POP", 7},
-/* 847 */ { "VARYING", 7},
-/* 848 */ { "VAR_SAMP", 8},
-/* 849 */ { "VIA", 3},
-/* 850 */ { "VIEW", 4},
-/* 851 */ { "VIRTUAL", 7},
-/* 852 */ { "WAIT", 4},
-/* 853 */ { "WARNINGS", 8},
-/* 854 */ { "WEEK", 4},
-/* 855 */ { "WHEN", 4},
-/* 856 */ { "WHERE", 5},
-/* 857 */ { "WHILE", 5},
-/* 858 */ { "WITH", 4},
-/* 859 */ { "WITH CUBE", 9},
-/* 860 */ { "WITH ROLLUP", 11},
-/* 861 */ { "WORK", 4},
-/* 862 */ { "WRAPPER", 7},
-/* 863 */ { "WRITE", 5},
-/* 864 */ { "X509", 4},
-/* 865 */ { "XA", 2},
-/* 866 */ { "XML", 3},
-/* 867 */ { "XOR", 3},
-/* 868 */ { "YEAR_MONTH", 10},
-/* 869 */ { "YEAR", 4},
-/* 870 */ { "ZEROFILL", 8},
-/* 871 */ { "?", 1},
-/* 872 */ { "?, ...", 6},
-/* 873 */ { "(?)", 3},
-/* 874 */ { "(?) /* , ... */", 15},
-/* 875 */ { "(...)", 5},
-/* 876 */ { "(...) /* , ... */", 17},
-/* 877 */ { "UNUSED", 6},
+/* 551 */ { "MASTER_SSL_CRL", 14},
+/* 552 */ { "MASTER_SSL_CRLPATH", 18},
+/* 553 */ { "MASTER_SSL_KEY", 14},
+/* 554 */ { "MASTER_SSL", 10},
+/* 555 */ { "MASTER_SSL_VERIFY_SERVER_CERT", 29},
+/* 556 */ { "MASTER", 6},
+/* 557 */ { "MASTER_USER", 11},
+/* 558 */ { "MASTER_HEARTBEAT_PERIOD", 23},
+/* 559 */ { "MATCH", 5},
+/* 560 */ { "MAX_CONNECTIONS_PER_HOUR", 24},
+/* 561 */ { "MAX_QUERIES_PER_HOUR", 20},
+/* 562 */ { "MAX_ROWS", 8},
+/* 563 */ { "MAX_SIZE", 8},
+/* 564 */ { "MAX", 3},
+/* 565 */ { "MAX_UPDATES_PER_HOUR", 20},
+/* 566 */ { "MAX_USER_CONNECTIONS", 20},
+/* 567 */ { "MAXVALUE", 8},
+/* 568 */ { "MEDIUMBLOB", 10},
+/* 569 */ { "MIDDLEINT", 9},
+/* 570 */ { "MEDIUMTEXT", 10},
+/* 571 */ { "MEDIUM", 6},
+/* 572 */ { "MEMORY", 6},
+/* 573 */ { "MERGE", 5},
+/* 574 */ { "MESSAGE_TEXT", 12},
+/* 575 */ { "MICROSECOND", 11},
+/* 576 */ { "MIGRATE", 7},
+/* 577 */ { "MINUTE_MICROSECOND", 18},
+/* 578 */ { "MINUTE_SECOND", 13},
+/* 579 */ { "SQL_TSI_MINUTE", 14},
+/* 580 */ { "MIN_ROWS", 8},
+/* 581 */ { "MIN", 3},
+/* 582 */ { "MODE", 4},
+/* 583 */ { "MODIFIES", 8},
+/* 584 */ { "MODIFY", 6},
+/* 585 */ { "MOD", 3},
+/* 586 */ { "SQL_TSI_MONTH", 13},
+/* 587 */ { "MULTILINESTRING", 15},
+/* 588 */ { "MULTIPOINT", 10},
+/* 589 */ { "MULTIPOLYGON", 12},
+/* 590 */ { "MUTEX", 5},
+/* 591 */ { "MYSQL_ERRNO", 11},
+/* 592 */ { "NAMES", 5},
+/* 593 */ { "NAME", 4},
+/* 594 */ { "NATIONAL", 8},
+/* 595 */ { "NATURAL", 7},
+/* 596 */ { "(nchar)", 7},
+/* 597 */ { "NCHAR", 5},
+/* 598 */ { "NDBCLUSTER", 10},
+/* 599 */ { "!=", 2},
+/* 600 */ { "~", 1},
+/* 601 */ { "NEW", 3},
+/* 602 */ { "NEXT", 4},
+/* 603 */ { "NODEGROUP", 9},
+/* 604 */ { "NONE", 4},
+/* 605 */ { "!", 1},
+/* 606 */ { "NOT", 3},
+/* 607 */ { "NOW", 3},
+/* 608 */ { "NO", 2},
+/* 609 */ { "NO_WAIT", 7},
+/* 610 */ { "NO_WRITE_TO_BINLOG", 18},
+/* 611 */ { "NULL", 4},
+/* 612 */ { "(num)", 5},
+/* 613 */ { "NUMERIC", 7},
+/* 614 */ { "NVARCHAR", 8},
+/* 615 */ { "OFFSET", 6},
+/* 616 */ { "OLD_PASSWORD", 12},
+/* 617 */ { "ON", 2},
+/* 618 */ { "ONE_SHOT", 8},
+/* 619 */ { "ONE", 3},
+/* 620 */ { "ONLINE", 6},
+/* 621 */ { "OPEN", 4},
+/* 622 */ { "OPTIMIZE", 8},
+/* 623 */ { "OPTIONS", 7},
+/* 624 */ { "OPTION", 6},
+/* 625 */ { "OPTIONALLY", 10},
+/* 626 */ { "|", 1},
+/* 627 */ { "ORDER", 5},
+/* 628 */ { "||", 2},
+/* 629 */ { "OR", 2},
+/* 630 */ { "OUTER", 5},
+/* 631 */ { "OUTFILE", 7},
+/* 632 */ { "OUT", 3},
+/* 633 */ { "OWNER", 5},
+/* 634 */ { "PACK_KEYS", 9},
+/* 635 */ { "PAGE", 4},
+/* 636 */ { "PAGE_CHECKSUM", 13},
+/* 637 */ { "?", 1},
+/* 638 */ { "PARSER", 6},
+/* 639 */ { "PARSE_VCOL_EXPR", 15},
+/* 640 */ { "PARTIAL", 7},
+/* 641 */ { "PARTITIONING", 12},
+/* 642 */ { "PARTITIONS", 10},
+/* 643 */ { "PARTITION", 9},
+/* 644 */ { "PASSWORD", 8},
+/* 645 */ { "PERSISTENT", 10},
+/* 646 */ { "PHASE", 5},
+/* 647 */ { "PLUGINS", 7},
+/* 648 */ { "PLUGIN", 6},
+/* 649 */ { "POINT", 5},
+/* 650 */ { "POLYGON", 7},
+/* 651 */ { "PORT", 4},
+/* 652 */ { "POSITION", 8},
+/* 653 */ { "PRECISION", 9},
+/* 654 */ { "PREPARE", 7},
+/* 655 */ { "PRESERVE", 8},
+/* 656 */ { "PREV", 4},
+/* 657 */ { "PRIMARY", 7},
+/* 658 */ { "PRIVILEGES", 10},
+/* 659 */ { "PROCEDURE", 9},
+/* 660 */ { "PROCESS", 7},
+/* 661 */ { "PROCESSLIST", 11},
+/* 662 */ { "PROFILE", 7},
+/* 663 */ { "PROFILES", 8},
+/* 664 */ { "PROXY", 5},
+/* 665 */ { "PURGE", 5},
+/* 666 */ { "SQL_TSI_QUARTER", 15},
+/* 667 */ { "QUERY", 5},
+/* 668 */ { "QUICK", 5},
+/* 669 */ { "RANGE", 5},
+/* 670 */ { "READS", 5},
+/* 671 */ { "READ_ONLY", 9},
+/* 672 */ { "READ", 4},
+/* 673 */ { "READ_WRITE", 10},
+/* 674 */ { "REAL", 4},
+/* 675 */ { "REBUILD", 7},
+/* 676 */ { "RECOVER", 7},
+/* 677 */ { "REDOFILE", 8},
+/* 678 */ { "REDO_BUFFER_SIZE", 16},
+/* 679 */ { "REDUNDANT", 9},
+/* 680 */ { "REFERENCES", 10},
+/* 681 */ { "RLIKE", 5},
+/* 682 */ { "RELAY", 5},
+/* 683 */ { "RELAYLOG", 8},
+/* 684 */ { "RELAY_LOG_FILE", 14},
+/* 685 */ { "RELAY_LOG_POS", 13},
+/* 686 */ { "RELAY_THREAD", 12},
+/* 687 */ { "RELEASE", 7},
+/* 688 */ { "RELOAD", 6},
+/* 689 */ { "REMOVE", 6},
+/* 690 */ { "RENAME", 6},
+/* 691 */ { "REORGANIZE", 10},
+/* 692 */ { "REPAIR", 6},
+/* 693 */ { "REPEATABLE", 10},
+/* 694 */ { "REPEAT", 6},
+/* 695 */ { "REPLACE", 7},
+/* 696 */ { "REPLICATION", 11},
+/* 697 */ { "REQUIRE", 7},
+/* 698 */ { "RESET", 5},
+/* 699 */ { "RESIGNAL", 8},
+/* 700 */ { "USER_RESOURCES", 14},
+/* 701 */ { "RESTORE", 7},
+/* 702 */ { "RESTRICT", 8},
+/* 703 */ { "RESUME", 6},
+/* 704 */ { "RETURNS", 7},
+/* 705 */ { "RETURN", 6},
+/* 706 */ { "REVOKE", 6},
+/* 707 */ { "RIGHT", 5},
+/* 708 */ { "ROLLBACK", 8},
+/* 709 */ { "ROLLUP", 6},
+/* 710 */ { "ROUTINE", 7},
+/* 711 */ { "ROWS", 4},
+/* 712 */ { "ROW_FORMAT", 10},
+/* 713 */ { "ROW", 3},
+/* 714 */ { "RTREE", 5},
+/* 715 */ { "SAVEPOINT", 9},
+/* 716 */ { "SCHEDULE", 8},
+/* 717 */ { "SCHEMA_NAME", 11},
+/* 718 */ { "SECOND_MICROSECOND", 18},
+/* 719 */ { "SQL_TSI_SECOND", 14},
+/* 720 */ { "SECURITY", 8},
+/* 721 */ { "SELECT", 6},
+/* 722 */ { "SENSITIVE", 9},
+/* 723 */ { "SEPARATOR", 9},
+/* 724 */ { "SERIALIZABLE", 12},
+/* 725 */ { "SERIAL", 6},
+/* 726 */ { "SESSION", 7},
+/* 727 */ { "SERVER", 6},
+/* 728 */ { "SERVER_OPTIONS", 14},
+/* 729 */ { "SET", 3},
+/* 730 */ { ":=", 2},
+/* 731 */ { "SHARE", 5},
+/* 732 */ { "<<", 2},
+/* 733 */ { ">>", 2},
+/* 734 */ { "SHOW", 4},
+/* 735 */ { "SHUTDOWN", 8},
+/* 736 */ { "SIGNAL", 6},
+/* 737 */ { "SIGNED", 6},
+/* 738 */ { "SIMPLE", 6},
+/* 739 */ { "SLAVE", 5},
+/* 740 */ { "SLOW", 4},
+/* 741 */ { "SMALLINT", 8},
+/* 742 */ { "SNAPSHOT", 8},
+/* 743 */ { "SOCKET", 6},
+/* 744 */ { "SOFT", 4},
+/* 745 */ { "SONAME", 6},
+/* 746 */ { "SOUNDS", 6},
+/* 747 */ { "SOURCE", 6},
+/* 748 */ { "SPATIAL", 7},
+/* 749 */ { "SPECIFIC", 8},
+/* 750 */ { "SQLEXCEPTION", 12},
+/* 751 */ { "SQLSTATE", 8},
+/* 752 */ { "SQLWARNING", 10},
+/* 753 */ { "SQL_BIG_RESULT", 14},
+/* 754 */ { "SQL_BUFFER_RESULT", 17},
+/* 755 */ { "SQL_CACHE", 9},
+/* 756 */ { "SQL_CALC_FOUND_ROWS", 19},
+/* 757 */ { "SQL_NO_CACHE", 12},
+/* 758 */ { "SQL_SMALL_RESULT", 16},
+/* 759 */ { "SQL", 3},
+/* 760 */ { "SQL_THREAD", 10},
+/* 761 */ { "SSL", 3},
+/* 762 */ { "STARTING", 8},
+/* 763 */ { "STARTS", 6},
+/* 764 */ { "START", 5},
+/* 765 */ { "STATUS", 6},
+/* 766 */ { "STDDEV_SAMP", 11},
+/* 767 */ { "STDDEV_POP", 10},
+/* 768 */ { "STOP", 4},
+/* 769 */ { "STORAGE", 7},
+/* 770 */ { "STRAIGHT_JOIN", 13},
+/* 771 */ { "STRING", 6},
+/* 772 */ { "SUBCLASS_ORIGIN", 15},
+/* 773 */ { "SUBDATE", 7},
+/* 774 */ { "SUBJECT", 7},
+/* 775 */ { "SUBPARTITIONS", 13},
+/* 776 */ { "SUBPARTITION", 12},
+/* 777 */ { "SUBSTRING", 9},
+/* 778 */ { "SUM", 3},
+/* 779 */ { "SUPER", 5},
+/* 780 */ { "SUSPEND", 7},
+/* 781 */ { "SWAPS", 5},
+/* 782 */ { "SWITCHES", 8},
+/* 783 */ { "SYSDATE", 7},
+/* 784 */ { "TABLES", 6},
+/* 785 */ { "TABLESPACE", 10},
+/* 786 */ { "TABLE_REF_PRIORITY", 18},
+/* 787 */ { "TABLE_STATISTICS", 16},
+/* 788 */ { "TABLE", 5},
+/* 789 */ { "TABLE_CHECKSUM", 14},
+/* 790 */ { "TABLE_NAME", 10},
+/* 791 */ { "TEMPORARY", 9},
+/* 792 */ { "TEMPTABLE", 9},
+/* 793 */ { "TERMINATED", 10},
+/* 794 */ { "(text)", 6},
+/* 795 */ { "TEXT", 4},
+/* 796 */ { "THAN", 4},
+/* 797 */ { "THEN", 4},
+/* 798 */ { "TIMESTAMP", 9},
+/* 799 */ { "TIMESTAMPADD", 12},
+/* 800 */ { "TIMESTAMPDIFF", 13},
+/* 801 */ { "TIME", 4},
+/* 802 */ { "TINYBLOB", 8},
+/* 803 */ { "TINYINT", 7},
+/* 804 */ { "TINYTEXT", 8},
+/* 805 */ { "TO", 2},
+/* 806 */ { "TRAILING", 8},
+/* 807 */ { "TRANSACTION", 11},
+/* 808 */ { "TRANSACTIONAL", 13},
+/* 809 */ { "TRIGGERS", 8},
+/* 810 */ { "TRIGGER", 7},
+/* 811 */ { "TRIM", 4},
+/* 812 */ { "TRUE", 4},
+/* 813 */ { "TRUNCATE", 8},
+/* 814 */ { "TYPES", 5},
+/* 815 */ { "TYPE", 4},
+/* 816 */ { "UDF_RETURNS", 11},
+/* 817 */ { "(ulonglong)", 11},
+/* 818 */ { "UNCOMMITTED", 11},
+/* 819 */ { "UNDEFINED", 9},
+/* 820 */ { "(_charset)", 10},
+/* 821 */ { "UNDOFILE", 8},
+/* 822 */ { "UNDO_BUFFER_SIZE", 16},
+/* 823 */ { "UNDO", 4},
+/* 824 */ { "UNICODE", 7},
+/* 825 */ { "UNINSTALL", 9},
+/* 826 */ { "UNION", 5},
+/* 827 */ { "UNIQUE", 6},
+/* 828 */ { "UNKNOWN", 7},
+/* 829 */ { "UNLOCK", 6},
+/* 830 */ { "UNSIGNED", 8},
+/* 831 */ { "UNTIL", 5},
+/* 832 */ { "UPDATE", 6},
+/* 833 */ { "UPGRADE", 7},
+/* 834 */ { "USAGE", 5},
+/* 835 */ { "SYSTEM_USER", 11},
+/* 836 */ { "USER_STATISTICS", 15},
+/* 837 */ { "USE_FRM", 7},
+/* 838 */ { "USE", 3},
+/* 839 */ { "USING", 5},
+/* 840 */ { "UTC_DATE", 8},
+/* 841 */ { "UTC_TIMESTAMP", 13},
+/* 842 */ { "UTC_TIME", 8},
+/* 843 */ { "VALUES", 6},
+/* 844 */ { "VALUE", 5},
+/* 845 */ { "VARBINARY", 9},
+/* 846 */ { "VARCHARACTER", 12},
+/* 847 */ { "VARIABLES", 9},
+/* 848 */ { "VAR_POP", 7},
+/* 849 */ { "VARYING", 7},
+/* 850 */ { "VAR_SAMP", 8},
+/* 851 */ { "VIA", 3},
+/* 852 */ { "VIEW", 4},
+/* 853 */ { "VIRTUAL", 7},
+/* 854 */ { "WAIT", 4},
+/* 855 */ { "WARNINGS", 8},
+/* 856 */ { "WEEK", 4},
+/* 857 */ { "WHEN", 4},
+/* 858 */ { "WHERE", 5},
+/* 859 */ { "WHILE", 5},
+/* 860 */ { "WITH", 4},
+/* 861 */ { "WITH CUBE", 9},
+/* 862 */ { "WITH ROLLUP", 11},
+/* 863 */ { "WORK", 4},
+/* 864 */ { "WRAPPER", 7},
+/* 865 */ { "WRITE", 5},
+/* 866 */ { "X509", 4},
+/* 867 */ { "XA", 2},
+/* 868 */ { "XML", 3},
+/* 869 */ { "XOR", 3},
+/* 870 */ { "YEAR_MONTH", 10},
+/* 871 */ { "YEAR", 4},
+/* 872 */ { "ZEROFILL", 8},
+/* 873 */ { "?", 1},
+/* 874 */ { "?, ...", 6},
+/* 875 */ { "(?)", 3},
+/* 876 */ { "(?) /* , ... */", 15},
+/* 877 */ { "(...)", 5},
+/* 878 */ { "(...) /* , ... */", 17},
+/* 879 */ { "UNUSED", 6},
/* DUMMY */ { "", 0}
};
/* PFS specific tokens. */
-#define TOK_PFS_GENERIC_VALUE 871
-#define TOK_PFS_GENERIC_VALUE_LIST 872
-#define TOK_PFS_ROW_SINGLE_VALUE 873
-#define TOK_PFS_ROW_SINGLE_VALUE_LIST 874
-#define TOK_PFS_ROW_MULTIPLE_VALUE 875
-#define TOK_PFS_ROW_MULTIPLE_VALUE_LIST 876
-#define TOK_PFS_UNUSED 877
+#define TOK_PFS_GENERIC_VALUE 873
+#define TOK_PFS_GENERIC_VALUE_LIST 874
+#define TOK_PFS_ROW_SINGLE_VALUE 875
+#define TOK_PFS_ROW_SINGLE_VALUE_LIST 876
+#define TOK_PFS_ROW_MULTIPLE_VALUE 877
+#define TOK_PFS_ROW_MULTIPLE_VALUE_LIST 878
+#define TOK_PFS_UNUSED 879
diff --git a/vio/CMakeLists.txt b/vio/CMakeLists.txt
index e61281a43d8..43171179e66 100644
--- a/vio/CMakeLists.txt
+++ b/vio/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,6 +17,6 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${SSL_INCLUDE_DIRS})
ADD_DEFINITIONS(${SSL_DEFINES})
-SET(VIO_SOURCES vio.c viosocket.c viossl.c viosslfactories.c)
+SET(VIO_SOURCES vio.c viosocket.c viossl.c viopipe.c vioshm.c viosslfactories.c)
ADD_CONVENIENCE_LIBRARY(vio ${VIO_SOURCES})
TARGET_LINK_LIBRARIES(vio ${LIBSOCKET})
diff --git a/vio/vio.c b/vio/vio.c
index aed99e72d54..e2a3b9dcf50 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -23,24 +23,26 @@
#include "vio_priv.h"
-#if defined(__WIN__) || defined(HAVE_SMEM)
+#ifdef _WIN32
/**
- Stub poll_read method that defaults to indicate that there
- is data to read.
+ Stub io_wait method that defaults to indicate that
+ requested I/O event is ready.
Used for named pipe and shared memory VIO types.
@param vio Unused.
+ @param event Unused.
@param timeout Unused.
- @retval FALSE There is data to read.
+ @retval 1 The requested I/O event has occurred.
*/
-static my_bool no_poll_read(Vio *vio __attribute__((unused)),
- uint timeout __attribute__((unused)))
+static int no_io_wait(Vio *vio __attribute__((unused)),
+ enum enum_vio_io_event event __attribute__((unused)),
+ int timeout __attribute__((unused)))
{
- return FALSE;
+ return 1;
}
#endif
@@ -73,8 +75,8 @@ int vio_pipe_shutdown(Vio *vio, int how)
* Helper to fill most of the Vio* with defaults.
*/
-static void vio_init(Vio* vio, enum enum_vio_type type,
- my_socket sd, HANDLE hPipe, uint flags)
+static void vio_init(Vio *vio, enum enum_vio_type type,
+ my_socket sd, uint flags)
{
DBUG_ENTER("vio_init");
DBUG_PRINT("enter", ("type: %d sd: %d flags: %d", type, sd, flags));
@@ -82,11 +84,12 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
#ifndef HAVE_VIO_READ_BUFF
flags&= ~VIO_BUFFERED_READ;
#endif
- bzero((char*) vio, sizeof(*vio));
- vio->type = type;
- vio->sd = sd;
- vio->hPipe = hPipe;
+ memset(vio, 0, sizeof(*vio));
+ vio->type= type;
+ vio->mysql_socket= MYSQL_INVALID_SOCKET;
+ mysql_socket_setfd(&vio->mysql_socket, sd);
vio->localhost= flags & VIO_LOCALHOST;
+ vio->read_timeout= vio->write_timeout= -1;
if ((flags & VIO_BUFFERED_READ) &&
!(vio->read_buffer= (char*)my_malloc(VIO_READ_BUFFER_SIZE, MYF(MY_WME))))
flags&= ~VIO_BUFFERED_READ;
@@ -100,26 +103,17 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->fastsend =vio_fastsend;
vio->viokeepalive =vio_keepalive;
vio->should_retry =vio_should_retry;
- vio->was_interrupted=vio_was_interrupted;
+ vio->was_timeout =vio_was_timeout;
vio->vioclose =vio_close_pipe;
vio->peer_addr =vio_peer_addr;
- vio->vioblocking =vio_blocking;
- vio->is_blocking =vio_is_blocking;
-
- vio->poll_read =no_poll_read;
+ vio->io_wait =no_io_wait;
vio->is_connected =vio_is_connected_pipe;
vio->has_data =has_no_data;
vio->shutdown =vio_pipe_shutdown;
-
- vio->timeout=vio_win32_timeout;
- /* Set default timeout */
- vio->read_timeout_ms= INFINITE;
- vio->write_timeout_ms= INFINITE;
- vio->pipe_overlapped.hEvent= CreateEvent(NULL, TRUE, FALSE, NULL);
DBUG_VOID_RETURN;
}
#endif
-#ifdef HAVE_SMEM
+#ifdef HAVE_SMEM
if (type == VIO_TYPE_SHARED_MEMORY)
{
vio->viodelete =vio_delete;
@@ -129,26 +123,17 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->fastsend =vio_fastsend;
vio->viokeepalive =vio_keepalive;
vio->should_retry =vio_should_retry;
- vio->was_interrupted=vio_was_interrupted;
+ vio->was_timeout =vio_was_timeout;
vio->vioclose =vio_close_shared_memory;
vio->peer_addr =vio_peer_addr;
- vio->vioblocking =vio_blocking;
- vio->is_blocking =vio_is_blocking;
-
- vio->poll_read =no_poll_read;
+ vio->io_wait =no_io_wait;
vio->is_connected =vio_is_connected_shared_memory;
vio->has_data =vio_shared_memory_has_data;
vio->shutdown =vio_shared_memory_shutdown;
-
- /* Currently, shared memory is on Windows only, hence the below is ok*/
- vio->timeout= vio_win32_timeout;
- /* Set default timeout */
- vio->read_timeout_ms= INFINITE;
- vio->write_timeout_ms= INFINITE;
DBUG_VOID_RETURN;
}
-#endif
-#ifdef HAVE_OPENSSL
+#endif
+#ifdef HAVE_OPENSSL
if (type == VIO_TYPE_SSL)
{
vio->viodelete =vio_ssl_delete;
@@ -158,16 +143,14 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->fastsend =vio_fastsend;
vio->viokeepalive =vio_keepalive;
vio->should_retry =vio_should_retry;
- vio->was_interrupted=vio_was_interrupted;
+ vio->was_timeout =vio_was_timeout;
vio->vioclose =vio_ssl_close;
vio->peer_addr =vio_peer_addr;
- vio->vioblocking =vio_ssl_blocking;
- vio->is_blocking =vio_is_blocking;
- vio->timeout =vio_timeout;
- vio->poll_read =vio_poll_read;
+ vio->io_wait =vio_io_wait;
vio->is_connected =vio_is_connected;
vio->has_data =vio_ssl_has_data;
vio->shutdown =vio_socket_shutdown;
+ vio->timeout =vio_socket_timeout;
DBUG_VOID_RETURN;
}
#endif /* HAVE_OPENSSL */
@@ -178,77 +161,107 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->fastsend =vio_fastsend;
vio->viokeepalive =vio_keepalive;
vio->should_retry =vio_should_retry;
- vio->was_interrupted =vio_was_interrupted;
+ vio->was_timeout =vio_was_timeout;
vio->vioclose =vio_close;
vio->peer_addr =vio_peer_addr;
- vio->vioblocking =vio_blocking;
- vio->is_blocking =vio_is_blocking;
- vio->timeout =vio_timeout;
- vio->poll_read =vio_poll_read;
+ vio->io_wait =vio_io_wait;
vio->is_connected =vio_is_connected;
vio->shutdown =vio_socket_shutdown;
- vio->has_data= (flags & VIO_BUFFERED_READ) ?
- vio_buff_has_data : has_no_data;
+ vio->timeout =vio_socket_timeout;
+ vio->has_data = ((flags & VIO_BUFFERED_READ) ?
+ vio_buff_has_data : has_no_data);
DBUG_VOID_RETURN;
}
-/* Reset initialized VIO to use with another transport type */
+/**
+ Reinitialize an existing Vio object.
+
+ @remark Used to rebind an initialized socket-based Vio object
+ to another socket-based transport type. For example,
+ rebind a TCP/IP transport to SSL.
+
+ @param vio A VIO object.
+ @param type A socket-based transport type.
+ @param sd The socket.
+ @param ssl An optional SSL structure.
+ @param flags Flags passed to vio_init.
-void vio_reset(Vio* vio, enum enum_vio_type type,
- my_socket sd, HANDLE hPipe, uint flags)
+ @return Return value is zero on success.
+*/
+
+my_bool vio_reset(Vio* vio, enum enum_vio_type type,
+ my_socket sd, void *ssl __attribute__((unused)), uint flags)
{
+ int ret= FALSE;
+ Vio old_vio= *vio;
+ DBUG_ENTER("vio_reset");
+
+ /* The only supported rebind is from a socket-based transport type. */
+ DBUG_ASSERT(vio->type == VIO_TYPE_TCPIP || vio->type == VIO_TYPE_SOCKET);
+
+ /*
+ Will be reinitialized depending on the flags.
+ Nonetheless, already buffered inside the SSL layer.
+ */
my_free(vio->read_buffer);
- vio_init(vio, type, sd, hPipe, flags);
+
+ vio_init(vio, type, sd, flags);
+
+ /* Preserve perfschema info for this connection */
+ vio->mysql_socket.m_psi= old_vio.mysql_socket.m_psi;
+
+#ifdef HAVE_OPENSSL
+ vio->ssl_arg= ssl;
+#endif
+
+ /*
+ Propagate the timeout values. Necessary to also propagate
+ the underlying proprieties associated with the timeout,
+ such as the socket blocking mode.
+ */
+ if (old_vio.read_timeout >= 0)
+ ret|= vio_timeout(vio, 0, old_vio.read_timeout);
+
+ if (old_vio.write_timeout >= 0)
+ ret|= vio_timeout(vio, 1, old_vio.write_timeout);
+
+ DBUG_RETURN(test(ret));
}
-/* Open the socket or TCP/IP connection and read the fnctl() status */
+/* Create a new VIO for socket or TCP/IP connection. */
-Vio *vio_new(my_socket sd, enum enum_vio_type type, uint flags)
+Vio *mysql_socket_vio_new(MYSQL_SOCKET mysql_socket, enum enum_vio_type type, uint flags)
{
Vio *vio;
- DBUG_ENTER("vio_new");
+ my_socket sd= mysql_socket_getfd(mysql_socket);
+ DBUG_ENTER("mysql_socket_vio_new");
DBUG_PRINT("enter", ("sd: %d", sd));
if ((vio = (Vio*) my_malloc(sizeof(*vio),MYF(MY_WME))))
{
- vio_init(vio, type, sd, 0, flags);
- sprintf(vio->desc,
- (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"),
- vio->sd);
-#if !defined(__WIN__)
-#if !defined(NO_FCNTL_NONBLOCK)
- /*
- We call fcntl() to set the flags and then immediately read them back
- to make sure that we and the system are in agreement on the state of
- things.
-
- An example of why we need to do this is FreeBSD (and apparently some
- other BSD-derived systems, like Mac OS X), where the system sometimes
- reports that the socket is set for non-blocking when it really will
- block.
- */
- fcntl(sd, F_SETFL, 0);
- vio->fcntl_mode= fcntl(sd, F_GETFL);
-#elif defined(HAVE_SYS_IOCTL_H) /* hpux */
- /* Non blocking sockets doesn't work good on HPUX 11.0 */
- (void) ioctl(sd,FIOSNBIO,0);
- vio->fcntl_mode &= ~O_NONBLOCK;
-#endif
-#else /* !defined(__WIN__) */
- {
- /* set to blocking mode by default */
- ulong arg=0, r;
- r = ioctlsocket(sd,FIONBIO,(void*) &arg);
- vio->fcntl_mode &= ~O_NONBLOCK;
- }
-#endif
+ vio_init(vio, type, sd, flags);
+ vio->mysql_socket= mysql_socket;
}
DBUG_RETURN(vio);
}
+/* Open the socket or TCP/IP connection and read the fnctl() status */
+
+Vio *vio_new(my_socket sd, enum enum_vio_type type, uint flags)
+{
+ Vio *vio;
+ MYSQL_SOCKET mysql_socket= MYSQL_INVALID_SOCKET;
+ DBUG_ENTER("vio_new");
+ DBUG_PRINT("enter", ("sd: %d", sd));
+
+ mysql_socket_setfd(&mysql_socket, sd);
+ vio = mysql_socket_vio_new(mysql_socket, type, flags);
-#ifdef __WIN__
+ DBUG_RETURN(vio);
+}
+
+#ifdef _WIN32
Vio *vio_new_win32pipe(HANDLE hPipe)
{
@@ -256,7 +269,15 @@ Vio *vio_new_win32pipe(HANDLE hPipe)
DBUG_ENTER("vio_new_handle");
if ((vio = (Vio*) my_malloc(sizeof(Vio),MYF(MY_WME))))
{
- vio_init(vio, VIO_TYPE_NAMEDPIPE, 0, hPipe, VIO_LOCALHOST);
+ vio_init(vio, VIO_TYPE_NAMEDPIPE, 0, VIO_LOCALHOST);
+ /* Create an object for event notification. */
+ vio->overlapped.hEvent= CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (vio->overlapped.hEvent == NULL)
+ {
+ my_free(vio);
+ DBUG_RETURN(NULL);
+ }
+ vio->hPipe= hPipe;
strmov(vio->desc, "named pipe");
}
DBUG_RETURN(vio);
@@ -272,7 +293,7 @@ Vio *vio_new_win32shared_memory(HANDLE handle_file_map, HANDLE handle_map,
DBUG_ENTER("vio_new_win32shared_memory");
if ((vio = (Vio*) my_malloc(sizeof(Vio),MYF(MY_WME))))
{
- vio_init(vio, VIO_TYPE_SHARED_MEMORY, 0, 0, VIO_LOCALHOST);
+ vio_init(vio, VIO_TYPE_SHARED_MEMORY, 0, VIO_LOCALHOST);
vio->handle_file_map= handle_file_map;
vio->handle_map= handle_map;
vio->event_server_wrote= event_server_wrote;
@@ -290,6 +311,49 @@ Vio *vio_new_win32shared_memory(HANDLE handle_file_map, HANDLE handle_map,
#endif
+/**
+ Set timeout for a network send or receive operation.
+
+ @remark A non-infinite timeout causes the socket to be
+ set to non-blocking mode. On infinite timeouts,
+ the socket is set to blocking mode.
+
+ @remark A negative timeout means an infinite timeout.
+
+ @param vio A VIO object.
+ @param which Whether timeout is for send (1) or receive (0).
+ @param timeout Timeout interval in seconds.
+
+ @return FALSE on success, TRUE otherwise.
+*/
+
+int vio_timeout(Vio *vio, uint which, int timeout_sec)
+{
+ int timeout_ms;
+ my_bool old_mode;
+
+ /*
+ Vio timeouts are measured in milliseconds. Check for a possible
+ overflow. In case of overflow, set to infinite.
+ */
+ if (timeout_sec > INT_MAX/1000)
+ timeout_ms= -1;
+ else
+ timeout_ms= (int) (timeout_sec * 1000);
+
+ /* Deduce the current timeout status mode. */
+ old_mode= vio->write_timeout < 0 && vio->read_timeout < 0;
+
+ if (which)
+ vio->write_timeout= timeout_ms;
+ else
+ vio->read_timeout= timeout_ms;
+
+ /* VIO-specific timeout handling. Might change the blocking mode. */
+ return vio->timeout ? vio->timeout(vio, which, old_mode) : 0;
+}
+
+
void vio_delete(Vio* vio)
{
if (!vio)
diff --git a/vio/vio_priv.h b/vio/vio_priv.h
index 61a8ab150a9..c1dc090a106 100644
--- a/vio/vio_priv.h
+++ b/vio/vio_priv.h
@@ -1,7 +1,4 @@
-#ifndef VIO_PRIV_INCLUDED
-#define VIO_PRIV_INCLUDED
-
-/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates.
Copyright (c) 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -17,6 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#ifndef VIO_PRIV_INCLUDED
+#define VIO_PRIV_INCLUDED
+
/* Structures and functions private to the vio package */
#define DONT_MAP_VIO
@@ -26,16 +26,7 @@
#include <m_string.h>
#include <violite.h>
-#ifndef __WIN__
-#include <sys/socket.h>
-#include <netdb.h>
-#endif
-
#ifdef _WIN32
-void vio_win32_timeout(Vio *vio, uint which, uint timeout);
-#endif
-
-#ifdef __WIN__
size_t vio_read_pipe(Vio *vio, uchar * buf, size_t size);
size_t vio_write_pipe(Vio *vio, const uchar * buf, size_t size);
my_bool vio_is_connected_pipe(Vio *vio);
@@ -53,9 +44,10 @@ my_bool vio_shared_memory_has_data(Vio *vio);
int vio_shutdown_shared_memory(Vio *vio, int how);
#endif
-int vio_socket_shutdown(Vio *vio, int how);
-void vio_timeout(Vio *vio,uint which, uint timeout);
-my_bool vio_buff_has_data(Vio *vio);
+int vio_socket_shutdown(Vio *vio, int how);
+my_bool vio_buff_has_data(Vio *vio);
+int vio_socket_io_wait(Vio *vio, enum enum_vio_io_event event);
+int vio_socket_timeout(Vio *vio, uint which, my_bool old_mode);
#ifdef HAVE_OPENSSL
#include "my_net.h" /* needed because of struct in_addr */
@@ -66,9 +58,6 @@ size_t vio_ssl_write(Vio *vio,const uchar* buf, size_t size);
/* When the workday is over... */
int vio_ssl_close(Vio *vio);
void vio_ssl_delete(Vio *vio);
-
-int vio_ssl_blocking(Vio *vio, my_bool set_blocking_mode, my_bool *old_mode);
-
my_bool vio_ssl_has_data(Vio *vio);
#endif /* HAVE_OPENSSL */
diff --git a/vio/viopipe.c b/vio/viopipe.c
new file mode 100644
index 00000000000..db9881923ee
--- /dev/null
+++ b/vio/viopipe.c
@@ -0,0 +1,168 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#include "vio_priv.h"
+
+#ifdef _WIN32
+
+/*
+ Disable posting IO completion event to the port.
+ In some cases (synchronous timed IO) we want to skip IOCP notifications.
+*/
+static void disable_iocp_notification(OVERLAPPED *overlapped)
+{
+ HANDLE *handle = &(overlapped->hEvent);
+ *handle = ((HANDLE)((ULONG_PTR) *handle|1));
+}
+
+/* Enable posting IO completion event to the port */
+static void enable_iocp_notification(OVERLAPPED *overlapped)
+{
+ HANDLE *handle = &(overlapped->hEvent);
+ *handle = (HANDLE)((ULONG_PTR) *handle & ~1);
+}
+
+
+/*
+ Finish pending IO on pipe. Honor wait timeout
+*/
+
+static size_t wait_overlapped_result(Vio *vio, int timeout)
+{
+ size_t ret= (size_t) -1;
+ DWORD transferred, wait_status, timeout_ms;
+ DBUG_ENTER("wait_overlapped_result");
+
+ timeout_ms= timeout >= 0 ? timeout : INFINITE;
+
+ /* Wait for the overlapped operation to be completed. */
+ ret= WaitForSingleObjectEx(vio->pipe_overlapped.hEvent, timeout_ms, TRUE);
+
+ /*
+ WaitForSingleObjects will normally return WAIT_OBJECT_O (success,
+ IO completed) or WAIT_TIMEOUT.
+ */
+ if (ret != WAIT_OBJECT_0)
+ {
+ CancelIo(vio->hPipe);
+ DBUG_PRINT("error",("WaitForSingleObject() returned %d", ret));
+ if (wait_status == WAIT_TIMEOUT)
+ SetLastError(SOCKET_ETIMEDOUT);
+ DBUG_RETURN((size_t)-1);
+ }
+
+ if (!GetOverlappedResult(vio->hPipe,&(vio->overlapped),&transferred, FALSE))
+ {
+ DBUG_PRINT("error",("GetOverlappedResult() returned last error %d",
+ GetLastError()));
+ DBUG_RETURN((size_t)-1);
+ }
+ DBUG_RETURN(transferred);
+}
+
+
+size_t vio_read_pipe(Vio *vio, uchar *buf, size_t count)
+{
+ DWORD transferred;
+ size_t ret= (size_t) -1;
+ DBUG_ENTER("vio_read_pipe");
+ DBUG_PRINT("enter", ("sd: %d buf: %p size: %d", vio->sd, buf,
+ (int) count));
+
+ disable_iocp_notification(&vio->overlapped);
+ /* Attempt to read from the pipe (overlapped I/O). */
+ if (ReadFile(vio->hPipe, buf, count, &transferred, &vio->overlapped))
+ {
+ /* The operation completed immediately. */
+ ret= transferred;
+ }
+ /* Read operation is pending completion asynchronously? */
+ else
+ {
+ if (GetLastError() != ERROR_IO_PENDING)
+ {
+ enable_iocp_notification(&vio->pipe_overlapped);
+ DBUG_PRINT("error",("ReadFile() returned last error %d",
+ GetLastError()));
+ DBUG_RETURN((size_t)-1);
+ }
+ ret= wait_overlapped_result(vio, vio->read_timeout);
+ }
+ enable_iocp_notification(&vio->overlapped);
+ DBUG_PRINT("exit", ("%d", (int) ret));
+ DBUG_RETURN(ret);
+}
+
+
+size_t vio_write_pipe(Vio *vio, const uchar *buf, size_t count)
+{
+ DWORD transferred;
+ size_t ret= (size_t) -1;
+ DBUG_ENTER("vio_write_pipe");
+ DBUG_PRINT("enter", ("sd: %d buf: %p size: %d", vio->sd, buf,
+ (int) count));
+
+ disable_iocp_notification(&vio->pipe_overlapped);
+ /* Attempt to write to the pipe (overlapped I/O). */
+ if (WriteFile(vio->hPipe, buf, count, &transferred, &vio->overlapped))
+ {
+ /* The operation completed immediately. */
+ ret= transferred;
+ }
+ else
+ {
+ enable_iocp_notification(&vio->pipe_overlapped);
+ if (GetLastError() != ERROR_IO_PENDING)
+ {
+ DBUG_PRINT("vio_error",("WriteFile() returned last error %d",
+ GetLastError()));
+ DBUG_RETURN((size_t)-1);
+ }
+ ret= wait_overlapped_result(vio, vio->write_timeout);
+ }
+ enable_iocp_notification(&vio->pipe_overlapped);
+ DBUG_PRINT("exit", ("%d", (int) ret));
+ DBUG_RETURN(ret);
+}
+
+
+my_bool vio_is_connected_pipe(Vio *vio)
+{
+ if (PeekNamedPipe(vio->hPipe, NULL, 0, NULL, NULL, NULL))
+ return TRUE;
+ else
+ return (GetLastError() != ERROR_BROKEN_PIPE);
+}
+
+
+int vio_close_pipe(Vio *vio)
+{
+ BOOL ret;
+ DBUG_ENTER("vio_close_pipe");
+
+ CancelIo(vio->hPipe);
+ CloseHandle(vio->overlapped.hEvent);
+ DisconnectNamedPipe(vio->hPipe);
+ ret= CloseHandle(vio->hPipe);
+
+ vio->type= VIO_CLOSED;
+ vio->hPipe= NULL;
+ vio->mysql_socket= MYSQL_INVALID_SOCKET;
+
+ DBUG_RETURN(ret);
+}
+
+#endif
+
diff --git a/vio/vioshm.c b/vio/vioshm.c
new file mode 100644
index 00000000000..acc7d2402c5
--- /dev/null
+++ b/vio/vioshm.c
@@ -0,0 +1,217 @@
+/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#include "vio_priv.h"
+
+#if defined(_WIN32) && defined(HAVE_SMEM)
+
+size_t vio_read_shared_memory(Vio *vio, uchar *buf, size_t size)
+{
+ size_t length;
+ size_t remain_local;
+ char *current_position;
+ HANDLE events[2];
+ DWORD timeout;
+ DBUG_ENTER("vio_read_shared_memory");
+
+ remain_local= size;
+ current_position= buf;
+ timeout= vio->read_timeout >= 0 ? vio->read_timeout : INFINITE;
+
+ events[0]= vio->event_server_wrote;
+ events[1]= vio->event_conn_closed;
+
+ do
+ {
+ if (vio->shared_memory_remain == 0)
+ {
+ DWORD wait_status;
+
+ wait_status= WaitForMultipleObjects(array_elements(events), events,
+ FALSE, timeout);
+
+ /*
+ WaitForMultipleObjects can return next values:
+ WAIT_OBJECT_0+0 - event from vio->event_server_wrote
+ WAIT_OBJECT_0+1 - event from vio->event_conn_closed.
+ We can't read anything
+ WAIT_ABANDONED_0 and WAIT_TIMEOUT - fail. We can't read anything
+ */
+ if (wait_status != WAIT_OBJECT_0)
+ {
+ /*
+ If wait_status is WAIT_TIMEOUT, set error code to indicate a
+ timeout error. If vio->event_conn_closed was set, use an EOF
+ condition (return value of zero) to indicate that the operation
+ has been aborted.
+ */
+ if (wait_status == WAIT_TIMEOUT)
+ SetLastError(SOCKET_ETIMEDOUT);
+ else if (wait_status == (WAIT_OBJECT_0 + 1))
+ DBUG_RETURN(0);
+
+ DBUG_RETURN(-1);
+ }
+
+ vio->shared_memory_pos= vio->handle_map;
+ vio->shared_memory_remain= uint4korr((ulong*)vio->shared_memory_pos);
+ vio->shared_memory_pos+= 4;
+ }
+
+ length= size;
+
+ if (vio->shared_memory_remain < length)
+ length= vio->shared_memory_remain;
+ if (length > remain_local)
+ length= remain_local;
+
+ memcpy(current_position, vio->shared_memory_pos, length);
+
+ vio->shared_memory_remain-= length;
+ vio->shared_memory_pos+= length;
+ current_position+= length;
+ remain_local-= length;
+
+ if (!vio->shared_memory_remain)
+ {
+ if (!SetEvent(vio->event_client_read))
+ DBUG_RETURN(-1);
+ }
+ } while (remain_local);
+ length= size;
+
+ DBUG_RETURN(length);
+}
+
+
+size_t vio_write_shared_memory(Vio *vio, const uchar *buf, size_t size)
+{
+ size_t length, remain, sz;
+ HANDLE pos;
+ const uchar *current_position;
+ HANDLE events[2];
+ DWORD timeout;
+ DBUG_ENTER("vio_write_shared_memory");
+
+ remain= size;
+ current_position= buf;
+ timeout= vio->write_timeout >= 0 ? vio->write_timeout : INFINITE;
+
+ events[0]= vio->event_server_read;
+ events[1]= vio->event_conn_closed;
+
+ while (remain != 0)
+ {
+ DWORD wait_status;
+
+ wait_status= WaitForMultipleObjects(array_elements(events), events,
+ FALSE, timeout);
+
+ if (wait_status != WAIT_OBJECT_0)
+ {
+ /* Set error code to indicate a timeout error or disconnect. */
+ if (wait_status == WAIT_TIMEOUT)
+ SetLastError(SOCKET_ETIMEDOUT);
+ else
+ SetLastError(ERROR_GRACEFUL_DISCONNECT);
+
+ DBUG_RETURN((size_t) -1);
+ }
+
+ sz= (remain > shared_memory_buffer_length ? shared_memory_buffer_length :
+ remain);
+
+ int4store(vio->handle_map, sz);
+ pos= vio->handle_map + 4;
+ memcpy(pos, current_position, sz);
+ remain-= sz;
+ current_position+= sz;
+ if (!SetEvent(vio->event_client_wrote))
+ DBUG_RETURN((size_t) -1);
+ }
+ length= size;
+
+ DBUG_RETURN(length);
+}
+
+
+my_bool vio_is_connected_shared_memory(Vio *vio)
+{
+ return (WaitForSingleObject(vio->event_conn_closed, 0) != WAIT_OBJECT_0);
+}
+
+
+/**
+ Close shared memory and DBUG_PRINT any errors that happen on closing.
+ @return Zero if all closing functions succeed, and nonzero otherwise.
+*/
+int vio_close_shared_memory(Vio * vio)
+{
+ int error_count= 0;
+ DBUG_ENTER("vio_close_shared_memory");
+ if (vio->type != VIO_CLOSED)
+ {
+ /*
+ Set event_conn_closed for notification of both client and server that
+ connection is closed
+ */
+ SetEvent(vio->event_conn_closed);
+ /*
+ Close all handlers. UnmapViewOfFile and CloseHandle return non-zero
+ result if they are success.
+ */
+ if (UnmapViewOfFile(vio->handle_map) == 0)
+ {
+ error_count++;
+ DBUG_PRINT("vio_error", ("UnmapViewOfFile() failed"));
+ }
+ if (CloseHandle(vio->event_server_wrote) == 0)
+ {
+ error_count++;
+ DBUG_PRINT("vio_error", ("CloseHandle(vio->esw) failed"));
+ }
+ if (CloseHandle(vio->event_server_read) == 0)
+ {
+ error_count++;
+ DBUG_PRINT("vio_error", ("CloseHandle(vio->esr) failed"));
+ }
+ if (CloseHandle(vio->event_client_wrote) == 0)
+ {
+ error_count++;
+ DBUG_PRINT("vio_error", ("CloseHandle(vio->ecw) failed"));
+ }
+ if (CloseHandle(vio->event_client_read) == 0)
+ {
+ error_count++;
+ DBUG_PRINT("vio_error", ("CloseHandle(vio->ecr) failed"));
+ }
+ if (CloseHandle(vio->handle_file_map) == 0)
+ {
+ error_count++;
+ DBUG_PRINT("vio_error", ("CloseHandle(vio->hfm) failed"));
+ }
+ if (CloseHandle(vio->event_conn_closed) == 0)
+ {
+ error_count++;
+ DBUG_PRINT("vio_error", ("CloseHandle(vio->ecc) failed"));
+ }
+ }
+ vio->type= VIO_CLOSED;
+ vio->mysql_socket= MYSQL_INVALID_SOCKET;
+ DBUG_RETURN(error_count);
+}
+
+#endif /* #if defined(_WIN32) && defined(HAVE_SMEM) */
+
diff --git a/vio/viosocket.c b/vio/viosocket.c
index baefa1c6d06..96cf5c195e3 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -24,12 +24,12 @@
the file descriptior.
*/
+#include "vio_priv.h"
#ifdef __WIN__
#include <winsock2.h>
#include <MSWSock.h>
#pragma comment(lib, "ws2_32.lib")
#endif
-#include "vio_priv.h"
#include "my_context.h"
#include <mysql_async.h>
@@ -39,21 +39,92 @@
int vio_errno(Vio *vio __attribute__((unused)))
{
- return socket_errno; /* On Win32 this mapped to WSAGetLastError() */
+ /* These transport types are not Winsock based. */
+#ifdef _WIN32
+ if (vio->type == VIO_TYPE_NAMEDPIPE ||
+ vio->type == VIO_TYPE_SHARED_MEMORY)
+ return GetLastError();
+#endif
+
+ /* Mapped to WSAGetLastError() on Win32. */
+ return socket_errno;
}
-size_t vio_read(Vio * vio, uchar* buf, size_t size)
+/**
+ Attempt to wait for an I/O event on a socket.
+
+ @param vio VIO object representing a connected socket.
+ @param event The type of I/O event (read or write) to wait for.
+
+ @return Return value is -1 on failure, 0 on success.
+*/
+
+int vio_socket_io_wait(Vio *vio, enum enum_vio_io_event event)
{
- size_t r;
+ int timeout, ret;
+
+ DBUG_ASSERT(event == VIO_IO_EVENT_READ || event == VIO_IO_EVENT_WRITE);
+
+ /* Choose an appropriate timeout. */
+ if (event == VIO_IO_EVENT_READ)
+ timeout= vio->read_timeout;
+ else
+ timeout= vio->write_timeout;
+
+ /* Wait for input data to become available. */
+ switch (vio_io_wait(vio, event, timeout))
+ {
+ case -1:
+ /* Upon failure, vio_read/write() shall return -1. */
+ ret= -1;
+ break;
+ case 0:
+ /* The wait timed out. */
+ ret= -1;
+ break;
+ default:
+ /* A positive value indicates an I/O event. */
+ ret= 0;
+ break;
+ }
+
+ return ret;
+}
+
+
+/*
+ Define a stub MSG_DONTWAIT if unavailable. In this case, fcntl
+ (or a equivalent) is used to enable non-blocking operations.
+ The flag must be supported in both send and recv operations.
+*/
+#if defined(__linux__)
+#define VIO_USE_DONTWAIT 1
+#define VIO_DONTWAIT MSG_DONTWAIT
+#else
+#define VIO_DONTWAIT 0
+#endif
+
+size_t vio_read(Vio *vio, uchar *buf, size_t size)
+{
+ ssize_t ret;
+ int flags= 0;
DBUG_ENTER("vio_read");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd, (long) buf,
- (uint) size));
+ DBUG_PRINT("enter", ("sd: %d buf: %p size: %d",
+ mysql_socket_getfd(vio->mysql_socket), buf,
+ (int) size));
- /* Ensure nobody uses vio_read_buff and vio_read simultaneously */
+ /* Ensure nobody uses vio_read_buff and vio_read simultaneously. */
DBUG_ASSERT(vio->read_end == vio->read_pos);
+
+ /* If timeout is enabled, do not block if data is unavailable. */
+ if (vio->read_timeout >= 0)
+ flags= VIO_DONTWAIT;
+
if (vio->async_context && vio->async_context->active)
- r= my_recv_async(vio->async_context, vio->sd, buf, size, vio->read_timeout);
+ ret= my_recv_async(vio->async_context,
+ mysql_socket_getfd(vio->mysql_socket),
+ buf, size, vio->read_timeout);
else
{
if (vio->async_context)
@@ -65,21 +136,28 @@ size_t vio_read(Vio * vio, uchar* buf, size_t size)
my_bool old_mode;
vio_blocking(vio, TRUE, &old_mode);
}
-#ifdef __WIN__
- r = recv(vio->sd, buf, size,0);
-#else
- errno=0; /* For linux */
- r = read(vio->sd, buf, size);
-#endif /* __WIN__ */
+ while ((ret= mysql_socket_recv(vio->mysql_socket, (SOCKBUF_T *)buf, size,
+ flags)) == -1)
+ {
+ int error= socket_errno;
+
+ /* The operation would block? */
+ if (error != SOCKET_EAGAIN && error != SOCKET_EWOULDBLOCK)
+ break;
+
+ /* Wait for input data to become available. */
+ if ((ret= vio_socket_io_wait(vio, VIO_IO_EVENT_READ)))
+ break;
+ }
}
#ifndef DBUG_OFF
- if (r == (size_t) -1)
+ if (ret == -1)
{
- DBUG_PRINT("vio_error", ("Got error %d during read",errno));
+ DBUG_PRINT("vio_error", ("Got error %d during read", errno));
}
#endif /* DBUG_OFF */
- DBUG_PRINT("exit", ("%ld", (long) r));
- DBUG_RETURN(r);
+ DBUG_PRINT("exit", ("%d", (int) ret));
+ DBUG_RETURN(ret);
}
@@ -93,12 +171,13 @@ size_t vio_read_buff(Vio *vio, uchar* buf, size_t size)
size_t rc;
#define VIO_UNBUFFERED_READ_MIN_SIZE 2048
DBUG_ENTER("vio_read_buff");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd, (long) buf,
- (uint) size));
+ DBUG_PRINT("enter", ("sd: %d buf: %p size: %d",
+ mysql_socket_getfd(vio->mysql_socket),
+ buf, (int) size));
if (vio->read_pos < vio->read_end)
{
- rc= min((size_t) (vio->read_end - vio->read_pos), size);
+ rc= MY_MIN((size_t) (vio->read_end - vio->read_pos), size);
memcpy(buf, vio->read_pos, rc);
vio->read_pos+= rc;
/*
@@ -127,19 +206,29 @@ size_t vio_read_buff(Vio *vio, uchar* buf, size_t size)
#undef VIO_UNBUFFERED_READ_MIN_SIZE
}
+
my_bool vio_buff_has_data(Vio *vio)
{
return (vio->read_pos != vio->read_end);
}
-size_t vio_write(Vio * vio, const uchar* buf, size_t size)
+
+size_t vio_write(Vio *vio, const uchar* buf, size_t size)
{
- size_t r;
+ ssize_t ret;
+ int flags= 0;
DBUG_ENTER("vio_write");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd, (long) buf,
- (uint) size));
+ DBUG_PRINT("enter", ("sd: %d buf: %p size: %d",
+ mysql_socket_getfd(vio->mysql_socket), buf,
+ (int) size));
+
+ /* If timeout is enabled, do not block. */
+ if (vio->write_timeout >= 0)
+ flags= VIO_DONTWAIT;
+
if (vio->async_context && vio->async_context->active)
- r= my_send_async(vio->async_context, vio->sd, buf, size,
+ ret= my_send_async(vio->async_context,
+ mysql_socket_getfd(vio->mysql_socket), buf, size,
vio->write_timeout);
else
{
@@ -152,20 +241,27 @@ size_t vio_write(Vio * vio, const uchar* buf, size_t size)
my_bool old_mode;
vio_blocking(vio, TRUE, &old_mode);
}
-#ifdef __WIN__
- r = send(vio->sd, buf, size,0);
-#else
- r = write(vio->sd, buf, size);
-#endif /* __WIN__ */
+ while ((ret= mysql_socket_send(vio->mysql_socket, (SOCKBUF_T *)buf, size,
+ flags)) == -1)
+ {
+ int error= socket_errno;
+ /* The operation would block? */
+ if (error != SOCKET_EAGAIN && error != SOCKET_EWOULDBLOCK)
+ break;
+
+ /* Wait for the output buffer to become writable.*/
+ if ((ret= vio_socket_io_wait(vio, VIO_IO_EVENT_WRITE)))
+ break;
+ }
}
#ifndef DBUG_OFF
- if (r == (size_t) -1)
+ if (ret == -1)
{
DBUG_PRINT("vio_error", ("Got error on write: %d",socket_errno));
}
#endif /* DBUG_OFF */
- DBUG_PRINT("exit", ("%u", (uint) r));
- DBUG_RETURN(r);
+ DBUG_PRINT("exit", ("%d", (int) ret));
+ DBUG_RETURN(ret);
}
#ifdef _WIN32
@@ -177,8 +273,9 @@ static void CALLBACK cancel_io_apc(ULONG_PTR data)
/*
Cancel IO on Windows.
- On XP, issue CancelIo as asynchronous procedure call to the thread that started
- IO. On Vista+, simpler cancelation is done with CancelIoEx.
+ On XP, issue CancelIo as asynchronous procedure call to the thread
+ that started IO. On Vista+, simpler cancelation is done with
+ CancelIoEx.
*/
int cancel_io(HANDLE handle, DWORD thread_id)
@@ -212,21 +309,25 @@ int cancel_io(HANDLE handle, DWORD thread_id)
}
#endif
+
int vio_socket_shutdown(Vio *vio, int how)
{
- int ret= shutdown(vio->sd, how);
+ int ret= shutdown(mysql_socket_getfd(vio->mysql_socket), how);
#ifdef _WIN32
/* Cancel possible IO in progress (shutdown does not do that on Windows). */
- (void) cancel_io((HANDLE)vio->sd, vio->thread_id);
+ (void) cancel_io((HANDLE) mysql_socket_getfd(vio->mysql_socket),
+ vio->thread_id);
#endif
return ret;
}
-int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode,
- my_bool *old_mode)
+int vio_blocking(Vio *vio, my_bool set_blocking_mode, my_bool *old_mode)
{
- int r=0;
+ int r= 0;
+#if defined(__WIN__) || !defined(NO_FCNTL_NONBLOCK)
+ my_socket sd= mysql_socket_getfd(vio->mysql_socket);
+#endif
DBUG_ENTER("vio_blocking");
*old_mode= test(!(vio->fcntl_mode & O_NONBLOCK));
@@ -235,16 +336,16 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode,
#if !defined(__WIN__)
#if !defined(NO_FCNTL_NONBLOCK)
- if (vio->sd >= 0)
+ if (sd >= 0)
{
- int old_fcntl=vio->fcntl_mode;
+ int old_fcntl= vio->fcntl_mode;
if (set_blocking_mode)
vio->fcntl_mode &= ~O_NONBLOCK; /* clear bit */
else
vio->fcntl_mode |= O_NONBLOCK; /* set bit */
if (old_fcntl != vio->fcntl_mode)
{
- r= fcntl(vio->sd, F_SETFL, vio->fcntl_mode);
+ r= fcntl(sd, F_SETFL, vio->fcntl_mode);
if (r == -1)
{
DBUG_PRINT("info", ("fcntl failed, errno %d", errno));
@@ -271,7 +372,7 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode,
vio->fcntl_mode |= O_NONBLOCK; /* set bit */
}
if (old_fcntl != vio->fcntl_mode)
- r = ioctlsocket(vio->sd,FIONBIO,(void*) &arg);
+ r = ioctlsocket(sd,FIONBIO,(void*) &arg);
}
else
r= test(!(vio->fcntl_mode & O_NONBLOCK)) != set_blocking_mode;
@@ -291,6 +392,75 @@ vio_is_blocking(Vio * vio)
}
+int vio_socket_timeout(Vio *vio,
+ uint which __attribute__((unused)),
+ my_bool old_mode __attribute__((unused)))
+{
+ int ret= 0;
+ DBUG_ENTER("vio_socket_timeout");
+
+#if defined(_WIN32)
+ {
+ int optname;
+ DWORD timeout= 0;
+ const char *optval= (const char *) &timeout;
+
+ /*
+ The default socket timeout value is zero, which means an infinite
+ timeout. Values less than 500 milliseconds are interpreted to be of
+ 500 milliseconds. Hence, the VIO behavior for zero timeout, which is
+ intended to cause the send or receive operation to fail immediately
+ if no data is available, is not supported on WIN32 and neither is
+ necessary as it's not possible to set the VIO timeout value to zero.
+
+ Assert that the VIO timeout is either positive or set to infinite.
+ */
+ DBUG_ASSERT(which || vio->read_timeout);
+ DBUG_ASSERT(!which || vio->write_timeout);
+
+ if (which)
+ {
+ optname= SO_SNDTIMEO;
+ if (vio->write_timeout > 0)
+ timeout= vio->write_timeout;
+ }
+ else
+ {
+ optname= SO_RCVTIMEO;
+ if (vio->read_timeout > 0)
+ timeout= vio->read_timeout;
+ }
+
+ ret= mysql_socket_setsockopt(vio->mysql_socket, SOL_SOCKET, optname,
+ optval, sizeof(timeout));
+ }
+#else
+ /*
+ The MSG_DONTWAIT trick is not used with SSL sockets as the send and
+ receive I/O operations are wrapped through SSL-specific functions
+ (SSL_read and SSL_write) which are not equivalent to the standard
+ recv(2) and send(2) used in vio_read() and vio_write(). Hence, the
+ socket blocking mode is changed and vio_io_wait() is used to wait
+ for I/O or timeout.
+ */
+#ifdef VIO_USE_DONTWAIT
+ if (vio->type == VIO_TYPE_SSL)
+#endif
+ {
+ /* Deduce what should be the new blocking mode of the socket. */
+ my_bool new_mode= vio->write_timeout < 0 && vio->read_timeout < 0;
+ my_bool not_used;
+
+ /* If necessary, update the blocking mode. */
+ if (new_mode != old_mode)
+ ret= vio_blocking(vio, new_mode, &not_used);
+ }
+#endif
+
+ DBUG_RETURN(ret);
+}
+
+
int vio_fastsend(Vio * vio __attribute__((unused)))
{
int r=0;
@@ -304,7 +474,8 @@ int vio_fastsend(Vio * vio __attribute__((unused)))
#if defined(IPTOS_THROUGHPUT)
{
int tos = IPTOS_THROUGHPUT;
- r= setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos));
+ r= mysql_socket_setsockopt(vio->mysql_socket, IPPROTO_IP, IP_TOS,
+ (void *)&tos, sizeof(tos));
}
#endif /* IPTOS_THROUGHPUT */
if (!r)
@@ -315,7 +486,7 @@ int vio_fastsend(Vio * vio __attribute__((unused)))
int nodelay = 1;
#endif
- r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY,
+ r= mysql_socket_setsockopt(vio->mysql_socket, IPPROTO_TCP, TCP_NODELAY,
IF_WIN((const char*), (void*)) &nodelay,
sizeof(nodelay));
@@ -334,78 +505,56 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive)
int r=0;
uint opt = 0;
DBUG_ENTER("vio_keepalive");
- DBUG_PRINT("enter", ("sd: %d set_keep_alive: %d", vio->sd, (int)
- set_keep_alive));
+ DBUG_PRINT("enter", ("sd: %d set_keep_alive: %d",
+ mysql_socket_getfd(vio->mysql_socket),
+ (int)set_keep_alive));
+
if (vio->type != VIO_TYPE_NAMEDPIPE && vio->type != VIO_TYPE_SHARED_MEMORY)
{
if (set_keep_alive)
opt = 1;
- r = setsockopt(vio->sd, SOL_SOCKET, SO_KEEPALIVE, (char *) &opt,
- sizeof(opt));
+ r = mysql_socket_setsockopt(vio->mysql_socket, SOL_SOCKET, SO_KEEPALIVE,
+ (char *)&opt, sizeof(opt));
}
DBUG_RETURN(r);
}
-my_bool
-vio_should_retry(Vio * vio)
-{
- int en = socket_errno;
- /*
- man 2 read write
- EAGAIN or EWOULDBLOCK when a socket is a non-blocking mode means
- that the read/write would block.
- man 7 socket
- EAGAIN or EWOULDBLOCK when a socket is in a blocking mode means
- that the corresponding receiving or sending timeout was reached.
- */
- return en == SOCKET_EINTR ||
- (!vio_is_blocking(vio) &&
- (en == SOCKET_EAGAIN || en == SOCKET_EWOULDBLOCK));
-}
+/**
+ Indicate whether a I/O operation must be retried later.
+
+ @param vio A VIO object
+ @return Whether a I/O operation should be deferred.
+ @retval TRUE Temporary failure, retry operation.
+ @retval FALSE Indeterminate failure.
+*/
my_bool
-vio_was_interrupted(Vio *vio __attribute__((unused)))
+vio_should_retry(Vio *vio)
{
- int en= socket_errno;
- return (en == SOCKET_EAGAIN || en == SOCKET_EINTR ||
- en == SOCKET_EWOULDBLOCK || en == SOCKET_ETIMEDOUT);
+ return (vio_errno(vio) == SOCKET_EINTR);
}
-int
-mysql_socket_shutdown(my_socket mysql_socket, int how)
-{
- int result;
+/**
+ Indicate whether a I/O operation timed out.
-#ifdef __WIN__
- static LPFN_DISCONNECTEX DisconnectEx = NULL;
- if (DisconnectEx == NULL)
- {
- DWORD dwBytesReturned;
- GUID guidDisconnectEx = WSAID_DISCONNECTEX;
- WSAIoctl(mysql_socket, SIO_GET_EXTENSION_FUNCTION_POINTER,
- &guidDisconnectEx, sizeof(GUID),
- &DisconnectEx, sizeof(DisconnectEx),
- &dwBytesReturned, NULL, NULL);
- }
-#endif
+ @param vio A VIO object
- /* Non instrumented code */
-#ifdef __WIN__
- if (DisconnectEx)
- result= (DisconnectEx(mysql_socket, (LPOVERLAPPED) NULL,
- (DWORD) 0, (DWORD) 0) == TRUE) ? 0 : -1;
- else
-#endif
- result= shutdown(mysql_socket, how);
+ @return Whether a I/O operation timed out.
+ @retval TRUE Operation timed out.
+ @retval FALSE Not a timeout failure.
+*/
- return result;
+my_bool
+vio_was_timeout(Vio *vio)
+{
+ return (vio_errno(vio) == SOCKET_ETIMEDOUT);
}
-int vio_close(Vio * vio)
+int vio_close(Vio *vio)
{
int r=0;
DBUG_ENTER("vio_close");
@@ -416,10 +565,10 @@ int vio_close(Vio * vio)
vio->type == VIO_TYPE_SOCKET ||
vio->type == VIO_TYPE_SSL);
- DBUG_ASSERT(vio->sd >= 0);
- if (mysql_socket_shutdown(vio->sd, SHUT_RDWR))
+ DBUG_ASSERT(mysql_socket_getfd(vio->mysql_socket) >= 0);
+ if (mysql_socket_shutdown(vio->mysql_socket, SHUT_RDWR))
r= -1;
- if (closesocket(vio->sd))
+ if (mysql_socket_close(vio->mysql_socket))
r= -1;
}
if (r)
@@ -428,13 +577,19 @@ int vio_close(Vio * vio)
/* FIXME: error handling (not critical for MySQL) */
}
vio->type= VIO_CLOSED;
- vio->sd= -1;
+ vio->mysql_socket= MYSQL_INVALID_SOCKET;
DBUG_RETURN(r);
}
const char *vio_description(Vio * vio)
{
+ if (!vio->desc[0])
+ {
+ my_snprintf(vio->desc, VIO_DESCRIPTION_SIZE,
+ (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"),
+ mysql_socket_getfd(vio->mysql_socket));
+ }
return vio->desc;
}
@@ -445,7 +600,7 @@ enum enum_vio_type vio_type(Vio* vio)
my_socket vio_fd(Vio* vio)
{
- return vio->sd;
+ return mysql_socket_getfd(vio->mysql_socket);
}
/**
@@ -471,6 +626,7 @@ my_socket vio_fd(Vio* vio)
(sockaddr_storage).
@param dst_length [out] actual length of the normalized IP address.
*/
+
static void vio_get_normalized_ip(const struct sockaddr *src,
int src_length,
struct sockaddr *dst,
@@ -586,7 +742,8 @@ my_bool vio_peer_addr(Vio *vio, char *ip_buffer, uint16 *port,
size_t ip_buffer_size)
{
DBUG_ENTER("vio_peer_addr");
- DBUG_PRINT("enter", ("Client socked fd: %d", (int) vio->sd));
+ DBUG_PRINT("enter", ("Client socked fd: %d",
+ (int)mysql_socket_getfd(vio->mysql_socket)));
if (vio->localhost)
{
@@ -617,7 +774,7 @@ my_bool vio_peer_addr(Vio *vio, char *ip_buffer, uint16 *port,
/* Get sockaddr by socked fd. */
- err_code= getpeername(vio->sd, addr, &addr_length);
+ err_code= mysql_socket_getpeername(vio->mysql_socket, addr, &addr_length);
if (err_code)
{
@@ -655,58 +812,6 @@ my_bool vio_peer_addr(Vio *vio, char *ip_buffer, uint16 *port,
/**
- Indicate whether there is data to read on a given socket.
-
- @note An exceptional condition event and/or errors are
- interpreted as if there is data to read.
-
- @param sd A connected socket.
- @param timeout Maximum time in seconds to poll.
-
- @retval FALSE There is data to read.
- @retval TRUE There is no data to read.
-*/
-
-static my_bool socket_poll_read(my_socket sd, uint timeout)
-{
-#ifdef __WIN__
- int res;
- my_socket fd= sd;
- fd_set readfds, errorfds;
- struct timeval tm;
- DBUG_ENTER("socket_poll_read");
- tm.tv_sec= timeout;
- tm.tv_usec= 0;
- FD_ZERO(&readfds);
- FD_ZERO(&errorfds);
- FD_SET(fd, &readfds);
- FD_SET(fd, &errorfds);
- /* The first argument is ignored on Windows, so a conversion to int is OK */
- if ((res= select((int) fd, &readfds, NULL, &errorfds, &tm) <= 0))
- {
- DBUG_RETURN(res < 0 ? 0 : 1);
- }
- res= FD_ISSET(fd, &readfds) || FD_ISSET(fd, &errorfds);
- DBUG_RETURN(!res);
-#elif defined(HAVE_POLL)
- struct pollfd fds;
- int res;
- DBUG_ENTER("socket_poll_read");
- fds.fd=sd;
- fds.events=POLLIN;
- fds.revents=0;
- if ((res=poll(&fds,1,(int) timeout*1000)) <= 0)
- {
- DBUG_RETURN(res < 0 ? 0 : 1); /* Don't return 1 on errors */
- }
- DBUG_RETURN(fds.revents & (POLLIN | POLLERR | POLLHUP) ? 0 : 1);
-#else
- return 0;
-#endif
-}
-
-
-/**
Retrieve the amount of data that can be read from a socket.
@param vio A VIO object.
@@ -715,510 +820,383 @@ static my_bool socket_poll_read(my_socket sd, uint timeout)
@retval FALSE Success.
@retval TRUE Failure.
*/
+// WL#4896: Not covered
static my_bool socket_peek_read(Vio *vio, uint *bytes)
{
+ my_socket sd= mysql_socket_getfd(vio->mysql_socket);
#if defined(_WIN32)
int len;
- if (ioctlsocket(vio->sd, FIONREAD, &len))
+ if (ioctlsocket(sd, FIONREAD, &len))
return TRUE;
*bytes= len;
return FALSE;
#elif defined(FIONREAD_IN_SYS_IOCTL) || defined(FIONREAD_IN_SYS_FILIO)
int len;
- if (ioctl(vio->sd, FIONREAD, &len) < 0)
+ if (ioctl(sd, FIONREAD, &len) < 0)
return TRUE;
*bytes= len;
return FALSE;
#else
char buf[1024];
- ssize_t res= recv(vio->sd, &buf, sizeof(buf), MSG_PEEK);
+ ssize_t res= recv(sd, &buf, sizeof(buf), MSG_PEEK);
if (res < 0)
return TRUE;
*bytes= res;
return FALSE;
-#endif
+#endif /*_WIN32*/
}
+#ifndef _WIN32
/**
- Indicate whether there is data to read on a given socket.
-
- @remark Errors are interpreted as if there is data to read.
-
- @param sd A connected socket.
- @param timeout Maximum time in seconds to wait.
-
- @retval FALSE There is data (or EOF) to read. Also FALSE if error.
- @retval TRUE There is _NO_ data to read or timed out.
+ Set of event flags grouped by operations.
*/
-my_bool vio_poll_read(Vio *vio, uint timeout)
-{
- my_socket sd= vio->sd;
- DBUG_ENTER("vio_poll_read");
- if (vio->async_context && vio->async_context->active)
- DBUG_RETURN(my_poll_read_async(vio->async_context, timeout));
-#ifdef HAVE_OPENSSL
- if (vio->type == VIO_TYPE_SSL)
- sd= SSL_get_fd((SSL*) vio->ssl_arg);
+/*
+ Linux specific flag used to detect connection shutdown. The flag is
+ also used for half-closed notification, which here is interpreted as
+ if there is data available to be read from the socket.
+*/
+#ifndef POLLRDHUP
+#define POLLRDHUP 0
#endif
- DBUG_RETURN(socket_poll_read(sd, timeout));
-}
+/* Data may be read. */
+#define MY_POLL_SET_IN (POLLIN | POLLPRI)
+/* Data may be written. */
+#define MY_POLL_SET_OUT (POLLOUT)
+/* An error or hangup. */
+#define MY_POLL_SET_ERR (POLLERR | POLLHUP | POLLNVAL)
+
+#endif /* _WIN32 */
/**
- Determine if the endpoint of a connection is still available.
+ Wait for an I/O event on a VIO socket.
- @remark The socket is assumed to be disconnected if an EOF
- condition is encountered.
+ @param vio VIO object representing a connected socket.
+ @param event The type of I/O event to wait for.
+ @param timeout Interval (in milliseconds) to wait for an I/O event.
+ A negative timeout value means an infinite timeout.
- @param vio The VIO object.
+ @remark sock_errno is set to SOCKET_ETIMEDOUT on timeout.
- @retval TRUE EOF condition not found.
- @retval FALSE EOF condition is signaled.
+ @return A three-state value which indicates the operation status.
+ @retval -1 Failure, socket_errno indicates the error.
+ @retval 0 The wait has timed out.
+ @retval 1 The requested I/O event has occurred.
*/
-my_bool vio_is_connected(Vio *vio)
+#ifndef _WIN32
+int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
{
- uint bytes= 0;
- DBUG_ENTER("vio_is_connected");
+ int ret;
+ short revents= 0;
+ struct pollfd pfd;
+ my_socket sd= mysql_socket_getfd(vio->mysql_socket);
+ MYSQL_SOCKET_WAIT_VARIABLES(locker, state) /* no ';' */
+ DBUG_ENTER("vio_io_wait");
- /* In the presence of errors the socket is assumed to be connected. */
+ memset(&pfd, 0, sizeof(pfd));
- /*
- The first step of detecting a EOF condition is veryfing
- whether there is data to read. Data in this case would
- be the EOF.
- */
- if (vio_poll_read(vio, 0))
- DBUG_RETURN(TRUE);
+ pfd.fd= sd;
/*
- The second step is read() or recv() from the socket returning
- 0 (EOF). Unfortunelly, it's not possible to call read directly
- as we could inadvertently read meaningful connection data.
- Simulate a read by retrieving the number of bytes available to
- read -- 0 meaning EOF.
+ Set the poll bitmask describing the type of events.
+ The error flags are only valid in the revents bitmask.
*/
- if (socket_peek_read(vio, &bytes))
- DBUG_RETURN(TRUE);
-
-#ifdef HAVE_OPENSSL
- /* There might be buffered data at the SSL layer. */
- if (!bytes && vio->type == VIO_TYPE_SSL)
- bytes= SSL_pending((SSL*) vio->ssl_arg);
-#endif
-
- DBUG_RETURN(bytes ? TRUE : FALSE);
-}
-
-
-void vio_timeout(Vio *vio, uint which, uint timeout)
-{
-#if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO)
- int r;
- DBUG_ENTER("vio_timeout");
-
+ switch (event)
{
-#ifdef __WIN__
- /* Windows expects time in milliseconds as int */
- int wait_timeout= (int) timeout * 1000;
-#else
- /* POSIX specifies time as struct timeval. */
- struct timeval wait_timeout;
- wait_timeout.tv_sec= timeout;
- wait_timeout.tv_usec= 0;
-#endif
-
- r= setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO,
- IF_WIN((const char*), (const void*))&wait_timeout,
- sizeof(wait_timeout));
-
+ case VIO_IO_EVENT_READ:
+ pfd.events= MY_POLL_SET_IN;
+ revents= MY_POLL_SET_IN | MY_POLL_SET_ERR | POLLRDHUP;
+ break;
+ case VIO_IO_EVENT_WRITE:
+ case VIO_IO_EVENT_CONNECT:
+ pfd.events= MY_POLL_SET_OUT;
+ revents= MY_POLL_SET_OUT | MY_POLL_SET_ERR;
+ break;
}
- if (r != 0)
- DBUG_PRINT("error", ("setsockopt failed: %d, errno: %d", r, socket_errno));
-
- DBUG_VOID_RETURN;
-#else
-/*
- Platforms not suporting setting of socket timeout should either use
- thr_alarm or just run without read/write timeout(s)
-*/
-#endif
- /* Make timeout values available for async operations. */
- if (which)
- vio->write_timeout= timeout;
- else
- vio->read_timeout= timeout;
-}
-
-
-#ifdef __WIN__
-/*
- Disable posting IO completion event to the port.
- In some cases (synchronous timed IO) we want to skip IOCP notifications.
-*/
-static void disable_iocp_notification(OVERLAPPED *overlapped)
-{
- HANDLE *handle = &(overlapped->hEvent);
- *handle = ((HANDLE)((ULONG_PTR) *handle|1));
-}
-
-/* Enable posting IO completion event to the port */
-static void enable_iocp_notification(OVERLAPPED *overlapped)
-{
- HANDLE *handle = &(overlapped->hEvent);
- *handle = (HANDLE)((ULONG_PTR) *handle & ~1);
-}
+ MYSQL_START_SOCKET_WAIT(locker, &state, vio->mysql_socket, PSI_SOCKET_SELECT, 0);
-/*
- Finish pending IO on pipe. Honor wait timeout
-*/
-static size_t pipe_complete_io(Vio* vio, char* buf, size_t size, DWORD timeout_ms)
-{
- DWORD length;
- DWORD ret;
-
- DBUG_ENTER("pipe_complete_io");
-
- ret= WaitForSingleObjectEx(vio->pipe_overlapped.hEvent, timeout_ms, TRUE);
/*
- WaitForSingleObjects will normally return WAIT_OBJECT_O (success, IO completed)
- or WAIT_TIMEOUT.
+ Wait for the I/O event and return early in case of
+ error or timeout.
*/
- if(ret != WAIT_OBJECT_0)
+ switch ((ret= poll(&pfd, 1, timeout)))
{
- CancelIo(vio->hPipe);
- DBUG_PRINT("error",("WaitForSingleObject() returned %d", ret));
- DBUG_RETURN((size_t)-1);
- }
-
- if (!GetOverlappedResult(vio->hPipe,&(vio->pipe_overlapped),&length, FALSE))
- {
- DBUG_PRINT("error",("GetOverlappedResult() returned last error %d",
- GetLastError()));
- DBUG_RETURN((size_t)-1);
+ case -1:
+ /* On error, -1 is returned. */
+ break;
+ case 0:
+ /*
+ Set errno to indicate a timeout error.
+ (This is not compiled in on WIN32.)
+ */
+ errno= SOCKET_ETIMEDOUT;
+ break;
+ default:
+ /* Ensure that the requested I/O event has completed. */
+ DBUG_ASSERT(pfd.revents & revents);
+ break;
}
- DBUG_RETURN(length);
+ MYSQL_END_SOCKET_WAIT(locker, 0);
+ DBUG_RETURN(ret);
}
+#else
-size_t vio_read_pipe(Vio * vio, uchar *buf, size_t size)
+int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
{
- DWORD bytes_read;
- size_t retval;
- DBUG_ENTER("vio_read_pipe");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd, (long) buf,
- (uint) size));
-
- disable_iocp_notification(&vio->pipe_overlapped);
- if (ReadFile(vio->hPipe, buf, (DWORD)size, &bytes_read,
- &(vio->pipe_overlapped)))
- {
- retval= bytes_read;
- }
- else
+ int ret;
+ struct timeval tm;
+ my_socket fd= mysql_socket_getfd(vio->mysql_socket);
+ fd_set readfds, writefds, exceptfds;
+ MYSQL_SOCKET_WAIT_VARIABLES(locker, state) /* no ';' */
+ DBUG_ENTER("vio_io_wait");
+
+ /* Convert the timeout, in milliseconds, to seconds and microseconds. */
+ if (timeout >= 0)
{
- if (GetLastError() != ERROR_IO_PENDING)
- {
- enable_iocp_notification(&vio->pipe_overlapped);
- DBUG_PRINT("error",("ReadFile() returned last error %d",
- GetLastError()));
- DBUG_RETURN((size_t)-1);
- }
- retval= pipe_complete_io(vio, buf, size,vio->read_timeout_ms);
+ tm.tv_sec= timeout / 1000;
+ tm.tv_usec= (timeout % 1000) * 1000;
}
- enable_iocp_notification(&vio->pipe_overlapped);
- DBUG_PRINT("exit", ("%lld", (longlong)retval));
- DBUG_RETURN(retval);
-}
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptfds);
-size_t vio_write_pipe(Vio * vio, const uchar* buf, size_t size)
-{
- DWORD bytes_written;
- size_t retval;
- DBUG_ENTER("vio_write_pipe");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd, (long) buf,
- (uint) size));
- disable_iocp_notification(&vio->pipe_overlapped);
- if (WriteFile(vio->hPipe, buf, (DWORD)size, &bytes_written,
- &(vio->pipe_overlapped)))
- {
- retval= bytes_written;
- }
- else
+ /* Always receive notification of exceptions. */
+ FD_SET(fd, &exceptfds);
+
+ switch (event)
{
- enable_iocp_notification(&vio->pipe_overlapped);
- if (GetLastError() != ERROR_IO_PENDING)
- {
- DBUG_PRINT("vio_error",("WriteFile() returned last error %d",
- GetLastError()));
- DBUG_RETURN((size_t)-1);
- }
- retval= pipe_complete_io(vio, (char *)buf, size, vio->write_timeout_ms);
+ case VIO_IO_EVENT_READ:
+ /* Readiness for reading. */
+ FD_SET(fd, &readfds);
+ break;
+ case VIO_IO_EVENT_WRITE:
+ case VIO_IO_EVENT_CONNECT:
+ /* Readiness for writing. */
+ FD_SET(fd, &writefds);
+ break;
}
- enable_iocp_notification(&vio->pipe_overlapped);
- DBUG_PRINT("exit", ("%lld", (longlong)retval));
- DBUG_RETURN(retval);
-}
+ MYSQL_START_SOCKET_WAIT(locker, &state, vio->mysql_socket, PSI_SOCKET_SELECT, 0);
-my_bool vio_is_connected_pipe(Vio *vio)
-{
- if (PeekNamedPipe(vio->hPipe, NULL, 0, NULL, NULL, NULL))
- return TRUE;
- else
- return (GetLastError() != ERROR_BROKEN_PIPE);
-}
+ /* The first argument is ignored on Windows. */
+ ret= select(0, &readfds, &writefds, &exceptfds, (timeout >= 0) ? &tm : NULL);
+ MYSQL_END_SOCKET_WAIT(locker, 0);
-int vio_close_pipe(Vio * vio)
-{
- int r;
- DBUG_ENTER("vio_close_pipe");
+ /* Set error code to indicate a timeout error. */
+ if (ret == 0)
+ WSASetLastError(SOCKET_ETIMEDOUT);
- CancelIo(vio->hPipe);
- CloseHandle(vio->pipe_overlapped.hEvent);
- DisconnectNamedPipe(vio->hPipe);
- r= CloseHandle(vio->hPipe);
- if (r)
+ /* Error or timeout? */
+ if (ret <= 0)
+ DBUG_RETURN(ret);
+
+ /* The requested I/O event is ready? */
+ switch (event)
{
- DBUG_PRINT("vio_error", ("close() failed, error: %d",GetLastError()));
- /* FIXME: error handling (not critical for MySQL) */
+ case VIO_IO_EVENT_READ:
+ ret= test(FD_ISSET(fd, &readfds));
+ break;
+ case VIO_IO_EVENT_WRITE:
+ case VIO_IO_EVENT_CONNECT:
+ ret= test(FD_ISSET(fd, &writefds));
+ break;
}
- vio->type= VIO_CLOSED;
- vio->sd= -1;
- DBUG_RETURN(r);
-}
+ /* Error conditions pending? */
+ ret|= test(FD_ISSET(fd, &exceptfds));
-void vio_win32_timeout(Vio *vio, uint which , uint timeout_sec)
-{
- DWORD timeout_ms;
- /*
- Windows is measuring timeouts in milliseconds. Check for possible int
- overflow.
- */
- if (timeout_sec > UINT_MAX/1000)
- timeout_ms= INFINITE;
- else
- timeout_ms= timeout_sec * 1000;
+ /* Not a timeout, ensure that a condition was met. */
+ DBUG_ASSERT(ret);
- /* which == 1 means "write", which == 0 means "read".*/
- if(which)
- vio->write_timeout_ms= timeout_ms;
- else
- vio->read_timeout_ms= timeout_ms;
+ DBUG_RETURN(ret);
}
+#endif /* _WIN32 */
-#ifdef HAVE_SMEM
-
-size_t vio_read_shared_memory(Vio * vio, uchar* buf, size_t size)
-{
- size_t length;
- size_t remain_local;
- char *current_position;
- HANDLE events[2];
- DBUG_ENTER("vio_read_shared_memory");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d", vio->sd, (long) buf,
- size));
+/**
+ Connect to a peer address.
- remain_local = size;
- current_position=buf;
+ @param vio A VIO object.
+ @param addr Socket address containing the peer address.
+ @param len Length of socket address.
+ @param timeout Interval (in milliseconds) to wait until a
+ connection is established.
- events[0]= vio->event_server_wrote;
- events[1]= vio->event_conn_closed;
+ @retval FALSE A connection was successfully established.
+ @retval TRUE A fatal error. See socket_errno.
+*/
- do
- {
- if (vio->shared_memory_remain == 0)
- {
- /*
- WaitForMultipleObjects can return next values:
- WAIT_OBJECT_0+0 - event from vio->event_server_wrote
- WAIT_OBJECT_0+1 - event from vio->event_conn_closed. We can't read
- anything
- WAIT_ABANDONED_0 and WAIT_TIMEOUT - fail. We can't read anything
- */
- if (WaitForMultipleObjects(array_elements(events), events, FALSE,
- vio->read_timeout_ms) != WAIT_OBJECT_0)
- {
- DBUG_RETURN(-1);
- };
+my_bool
+vio_socket_connect(Vio *vio, struct sockaddr *addr, socklen_t len, int timeout)
+{
+ int ret, wait;
+ my_bool not_used;
+ DBUG_ENTER("vio_socket_connect");
- vio->shared_memory_pos = vio->handle_map;
- vio->shared_memory_remain = uint4korr((ulong*)vio->shared_memory_pos);
- vio->shared_memory_pos+=4;
- }
+ /* Only for socket-based transport types. */
+ DBUG_ASSERT(vio->type == VIO_TYPE_SOCKET || vio->type == VIO_TYPE_TCPIP);
- length = size;
+ /* If timeout is not infinite, set socket to non-blocking mode. */
+ if ((timeout > -1) && vio_blocking(vio, FALSE, &not_used))
+ DBUG_RETURN(TRUE);
- if (vio->shared_memory_remain < length)
- length = vio->shared_memory_remain;
- if (length > remain_local)
- length = remain_local;
+ /* Initiate the connection. */
+ ret= mysql_socket_connect(vio->mysql_socket, addr, len);
- memcpy(current_position,vio->shared_memory_pos,length);
+#ifdef _WIN32
+ wait= (ret == SOCKET_ERROR) &&
+ (WSAGetLastError() == WSAEINPROGRESS ||
+ WSAGetLastError() == WSAEWOULDBLOCK);
+#else
+ wait= (ret == -1) && (errno == EINPROGRESS || errno == EALREADY);
+#endif
- vio->shared_memory_remain-=length;
- vio->shared_memory_pos+=length;
- current_position+=length;
- remain_local-=length;
+ /*
+ The connection is in progress. The vio_io_wait() call can be used
+ to wait up to a specified period of time for the connection to
+ succeed.
+
+ If vio_io_wait() returns 0 (after waiting however many seconds),
+ the socket never became writable (host is probably unreachable.)
+ Otherwise, if vio_io_wait() returns 1, then one of two conditions
+ exist:
+
+ 1. An error occurred. Use getsockopt() to check for this.
+ 2. The connection was set up successfully: getsockopt() will
+ return 0 as an error.
+ */
+ if (wait && (vio_io_wait(vio, VIO_IO_EVENT_CONNECT, timeout) == 1))
+ {
+ int error;
+ IF_WIN(int, socklen_t) optlen= sizeof(error);
+ IF_WIN(char, void) *optval= (IF_WIN(char, void) *) &error;
- if (!vio->shared_memory_remain)
+ /*
+ At this point, we know that something happened on the socket.
+ But this does not means that everything is alright. The connect
+ might have failed. We need to retrieve the error code from the
+ socket layer. We must return success only if we are sure that
+ it was really a success. Otherwise we might prevent the caller
+ from trying another address to connect to.
+ */
+ if (!(ret= mysql_socket_getsockopt(vio->mysql_socket, SOL_SOCKET,
+ SO_ERROR, optval, &optlen)))
{
- if (!SetEvent(vio->event_client_read))
- DBUG_RETURN(-1);
+#ifdef _WIN32
+ WSASetLastError(error);
+#else
+ errno= error;
+#endif
+ ret= test(error);
}
- } while (remain_local);
- length = size;
+ }
- DBUG_PRINT("exit", ("%lu", (ulong) length));
- DBUG_RETURN(length);
+ /* If necessary, restore the blocking mode, but only if connect succeeded. */
+ if ((timeout > -1) && (ret == 0))
+ {
+ my_bool not_used;
+ if (vio_blocking(vio, TRUE, &not_used))
+ DBUG_RETURN(TRUE);
+ }
+
+ DBUG_RETURN(test(ret));
}
-size_t vio_write_shared_memory(Vio * vio, const uchar* buf, size_t size)
-{
- size_t length, remain, sz;
- HANDLE pos;
- const uchar *current_position;
- HANDLE events[2];
+/**
+ Determine if the endpoint of a connection is still available.
- DBUG_ENTER("vio_write_shared_memory");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d", vio->sd, (long) buf,
- size));
+ @remark The socket is assumed to be disconnected if an EOF
+ condition is encountered.
- remain = size;
- current_position = buf;
+ @param vio The VIO object.
- events[0]= vio->event_server_read;
- events[1]= vio->event_conn_closed;
+ @retval TRUE EOF condition not found.
+ @retval FALSE EOF condition is signaled.
+*/
- while (remain != 0)
- {
- if (WaitForMultipleObjects(array_elements(events), events, FALSE,
- vio->write_timeout_ms) != WAIT_OBJECT_0)
- {
- DBUG_RETURN((size_t) -1);
- }
+my_bool vio_is_connected(Vio *vio)
+{
+ uint bytes= 0;
+ DBUG_ENTER("vio_is_connected");
- sz= (remain > shared_memory_buffer_length ? shared_memory_buffer_length :
- remain);
+ /*
+ The first step of detecting an EOF condition is verifying
+ whether there is data to read. Data in this case would be
+ the EOF. An exceptional condition event and/or errors are
+ interpreted as if there is data to read.
+ */
+ if (!vio_io_wait(vio, VIO_IO_EVENT_READ, 0))
+ DBUG_RETURN(TRUE);
- int4store(vio->handle_map,sz);
- pos = vio->handle_map + 4;
- memcpy(pos,current_position,sz);
- remain-=sz;
- current_position+=sz;
- if (!SetEvent(vio->event_client_wrote))
- DBUG_RETURN((size_t) -1);
+ /*
+ The second step is read() or recv() from the socket returning
+ 0 (EOF). Unfortunately, it's not possible to call read directly
+ as we could inadvertently read meaningful connection data.
+ Simulate a read by retrieving the number of bytes available to
+ read -- 0 meaning EOF. In the presence of unrecoverable errors,
+ the socket is assumed to be disconnected.
+ */
+ while (socket_peek_read(vio, &bytes))
+ {
+ if (socket_errno != SOCKET_EINTR)
+ DBUG_RETURN(FALSE);
}
- length = size;
-
- DBUG_PRINT("exit", ("%lu", (ulong) length));
- DBUG_RETURN(length);
-}
+#ifdef HAVE_OPENSSL
+ /* There might be buffered data at the SSL layer. */
+ if (!bytes && vio->type == VIO_TYPE_SSL)
+ bytes= SSL_pending((SSL*) vio->ssl_arg);
+#endif
-my_bool vio_is_connected_shared_memory(Vio *vio)
-{
- return (WaitForSingleObject(vio->event_conn_closed, 0) != WAIT_OBJECT_0);
+ DBUG_RETURN(bytes ? TRUE : FALSE);
}
+#ifndef DBUG_OFF
/**
- Close shared memory and DBUG_PRINT any errors that happen on closing.
- @return Zero if all closing functions succeed, and nonzero otherwise.
-*/
-int vio_close_shared_memory(Vio * vio)
-{
- int error_count= 0;
- DBUG_ENTER("vio_close_shared_memory");
- if (vio->type != VIO_CLOSED)
- {
- /*
- Set event_conn_closed for notification of both client and server that
- connection is closed
- */
- SetEvent(vio->event_conn_closed);
- /*
- Close all handlers. UnmapViewOfFile and CloseHandle return non-zero
- result if they are success.
- */
- if (UnmapViewOfFile(vio->handle_map) == 0)
- {
- error_count++;
- DBUG_PRINT("vio_error", ("UnmapViewOfFile() failed"));
- }
- if (CloseHandle(vio->event_server_wrote) == 0)
- {
- error_count++;
- DBUG_PRINT("vio_error", ("CloseHandle(vio->esw) failed"));
- }
- if (CloseHandle(vio->event_server_read) == 0)
- {
- error_count++;
- DBUG_PRINT("vio_error", ("CloseHandle(vio->esr) failed"));
- }
- if (CloseHandle(vio->event_client_wrote) == 0)
- {
- error_count++;
- DBUG_PRINT("vio_error", ("CloseHandle(vio->ecw) failed"));
- }
- if (CloseHandle(vio->event_client_read) == 0)
- {
- error_count++;
- DBUG_PRINT("vio_error", ("CloseHandle(vio->ecr) failed"));
- }
- if (CloseHandle(vio->handle_file_map) == 0)
- {
- error_count++;
- DBUG_PRINT("vio_error", ("CloseHandle(vio->hfm) failed"));
- }
- if (CloseHandle(vio->event_conn_closed) == 0)
- {
- error_count++;
- DBUG_PRINT("vio_error", ("CloseHandle(vio->ecc) failed"));
- }
- }
- vio->type= VIO_CLOSED;
- vio->sd= -1;
- DBUG_RETURN(error_count);
-}
-#endif /* HAVE_SMEM */
-#endif /* __WIN__ */
-
+ Number of bytes in the read or socket buffer
-/**
- Number of bytes in the read buffer.
+ @remark An EOF condition might count as one readable byte.
- @return number of bytes in the read buffer or < 0 if error.
+ @return number of bytes in one of the buffers or < 0 if error.
*/
ssize_t vio_pending(Vio *vio)
{
-#ifdef HAVE_OPENSSL
- SSL *ssl= (SSL*) vio->ssl_arg;
-#endif
+ uint bytes= 0;
+ /* Data pending on the read buffer. */
if (vio->read_pos < vio->read_end)
return vio->read_end - vio->read_pos;
-#ifdef HAVE_OPENSSL
- if (ssl)
- return SSL_pending(ssl);
-#endif
+ /* Skip non-socket based transport types. */
+ if (vio->type == VIO_TYPE_TCPIP || vio->type == VIO_TYPE_SOCKET)
+ {
+ /* Obtain number of readable bytes in the socket buffer. */
+ if (socket_peek_read(vio, &bytes))
+ return -1;
+ }
+
+ /*
+ SSL not checked due to a yaSSL bug in SSL_pending that
+ causes it to attempt to read from the socket.
+ */
- return 0;
+ return (ssize_t) bytes;
}
+#endif /* DBUG_OFF */
/**
Checks if the error code, returned by vio_getnameinfo(), means it was the
@@ -1237,13 +1215,9 @@ ssize_t vio_pending(Vio *vio)
my_bool vio_is_no_name_error(int err_code)
{
#ifdef _WIN32
-
return err_code == WSANO_DATA || err_code == EAI_NONAME;
-
#else
-
return err_code == EAI_NONAME;
-
#endif
}
@@ -1282,8 +1256,6 @@ int vio_getnameinfo(const struct sockaddr *sa,
#endif /* HAVE_IPV6 */
}
- return getnameinfo(sa, sa_length,
- hostname, hostname_size,
- port, port_size,
- flags);
+ return getnameinfo(sa, sa_length, hostname, hostname_size,
+ port, port_size, flags);
}
diff --git a/vio/viossl.c b/vio/viossl.c
index 48881cc2903..dfca68947cc 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -61,46 +61,190 @@ report_errors(SSL* ssl)
#endif
-size_t vio_ssl_read(Vio *vio, uchar* buf, size_t size)
+/**
+ Obtain the equivalent system error status for the last SSL I/O operation.
+
+ @param ssl_error The result code of the failed TLS/SSL I/O operation.
+*/
+
+static void ssl_set_sys_error(int ssl_error)
+{
+ int error= 0;
+
+ switch (ssl_error)
+ {
+ case SSL_ERROR_ZERO_RETURN:
+ error= SOCKET_ECONNRESET;
+ break;
+ case SSL_ERROR_WANT_READ:
+ case SSL_ERROR_WANT_WRITE:
+#ifdef SSL_ERROR_WANT_CONNECT
+ case SSL_ERROR_WANT_CONNECT:
+#endif
+#ifdef SSL_ERROR_WANT_ACCEPT
+ case SSL_ERROR_WANT_ACCEPT:
+#endif
+ error= SOCKET_EWOULDBLOCK;
+ break;
+ case SSL_ERROR_SSL:
+ /* Protocol error. */
+#ifdef EPROTO
+ error= EPROTO;
+#else
+ error= SOCKET_ECONNRESET;
+#endif
+ break;
+ case SSL_ERROR_SYSCALL:
+ case SSL_ERROR_NONE:
+ default:
+ break;
+ };
+
+ /* Set error status to a equivalent of the SSL error. */
+ if (error)
+ {
+#ifdef _WIN32
+ WSASetLastError(error);
+#else
+ errno= error;
+#endif
+ }
+}
+
+
+/**
+ Indicate whether a SSL I/O operation must be retried later.
+
+ @param vio VIO object representing a SSL connection.
+ @param ret Value returned by a SSL I/O function.
+ @param event[out] The type of I/O event to wait/retry.
+
+ @return Whether a SSL I/O operation should be deferred.
+ @retval TRUE Temporary failure, retry operation.
+ @retval FALSE Indeterminate failure.
+*/
+
+static my_bool ssl_should_retry(Vio *vio, int ret, enum enum_vio_io_event *event)
+{
+ int ssl_error;
+ SSL *ssl= vio->ssl_arg;
+ my_bool should_retry= TRUE;
+
+ /* Retrieve the result for the SSL I/O operation. */
+ ssl_error= SSL_get_error(ssl, ret);
+
+ /* Retrieve the result for the SSL I/O operation. */
+ switch (ssl_error)
+ {
+ case SSL_ERROR_WANT_READ:
+ *event= VIO_IO_EVENT_READ;
+ break;
+ case SSL_ERROR_WANT_WRITE:
+ *event= VIO_IO_EVENT_WRITE;
+ break;
+ default:
+#ifndef DBUG_OFF
+ report_errors(ssl);
+#endif
+ should_retry= FALSE;
+ ssl_set_sys_error(ssl_error);
+ break;
+ }
+
+ return should_retry;
+}
+
+
+size_t vio_ssl_read(Vio *vio, uchar *buf, size_t size)
{
- size_t r;
+ int ret;
+ SSL *ssl= vio->ssl_arg;
DBUG_ENTER("vio_ssl_read");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u ssl: 0x%lx",
- vio->sd, (long) buf, (uint) size, (long) vio->ssl_arg));
+ DBUG_PRINT("enter", ("sd: %d buf: %p size: %d ssl: %p",
+ mysql_socket_getfd(vio->mysql_socket), buf, (int) size,
+ vio->ssl_arg));
if (vio->async_context && vio->async_context->active)
- r= my_ssl_read_async(vio->async_context, (SSL *)vio->ssl_arg, buf, size);
+ ret= my_ssl_read_async(vio->async_context, (SSL *)vio->ssl_arg, buf, size);
else
- r= SSL_read((SSL*) vio->ssl_arg, buf, size);
+ {
+ while ((ret= SSL_read(ssl, buf, size)) < 0)
+ {
+ enum enum_vio_io_event event;
+
+ /* Process the SSL I/O error. */
+ if (!ssl_should_retry(vio, ret, &event))
+ break;
+ /* Attempt to wait for an I/O event. */
+ if (vio_socket_io_wait(vio, event))
+ break;
+ }
+ }
+
#ifndef DBUG_OFF
- if (r == (size_t) -1)
+ if (ret < 0)
report_errors((SSL*) vio->ssl_arg);
#endif
- DBUG_PRINT("exit", ("%u", (uint) r));
- DBUG_RETURN(r);
+ DBUG_PRINT("exit", ("%d", (int) ret));
+ DBUG_RETURN(ret < 0 ? -1 : ret);
+
}
-size_t vio_ssl_write(Vio *vio, const uchar* buf, size_t size)
+size_t vio_ssl_write(Vio *vio, const uchar *buf, size_t size)
{
- size_t r;
+ int ret;
+ SSL *ssl= vio->ssl_arg;
DBUG_ENTER("vio_ssl_write");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd,
- (long) buf, (uint) size));
+ DBUG_PRINT("enter", ("sd: %d buf: %p size: %d",
+ mysql_socket_getfd(vio->mysql_socket),
+ buf, (int) size));
if (vio->async_context && vio->async_context->active)
- r= my_ssl_write_async(vio->async_context, (SSL *)vio->ssl_arg, buf, size);
+ ret= my_ssl_write_async(vio->async_context, (SSL *)vio->ssl_arg, buf,
+ size);
else
- r= SSL_write((SSL*) vio->ssl_arg, buf, size);
+ {
+ while ((ret= SSL_write(ssl, buf, size)) < 0)
+ {
+ enum enum_vio_io_event event;
+
+ /* Process the SSL I/O error. */
+ if (!ssl_should_retry(vio, ret, &event))
+ break;
+
+ /* Attempt to wait for an I/O event. */
+ if (vio_socket_io_wait(vio, event))
+ break;
+ }
+ }
+
#ifndef DBUG_OFF
- if (r == (size_t) -1)
+ if (ret < 0)
report_errors((SSL*) vio->ssl_arg);
#endif
- DBUG_PRINT("exit", ("%u", (uint) r));
- DBUG_RETURN(r);
+ DBUG_RETURN(ret < 0 ? -1 : ret);
+}
+
+#ifdef HAVE_YASSL
+
+/* Emulate a blocking recv() call with vio_read(). */
+static long yassl_recv(void *ptr, void *buf, size_t len,
+ int flag __attribute__((unused)))
+{
+ return vio_read(ptr, buf, len);
}
+/* Emulate a blocking send() call with vio_write(). */
+static long yassl_send(void *ptr, const void *buf, size_t len,
+ int flag __attribute__((unused)))
+{
+ return vio_write(ptr, buf, len);
+}
+
+#endif
+
int vio_ssl_close(Vio *vio)
{
int r= 0;
@@ -158,16 +302,57 @@ void vio_ssl_delete(Vio *vio)
}
+/** SSL handshake handler. */
+typedef int (*ssl_handshake_func_t)(SSL*);
+
+
+/**
+ Loop and wait until a SSL handshake is completed.
+
+ @param vio VIO object representing a SSL connection.
+ @param ssl SSL structure for the connection.
+ @param func SSL handshake handler.
+
+ @return Return value is 1 on success.
+*/
+
+static int ssl_handshake_loop(Vio *vio, SSL *ssl, ssl_handshake_func_t func)
+{
+ int ret;
+
+ vio->ssl_arg= ssl;
+
+ /* Initiate the SSL handshake. */
+ while ((ret= func(ssl)) < 1)
+ {
+ enum enum_vio_io_event event;
+
+ /* Process the SSL I/O error. */
+ if (!ssl_should_retry(vio, ret, &event))
+ break;
+
+ /* Wait for I/O so that the handshake can proceed. */
+ if (vio_socket_io_wait(vio, event))
+ break;
+ }
+
+ vio->ssl_arg= NULL;
+
+ return ret;
+}
+
+
static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
- int (*connect_accept_func)(SSL*), unsigned long *errptr)
+ ssl_handshake_func_t func, unsigned long *errptr)
{
int r;
SSL *ssl;
my_bool unused;
my_bool was_blocking;
+ my_socket sd= mysql_socket_getfd(vio->mysql_socket);
DBUG_ENTER("ssl_do");
DBUG_PRINT("enter", ("ptr: 0x%lx, sd: %d ctx: 0x%lx",
- (long) ptr, vio->sd, (long) ptr->ssl_context));
+ (long) ptr, sd, (long) ptr->ssl_context));
/* Set socket to blocking if not already set */
vio_blocking(vio, 1, &was_blocking);
@@ -182,9 +367,23 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
DBUG_PRINT("info", ("ssl: 0x%lx timeout: %ld", (long) ssl, timeout));
SSL_clear(ssl);
SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
- SSL_set_fd(ssl, vio->sd);
+ SSL_set_fd(ssl, sd);
+
+ /*
+ Since yaSSL does not support non-blocking send operations, use
+ special transport functions that properly handles non-blocking
+ sockets. These functions emulate the behavior of blocking I/O
+ operations by waiting for I/O to become available.
+ */
+#ifdef HAVE_YASSL
+ /* Set first argument of the transport functions. */
+ yaSSL_transport_set_ptr(ssl, vio);
+ /* Set functions to use in order to send and receive data. */
+ yaSSL_transport_set_recv_function(ssl, yassl_recv);
+ yaSSL_transport_set_send_function(ssl, yassl_send);
+#endif
- if ((r= connect_accept_func(ssl)) < 1)
+ if ((r= ssl_handshake_loop(vio, ssl, func)) < 1)
{
DBUG_PRINT("error", ("SSL_connect/accept failure"));
*errptr= SSL_get_error(ssl, r);
@@ -198,8 +397,11 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
change type, set sd to the fd used when connecting
and set pointer to the SSL structure
*/
- vio_reset(vio, VIO_TYPE_SSL, SSL_get_fd(ssl), 0, 0);
- vio->ssl_arg= (void*)ssl;
+ if (vio_reset(vio, VIO_TYPE_SSL, SSL_get_fd(ssl), ssl, 0))
+ {
+ vio_blocking(vio, was_blocking, &unused);
+ DBUG_RETURN(1);
+ }
#ifndef DBUG_OFF
{
@@ -249,16 +451,6 @@ int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout, unsigned long *e
}
-int vio_ssl_blocking(Vio *vio __attribute__((unused)),
- my_bool set_blocking_mode,
- my_bool *old_mode)
-{
- /* Mode is always blocking */
- *old_mode= 1;
- /* Return error if we try to change to non_blocking mode */
- return (set_blocking_mode ? 0 : 1);
-}
-
my_bool vio_ssl_has_data(Vio *vio)
{
return SSL_pending(vio->ssl_arg) > 0 ? TRUE : FALSE;
diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c
index f64869e905d..00c20d2d773 100644
--- a/vio/viosslfactories.c
+++ b/vio/viosslfactories.c
@@ -165,19 +165,22 @@ static struct st_VioSSLFd *
new_VioSSLFd(const char *key_file, const char *cert_file,
const char *ca_file, const char *ca_path,
const char *cipher, SSL_METHOD *method,
- enum enum_ssl_init_error *error)
+ enum enum_ssl_init_error *error,
+ const char *crl_file, const char *crl_path)
{
DH *dh;
struct st_VioSSLFd *ssl_fd;
DBUG_ENTER("new_VioSSLFd");
DBUG_PRINT("enter",
("key_file: '%s' cert_file: '%s' ca_file: '%s' ca_path: '%s' "
- "cipher: '%s'",
+ "cipher: '%s' crl_file: '%s' crl_path: '%s' ",
key_file ? key_file : "NULL",
cert_file ? cert_file : "NULL",
ca_file ? ca_file : "NULL",
ca_path ? ca_path : "NULL",
- cipher ? cipher : "NULL"));
+ cipher ? cipher : "NULL",
+ crl_file ? crl_file : "NULL",
+ crl_path ? crl_path : "NULL"));
check_ssl_init();
@@ -225,6 +228,30 @@ new_VioSSLFd(const char *key_file, const char *cert_file,
}
}
+ if (crl_file || crl_path)
+ {
+#ifdef HAVE_YASSL
+ DBUG_PRINT("warning", ("yaSSL doesn't support CRL"));
+ DBUG_ASSERT(0);
+#else
+ X509_STORE *store= SSL_CTX_get_cert_store(ssl_fd->ssl_context);
+ /* Load crls from the trusted ca */
+ if (X509_STORE_load_locations(store, crl_file, crl_path) == 0 ||
+ X509_STORE_set_flags(store,
+ X509_V_FLAG_CRL_CHECK |
+ X509_V_FLAG_CRL_CHECK_ALL) == 0)
+ {
+ DBUG_PRINT("warning", ("X509_STORE_load_locations for CRL failed"));
+ *error= SSL_INITERR_BAD_PATHS;
+ DBUG_PRINT("error", ("%s", sslGetErrString(*error)));
+ report_errors();
+ SSL_CTX_free(ssl_fd->ssl_context);
+ my_free(ssl_fd);
+ DBUG_RETURN(0);
+ }
+#endif
+ }
+
if (vio_set_cert_stuff(ssl_fd->ssl_context, cert_file, key_file, error))
{
DBUG_PRINT("error", ("vio_set_cert_stuff failed"));
@@ -249,7 +276,8 @@ new_VioSSLFd(const char *key_file, const char *cert_file,
struct st_VioSSLFd *
new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
const char *ca_file, const char *ca_path,
- const char *cipher, enum enum_ssl_init_error* error)
+ const char *cipher, enum enum_ssl_init_error* error,
+ const char *crl_file, const char *crl_path)
{
struct st_VioSSLFd *ssl_fd;
int verify= SSL_VERIFY_PEER;
@@ -262,7 +290,8 @@ new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
verify= SSL_VERIFY_NONE;
if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file,
- ca_path, cipher, TLSv1_client_method(), error)))
+ ca_path, cipher, TLSv1_client_method(), error,
+ crl_file, crl_path)))
{
return 0;
}
@@ -279,13 +308,15 @@ new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
struct st_VioSSLFd *
new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
const char *ca_file, const char *ca_path,
- const char *cipher, enum enum_ssl_init_error* error)
+ const char *cipher, enum enum_ssl_init_error* error,
+ const char *crl_file, const char *crl_path)
{
struct st_VioSSLFd *ssl_fd;
int verify= SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE;
if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file,
ca_path, cipher,
- (SSL_METHOD*) TLSv1_server_method(), error)))
+ (SSL_METHOD*) TLSv1_server_method(), error,
+ crl_file, crl_path)))
{
return 0;
}